mesolve with explicit time dependence and dissipation

245 views
Skip to first unread message

vali...@gmail.com

unread,
Nov 24, 2014, 11:41:23 PM11/24/14
to qu...@googlegroups.com
Hello,

I think I ran into a problem in the function mesolve. I have the following script for the simple case of a single qubit driven with dissipation. No matter what driving amplitude or detuning I choose, the system always ends up in the 50% population state. If I remove dissipation I obtain what I would expect which is an average steady-state population that depends on driving amplitude, detuning of driving and qubit dissipation. I have tried all possible ways in which to write the time-dependent Hamiltonian with the same result. Here is the code, with the result for the used parameters, which shows that something is odd since starting from the ground state with driving amplitude set to 0, I end up at 50%... any feedback will be much appreciated!

from qutip import *
from scipy import *
from pylab import *

#Define input parameters
eps = 0
delta = 24
w = 28
A = 0
wq = sqrt(delta ** 2 + eps ** 2)

#State vectors in diagonal basis
grd = basis(2,0)
exc = basis(2,1)

#Initial state: ground state of the full Hamiltonian in the non-diagonal basis
grdf = sqrt((wq + eps)/(2 * wq)) *  grd - sqrt((wq - eps)/(2 * wq)) * exc
psi0f = grdf

#Definition of qubit operators
sx = sigmax()
sz = sigmaz()
sm = destroy(2)

#Collapse operators
cf_ops = []
gamma = 0.1
cf_ops.append(sqrt(gamma) * sm)
gamma2 = gamma/2
cf_ops.append(sqrt(gamma2) * sz)

#Time vector
t = linspace(0, 50, 100)

#Define final state projector
sigma_ggf = grdf * grdf.dag()

#System Hamiltonian
H0f = -delta/2 * sx - eps/2 * sz
H1f = -sz
Hf = [H0f, [H1f, 'A * cos(w * t)']]

#Parameter values of driving
Hargs = {'w': w, 'A': A}

output = mesolve(Hf, psi0f, t, cf_ops, [sigma_ggf], args = Hargs)

plot(t, output.expect[0])

show()

Thanks!

Pol

vali...@gmail.com

unread,
Nov 26, 2014, 1:18:57 AM11/26/14
to qu...@googlegroups.com, vali...@gmail.com
Hi to myself,

I just found the error. It was in my code, obviously, but the nature of the error was non-trivial (to me). I defined the collapse operator for relaxation to be proportional to 'sigma^-' in the flux basis. And that is the mistake, it should be defined in the energy basis where the qubit Hamiltonian is diagonal. In the code above the collapse operators have to be transformed in the flux (non-diagonal) basis. Taking into account the correct definition of the eigenvectors, the new collapse operators should look like:

#New collapse operators
cf_ops = []
cf_ops.append(sqrt(gamma) * (-delta/(2 * wq) * sz + (wq + eps)/(2 * wq) * sm - (wq - eps)/(2 * wq) * sm.dag()))
cf_ops.append(sqrt(gamma2) * (eps/wq * sz + delta/wq * sx))

They are quite ugly, especially the transformed sigma^-.

So actually this problem is much simpler to formulate if everything is written in the energy basis of the qubit. The only change in the code of my first post should be in the Hamiltonian:

#Hamiltonian in diagonal basis
H0 = -wq/2 * sz
H1 = (eps/wq * sz + delta/wq * sx)

H = [H0, [H1, 'A * cos(w * t)']]

This actually made me realize that there is a couple of examples in the QuTiP documentation (version 2.2.0) that uses the incorrect definition of the collapse operators like I was doing. It is the examples of 'Landau Zener' transitions. I did check it and I can see clear differences if I use the modified definition of the collapse operators. I think this should be corrected in the documentation and demos. I will write a longer post when I examine this a little more closely.

For now I just wanted to clarify my own confusion.

Best,

Pol

jrjoh...@gmail.com

unread,
Nov 26, 2014, 1:55:34 AM11/26/14
to qutip group
Hi Pol

Thanks for following up on your own post. Yes, the basis used for the collapse operators and the Hamiltonian is obviously important and must be consistent. However, the 'correct' definitions is sometimes a matter of interpretation and the problem at hand. For example, is your environment inducing transitions in the eigenbasis or in the computational basis? It depends on the situation. But we'd be happy to improve the documentation and attempt communicate this important point more clearly, so we would love get feedback on where you think we should adjust the documentation and examples.

Thanks,
Rob

vali...@gmail.com

unread,
Dec 8, 2014, 11:52:10 PM12/8/14
to qu...@googlegroups.com
Hi Rob,

Sorry to come back to your response with a significant delay. You are right that the correct form of the collapse operators depends on the nature of your noise, and it could be that in your examples it is as you describe it. However in the example of the single driven qubit, which is quite a standard case, unless I use the collapse operators as I described above, I obtain odd-looking results like the qubit starting in the ground state without driving and ending in a 50% mixture.
I am attaching the full script that solves the dynamics in both the energy as well as the flux basis. I also add the propagator_steadystate calculation to compare (I don't know why but for off-resonant driving the results deviate a little although it is a small difference).
In the documentation of the latest Qutip version you removed the chapter on examples and moved some of them in the description of each function. Maybe there could be room somewhere in the introduction to time-dependent systems for the simple case of the driven qubit? Or otherwise somewhere on the website?

It's just a suggestion, of course you are free to do as you may! I just wanted to help out in case someone gets stuck like I did.

Best,

Pol
Driven_qubit_single.py

jrjoh...@gmail.com

unread,
Jan 8, 2015, 9:27:00 PM1/8/15
to qutip group
Hi Pol

Very sorry for taking so long to get back to you about this.You're example program is very illustrative and I think it would make a great addition to the tutorials sections on the web page. As you noted we have removed examples from the documentations in favor of the collection of IPython notebook examples on the qutip.org web site. Would you be willing to reformat your example as an IPython notebook and submit a pull request for it to be included in the examples section there?


​Rob

Pol Forn-Diaz

unread,
Jan 9, 2015, 12:47:50 PM1/9/15
to qu...@googlegroups.com
Hi Rob,

I would be very happy to create an example. I have never used IPython before so I will take some time but once I'm done I will let you know.

Best,

Pol
--
You received this message because you are subscribed to a topic in the Google Groups "qutip" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/w-uM-yaWFCc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages