AbsorbSingleQubitGates

class samplomatic.transpiler.passes.AbsorbSingleQubitGates(*args, **kwargs)[source]

Bases: TransformationPass

Absorb all chains of single-qubit gates that are left of a box instruction into the box.

Any instruction that is not a single-qubit gate, including measurements, entanglers, barriers, and boxes, is considered an interruption and ends a chain. For example, if an X, a measurement, a Y, and a Z gate precede a box in this order, then the Y and the Z will be absorbed into the box, but the X and the measurement will not.

Methods Summary

run(dag)

Perform rightwards absorption of chains of single-qubit gates.

Methods Documentation

run(dag: DAGCircuit) DAGCircuit[source]

Perform rightwards absorption of chains of single-qubit gates.