Various simulations of non-relativistic single particle quantum mechanics in bounded 2D potentials. The eigenstates animation are inspired by the awesome art by Hudson Smith.
The prerequisites for using the program are listed in the requirements.txt
file. Run discrete_hamiltonian.py
to show a numerical simulation of
a wavepacket in a Harmonic Oscillator. The script eigenstates_animation.py
displays eigenstates in various potentials, and compare_with_analytic.py
compares
numerically computed energy eigenvalues of the Harmonic Oscillator and Infinite Square Well with their analytical versions. The file self_contained_example.py
is meant to be a short, standalone example of finding the eigenvalues and eigenstates of the discrete Hamiltonian.
Thanks to rafael-fuente for giving the suggestion to use kron/kronsum instead of using for loops to construct the Hamiltonian.
Discretizing the Hamiltonian:
Using 2D Grids for higher dimensional discrete operators (credit to rafael-fuente for the suggestion):
Using shift-invert mode to speed up the compution of finding eigenvalues and eigenvectors (thanks to dhudsmith for the suggestion):
Discrete Laplacian stencils:
Energies for analytically solvable potentials (used to compare it with the numerical solutions):
Domain colouring using hue angle: