Hi,
I'm trying to simulate the Hamiltonian
H = g1 Z1 (b+bdagger) + g2 Z2 (b + bdagger) + ϵ bdagger*b
where Z1, Z2 are the Pauli Z operators on qubits 1,2, and b is the destroy operator on some QHO (say a 3 level system). And I want to find the expectation value of b over time.
This can be solved analytically in the rotating frame to obtain
<b> = b + (1-exp(-iϵt))(g1 Z1 + g2 Z2)/ϵ
Which results in a circle when we plot the imaginary/real parts.
When I try to find the expectation value numerically, by evolving in time a set of states (either specific states or the eigenstates of the Hamiltonian), I get a dramatically different result. Here is the code:
-------------------
import qutip
import numpy as np
import matplotlib.pyplot as plt
g1 = 5.6
g2 = 6.0
z1 = qutip.tensor(qutip.sigmaz(), qutip.qeye(3), qutip.qeye(2))
z2 = qutip.tensor(qutip.qeye(2), qutip.qeye(3), qutip.sigmaz())
b = qutip.tensor(qutip.qeye(2), qutip.destroy(3), qutip.qeye(2))
H = g1 * z1 * (b.dag() + b) + g2 * z2 * (b.dag() + b) + ϵ*b.dag()*b
energies, states = H.eigenstates()
# states = [qutip.tensor(qutip.basis(2, i), qutip.basis(3, 0), qutip.basis(2, j)) for i in range(2) for j in range(2)]
for s in states:
solve = qutip.sesolve(H, s, np.linspace(0, tau/ϵ))
p = [qutip.expect(b, x) for x in solve.states]
plt.plot(np.real(p), np.imag(p))
plt.show()
--------------
Any idea what I'm doing wrong?