Problems when applying a simple time dependent hamiltonian

135 views
Skip to first unread message

charli...@gmail.com

unread,
Dec 12, 2016, 3:19:35 PM12/12/16
to QuTiP: Quantum Toolbox in Python
Hello,

I am trying to implement a time dependent hamiltonian that basically amounts to a sequence of square pulses that "turn on" relevant components, i.e. the time varying coefficient of the components are top-hat functions centered at the appropriate times. Usually this works but in some circumstances I will run this kind of setup through mesolve() or mcsolve() and only some of or none of the pulses get carried out, often only the first one. I can't make out any kind of pattern to these failures, does anyone have an idea of why this might be happening?

If I apply these pulses as constant hamiltonians over the correct time period they work fine so I could feasibly carry out my sequence that way but it would be very time consuming.

Thanks

Charlie

Kevin Fischer

unread,
Dec 12, 2016, 4:09:02 PM12/12/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
Hi Charlie,

I've run into some problems like this before, when I was sending very short pulses. I eventually discovered that the integrator was choosing a time-step that was larger than the pulse width in some cases, perhaps this is your problem. In my case, there were a couple ways around it:
  • Explicitly set the maximum integrator time-step longer than the pulse length using the Odeoptions(max_step=X, nstep=X). You'll probably need to increase nstep as well, which is the maximum number of steps allowed.
  • If you have fast dynamics followed by slow dynamics, you might not want to integrate the whole thing with max_step being very small. Often I would input a non-linear tlist that had a bunch of points during the fast dynamics (since max_step is never greater than the difference between steps in tlist) and fewer points during the slow dynamics.
Hope this helps,

Kevin

charli...@gmail.com

unread,
Dec 12, 2016, 4:32:22 PM12/12/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
Hi Kevin,

Thanks but that doesn't sound like it's the problem I'm having. A particular pulse sequence I have trouble with is just 5 pi-pulses of the same speed between energy levels with a tlist of length 1000, meaning that each pulse takes place over around 200 time steps so I don't think pulses being too short is a problem.

The oddest thing, which I should have mentioned in my opening post, is that the conditions for this failure to happen are all over the place. Sometimes it depends on which state I begin the simulation with, sometimes it's the strength or presence of any collapse operators, sometimes it works if I just add some "dead time" to the end of the tlist.

I can't make head or tail of it.

Alex Pitchford

unread,
Dec 12, 2016, 11:48:07 PM12/12/16
to qu...@googlegroups.com
Hi Charlie,

I am looking to get a better understanding of the time-dependent H implementation at the moment. Investigating your issue could kill two birds with one stone. Would you be happy to send over a code example that is causing you issues?

You can send it to me directly alex.pi...@gmail.com if you prefer.

Alex

--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

charli...@gmail.com

unread,
Dec 13, 2016, 6:18:30 AM12/13/16
to QuTiP: Quantum Toolbox in Python
I've sent you a file with some code which demonstrates some of the issues I'm having. It is also attached here in case anyone else wants to have a crack at it.
RydbergCNOT.py

M Cotrufo

unread,
Dec 14, 2016, 12:21:13 PM12/14/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
I have a very similar problem, as described in this message that I just posted https://groups.google.com/forum/#!topic/qutip/-_Z6Zyr4Zh4 (and immediately after that I found this conversation)
In that conversation, you can find a very simple example of a script that produces similar problems (just pumping a cavity with a source which is alternatingly on and off).
It seems that the final result (i.e., whether a certain pulse is seen by the cavity or not) depends on the total time duration! For short times (e.g. T=8ns), all the pulses are seen by the cavity, for T > 15 ns some pulses are missed, and sometimes none of them are seen.

M Cotrufo

unread,
Dec 14, 2016, 12:25:36 PM12/14/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
Hi Kevin,
in your answer, do you perhaps mean "shorter than the pulse length" instead of "longer than the pulse length"?

M Cotrufo

unread,
Dec 14, 2016, 12:32:13 PM12/14/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
The suggestion of Kevin worked well for my problem! https://groups.google.com/d/msg/qutip/-_Z6Zyr4Zh4/0cAy-1FkDAAJ

charli...@gmail.com

unread,
Dec 14, 2016, 12:52:31 PM12/14/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
It seems to work for the script I posted earlier in the thread as well, I shouldn't have been so quick to dismiss it, my apologies Kevin.

I'll have to see if this works for mcsolve as well.

Paul Nation

unread,
Dec 15, 2016, 6:09:48 PM12/15/16
to QuTiP Group
Indeed, Kevin's answer is correct. The solver doesn't know the pulses are there unless the time step happened to hit the exact time of the delta kick.  On a related note, you should try to avoid discontinuous functions when possible. Instead, having a smooth continuous approximation to the delta (or step) shapes is the way to go.

-P

--

Kevin Fischer

unread,
Dec 15, 2016, 8:52:16 PM12/15/16
to QuTiP: Quantum Toolbox in Python, charli...@gmail.com
Great, glad that worked for both of you!
Reply all
Reply to author
Forward
0 new messages