fiqci.ems.transpiler_passes.zne_circuits#
Classes
|
A pass to generate circuits for zero-noise extrapolation (ZNE) by folding gates. |
- class ZNECircuits(*args, **kwargs)#
Bases:
TransformationPassA pass to generate circuits for zero-noise extrapolation (ZNE) by folding gates.
- __init__(fold_gates: Iterable[str] | None = None, scale_factor: float = 1, folding_method: str = 'local', seed=None)#
Initialize the ZNECircuits pass.
- Parameters:
fold_gates – An optional iterable of gate names to fold. If None, all gates will be folded.
scale_factor – The factor by which to scale the noise. Any real number >= 1. Non-odd-integer values are approximated by partially folding a randomly-sampled subset of gates.
folding_method – The method to use for folding gates (“local” or “global”).
seed – Seed or numpy Generator for the random gate sampling used to approximate non-odd-integer scale factors. Passing an existing Generator shares its state (and is returned unchanged by
np.random.default_rng), so a single Generator can drive many passes reproducibly.
- run(dag: DAGCircuit) DAGCircuit#
Run the ZNECircuits pass on the given DAGCircuit.
- Parameters:
dag – The input DAGCircuit to transform.
- Returns:
A new DAGCircuit with folded gates for ZNE.