diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index 1b3a3841e94..2fb0e83248f 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -107,11 +107,10 @@ import numpy as np from qiskit.providers.fake_provider import GenericBackendV2 - from qiskit.circuit.library import HGate, PhaseGate, RXGate, TdgGate, TGate, XGate + from qiskit.circuit.library import HGate, PhaseGate, RXGate, TdgGate, TGate, XGate, CXGate from qiskit.transpiler import PassManager, generate_preset_pass_manager from qiskit.transpiler.passes import ( ALAPScheduleAnalysis, - CXCancellation, InverseCancellation, PadDynamicalDecoupling, ) @@ -132,7 +131,7 @@ ] logical_opt = PassManager( [ - CXCancellation(), + InverseCancellation([CXGate()]), InverseCancellation(inverse_gate_list), ] ) diff --git a/qiskit/transpiler/passes/__init__.py b/qiskit/transpiler/passes/__init__.py index 948dea65018..8823e1ce723 100644 --- a/qiskit/transpiler/passes/__init__.py +++ b/qiskit/transpiler/passes/__init__.py @@ -75,7 +75,6 @@ CollectLinearFunctions CollectCliffords ConsolidateBlocks - CXCancellation InverseCancellation CommutationAnalysis CommutativeCancellation diff --git a/releasenotes/notes/remove_cxcancellation_11937-1d225c4331b7b4e2.yaml b/releasenotes/notes/remove_cxcancellation_11937-1d225c4331b7b4e2.yaml new file mode 100644 index 00000000000..50788b2aeae --- /dev/null +++ b/releasenotes/notes/remove_cxcancellation_11937-1d225c4331b7b4e2.yaml @@ -0,0 +1,6 @@ +--- +upgrade_transpiler: + - | + The pass ``qiskit.transpiler.passes.CXCancellation`` was removed. It was deprecated in favor of + class:`.InverseCancellation`, which is more generic. + ``CXCancellation`` is fully semantically equivalent to ``InverseCancellation([CXGate()])``.