The wavefunction ψ(x,t) is evolved by directly integrating the 1D time-dependent Schrodinger equation on a spatial grid (ħ=m=1), using Visscher's leapfrog scheme that steps the real and imaginary parts on staggered half-time-steps — a standard, unconditionally-stable-in-practice finite-difference method:
i dψ/dt = -½ d²ψ/dx² + V(x)ψ
ψ = R + iI
R(t+dt) = R(t) + dt·H[I(t+dt/2)]
I(t+dt/2) = I(t-dt/2) - dt·H[R(t)]
A Gaussian wavepacket with mean momentum k₀=√(2E) is launched from the left at a rectangular barrier of height V₀ and width L. The exact stationary-state transmission coefficient for this barrier is:
E < V₀: T = 1 / (1 + V₀²·sinh²(κL) / (4E(V₀-E))), κ=√(2(V₀-E))
E > V₀: T = 1 / (1 + V₀²·sin²(kL) / (4E(E-V₀))), k=√(2(E-V₀))
When the packet has fully separated from the barrier the simulation integrates |ψ|² on each side to get the measured transmission and reflection probabilities, so you can watch the numerical experiment converge to the closed-form prediction — including the classically forbidden case E<V₀, where transmission is still nonzero.