Heun

experimental.network_dynamics.solvers.Heun(
    block_size=None,
    recompute_coupling_per_stage=False,
    grad_horizon=None,
)

Heun’s method (improved Euler).

Two-stage method with predictor-corrector structure. For SDEs: Stochastic Heun method.

Note: Whether the coupling input is held constant across the two stages or recomputed per stage is decided outside step by the recompute_coupling_per_stage flag (see NativeSolver); the dynamics_fn passed here already encodes that choice via closure.

Methods

Name Description
step Heun integration step with predictor-corrector.

step

experimental.network_dynamics.solvers.Heun.step(
    dynamics_fn,
    t,
    state,
    dt,
    params,
    noise_sample=0.0,
)

Heun integration step with predictor-corrector.

Args: dynamics_fn: Dynamics function (t, state, params) -> (derivatives, auxiliaries) t: Current time state: Current state [n_states, n_nodes] dt: Time step params: Parameters noise_sample: Pre-scaled noise increment

Returns: Tuple of (next_state, auxiliaries): - next_state: Next state [n_states, n_nodes] - auxiliaries: Auxiliary variables from FIRST evaluation [n_auxiliaries, n_nodes] (represents valid state at current time t)