solprop.backends.host.adams#

The reference’s interaction-picture Adams march (SEP 13, SEP 14, SEP 47).

The controller, history, ledger and lifecycle of HostAdamsMarch, owned by the NumPy reference since SEP 47 phase 2: copied from the shared march that the native bridge still inherits (solprop.backends.multistep.AdamsMarch), so that the control is the reference’s own. The state-sized arithmetic stays shared, a recorded exception (solprop.backends.host): the march hands every operation of its fused and exponential paths to the host engine (solprop.backends.multistep.HostHistory), which the bridge’s march also takes where native keeps no resident history, and the comparison variants’ trials to solprop.backends.host.general.HostGeneralPath. The decisions are solprop.backends.adams_core’s functions of one policy record.

The method, its lifecycle and its numbers are those of solprop.backends.multistep’s module documentation.

Classes

HostAdamsMarch(backend, method, *[, ...])

March a reference backend's state with an interaction-picture Adams method.

class solprop.backends.host.adams.HostAdamsMarch(backend, method, *, compensation='transported', engine=None)[source]#

Bases: object

March a reference backend’s state with an interaction-picture Adams method.

Parameters:
backendsolprop.backends.host.driver.HostDriver

The backend whose state, source evaluation and propagators are used. It owns the step history and the statistics rows; this object owns the derivative history and the call ledger.

methodsolprop.stepper.multistep.Multistep

The method.

compensation{‘transported’, ‘untransported’}, optional

How a varying operator’s linear compensation is integrated (SEP 16 Q8): "transported", the delivered treatment, or "untransported", kept as a test witness only.

engineobject, optional

An AdamsEngine for the fused and exponential paths, which the general path never takes, as the bridge’s march never takes a resident engine there; None, the default, takes the host engine (HostHistory) over the backend’s hooks. A scripted engine drives the controller alone, for the decision traces of SEP 39 section 7.1. Typed object because the engine protocol is structural and not checkable at run time; the members the path calls are checked here instead.

Raises:
solprop.exceptions.BackendError

If engine lacks a member its path calls.

begin_run()[source]#

Start a run’s accounting afresh: the ledger and the last attempt’s flags.

Called by set_initial(), so that a backend loaded for another run counts that run’s calls alone and chooses its first order and step as a fresh backend would (SEP 22 section 4.7, SEP 39 R9): the last rejection and the collar’s flag are cleared. A resume restores its persisted ledger and flags afterwards.

export_refusal()[source]#

Return why this march cannot carry its history across a resume, or None.

The fused and exponential paths keep their history in an engine, and every engine exports and installs its rows (AdamsEngine, SEP 29 section 6.6). The general path combines a list of host arrays one product at a time and keeps no store a snapshot could hold.

Returns:
str or None

The reason, or None when the march exports and installs its history.

load(snapshot)[source]#

Continue from a snapshot taken where the backend’s state now stands.

The backend has been loaded at the snapshot’s position; this installs the accepted state exactly as it was held, the history, the order, the rejection count and the proposed step, so that the march goes on as the uninterrupted one would have. Nothing is changed when the snapshot cannot be used.

Parameters:
snapshotsolprop.output.schema.MarchSnapshot

What snapshot() returned, possibly read back from a file.

Returns:
str or None

None when the history was continued, otherwise why it starts afresh.

march_to(target)[source]#

Step the backend’s state adaptively to target, landing on it exactly.

Parameters:
targetfloat

Position to reach, m.

Raises:
ConvergenceError

If the proposal falls below the contract’s dz_min.

replay_step(dz, end, slack)[source]#

Take one prescribed step from the backend’s position and accept it.

The unit a replay and a lockstep group advance by (solprop.backends.host.group.HostGroup): the budget, the startup of an empty history, the step and, when end is a hard kink, the restart.

Parameters:
dzfloat

The step, m.

endfloat

The schedule’s edge it ends on, m.

slackfloat

How far an edge may sit from a kink it lands on, m.

Returns:
float

The step’s scaled error norm, recorded and not acted on.

Raises:
ConvergenceError

If the norm is not finite: the field has diverged, and a replay cannot reject the step.

reset()[source]#

Forget the history: the state was loaded or changed outside the march.

snapshot()[source]#

Return the march’s state at its accepted position, for a resume.

Returns:
solprop.output.schema.MarchSnapshot or None

The snapshot, or None where there is nothing a resume could continue: no history yet, the march ahead of an interpolated observation, or a march that cannot carry its history (export_refusal()).

snapshot_nbytes()[source]#

Return the bytes snapshot() would copy, copying nothing.

Returns:
int or None

The state and every engine row, or None where snapshot() returns None.