1 Dimensional Schrödinger Equation Simulation


The time dependent Schrödinger equation is:

∂ψ(x,t)∂t=−iℏH^ψ(x,t)

A naive implementation using Eulers method where ψt+Δt(x)=ψt(x)+∂ψt(x)∂tΔt will usually cause the waveform to explode due to floating point and integration errors.


Because ψ is usually derived from quantizing a classical theory, it's an infinite dimensional vector in a Hilbert space. So ψ∈(ℝ→ℂ) assigning a complex number to each possible position. For the simulation we will approximate it as a finite dimensional vector by discreetizing it over N points so ψ∈ℂN. Similarily H^∈ℂN×N is now a finite (Hermetian) matrix. The equation stays the same, but it's now in a finite dimensional Hilbert space:

∂ψ(x,t)∂t=−iℏH^ψ(x,t)

Assuming the Hamiltonian isn't time dependent, the differential equation has the closed form solution using matrix exponentiation.

ψ(x,t+Δt)=e−iℏH^Δtψ(x,t)

We should now actually define the Hamiltonian operator H^. The original discreet version for a non-relativistic particle with some potential function V is the linear operator:

H^=−ℏ22m∂2∂x2+V(x)

Since we discreetized ψ as a finite dimensional vector, we replace the second derivative with the finite difference method.

limh→0⁡df(x+h)dx−df(x)dxh
=limh→0⁡f(x+h)−f(x)h−f(x)−f(x−h)hh
=limh→0⁡(f(x+h)−f(x))−(f(x)−f(x−h))h2
=limh→0⁡f(x+h)−2f(x)+f(x−h)h2
≈f(x+Δx)−2f(x)+f(x−Δx)Δx2

So for each position of −ℏ22m∂2∂x2 we can make a matrix below. We assume no repeating boundary conditions. The matrix is equivelent to the Laplacian of a path graph.

−ℏ22m1Δx2[−111−21⋱1−211−1]

The potential term V(x) is simply the value at each point:

[V(0)V(Δx)⋱V((N−1)Δx)V(NΔx)]

H^ is the sum of those two matricies

H^=−ℏ22m1Δx2[−111−21⋱1−211−1]+[V(0)V(Δx)⋱V((N−1)Δx)V(NΔx)]

Each discrete step of the simulation will go through a certain change in time using the matrix exponent of the Hamiltonian operator. It should be simple to put it into a for loop now.

ψt+Δt=e−iℏH^Δtψt