1 Dimensional Schrödinger Equation Simulation


The time dependent Schrödinger equation is:

ψ(x,t)t=iH^ψ(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=iH^ψ(x,t)

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

ψ(x,t+Δt)=eiH^Δ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^=22m2x2+V(x)

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

limh0df(x+h)dxdf(x)dxh
=limh0f(x+h)f(x)hf(x)f(xh)hh
=limh0(f(x+h)f(x))(f(x)f(xh))h2
=limh0f(x+h)2f(x)+f(xh)h2
f(x+Δx)2f(x)+f(xΔx)Δx2

So for each position of 22m2x2 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[1112112111]

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

[V(0)V(Δx)V((N1)Δx)V(NΔx)]

H^ is the sum of those two matricies

H^=22m1Δx2[1112112111]+[V(0)V(Δx)V((N1)Δ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=eiH^Δtψt