New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stochastic solver using v5 class interface #2131
Conversation
I changed back the default integration method to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original giant .pyx
from QuTiP 4 was way too big. I think more reorganizing could be done, but let's leave that for the future. For now let's just finish cleaning this up and merge it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the idea is to use mcsolve
instead of the stochastic solver for photocurrent work now, I think we should add a small section to the mcsolve
guide that covers how to do that.
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
… stochastic.v5
@hodgestar |
@Ericgig Thank you for adding the mcsolve photocurrent docs. I just left one more question about the |
Checklist
This rewrite the stochastic solver to use the class interface.
smesolve
,ssesolve
have been rewritten to match other solver with matching class interfaceSMESolver
,SSESolver
. The main change is that the options used to be passed as keywords (**kwargs
) and are now passed as an options dict.m_ops
anddW_factors
are properties of the classes, but not available to overwrite through the function interface.target_tol
,timeout
) are added.solver
keyword is nowmethod
options, as it is in other solver.heterodyne
keyword. ie beforemethod="heterodyne"
nowheterodyne=True
.rouchon
, instead oftaylor1.5
. ie the method coming from a physic paper and not a mathematics textbook.The stochastic integration methods have been spitted in smaller chunk instead of the huge classes in _stochastic.pyx. I kept most methods, only skipping the taylor order 2.0 method. The python interface is kept very similar to the
Integrator
asSIntegrator
, the main difference being thatset_state
andget_state
use an extra random number generator with the time and state. The integration methods are usually 5%~10% slower than they where for medium size problems (shape ~100). Most method are computed the same way as before, but the rouchon method no longer use super operator, but keep the density matrix as a matrix and not an oper-ket.The derivative computation for used by the integration method has also been split into multiple functions and made only available for
smesolve
. For there methods to be valid, the each diffusion contribution must commute. Forsmesolve
, this means that eachsc_ops
must commute, as documented. Forssesolve
, eachsc_ops
must not only commute, but also commute with othersc_ops
's adjoint, this last part being missing from v4's documentation. It also meant that the sc_ops needed to commute with it's own adjoint when using heterodyne detection...ssepdpsolve
,smepdpsolve
,photocurrent_mesolve
,photocurrent_sesolve
removed. They are all less efficient variants ofmcsolve
.mcsolve
already include the photocurrent in the output.general_stochastic
, removed. It is a mostly generic stochastic equation solver. The user to define their equations to integrate, but the results are forced intoResults
with expectation values and dims checks, making it hard to use.