GlobalFoldPass¶
- class GlobalFoldPass(scale_factor)[source]¶
Bases:
TransformationPassGlobal unitary folding with fractional scale-factor support.
For a target scale factor
son a circuit ofdunitary gates:k = (s - 1) // 2 remainder = s - (1 + 2k) n = round(remainder · d / 2)
The returned DAG is
U · (U† · U)^k · L† · LwhereLis the sub-circuit of the lastnunitary gates ofU. Non-unitary instructions are ignored when countingdand selecting the tail.- Parameters:
scale_factor (
float) – Real number ≥ 1.1.0is a pass-through.- Raises:
ValueError – If
scale_factor< 1.
Methods Summary
effective_scale(dag)Scale factor actually realised on
dag.run(dag)Fold
dagin place and return the mutated DAG.Methods Documentation