CommutativeCancellation

class CommutativeCancellation(*args, **kwargs)[source]

Cancel the redundant (self-adjoint) gates through commutation relations.

Pass for cancelling self-inverse gates/rotations. The cancellation utilizes the commutation relations in the circuit. Gates considered include:

H, X, Y, Z, CX, CY, CZ

Attributes

CommutativeCancellation.is_analysis_pass

Check if the pass is an analysis pass.

CommutativeCancellation.is_transformation_pass

Check if the pass is a transformation pass.

Methods

CommutativeCancellation.name()

Return the name of the pass.

CommutativeCancellation.run(dag)

Run the CommutativeCancellation pass on dag.