Endpoint trajectories
Added in 0.3.2a1: install with pip install --pre 'qenvs==0.3.2a1'.
rollout_metrics evaluates physical control amplitudes at right endpoints.
These are privileged simulator diagnostics, not policy observations. An endpoint
maximum is not a continuous-time maximum or an executable stopping policy.
Endpoint diagnostics for physical piecewise-constant controls.
This low-level helper does not apply environment action bounds or observations. Metrics are privileged simulator diagnostics, not policy inputs. Only right endpoints are sampled; their maximum is not a continuous-time maximum.
rollout_metrics(model, actions, *, dt, metrics, method)
Evaluate scalar metrics at the end of each physical control interval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
a concrete model constructed outside JAX transformations. |
required |
actions
|
Array
|
real floating array (steps, model.n_controls), in physical units. No clipping, normalization or precision conversion is applied. |
required |
dt
|
float
|
positive finite control period, fixed outside jit. |
required |
metrics
|
Mapping[str, Callable[[Model, QArray], Array]]
|
nonempty mapping of names to pure (model, state) scalar-real callbacks. Capture this mapping outside jit, like dt and method. |
required |
method
|
Method
|
explicit dynamiqs solver, including its tolerances. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Times dt through steps*dt and a dict of metric arrays, each shape (steps,). |
dict[str, Array]
|
No initial sample or state history is returned. Differentiation with |
tuple[Array, dict[str, Array]]
|
respect to actions, jit and vmap are supported. |
Raises:
| Type | Description |
|---|---|
ValueError
|
invalid shape, dtype, fixed dt or metric outputs. |
Finite action and output checks belong at the host evaluation boundary; this scan does not convert traced arrays to NumPy or hide nonfinite scores.