5.1 ms
13.5 s

Simulating the 1-D TDSE

8.8 μs

iψ(x,t)t=(22m2x2+V(x))ψ(x,t)

6.8 μs

Crank-Nicholson scheme

8.3 μs

We can write a forward and backward euler expansion for the time derivative (setting =1):

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

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

Taking the mean value of these two expressions, we obtain the crank nicholson scheme:

(1+12iH^Δt)ψ(x,t+Δt)=(112iH^Δt)ψ(x,t)

This gives us a unitary evolution operator, which will preserve the normalization. The second derivative in H^ can be approximated using finite differences:

2ψjnx2=ψj+1n2ψjn+ψj1n(Δx)2

This can then be written in matrix form like so;

M1ψn+1=M2ψnψn+1=M11M2ψn

14.4 μs

M1=(ξα0.........0αξα0...0αξα0....0αξα0...0αξα0.........0αξ)M2=(γα0.........0αγα0...0αγα0....0αγα0...0αγα0.........0αγ)

7.2 μs

α=iΔt4m(Δx)2ξ=1+iΔt2(1m(Δx)2+V(x))γ=1iΔt2(1m(Δx)2+V(x))

8.4 μs

Boundary Condition

By virtue of this specific construction of the evolution matrices, the system has fixed boundary conditions (ψ(x)=0 at the boundaries). This effectively emulates an infinite wall on either sides, resulting in a particle-in-a-box system in the absence of any other potential inside.

29.9 μs

Initial Condition

12.6 μs
initCond (generic function with 1 method)
55.6 μs

Crank-Nicholson evolution

8.4 μs
schrodingerEquation (generic function with 1 method)
516 μs

Potential function

6.4 μs
V (generic function with 1 method)
45.0 μs

Plotting

6.6 μs
plotProbabilityDensity (generic function with 1 method)
168 μs
plotRealImg (generic function with 1 method)
80.8 μs

Simulation results

5.9 μs
nSteps
2200
176 ns
20.2 s