Software for generating animations of the time dependent schrödinger equation using the finite difference method in python, as seen in Visualizing the Impossible.
The accompanying article to this repo can be found here.
This repo contains software for generating animations of the TDSE using the finite difference method in python. This is done by recursively evalutating the following expression:
Derivation of this expression can be found in this repo's accompanying article, Visualizing the Impossible.
This repo and the accompanying article were create for the Summer of Math Exposition 3 (SoME3), read more about the competition at: https://some.3b1b.co/.
First, clone the repo,
git clone https://github.com/liam-ilan/time-dependent-schrodinger-equation.git
The software used to generate these renders was built with Python, Scipy, Numpy, and Matplotlib. To install all necessary packages through pip,
pip install -r requirements.txt
From there, run main.py
to render all animations and thumbnails for the accompanying article, as well as the demo gif at the top of the readme,
python main.py
renderer.py
provides a render()
method that creates a thumbnail and animation of the TDSE.
render(path, thumb_path, config)
path
: the path to save the animation tothumb_path
: the path to save the thumbnail toconfig
: a dictionary containing all nescacarry configurationk
: the wave number of the initial wave packetstd_dev
: the standard deviation of the initial wave packetx_0
: initial position of wave packetm
: mass of particlebounds
: an array of length 2, containing the low (1st item) and high (2nd item) spatial boundssample_number
: number of discrete elements to split space intodetla_t
: discrete timestepreal_time
: total simulated timefps
: fps of animationanim_duration
: length of animationpot_func
: a function, that gets a single position, and returns the potential at that position
Example config:
config_free = {
'k': 6e9,
'std_dev': 9e-10,
'x_0': -1.5e-8,
'm': constants.m_e,
'bounds': [-2e-8, 2e-8],
'sample_number': 800,
'delta_t': 5e-54,
'real_time': 3e-48,
'fps': 30,
'anim_duration': 15,
'pot_func': lambda x: 0,
}
All units are SI units.
- Built by Liam Ilan
- Check the accompanying article for a list of references