Quantum Dynamics: a superposition of box eigenstates in time

ψ(x,t) = Σn cn √(2/L) sin(nπx/L) e−iEnt/ħ with En = n²π²ħ²/(2mL²). Time is measured in units of mL²/ħ, so the phase of term n advances as n²π²t/2.

Coefficients cn (real)
nc
nc
nc

Complex plot of ψ(x) · √L Re ψ Im ψ |ψ|

The filled region is |ψ| colored by the phase arg ψ (red = 0, green = 2π/3, blue = 4π/3), as in the OSP complex plot. Tick the box to draw the real and imaginary parts on top.

Probability density |ψ(x)|² · L

The total probability shown above is Σ |ψ|² Δx over the grid, as in the original.

Expectation value of position, ⟨x⟩ / L

⟨x⟩ = Σ x |ψ|² Δx, appended once per step. The horizontal axis grows as the run continues.

About this page

This is an HTML + JavaScript port of QuantumDynamicsApp, a Java program written by Larry Engelhardt in 2010 with the Open Source Physics library. The original hard-coded two terms, n = 1 with c = 1/√2 and n = 6 with c = 0. Here the coefficients are editable, starting from the single n = 1 term with c = 1, and the Normalize button rescales them so Σ cn² = 1 and restarts the run at t = 0. While running, time advances smoothly at the rate set by the animation speed slider, in units of mL²/ħ per real second, so higher-n terms really do turn faster; slow the slider down to follow them. The time step is used by the Step button. The grid is fixed at 100 points, and the grid sums for total probability and ⟨x⟩ use the left-endpoint rule at x = iΔx, as in the Java.

See also Wavefunction in a Finite Hilbert Space, a companion simulation.

Created by Larry Engelhardt, Francis Marion University, with Claude (Anthropic), 2026. Licensed under CC BY-NC-SA 4.0. Source: github.com/lengelhardt/quantum_dynamics_1D_box.