The 1D time-dependent Schrödinger equation (ħ = m = 1) is split into real and imaginary parts ψ = R + iI and integrated with Visscher's staggered leapfrog scheme, which keeps the total probability stable over long runs:
i·∂ψ/∂t = -½·∂²ψ/∂x² + V(x)·ψ
∂I/∂t = ½·R'' − V·R (I stored at half-steps)
∂R/∂t = −½·I'' + V·I (R stored at integer steps)
The initial state is a normalized Gaussian wave packet ψ(x,0) = A·exp(−(x−x₀)²/2σ²)·exp(ik₀x). Norm, ⟨x⟩ and ⟨E⟩ = ⟨T⟩+⟨V⟩ are recomputed every frame directly from the grid; for the barrier the fraction of |ψ|² sitting past the barrier center gives the transmitted probability, the rest reflected.