BaseAlgorithmStep
- class cubie.integrators.algorithms.base_algorithm_step.BaseAlgorithmStep(config: BaseStepConfig, _defaults: AlgorithmDefaults)[source]
Bases:
CUDAFactoryBase class implementing cache and configuration handling for steps.
The class exposes properties and an
updatehelper shared by concrete explicit and implicit algorithms. Concrete subclasses implementbuildto compile device helpers and provide metadata about resource usage.- __init__(config: BaseStepConfig, _defaults: AlgorithmDefaults) None[source]
Initialise the algorithm step with its configuration object and its family default settings.
- Parameters:
config – Configuration describing the algorithm step.
_defaults – Algorithm family (e.g. FIRK or DIRK) default settings for other solver components.
- _apply_updates(updates: Dict[str, object]) Set[str][source]
Apply the step settings and buffer locations.
- Parameters:
updates – Setting names to new values.
- Returns:
Names the settings and the buffer registry took.
- Return type:
- Raises:
ValueError – A
tableauorn_statesother than this step’s.
- _update(updates: Dict[str, object], silent: bool) Set[str][source]
Apply the updates, then accept other algorithms’ parameters.
- Parameters:
updates – Setting names to new values.
silent – Suppress the other-algorithm parameter warning.
- Returns:
Recognised names, including other algorithms’ parameters.
- Return type:
Notes
After
_apply_updates(), unapplied names inALL_ALGORITHM_STEP_PARAMETERScount as recognised and warn.
- property algorithm_defaults: Dict[str, Any]
Return the family defaults overlaid with the tableau’s.
- build() StepCache[source]
Compile the step and record its sizes, order and flags.
- Returns:
The compiled step with its products filled in.
- Return type:
- property can_reuse_accepted_start: bool
Return
Truewhen the accepted state seeds the next proposal.Returns
Falsewhen the algorithm is not tableau-based.
- abstractmethod compile_step() StepCache[source]
Compile the step’s device functions.
- Returns:
The compiled step and any nonlinear solver.
- Return type:
- property controller_default_settings: Dict[str, Any]
Return the default settings that apply to the controller.
- copy() BaseAlgorithmStep[source]
Return a new step with these settings and the helper factory.
- default_tableau = None
Tableau a bare family alias builds on;
Nonefor fixed schemes.
- property error_weights: ndarray | None
Return the error weights in run precision; zeros when unused.
- classmethod family_defaults(tableau: ButcherTableau | None = None) AlgorithmDefaults[source]
Return the family’s controller and solver defaults.
- property first_same_as_last: bool
Return
Truewhen the first and last stages align.Returns
Falsewhen 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 has_error_estimate: bool
Return whether the algorithm produces an embedded error estimate.
- is_linear = False
Linearly-implicit steps own their linear solver directly.
- property optimisation_candidates: Tuple[Dict[str, Any], ...]
Return the setting combinations
Solver.optimizetimes.
- performance_defaults(hardware: Any = None) Dict[str, Any][source]
Return the placements
auto_performancesets for this step.
- settings_keys: frozenset | None = frozenset({'accumulator_location', 'algorithm', 'attempt_dense_prediction', 'base_state_placeholder_location', 'cached_auxiliaries_location', 'dae_initialisation', 'delta_location', 'driver_derivative_fn', 'drivers_fn', 'dxdt_fn', 'dxdt_location', 'error_atol', 'error_max_iters', 'error_residual_floor', 'error_residual_reduction', 'error_rtol', 'get_solver_helper_fn', 'increment_cache_location', 'inexact_newton', 'krylov_atol', 'krylov_iters_local_location', 'krylov_iters_out_location', 'krylov_max_iters', 'krylov_residual_floor', 'krylov_residual_reduction', 'krylov_rtol', 'linear_correction_type', 'lu_factor_location', 'mass_flags', 'n_drivers', 'n_states', 'newton_atol', 'newton_max_iters', 'newton_rtol', 'observables_fn', 'operator_beta', 'operator_gamma', 'p_location', 'precision', 'preconditioned_vec_location', 'preconditioner_order', 'preconditioner_type', 'predictor_previous_values_location', 'predictor_transform_location', 'prefactored', 'prev_theta_location', 'previous_step_size_location', 'r0_hat_location', 'residual_location', 's_hat_location', 'stage_accumulator_location', 'stage_base_location', 'stage_driver_stack_location', 'stage_increment_history_location', 'stage_increment_location', 'stage_rhs_location', 'stage_state_location', 'stage_store_location', 'temp_location', 'tmp_location', 'use_smoothed_error', 'v_location'})
Loose keys the factory accepts;
Noneaccepts every field.
Whether
elementsshared per run plus the kernel’s skew keep1 / fractionof the register-limited threads.
- property smoothed_error_weights: ndarray | None
Return the tableau’s smoothed weights while smoothing, else None.
- property step_default_settings: Dict[str, Any]
Return the default settings that apply to the step itself.