I,m starting with a simple J-C Hamiltonian and add a driving term to it:
from qutip import *
import numpy as np
import matplotlib.pyplot as plt
#-----------times----------------------
N=10;
times = np.linspace(0.0, 20.0, 100)
#-----initial state---------------
psi0 = tensor(ket2dm(fock(2, 0)), thermal_dm(N, 5));
#-----------Operators---------------
a = tensor(qeye(2),destroy(N));
sm =tensor(destroy(2),qeye(N));
#-----------parameter's values---------------
kc=0.1;
etta=1*300*kc;
#-----------Algebra--------------------------
coma=a*a.dag()- a.dag()* a;
comz=sm*sm.dag()+sm.dag()*sm;
#-----------System's Dynamics----------------
opt=Options(nsteps=1000)
H = 2 * np.pi * a.dag() * a + 2 * np.pi * sm.dag() * sm + 2 * np.pi * 0.25 * (sm*a.dag() + sm.dag()*a)+ 1j*etta*(a.dag()-a);
data = mesolve(H, psi0, times, [np.sqrt(0.1)*a], [coma,comz,a.dag()*a, sm.dag()*sm],options=opt)
#----------Plot----------------
plt.figure()
plt.plot(times, data.expect[0], times, data.expect[1],times, data.expect[2],times, data.expect[3])
plt.title('Master equation time evolution')
plt.xlabel('Time')
plt.ylabel('Expectation values')
plt.legend(("Boson Algebra","Fermion Algebra","cavity photon number", "atom excitation probability"))
plt.show()
As can be seen the bosonic commutation relation converges to zero instead of 1(blue curve).