AddTerminalRightDressedBoxes

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

Bases: TransformationPass

Add right-dressed boxes to collect uncollected virtual gates emitted by left-dressed boxes.

This pass adds right-dressed “collector” boxes to the given circuit to ensure that none of the virtual gates emitted by left-dressed boxes are left uncollected. Any group of single-qubit gates adjacent to a newly added right-dressed box is also placed inside the box.

Note

Given a circuit that contains only left-dressed boxes, this pass returns a circuit that can be successfully built.

Methods Summary

run(dag)

Add right-dressed boxes to collect the uncollected leftwards virtual gates emitted.

Methods Documentation

run(dag: DAGCircuit) DAGCircuit[source]

Add right-dressed boxes to collect the uncollected leftwards virtual gates emitted.