StageInfo

class StageInfo(name: str, axis: str | None, factor: float, metadata: dict[str, Any])[source]

Bases: NamedTuple

Per-stage dry-run report.

Create new instance of StageInfo(name, axis, factor, metadata)

Attributes Summary

axis

The result-key axis this stage fans out over (the stage's axis_name, e.g. "param_set", "twirl", "obs_group"), or None for stages that add no axis.

factor

Ratio of logical circuits after this stage to circuits before it.

metadata

Stage-specific introspection rendered by format_dry_run() — e.g. strategy / n_groups for MeasurementStage, n_twirls for PauliTwirlStage.

name

Stage identifier — type(stage).__name__ (e.g. "CircuitSpecStage", "MeasurementStage").

Attributes Documentation

axis: str | None

The result-key axis this stage fans out over (the stage’s axis_name, e.g. "param_set", "twirl", "obs_group"), or None for stages that add no axis.

factor: float

Ratio of logical circuits after this stage to circuits before it. factor > 1 is a fan-out (e.g. ParameterBindingStage, PauliTwirlStage); factor < 1 is a reduction (e.g. observable grouping in MeasurementStage collapsing N Pauli terms into M ≤ N commuting groups yields factor = M / N).

metadata: dict[str, Any]

Stage-specific introspection rendered by format_dry_run() — e.g. strategy / n_groups for MeasurementStage, n_twirls for PauliTwirlStage.

name: str

Stage identifier — type(stage).__name__ (e.g. "CircuitSpecStage", "MeasurementStage"). This is the value to match when checking a pipeline’s composition via [s.name for s in report.stages].