Simulating Schrödinger Equation in 1 Dimension


The time dependent schrodingers equation is:

iψ(x,t)t=22m2ψ(x,t)x2+V(x)ψ(x,t)

Divide both sides by i and then we have a way to do it iteratevely

ψ(x,t)t=22m2ψ(x,t)x2+V(x)ψ(x,t)i

and 1i=i so

ψ(x,t)t=i2m2ψ(x,t)x2+iV(x)ψ(x,t)

If this is implemented as simple as possible with Euler's method, it will usually be inaccurate and cause the wave to blow up. Simulating the equation will require a more accurate method.


First convert the equation to use the Hamiltonian, which is equal to the sum of the kinetic energy and potential energy.

A classical wave will look like

ψ(x,t)=ei(kxωt)

k=τλ is the wave vector, the radians per distance, and λ is the wave length of the wave.

ω=τv is the angular velocity.

By definition of h, the momentum of a wave is p=hλ=k

Then:

ψ(x,t)x=ikei(kxωt)=ikψ(x,t)
2ψ(x,t)x2=i2k2ei(kxωt)=k2ψ(x,t)
2ψ(x,t)x2=p22ψ(x,t)
p2ψ(x,t)=22ψ(x,t)x2

Calculating kinetic energy is K=12mv2=p22m, so:

2mK(x,t)ψ(x,t)=22ψ(x,t)x2
K(x,t)ψ(x,t)=22m2ψ(x,t)x2

And the Hamiltonian is H=K+V.

H=K+V
H(x,t)ψ(x,t)=K(x,t)ψ(x,t)+V(x)ψ(x,t)
H(x,t)ψ(x,t)=22m2ψ(x,t)x2+V(x)ψ(x,t)

And that is the same as the original equation so

H(x,t)ψ(x,t)=22m2ψ(x,t)x2+V(x)ψ(x,t)=iψ(x,t)t
iψ(x,t)t=H(x,t)ψ(x,t)
ψ(x,t)t=iH(x,t)ψ(x,t)

And we can replace the Hamiltonian at a point with the Hamiltonian operator H^

ψ(x,t)t=iH^ψ(x,t)

For the computer simulation we will represent ψ as a vector, so if we can make the H^ a matrix then we can approximate the differential equation using matrix exponentiation.

ψ(x,t)t=iH^ψ(x,t)
ψ(x,t)=eiH^tψ(x,0)

The Hamiltonian operator is equal to H^=22m2x2+V(x).

The second derivative can be calculated by:

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

When converted to discrete form:

f(x+Δx)2f(x)+f(xΔx)Δx2

And for each position of 22m2x2 we can make a matrix like:

22m1Δx2[1112112111]

Then for the V(x) part, it is just a value at each point:

[V(0)V(1)V(n1)V(n)]

So H^ is just the sum of those two matricies

H^=22m1Δx2[1112112111]+[V(0)V(1)V(n1)V(n)]

And then each discrete step of the simulation will go through a certain change in time

ψt+1=eiH^Δtψt

This method is more accurate but more computationally complex, since the matrix will have to be the same size as the size of vector ψ making this algorithm O(n2) of the number of elements in the vector.


I used this link for the explanation of the derivation and this link for explaining how to simulate it using the Hamiltonian.