BundleStage¶
- class BundleStage(name)[source]¶
Bases:
Stage[dict[tuple[tuple[str,Hashable], …],MetaCircuit],dict[tuple[tuple[str,Hashable], …],MetaCircuit]],ABCAbstract stage that transforms a keyed MetaCircuit batch.
Subclasses declare two orthogonal contracts via class properties:
handles_measurement— this stage emits measurement QASMs and recordsresult_formaton each circuit.consumes_dag_bodies— this stage reads (and typically mutates)meta.circuit_bodiesduringexpand.
Attributes Summary
Whether this stage reads
meta.circuit_bodiesduringexpand.Whether this stage sets up measurement circuits and result format.
Methods Summary
expand(batch, env)Transform keyed MetaCircuit batch and return expansion lineage plus token.
reduce(results, env, token)Identity by default; override if this stage reduces results.
Attributes Documentation
- consumes_dag_bodies¶
Whether this stage reads
meta.circuit_bodiesduringexpand.Default
True— the safe assumption. Override withFalseon stages that only inspect measurement/observable metadata (e.g.MeasurementStage,PCECostStage). Used byParameterBindingStageto decide whether it can stay on the fast QASM-template render path.
- handles_measurement¶
Whether this stage sets up measurement circuits and result format.
Pipelines must contain at least one stage with this property True.
Methods Documentation
- abstractmethod expand(batch, env)[source]¶
Transform keyed MetaCircuit batch and return expansion lineage plus token.
- Return type:
StageOutput[dict[tuple[tuple[str,Hashable],...],MetaCircuit]]