time dependent Schröidinger Equation

Welcome back!

I prepare here an introduction to solve time-dependent Schröidinger equation and added my code at the end. If you are interested more professional resources following link may help
Wavepacket Dynamics
But less likely you may learn about the details of their code. So here is your chance to start playing one of the most exciting and instructive problem in Quantum Physics. Below you see a wavepacket scattering from a potential at the center of the graph.

Cheers!
Nebo - First - Page 1
During my research, I have to solve 2D Schroedinger equation both time dependent and independent for specific potentials. In following, I explain the idea behind how to solve time-dependent Schroidinger equation. It is a useful research tool and it is also instructive.
One of my research area in general can be categorized as transport in nanostructures. For that I want to solve time- dependent Schroidinger equation.
i ψ t = - 2 2 m × 2 ψ x 2 + 2 ψ y 2 + V ψ
You can separate time dependence (separation of variable)
ψ x , y , t = e - i H t / ψ x , y H = - 2 2 m × x 2 + y 2
For a computer simulation first I choose a unit system where energy is measured in units of something so that all constants are 1in Schroidinger eqn. This is usually the first step doing simulations and known as atomic units. In this unit wave function can be propagated simply
ψ t + δ = e - i H δ ψ t
For this problem it turns out to be the form that we write above is not stable numerically. we will use following form,
e i H t / 2 ψ = e - i H t / 2 ψ 1 + i H t 2 ψ n , m , t = 1 - i H t 2 ψ n , m , 0
So we first multiply with half of the operator than we use ex pansion of the exponential and take the first term.
This is much stable numerically. The spatial part is also discritized as usual,
2 ψ x 2 = ψ n + 1 - 2 Ψ n + ψ n - 1 Δ x 2 , 2 ψ y 2 = ψ m + 1 - 2 ψ m + ψ m - 1 Δ y 2
Finally we get following eqn
1 - i Δ x δ 2 ε 2 × 1 - i Δ y δ 2 ε 2 × e i V t / 2 ψ n , m j + 1 = 1 + i Δ x δ 2 ε 2 × 1 + i Δ y δ 2 ε 2 × e - i V t / 2 ψ n , m j x ψ n , m j = ψ n + 1 , m j - 2 Ψ n , m j + ψ n - 1 , m j
where we defined central derivative operator for x and y. Here is the static potential as above. delta and epsilon are time and space increments. This eqn has 3 indicies, it is useful to define a new variable and solve it in 2 parts.
1 - i λ Δ x ϕ n j , m = 1 + i λ Δ y ψ n , m j
Now,
1 - i λ Δ y × e i V δ / 2 ψ n , m j + 1 = 1 + i λ Δ x × e - i V δ / 2 ϕ n , n j
first we use an initial condition and assume that at time step j we know the solution so phi can be calculated. So left hand side of above eqn is a known vector. Therefore rig a t hand side also calculated using 3 diagonal matrix form.

function M=tprop(J)
sigma=0.08;
a=0.08;
xv=0.4;
yv=0.4;
eps=0.01;
eta=0.5*eps^2;
k0=90;
kx=64;
ky=64;
Vmax=2*k0^2;
x=linspace(-0.5,1.5,J);
y=linspace(-0.5,1.5,J);
fi0=zeros(J,J);
V=zeros(J,J);
x0=0.25;
y0=0.25;
for ii=1:J
    for jj=1:J
        fi0(ii,jj)=(1/sqrt((pi*sigma^2)))*...
            exp(1i*x(ii)*kx+1i*y(jj)*ky...
            -(x(ii)-x0).^2/(2*sigma^2)...
            -(y(jj)-y0).^2/(2*sigma^2));
        if ((x(ii)-xv)^2+(y(jj)-yv)^2) <= a^2
            V(ii,jj)=Vmax;
        else
            V(ii,jj)=0;
        end
    end
end
n=1;
count=0;
while n < 160
    count=count+1;
    fin=solver(fi0,V,eps,eta,J);
    fi0=fin;
    n=n+1;
    fi=fin;
    [xx,yy]=meshgrid(x,y);
    colormap pink
    mesh(xx,yy,+10*V/(Vmax))
    hold
    surf(xx,yy,abs(fi))
    hold
    view(-145,75);
    axis([-0.5 1.5 -0.5 1.5 0 10])
%    colormap winter
    shading interp
    M(count)=getframe;
    drawnow;
end
end
function fin=solver(fi0,V,eps,eta,J)
lambda=2*eps^2/eta;
%
%   part 1
%
A=(1+2*1i/lambda)*diag(ones(J-2,1))-(1i/lambda)*diag(ones(J-3,1),-1)-...
    (1i/lambda)*diag(ones(J-3,1),1);
B=zeros(J-2,1);
fis=zeros(J,J);
%
%    find fis, intermediate time step.
%
for jj=2:J-1
    for ii=2:J-1
        B(ii-1)=fi0(ii,jj)+(1i/lambda)*(fi0(ii,jj+1)-2*fi0(ii,jj)+fi0(ii,jj-1));
    end
    C=linsolve(A,B);
    CC=[0;C;0];
    fis(:,jj)=CC;
end
%
%   part2
%
fiss=exp(-1i*eta*V/2).*fis;
A=(1+2*1i/lambda)*diag(ones(J-2,1))-(1i/lambda)*diag(ones(J-3,1),-1)...
    -(1i/lambda)*diag(ones(J-3,1),1);
B=zeros(J-2,1);
fins=zeros(J,J);
%
%   find new fin+1 (wavefunction at t+lambda)
%
for ii=2:J-1
    for jj=2:J-1
        B(jj-1)=fiss(ii,jj)+(1i/lambda)*(fiss(ii+1,jj)-2*fiss(ii,jj)+fiss(ii-1,jj));
    end
    C=linsolve(A,B);
    CC=[0;C;0];
    fins(ii,:)=CC.';

end
fin=exp(-1i*eta*V/2).*fins;
end

  
   

Comments

Popular posts from this blog