SolverResult

class SolverResult(ts, ys, *, time_axis, shot_axis=None, unp_inner)

Container for solver outputs that preserves array backend compatibility.

The object stores both the evaluation grid and simulated states or operators while exposing helpers to concatenate segments and stack per-shot batches without breaking the underlying NumPy or JAX array type.

Parameters:
  • ts (ndarray | Array) – Evaluation times.

  • ys (ndarray | Array) – Propagated states or operators.

  • time_axis (int) – Axis of ys corresponding to time.

  • shot_axis (int | None) – Optional axis of ys corresponding to shots.

  • unp_inner (Any) – NumPy or jax.numpy namespace used to store the result.

Methods

concat_segments(segment_results)

Concatenate sequential segment solutions while avoiding duplicate time stamps.

drop_first_time()

Return the solution array with the first time step removed.

final_along_time()

Return the final value along the designated time axis.

final_shot()

Return terminal states for each shot as a list.

stack_shots(shot_results)

Stack multiple solver runs along a unified shot axis.

Attributes

shot_axis

Index of the shot axis in ys, or None if there is no shot axis.

time_axis

Index of the time axis in ys.

ts

Timestamps of the stored trajectory (in \(\mu\text{s}\)).

unp_inner

Array namespace backing the stored arrays, either numpy or jax.numpy.

ys

Stored trajectory of states or propagators, with time and shot axes.