Skip to content

dq.method.TimeEvolution

TimeEvolution(
    rho0: QArrayLike | None = None,
    ode_method: Method = Tsit5(rtol=1e-09, atol=1e-09),
    atol: float = 0.0,
    rtol: float = 1e-06,
)

Time evolution method for the steady state of the Lindblad master equation.

This method integrates the Lindblad master equation from an initial state \(\rho_0\) until the residual \(\|\mathcal{L}(\rho)\|\) is small enough, where \(\mathcal{L}\) is the Lindbladian and \(\|\cdot\|\) the Frobenius norm. The integration stops at the first step where $$ |\mathcal{L}(\rho)| \leq \mathrm{atol} + \mathrm{rtol}\,|\mathcal{L}|, $$ with \(\|\mathcal{L}\| = 2\|H\| + 2\sum_k \|L_k\|^2\) (in spectral norm) an upper bound of the norm of the Lindbladian. The relative tolerance rtol is thus dimensionless, and independent of the frequency scale of the problem.

Accuracy and Liouvillian gap

A small residual does not imply a small error on the state: the error on \(\rho\) is of order \(\|\mathcal{L}(\rho)\|/\Delta\), with \(\Delta\) the Liouvillian gap, i.e. the slowest relaxation rate of the system. For a system with a small gap compared to \(\|\mathcal{L}\|\) (e.g. metastable states, cat qubits), decrease rtol accordingly.

Tolerances of the ODE method

The tolerances of ode_method must be well below rtol, typically by a factor 1000. Otherwise, close to the steady state, explicit methods take steps at the edge of their stability region, the residual stalls above the stopping criterion, and the method does not converge.

Parameters:

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

    Initial state, must have the dense layout. When the steady state is not unique, it selects the steady state that is reached. Defaults to the maximally mixed state \(I/n\).

  • ode_method –

    ODE method used for the time evolution (supported: Tsit5, Dopri5, Dopri8, Kvaerno3, Kvaerno5, Euler). Its max_steps bounds the number of steps before giving up. Defaults to Tsit5(rtol=1e-9, atol=1e-9).

  • atol –

    Absolute tolerance on the residual, in units of rate. Defaults to 0.0.

  • rtol –

    Relative tolerance on the residual, relative to \(\|\mathcal{L}\|\). Defaults to 1e-6.

Supported gradients

This method only supports dq.gradient.Forward, use it with jax.jacfwd() or jax.jvp(). Reverse mode (e.g. jax.grad()) is not supported: with the tight tolerances that ode_method needs to meet the stopping criterion, differentiating the adaptive time evolution in reverse mode returns wrong gradients. The gradient is computed by differentiating through every step of the time evolution, and is less accurate than the state: the sensitivity \(\partial\rho(t)/\partial\theta\) converges more slowly than \(\rho(t)\), so the error on the gradient is typically 10 to 100 times the error on the state. Decrease rtol (and the tolerances of ode_method) accordingly.