BaseAlgorithmStep

class cubie.integrators.algorithms.base_algorithm_step.BaseAlgorithmStep(config: BaseStepConfig, _controller_defaults: StepControlDefaults)[source]

Bases: CUDAFactory

Base class implementing cache and configuration handling for steps.

The class exposes properties and an update helper shared by concrete explicit and implicit algorithms. Concrete subclasses implement build to compile device helpers and provide metadata about resource usage.

__init__(config: BaseStepConfig, _controller_defaults: StepControlDefaults) None[source]

Initialise the algorithm step with its configuration object and its default runtime settings for collaborators.

Parameters:
  • config – Configuration describing the algorithm step.

  • _controller_defaults – Per-algorithm default step controller settings.

Returns:

This constructor updates internal configuration state.

Return type:

None

property can_reuse_accepted_start: bool

Return True when the accepted state seeds the next proposal.

Returns False when the algorithm is not tableau-based.

property controller_defaults: StepControlDefaults

Return per-algorithm default settings for controllers, solvers.

property evaluate_f: Callable | None

Return the compiled device derivative function.

property evaluate_observables: Callable | None

Return the compiled device observables function.

property first_same_as_last: bool

Return True when the first and last stages align.

Returns False when the algorithm is not tableau-based.

property get_solver_helper_fn: Callable | None

Return the helper factory used to build solver device functions.

Returns:

Callable that yields device helpers for solver construction when available.

Return type:

Callable or None

abstract property is_adaptive: bool
abstract property is_implicit: bool
abstract property is_multistage: bool
property n: int

Return the number of state variables advanced per step.

property n_drivers: int

Return the configured number of external drivers.

abstract property order: int

Return the classical order of accuracy of the algorithm.

register_buffers() None[source]

Register buffers required by the algorithm step.

property settings_dict: Dict[str, object]

Return the configuration dictionary for the algorithm step.

property stage_count: int

Return the number of stages described by the tableau.

property step_function: Callable

Return the cached device function that advances the solution.

property tableau: ButcherTableau | None

Return the configured tableau when available.

abstract property threads_per_step: int
update(updates_dict: Dict[str, object] | None = None, silent: bool = False, **kwargs: object) Set[str][source]

Apply configuration updates and invalidate caches when needed.

Parameters:
  • updates_dict – Mapping of configuration keys to their new values.

  • silent – When True, suppress warnings about inapplicable keys.

  • **kwargs – Additional configuration updates supplied inline.

Returns:

Set of configuration keys that were recognized and updated.

Return type:

set

Raises:

KeyError – Raised when an unknown key is provided while silent is False.