I am trying to convert the following finite difference equations into code (taken from the bottom of page 12 of this thesis by Maike Schulte Numerical Solution of the Schrodinger Equation on Unbounded Domains (2007)) (NB: it's a PDF). Please be aware I don't know a lot about this sort of thing. iℏD+tψnj,k=−ℏ22m∗(D2xψn+1/2j,k+D2yψn+1/2j,k)+Vn+1/2j,kψn+1/2j,k
I would like to make a simulation of the general behaviour of the Schrodinger equation in 2d, and scales are unimportant so I figure I can ignore ℏ, m, Δt, Δx and Δy, setting them all =1. I am also dropping the potential term setting V=0 for now.
Presumably from the definition of D+t the direction of time is positive thus the aim is to calculate ψn+1. So, the confusing thing, ψn+12 is used on the RHS hence ψn+1 appears in what I'm trying to compute. How can the formula for ψn+1 be expressed purely in terms of $\psi^{0
Answer
The issue is with short-hand notation. The term ψn+1/2j,k being operated on by D2x really means D2xψn+1/2j,k=D2x[12(ψn+1j,k+ψnj,k)]=12D2xψn+1j,k+12D2xψnj,k=12Δx2[ψn+1j−1,k+ψn+1j+1,k−2ψn+1j,k]+12Δx2[ψnj−1,k+ψnj+1,k−2ψnj,k]
It was also pointed out in this CompSci post that it might be easier to solve the Schrodinger equation in two pieces, one real and one imaginary (ψ=R+iI) and solve them at alternate half-time steps. Though it might be a little more complex, the method should be extensible to 2D.
In one dimension, you can solve the Crank-Nicolson method with a tri-diagonal matrix algorithm. In 2D, you get a penta-diagonal matrix that is a bit more complicated to solve (cf. this FORTRAN routine by Dr Kevin Kreider at the University of Akron). If you sweep along the dimensions individually (i.e.g, solve x for each y cell and vice versa), you can the aforementioned tri-diagonal solver to solve 2D problems (though it's typically referred to as "alternating direction implicit" when done this way).
Alternatively, you can use some sparse solvers in BLAS routines or try an iterative solver like the Gauss-Seidel method.
No comments:
Post a Comment