Numerical Notebooks Index
Numerical notebooks should make the canonical systems reproducible. A notebook is not just a plot generator: it should state the analytic result being checked, the numerical method, the parameters, the validation tolerance, and the known limitations.
The source notebooks are in the repository directory notebooks/wave-mechanics-canonical-systems/; paths in the table are relative to that directory. Open a chosen .ipynb file in a notebook application with Python and NumPy 2.0 or newer available, then run its cells from the beginning. Plotting is optional: the comparison cells test numerical results directly. See Benchmark Problems to interpret convergence and finite-domain errors.
Notebooks by Physical Problem
Section titled “Notebooks by Physical Problem”| Notebook Path | Model | Method | What to Compare |
|---|---|---|---|
one-dimensional-bound-systems/infinite-square-well.ipynb |
Infinite Square Well | finite-difference Hamiltonian diagonalization | eigenvalues approach and eigenvectors are orthonormal |
one-dimensional-bound-systems/finite-square-well-bound-states.ipynb |
Finite Square Well | matrix diagonalization | bound-state count changes with depth and edge leakage is negligible |
free-motion/gaussian-wave-packet-spreading.ipynb |
Wave Packet Spreading | spectral time evolution | norm is conserved and width follows the analytic Gaussian result |
scattering-tunneling/barrier-scattering-wave-packet.ipynb |
Wave Packets and Scattering, Rectangular Barrier Tunneling | split-step time evolution | transmission approaches the momentum-averaged stationary result under mesh, time-step, box, and observation-time checks; norm is checked separately |
harmonic-oscillator/harmonic-oscillator-eigenstates.ipynb |
Quantum Harmonic Oscillator | finite-difference diagonalization | eigenvalues approach and eigenfunctions show expected parity |
two-level-systems/two-level-system-dynamics.ipynb |
Two-State Hamiltonians | exact matrix evolution | probability oscillations match the analytic two-state formula |
hydrogenic/hydrogen-radial-wavefunctions.ipynb |
Hydrogen Atom | analytic radial functions on quadrature grids | radial functions normalize with measure and energies scale as |
three-dimensional/spherical-harmonics-gallery.ipynb |
Spherical Harmonics | analytic angular functions on quadrature grids | angular normalization and orthogonality are checked numerically |
electromagnetic-fields/landau-levels.ipynb |
Landau Levels | Landau-gauge oscillator discretization | equally spaced levels and degeneracy scaling with flux are verified |
The NumPy requirement comes from numpy.trapezoid, used in quadrature checks and available since NumPy 2.0. The oscillator and barrier notebooks include separate refinement studies; the shorter examples demonstrate their stated checks rather than a general convergence guarantee.
Validation Patterns
Section titled “Validation Patterns”Analytic checks should be explicit. Examples:
For the infinite square well,
For a normalized one-dimensional wave packet on a grid,
For Landau-level degeneracy in area ,
The notebook should state whether the comparison is exact, asymptotic, finite-grid, or finite-size. A failure to match an exact formula is not always a bug; it may be a boundary effect, a coarse grid, or an invalid parameter regime. The notebook should make that distinction visible.
Common Mistakes
Section titled “Common Mistakes”- Publishing a plot without a validation check.
- Treating agreement by eye as a numerical test.
- Hiding boundary conditions in code rather than stating them in markdown.
- Comparing finite-box numerics directly with infinite-line formulas without explaining the approximation.
- Reporting an eigenvalue without specifying grid spacing and convergence behavior.
- Using a gauge-dependent wavefunction plot as if it were a gauge-invariant observable.
Exercises
Section titled “Exercises”- Design the validation cell for an infinite-square-well diagonalization notebook. What two quantities should be checked?
Solution
Check eigenvalues against
for the lowest few states, and check numerical orthonormality of the eigenvectors with the grid inner product. A good notebook should also show convergence as the grid spacing is reduced.
- A wave-packet notebook conserves norm to high precision but its packet width disagrees with the analytic Gaussian formula. List two likely causes.
Solution
The initial state may not match the analytic Gaussian convention used in the formula, or the propagation may be affected by finite-box boundaries, grid dispersion, or time-step error. Norm conservation is necessary but not sufficient to validate the full evolution.
References
Section titled “References”- D. J. Griffiths and D. F. Schroeter, Introduction to Quantum Mechanics, 3rd ed., Cambridge University Press, 2018.
- R. J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations, SIAM, 2007.
- R. Shankar, Principles of Quantum Mechanics, 2nd ed., Springer, 1994.
- L. N. Trefethen and D. Bau III, Numerical Linear Algebra, SIAM, 1997.