使用 MATLAB ode45 求解时间相关薛定谔方程

计算科学 matlab 计算物理学 量子力学 八度
2021-12-02 18:29:53

时间相关哈密顿量的薛定谔方程是

iddtψ(t)=H(t)ψ(t).

我尝试在 ODE 45 中解决时间相关哈密顿量的薛定谔方程。但是,因为哈密顿量H(t)取决于时间,我不知道如何在 ode45 中进行插值。你能给我一些提示吗?

psi0 = [0 1];
H = [1 0;0 1]*cos(t); %this is wrong, I do not know how to implement this and pass it to ode45
hbar = 1;
t    = [0:1:100];
[T, psi] = ode45(dpsi, t, psi);
function dpsi = f(t, psi, H, psi0)
dpsi = (1/i)*H*psi;
1个回答

可能这就是你想要的?

function schrodingerEqn
psi0 = [0 1];
hbar = 1;
t    = [0:1:100];
fh = @(t, psi) f(t, psi, hbar);
[T, psi] = ode45(fh, t, psi0);
figure; plot(T, real(psi(:,2)));
end

function dpsi = f(t, psi, hbar)
dpsi = 1/(hbar*i)*[1 0;0 1]*cos(t)*psi;
end