This WebGL program simulates the quantum mechanics of a single particle confined in a 2D box, where inside this box the user can create new potential barriers and scatter Gaussian wavepackets off them. Link to the full instructions.
The default integration method used in this simulation is described in page 690 of An Introduction to Computer Simulation Methods by H. Gould et al (which references an article by P. Visscher). This method basically involves splitting the complex-valued wave function into its real and imaginary components, where each component is updated separately for each time step. Some other numerical methods may be chosen as well, such as the Crank-Nicolson and Split-Operator method. Their usage are more fully described in the Integration Methods section of the instructions.
Also provided is a (work in progress) simulation of a 2D relativistic quantum particle using the Dirac equation. The Dirac equation is numerically solved by updating each of the two two-component spinors separately at staggered time and spatial steps. This method is found in an article by R. Hammer and W. Pötz. A separate Dirac simulation using the Split operator method instead of the method described above is available as well.
More experimental and less stable features are located on a separate branch. Note that this branch is not included in Github Pages, so you will need to download or pull from it separately.
Some basic examples are showcased in this YouTube playlist.
- The WebGL API
- dat.gui by Google Data Arts Team
- stats.js by the stats.js authors
- jszip by Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso
-
Gould, H., Tobochnik J., Christian W. (2007). Quantum Systems. In An Introduction to Computer Simulation Methods, chapter 16. Pearson Addison-Wesley.
-
Visscher, P. (1991). A fast explicit algorithm for the time‐dependent Schrödinger equation. Computers in Physics, 5, 596-598. https://doi.org/10.1063/1.168415
-
Schroeder D. Quantum Scattering in Two Dimensions.
Crank-Nicolson Method:
-
Wikipedia contributors. (2021, October 6). Crank-Nicolson method. In Wikipedia, The Free Encyclopedia.
-
Wikipedia contributors. (2021, August 1). Jacobi method. In Wikipedia, The Free Encyclopedia.
-
Sadovskyy I., Koshelev A., Phillips C., Karpeyev D., Glatz A. (2015). Stable large-scale solver for Ginzburg-Landau equations for superconductors. Journal of Computational Physics 294, 639-654. https://doi.org/10.1016/j.jcp.2015.04.002
Split-Step:
-
James Schloss. The Split-Operator Method. In The Arcane Algorithm Archive.
-
Wikipedia contributors. (2021, May 6). Split-step method. In Wikipedia, The Free Encyclopedia.
-
Bauke, H., Keitel, C. (2011). Accelerating the Fourier split operator method via graphics processing units. Computer Physics Communications, 182(12), 2454-2463. https://doi.org/10.1016/j.cpc.2011.07.003
Dirac Equation:
-
Wikipedia contributors. (2021, June 16). Dirac equation. In Wikipedia, The Free Encyclopedia.
-
Wikipedia contributors. (2021, August 5). Dirac spinor. In Wikipedia, The Free Encyclopedia.
-
Hammer, R., Pötz W. (2014). Staggered grid leap-frog scheme for the (2 + 1)D Dirac equation. Computer Physics Communications, 185(1), 40-53. https://doi.org/10.1016/j.cpc.2013.08.013
Nonlinear Schrödinger Equation:
-
Antoine, X., Bao, W., Besse C. (2013). Computational methods for the dynamics of the nonlinear Schrödinger/Gross–Pitaevskii equations. Computer Physics Communications, 184(12), 2621-2633. https://doi.org/10.1016/j.cpc.2013.07.012
-
Ira Moxley III, F. (2013). Generalized finite-difference time-domain schemes for solving nonlinear Schrödinger equations. Dissertation, 290.
Laplacian Stencils:
-
Wikipedia contributors. (2021, February 17) Discrete Laplacian Operator 1.5.1 Implementation via operator discretization. In Wikipedia, The Free Encyclopedia.
-
Fornberg, B. (1988). Generation of Finite Difference Formulas on Arbitrarily Spaced Grids. Mathematics of Computation, 51(184), 699-706. https://doi.org/10.1090/S0025-5718-1988-0935077-0
Approximating the vector potential:
-
Feynman R., Leighton R., Sands M. (2011). The Schrödinger Equation in a Classical Context: A Seminar on Superconductivity. In In The Feynman Lectures on Physics: The New Millennium Edition, Volume 3, chapter 21. Basic Books.
-
Wikipedia contributors. (2021, April 21). Peierls substitution. In Wikipedia, The Free Encyclopedia.
Fast Fourier Transform:
-
Press W. et al. (1992). Fast Fourier Transform. In Numerical Recipes in Fortran 77, chapter 12.
-
Wikipedia contributors. (2021, October 8). Cooley–Tukey FFT algorithm. In Wikipedia, The Free Encyclopedia.
-
Weisstein, E. (2021). Fast Fourier Transform. In Wolfram MathWorld.
Hartree Atomic Units:
- Wikipedia contributors. (2021, May 14). Hartree atomic units. In Wikipedia, The Free Encyclopedia.
Names of the Different Boundary Conditions:
- Wikipedia contributors. (2021, March 7). Boundary value problem. In Wikipedia, The Free Encyclopedia.