This repository focuses on simulating the dynamics of an arbitrary wavefunction in a given potential using a numerical approach to solve the Schrödinger Equation.
The time-dependent Schrödinger equation is given by:
Or, in terms of position and time:
The time evolution of the wavefunction is defined formally as:
Since the kinetic energy operator (
The code is composed primarily of three parts: split.py, main.py, and viewer.py.
Sets the simulation parameters, including:
- Spatial grid and resolution.
- Timesteps and time resolution.
- Physical constants (
$\hbar$ , mass, etc.). - The initial wavefunction and the potential function.
It runs the logic in split.py and saves the raw data of the evolution package.
Contains the four principal functions needed for the analysis of the simulation:
-
step: Propagates the wavefunction using the Fast Fourier Transform (FFT) to toggle between position and momentum space, allowing the application of the Kinetic and Potential operators in their respective diagonal bases. -
time_correlation: Calculates the autocorrelation$\langle \psi(0) | \psi(t) \rangle$ at each time step. - Spectrum calculation: Functions to compute the energy spectrum via the Fourier transform of the time correlation.
All principal values are saved in a .npz file that compiles the wavefunction snapshots (in specific frames), correlation history, potential, spatial grid, timesteps, and the total energy expectation value.
Loads the saved data to generate:
- Plots of the time correlation.
- The Fourier transform of the correlation (Energy Spectrum).
- An animation of the wavefunction evolving over time.
The ultimate goal is to use the split-operator method and other techniques to study the absorption and emission of electrons within RIXS theory (Resonant Inelastic X-ray Scattering).