diff --git a/qiskit/transpiler/preset_passmanagers/builtin_plugins.py b/qiskit/transpiler/preset_passmanagers/builtin_plugins.py index 3dc89850e37a..c54d0e0bf084 100644 --- a/qiskit/transpiler/preset_passmanagers/builtin_plugins.py +++ b/qiskit/transpiler/preset_passmanagers/builtin_plugins.py @@ -39,7 +39,7 @@ CommutativeCancellation, Collect2qBlocks, ConsolidateBlocks, - CXCancellation, + InverseCancellation, ) from qiskit.transpiler.passes import Depth, Size, FixedPoint, MinimumPoint from qiskit.transpiler.passes.utils.gates_basis import GatesInBasis @@ -47,6 +47,13 @@ from qiskit.passmanager.flow_controllers import ConditionalController from qiskit.transpiler.timing_constraints import TimingConstraints from qiskit.transpiler.passes.layout.vf2_layout import VF2LayoutStopReason +from qiskit.circuit.library.standard_gates import ( + CXGate, + ECRGate, + CZGate, + SwapGate, + CYGate, +) class DefaultInitPassManager(PassManagerStagePlugin): @@ -468,7 +475,15 @@ def _opt_control(property_set): Optimize1qGatesDecomposition( basis=pass_manager_config.basis_gates, target=pass_manager_config.target ), - CXCancellation(), + InverseCancellation( + [ + CXGate(), + ECRGate(), + CZGate(), + CYGate(), + SwapGate(), + ] + ), ] elif optimization_level == 2: # Steps for optimization level 2