netket.experimental.dynamics.AbstractSolver#

class netket.experimental.dynamics.AbstractSolver[source]#

Bases: Pytree

Abstract base class for ODE solvers. This object is an immutable pyTree. The structure used to hold any solver-specific data should be initialized by _init_state.

Inheritance
Inheritance diagram of netket.experimental.dynamics.AbstractSolver
__init__(dt, adaptive=False, **kwargs)[source]#
Parameters:
  • dt – The initial time-step size of the integrator.

  • adaptive – A boolean indicator whether to use an adaptive scheme.

  • atol – The tolerance for the absolute error on the solution if adaptive. defaults to 0.0.

  • rtol – The tolerance for the relative error on the solution if adaptive. defaults to 1e-7.

  • dt_limits – The extremal accepted values for the time-step size dt if adaptive. defaults to (None, 10 * dt).

Attributes
is_adaptive#

Boolean indication whether the integrator can be adaptive.

is_explicit#

Boolean indication whether the integrator is explicit.

is_fsal#

Returns True if the first iteration is the same as last.

stages#

Number of stages (equal to the number of evaluations of the ode function) of the scheme.

dt: float#

The intial time-step size.

adaptive: bool#

The flag whether to use adaptive time-stepping.

integrator_params: IntegratorParameters#

Any additional arguments to pass to the Integrator

Methods
replace(**kwargs)[source]#

Replace the values of the fields of the object with the values of the keyword arguments. If the object is a dataclass, dataclasses.replace will be used. Otherwise, a new object will be created with the same type as the original object.

Return type:

TypeVar(P, bound= Pytree)

Parameters:
  • self (P)

  • kwargs (Any)

step(f, dt, t, y_t, state)[source]#

Performs one fixed-size step from t to t + dt :type f: Callable :param f: The ODE function. :type dt: float :param dt: The current time-step size. :type t: float :param t: The current time. :type y_t: Any :param y_t: The current solution. :type state: AbstractSolverState :param state: The state of the solver.

Return type:

tuple[Any, AbstractSolverState]

Returns:

The next solution y_t+1 and the corresponding updated state of the solver

Parameters:
step_with_error(f, dt, t, y_t, state)[source]#

Perform one fixed-size step from t to t + dt and additionally returns the error vector provided by the adaptive solver. :type f: Callable :param f: The ODE function. :type dt: float :param dt: The current time-step size. :type t: float :param t: The current time. :type y_t: Any :param y_t: The current solution. :type state: AbstractSolverState :param state: The state of the solver.

Return type:

tuple[Any, Any, AbstractSolverState]

Returns:

The next solution y_t+1, the error y_err and the corresponding updated state of the solver

Parameters: