Skip to content

dq.mesolve

mesolve(
    H: ArrayLike | TimeArray,
    jump_ops: list[ArrayLike | TimeArray],
    rho0: ArrayLike,
    tsave: ArrayLike,
    *,
    exp_ops: list[ArrayLike] | None = None,
    solver: Solver = Tsit5(),
    gradient: Gradient | None = None,
    options: Options = Options()
) -> MESolveResult

Solve the Lindblad master equation.

This function computes the evolution of the density matrix \(\rho(t)\) at time \(t\), starting from an initial state \(\rho_0\), according to the Lindblad master equation (with \(\hbar=1\) and where time is implicit(1)) $$ \frac{\dd\rho}{\dt} = -i[H, \rho] + \sum_{k=1}^N \left( L_k \rho L_k^\dag - \frac{1}{2} L_k^\dag L_k \rho - \frac{1}{2} \rho L_k^\dag L_k \right), $$ where \(H\) is the system's Hamiltonian and \(\{L_k\}\) is a collection of jump operators.

  1. With explicit time dependence:
    • \(\rho\to\rho(t)\)
    • \(H\to H(t)\)
    • \(L_k\to L_k(t)\)
Defining a time-dependent Hamiltonian or jump operator

If the Hamiltonian or the jump operators depend on time, they can be converted to time-arrays using dq.pwc(), dq.modulated(), or dq.timecallable(). See the Time-dependent operators tutorial for more details.

Running multiple simulations concurrently

The Hamiltonian H, the jump operators jump_ops and the initial density matrix rho0 can be batched to solve multiple master equations concurrently. All other arguments are common to every batch. See the Batching simulations tutorial for more details.

Parameters

  • H (array-like or time-array of shape (...H, n, n)) –

    Hamiltonian.

  • jump_ops (list of array-like or time-array, each of shape (...Lk, n, n)) –

    List of jump operators.

  • rho0 (array-like of shape (...rho0, n, 1) or (...rho0, n, n)) –

    Initial state.

  • tsave (array-like of shape (ntsave,)) –

    Times at which the states and expectation values are saved. The equation is solved from tsave[0] to tsave[-1], or from t0 to tsave[-1] if t0 is specified in options.

  • exp_ops (list of array-like, each of shape (n, n), optional) –

    List of operators for which the expectation value is computed.

  • solver –

    Solver for the integration. Defaults to dq.solver.Tsit5 (supported: Tsit5, Dopri5, Dopri8, Kvaerno3, Kvaerno5, Euler, Rouchon1, Rouchon2, Expm).

  • gradient –

    Algorithm used to compute the gradient. The default is solver-dependent, refer to the documentation of the chosen solver for more details.

  • options –

    Generic options, see dq.Options.

Returns

dq.MESolveResult object holding the result of the Lindblad master equation integration. Use the attributes states and expects to access saved quantities, more details in dq.MESolveResult.