From 96fcf2550843b8e8522b82c139964f2c85478fce Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Tue, 12 Nov 2024 23:32:22 +0100 Subject: [PATCH] reno --- qiskit/transpiler/__init__.py | 5 ++--- qiskit/transpiler/passes/__init__.py | 1 - .../notes/remove_cxcancellation_11937-1d225c4331b7b4e2.yaml | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/remove_cxcancellation_11937-1d225c4331b7b4e2.yaml diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index 1b3a3841e94f..2fb0e83248fa 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 948dea650180..8823e1ce7233 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 000000000000..50788b2aeae4 --- /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()])``.