RungeKutta4

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

Classical 4th order Runge-Kutta method (RK4).

Four-stage explicit method with high accuracy for smooth ODEs. For SDEs: Applies noise at the end of the RK4 step.

Note: Whether the coupling input is held constant across the four 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 RK4 integration step with four evaluations.

step

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

RK4 integration step with four evaluations.

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 (applied at end of step)

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)