Hello,
I have a question about how to use a collapse operator when using the Hamiltonian function.
See the following program as an example.
--------------------------------------------------
wq = 1.0 * 2 * np.pi
W = 1.0 * 2 * np.pi
gamma = 1
sm, sx, sy, sz = q.sigmam(), q.sigmax(), q.sigmay(), q.sigmaz()
H0 = 0.5 * wq * sz
H1x, H1y = W * sx, W * sy
args = {"H0": H0, "H1x": H1x, "H1y": H1y, "wq": wq}
def Ht(t, args):
return args["H0"] + np.cos(args["wq"] * t) * args["H1x"] + np.sin(args["wq"] * t) * args["H1y"]
tlist = np.linspace(0, (1/gamma)*5, 500+1)
psi0 = q.basis(2,0)
# c_ops = []
# c_ops = [0 * sm]
c_ops = [np.sqrt(gamma) * sm]
e_ops = [sm.dag() * sm]
result = q.mesolve(Ht, psi0, tlist, c_ops, e_ops, args=args, progress_bar=True)
fig, ax = plt.subplots(figsize=(12,5))
ax.plot(tlist, result.expect[0])
plt.show()
plt.close()
--------------------------------------------------
In this example, it seems to work correctly when the collapse operator exists (c_ops = [np.sqrt(gamma) * sm]).
However, when the collapse operator does not exist (c_ops = []), this outputs an error.
On the other hand, if gamma is zero (i.e. c_ops = [0 * sm]), this works.
This behavior seems strange.
Where is wrong with this program?
How should I use this?
The version_table() is as following:
QuTiP 4.2.0
Numpy 1.13.3
SciPy 0.19.1
matplotlib 2.1.0
Cython 0.26.1
IPython 6.1.0
Python 3.6.3
OS nt [win32]
Thanks