PreprocessStage

class PreprocessStage(preprocessor)[source]

Bases: BundleStage

Apply a CircuitPreprocessor’s transform to the post-spec batch.

Sits immediately after the spec stage. Transforms every MetaCircuit via preprocessor.preprocess before mitigation and the terminal measurement, so a single shared pipeline serves the cost, sampling, and metric routines.

Attributes Summary

consumes_dag_bodies

Whether this stage reads meta.circuit_bodies during expand.

Methods Summary

expand(batch, env)

Transform keyed MetaCircuit batch and return expansion lineage plus token.

Attributes Documentation

consumes_dag_bodies

Methods Documentation

expand(batch, env)[source]

Transform keyed MetaCircuit batch and return expansion lineage plus token.

Return type:

StageOutput[dict[tuple[tuple[str, Hashable], ...], MetaCircuit]]