Solvers¶
Python solver entry points.
- openquantumsim.solvers.mesolve(H, rho0, tlist, *, c_ops=None, e_ops=None, state_observables=None, options=None)[source]¶
Solve a Lindblad master equation.
Supports time-independent Hamiltonians and
TimeDependentHamiltonianobjects with scalar coefficients.
- openquantumsim.solvers.mcsolve(H, psi0, tlist, *, c_ops=None, e_ops=None, n_traj=None, state_observables=None, options=None)[source]¶
Run Monte Carlo wave-function trajectories.
Built-in
state_observablescreated byopenquantumsim.state_metrics()are aggregated by the backend when they can be represented as linear expectation values or pure-trajectory constants. Arbitrary Python callbacks remain available throughsingle_trajectory()or deterministicmesolve()runs with saved state access.- Parameters:
H (Operator)
psi0 (ndarray[tuple[Any, ...], dtype[complex128]])
tlist (Sequence[float])
c_ops (Sequence[Operator] | None)
e_ops (Sequence[Operator] | None)
n_traj (int | None)
state_observables (Mapping[str, Callable[[ndarray[tuple[Any, ...], dtype[complex128]]], Any]] | None)
options (Options | None)
- Return type:
- openquantumsim.solvers.single_trajectory(H, psi0, tlist, *, c_ops=None, e_ops=None, state_observables=None, options=None)[source]¶
Run one Monte Carlo wave-function trajectory.
Set
Options(save_states=True)to return the ket at each requested time.- Parameters:
- Return type:
- openquantumsim.solvers.steadystate(H, c_ops, *, method='iterative-gmres', options=None)[source]¶
Compute a Lindblad steady state.
- openquantumsim.solvers.lindblad_superoperator(H, c_ops=None)[source]¶
Return the dense Lindblad superoperator matrix in column-stacked form.
The returned matrix
Lacts onvec(rho)(column-stacked, matching NumPy’s Fortran-order reshape) asvec(L(rho)) = L @ vec(rho).
- openquantumsim.solvers.apply_superoperator(superoperator, rho)[source]¶
Apply a column-stacked superoperator to a density matrix.
- Parameters:
superoperator (ndarray[tuple[Any, ...], dtype[complex128]])
rho (ndarray[tuple[Any, ...], dtype[complex128]])
- Return type:
ndarray[tuple[Any, …], dtype[complex128]]
- openquantumsim.solvers.brmesolve(H, rho0, tlist, *, a_ops, e_ops=None, options=None)[source]¶
Solve the secular Bloch-Redfield master equation.
a_opspairs each bath-coupling operator with a spectrum callablegamma(omega)giving the dissipator weight at Bohr frequencyomega. A constant weightgis equivalent to a Lindblad collapse operatorsqrt(g) * A; a zero-temperature bath returnsgforomega > 0and0foromega < 0.Transitions sharing a Bohr frequency are treated as a single secular channel. The Hamiltonian must be Hermitian.
- openquantumsim.solvers.propagator(H, tlist, *, c_ops=None)[source]¶
Propagators for a time-independent system at each time in
tlist.Without collapse operators this returns the unitary propagators
U(t) = exp(-i H t). With collapse operators it returns the propagator superoperatorsS(t) = exp(L t)built from the Lindblad generator (seelindblad_superoperator()); apply them to a density matrix withapply_superoperator().