Error in calculating the two-time correlation functions for time-dependent Hamiltonian

28 views
Skip to first unread message

Parvendra Kumar

unread,
Jan 14, 2025, 2:54:43 AM1/14/25
to QuTiP: Quantum Toolbox in Python

Dear Group Members,

I am facing a problem while calculating the two-time correlation functions for a time-dependent Hamiltonian with QuTiP 5. The code is working perfectly fine with version 4. 

However, with version 5, it shows: ValueError: tlist must be the same len as the array to interpolate

Please suggest how I can correct my code to make it compatible with QuTiP ver. 5.

Thank you in advance.

Regards,

ParvendraScreenshot_14-1-2025_131238_localhost.jpeg

Éric Giguère

unread,
Jan 14, 2025, 9:38:40 AM1/14/25
to QuTiP: Quantum Toolbox in Python
You will need to build the time-dependent operators before passing them to correlation:

H = QobjEvo(H, args=args, tlist=tlist)
c_ops = [QobjEvo(op, args=args, tlist=tlist) for op in c_ops]

This tlist can be different than the one passed to correlation. 
Usually, it should span at least from tlist[0] + taulist[0] to tlist[-1] + taulist[-1], and since spline approximation are less precise closes to the edges, it could start a little before and end a little after these values.

But since you are using pulse, it's probably fine to have it defined only around them.

ps. For pulse, settings the max_step options is recommended: options={"max_step"=half pulse width}

Eric

Parvendra Kumar

unread,
Jan 17, 2025, 8:25:07 AM1/17/25
to qu...@googlegroups.com
Thanks a lot. 

--
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.
To view this discussion visit https://groups.google.com/d/msgid/qutip/3f055060-178f-421c-995f-5bb6c6bf7c5an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages