Changing precision in rho_ss

46 views
Skip to first unread message

Perry Rice

unread,
Feb 18, 2025, 8:40:13 PMFeb 18
to QuTiP: Quantum Toolbox in Python
I am having trouble with the syntax for this, looking at a system that is very weakly driven, so small numbers. My program runs but gives nonsense below a certain pump level. Tried various solver methods, direct,eigen, svd..... and they are all consistent, so I figure it must be in the lack sig figures somewhere.

Thanks

Éric Giguère

unread,
Feb 18, 2025, 9:44:15 PMFeb 18
to QuTiP: Quantum Toolbox in Python
Have you tried changing the tolerances?
`options={"atol": 1e-8, "rtol": 1e-6, "nsteps": 2500}` 
Lowering these tolerances will make the simulation slower, but should help with weaker drive.


Perry Rice

unread,
Feb 19, 2025, 10:36:49 AMFeb 19
to QuTiP: Quantum Toolbox in Python
I have but have struggled with the syntax. Does your code segment go inside the rho_ss(H........) call or as a separate options = command in a separate line? Thanks

Perry Rice

unread,
Feb 19, 2025, 2:02:45 PMFeb 19
to QuTiP: Quantum Toolbox in Python
adding that inside the rho_ss call runs, changing the tolerances does not improve performance nor take things longer to run
using 5.1

 rho_ss=steadystate(H,c_ops,options={"atol": 1e-8, "rtol": 1e-6, "nsteps": 2500})

Perry Rice

unread,
Feb 19, 2025, 2:06:52 PMFeb 19
to QuTiP: Quantum Toolbox in Python
that is then passed to correlation_3op_2t

Éric Giguère

unread,
Feb 19, 2025, 8:56:00 PMFeb 19
to QuTiP: Quantum Toolbox in Python
The `options` arguments should be passed to the `correlation_...` function.

For the steadystate call, the `solver` parameter control which function from numpy.linalg or scipy.sparse.linalg is called and extra keyword parameter are passed to these function.

rho_ss = steadystate(H, c_ops, solver="bicgstab", atol=1e-16, rtol=1e-5)
will call
scipy.sparse.linalg.bicgstab(L_as_scipy, zeros_vec, atol=1e-10, rtol=1e-5)

Per default scipy.sparse.linalg.spsolve is used, which does not have an explicit parameter.








Perry Rice

unread,
Feb 20, 2025, 11:07:24 AMFeb 20
to QuTiP: Quantum Toolbox in Python
Thanks. That runs but does not solve my issue. Is there a way to specify precision in correlation_3op_2t?

Appreciate the help

Éric Giguère

unread,
Feb 20, 2025, 11:14:51 PMFeb 20
to QuTiP: Quantum Toolbox in Python
Correlation uses mesolve, which receive the options:
`correlation_3op_2t(H, c_ops, args, options={"atol": 1e-10, "rtol":1e-8, nsteps=1e5})`

"atol"/"rtol" is applied by internal step, not total evolution, nor tlist / tau step. 
So it should be set a lot smaller than what you need.
There is a limit on how much precision we can get using double and qutip does not support any higher precision. 
Reply all
Reply to author
Forward
0 new messages