Problems with time-dependant Hamiltonian

44 views
Skip to first unread message

p.e...@t-online.de

unread,
Aug 6, 2016, 1:21:48 PM8/6/16
to QuTiP: Quantum Toolbox in Python
Hello everybody,
I need to implement the following Hamiltonian:
 
H = C*sigma_z + cos(f*t)*sigma_x + sin(f*t)*sigma_y

I tried this with the following code:
def Hfunc(t, args):
   
return args[0]*sigmaz() + np.cos(args[1]*t)*sigmax() + np.sin(args[1]*t)*sigmay()

And then I tried to solve a system with this Hamiltonian with
output = mesolve(Hfunc, psi0, t, c_op_list,exp_op_list,args=[C, f])
together with predefined vaulues for C and f.

But this does not work. I always get an error. What am I doing wrong?

Thanks a lot!

Peter

Paul Nation

unread,
Aug 7, 2016, 12:01:29 AM8/7/16
to QuTiP Group
That is the old time-dependent format.  You could try using the string based format:

H = [[sz, 'C'], [sx, 'cos(f*t)'], [sy, 'sin(f*t)’]]

with args={'C':1, 'f':1}, for example.

You could also replace the strings by any function that you like provided that the signature of the function is f(t,*args).

-Paul
--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages