An Interactive Single-Particle Quantum Mechanics Simulation in 2D


This simulation works by approximating the position space Hamiltonian H of the quantum system using a uniform finite difference grid, where its energy eigenstates |n> and eigenvalues Eₙ are subsequently solved for. From here the quantum system's (numerically approximated) wave function |ψ> is expressed as a linear combination of these energy eigenstates |n>, where

|ψ(0)> = Σₙ cₙ|n>, and
|ψ(t)> = Σₙ cₙ(t)|n> = Σₙ cₙ exp(-iEₙt/ħ)|n>.

Here t is the time elapsed in the simulation, and the cₙ(t) are complex-valued coefficients, where they are visually represented using circular "clock face" sliders that can be interactively modified in real time by the user. The lengths for each of these circular sliders are proportional to |cₙ(t)|, and their angular offsets are the same as the phase factor -Eₙt/ħ.

This interactive simulation is primarily based on Paul Falstad's various quantum mechanics apps. Some additional inspiration comes from Daniel Schroeder's quantum mechanics programs. Computations for obtaining the eigenvectors and eigenvalues of the numerically approximated Hamiltonian matrix are found using Eigen and Spectra. Both are licensed under the MPL2.