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()
) -> MEResult

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 (\(\hbar=1\)) $$ \frac{\dd\rho(t)}{\dt} = -i[H(t), \rho(t)] + \sum_{k=1}^N \left( L_k(t) \rho(t) L_k^\dag(t) - \frac{1}{2} L_k^\dag(t) L_k(t) \rho(t) - \frac{1}{2} \rho(t) L_k^\dag(t) L_k(t) \right), $$ where \(H(t)\) is the system's Hamiltonian at time \(t\) and \(\{L_k(t)\}\) is a collection of jump operators at time \(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.constant(), 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, Euler, Rouchon1, Rouchon2, Propagator).

  • gradient

    Algorithm used to compute the gradient.

  • options

    Generic options, see dq.Options.

Returns

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