Why the results of solving ordinary differential equation get from ODE45 are not correct?
4 views (last 30 days)
Show older comments
Recently, I make a program to solve Liouville von-neumann equation. The system Hamiltonian and initial state are known, I try to find the density matrix of system at any time.
The code as
% define the function
function dXdt = Liouvelle(t,X)
% Delta=5;
% epsilon=0.2; % driving strength
% Omega_d=10; % driving frequency
% Omega_r=10; % frequency of cavity
H=2*pi*[0.2 5; 5 -0.2];
%H=2*pi*[Delta -epsilon*cos(2*pi*Omega_d*t); -epsilon*cos(2*pi*Omega_d*t) -Delta]; %System Hamiltonian
X = reshape(X, size(H));
dXdt = -i*(H*X-X*H); %Liouville von-neumann equation
dXdt = dXdt(:);
% call the defined function to solve problem
clear
% initial state
X2=[0.5 0.5;0.5 0.5];
psi2=sqrt(2)/2*[1 1]';
input=psi2;
%options = odeset('RelTol',1e-8,'AbsTol',1e-10);
[T X]= ode45(@Liouvelle,[0:0.1:5],X2);
[m n] = size(X);
for j=1:m
XX(:,:,j)=reshape(X(j,:),size(X2));
F(j)=input'*XX(:,:,j)*input; % Compute the fidelity, Nielsen 'quantum computation and
% quantum information page 409 eq(9.60)
end
possibility=squeeze(XX(1,1,:));
figure(2); plot(T,F); hold on;
However, I find the non-diag element of some density matrix is not correct because the product of the element are larger than 0.25. If I set precision at ode45, the results are improved but their product are still little bit larger than 0.25.
I don't know what's wrong and how to solve this problem.
Thanks.
Zhihui
0 Comments
Answers (0)
See Also
Categories
Find more on Quantum Mechanics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!