Skip to content

dq.method.Rouchon3

Rouchon3(
    rtol: float = 1e-06,
    atol: float = 1e-06,
    safety_factor: float = 0.9,
    min_factor: float = 0.2,
    max_factor: float = 5.0,
    max_steps: int = 100000,
    dt: float | None = None,
    normalize: bool = True,
    exact_expm: bool = False,
)

Third-order Rouchon method (fixed or adaptive step size ODE method).

Note

By default the scheme is using adaptive step size. The error is estimated using the difference between the second-order and third-order. To use a fixed step size third-order method (without evaluating the second-order), set the dt argument.

Parameters

  • rtol –

    Relative tolerance.

  • atol –

    Absolute tolerance.

  • safety_factor –

    Safety factor for adaptive step sizing.

  • min_factor –

    Minimum factor for adaptive step sizing.

  • max_factor –

    Maximum factor for adaptive step sizing.

  • max_steps –

    Maximum number of steps.

  • dt –

    Fixed time step, if specified all arguments specific to adaptive step sizing are ignored (rtol, atol, safety_factor, min_factor, max_factor and max_steps).

  • normalize –

    If True, the scheme is trace-preserving to machine precision, which is the recommended option because it is much more stable. Otherwise, it is only trace-preserving to the scheme order in the numerical step size.

  • exact_expm –

    If True, the scheme uses the exact matrix exponential internally (at the cost of losing sparsity), otherwise it uses a Taylor expansion up to the scheme order.

Supported gradients

This method supports differentiation with dq.gradient.Autograd, dq.gradient.CheckpointAutograd (default) and dq.gradient.ForwardAutograd.