braincell.quad.diffrax_euler_step

braincell.quad.diffrax_euler_step#

braincell.quad.diffrax_euler_step(target, *args)[source]#

Advance one step with diffrax’s explicit Euler solver.

Wraps diffrax.Euler so it can be driven from the same brainstate.environ context as the native braincell integrators. The first call triggers a one-time import of diffrax (see __getattr__()); subsequent calls take the fast path.

Parameters:
  • target (DiffEqModule) – Module whose differential states will be advanced.

  • *args – Extra positional arguments forwarded to target’s compute_derivative and pre/post_integral hooks.

Returns:

target’s state is updated in place.

Return type:

None

Raises:

ModuleNotFoundError – If diffrax is not installed.

See also

euler_step

Native (no-diffrax) explicit Euler implementation.

diffrax_heun_step, diffrax_midpoint_step, diffrax_ralston_step

Notes

The current time and step size are read from the active brainstate.environ context. The braincell state vector is stacked along the last axis before being handed to diffrax.