PipelineEnv

class PipelineEnv(backend, param_sets=(), feature_batch=None, labels=None, artifacts=<factory>, result_format=None, reporter=None, cancellation_event=None, rng=None)[source]

Bases: object

Per-run context for the circuit pipeline.

The client passes the backend and any stage-specific data when constructing the env for a pipeline run.

Attributes Summary

artifacts

Mutable output dict populated during execution (e.g. circuit_count).

backend

Backend used to run circuits (e.g. simulator or cloud service).

cancellation_event

Threading event signalling cancellation (set by ProgramEnsemble).

feature_batch

Classical feature batch for the data axis, shape (n_samples, n_data).

labels

Optional per-sample supervised targets, shape (n_samples,), aligned with feature_batch.

param_sets

Parameter sets for binding — strictly 2D (list-of-lists or 2D ndarray).

reporter

Progress reporter for async polling feedback.

result_format

Canonical result format, set by the measurement stage during expand.

rng

Random generator for stochastic stage decisions (e.g. weighted_random shot allocation).

Attributes Documentation

artifacts: dict = <dataclasses._MISSING_TYPE object>

Mutable output dict populated during execution (e.g. circuit_count).

backend: CircuitRunner = <dataclasses._MISSING_TYPE object>

Backend used to run circuits (e.g. simulator or cloud service).

cancellation_event: Event | None = None

Threading event signalling cancellation (set by ProgramEnsemble).

feature_batch: ndarray[tuple[Any, ...], dtype[floating]] | None = None

Classical feature batch for the data axis, shape (n_samples, n_data). Read by DataBindingStage; None otherwise.

labels: ndarray[tuple[Any, ...], dtype[floating]] | None = None

Optional per-sample supervised targets, shape (n_samples,), aligned with feature_batch. Read by DataBindingStage.

param_sets: Sequence[Sequence[float]] | ndarray[tuple[Any, ...], dtype[floating]] = ()

Parameter sets for binding — strictly 2D (list-of-lists or 2D ndarray).

reporter: ProgressReporter | None = None

Progress reporter for async polling feedback.

result_format: ResultFormat | None = None

Canonical result format, set by the measurement stage during expand.

rng: Generator | None = None

Random generator for stochastic stage decisions (e.g. weighted_random shot allocation). When None, stages that need randomness construct a fresh, unseeded generator, which means they are not reproducible.