-1
from qutip import*
import numpy as np
import matplotlib.pyplot as plt
import cmath
#Definitions
omega=4
gamma=omega/4
#parameters
E1=-1/2
E2=5/2
E3=-1/2
w=1
psi0=basis(3,2)
d1=basis(3,0).dag()*qeye(3)
d2=qeye(3)*basis(3,1)
d3=basis(3,2).dag()*qeye(3)
#Hamiltonians' terms
ET=E1 * d1.dag() * d1+E2*d2.dag() * d2+E3*d3.dag()*d3
AO=omega*d1.dag()*d3
SC=gamma*d1.dag()*d2.dag()
ETC=E1 * d1.dag() * d1+E2*d2.dag() * d2+E3*d3.dag()*d3
AOC=omega*d3.dag()*d1
SCC=gamma*d2*d1
#Hamiltonians
H=ET+AO+SC+ETC+AOC+SCC
#X axis
times=np.linspace(0,20,100000)
#Solution
result=mesolve(H, psi0, times, [], [AO,AOC])
#graph
fig, ax= plt.subplots()
ax.plot(result.times, result.expect[0]);
ax.plot(result.times, result.expect[1]);
ax.set_xlabel('Time');
ax.set_ylabel('Expectation values');
plt.show(fig)
has error message?
– Elton Nunes
complexWarning: Casting Complex values to real discards the Imaginary part Return array(a, dtype, copy=False, order=order)
– Rubens Filho
puts this on the topic, and preferably the complete message
– Elton Nunes