Skip to content

dq.method.Event

Event(
    noclick_method: Method = Tsit5(),
    dtmax: float | None = None,
    root_finder: AbstractRootFinder | None = None,
    smart_sampling: bool = False,
)

Event method for the jump SSE.

This method uses the Diffrax library event handling to interrupt the no-click integration at the next sampled click time, apply the corresponding measurement backaction to the state, and continue the no-click integration until the subsequent sampled click time.

Click times precision

When using adaptive step size solvers for the no-click integration, you must specify either dtmax or root_finder to control the precision of the click times. Otherwise, the adaptive solver may choose to take very large step sizes, which results in imprecise click times. You can either:

  • specify dtmax to limit the maximum step size of the no-click evolution,
  • or use the root_finder argument to refine the exact click times to a chosen precision, see for example the optimistix library Newton root finder.

Parameters

  • noclick_method –

    Method for the no-click evolution. Defaults to dq.method.Tsit5 (supported: Tsit5, Dopri5, Dopri8, Kvaerno3, Kvaerno5, Euler).

  • dtmax –

    Maximum step size for the no-click evolution, defaults to None.

  • root_finder –

    Root finder to refine the click times, defaults to None (precision determined by the integration step size).

  • smart_sampling –

    If True, the no-click trajectory is sampled only once, and result.states contains only trajectories with one or more clicks. Information about the no-click trajectory are stored in result.infos:

    • result.infos.noclick_states (qarray of shape (..., nsave, n, 1)) - No-click trajectory.
    • result.infos.noclick_prob (array of shape (...)) - Probability of the no-click trajectory.
    • result.infos.noclick_expects (array of shape (..., len(exp_ops), ntsave) or None) - No-click trajectory expectation values.
Supported gradients

This method supports differentiation with dq.gradient.CheckpointAutograd (default).