From a463e1d6d0502a972575bb1120dce863820b278b Mon Sep 17 00:00:00 2001 From: Jun Doi Date: Thu, 16 Nov 2023 17:55:58 +0900 Subject: [PATCH] fix pass_manager function --- qiskit_aer/backends/plugin/aer_backend_plugin.py | 2 +- qiskit_aer/backends/statevector_simulator.py | 1 + qiskit_aer/backends/unitary_simulator.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qiskit_aer/backends/plugin/aer_backend_plugin.py b/qiskit_aer/backends/plugin/aer_backend_plugin.py index 943e92ebcd..c281d16490 100644 --- a/qiskit_aer/backends/plugin/aer_backend_plugin.py +++ b/qiskit_aer/backends/plugin/aer_backend_plugin.py @@ -71,7 +71,7 @@ def run(self, dag): class AerBackendPlugin(PassManagerStagePlugin): """custom passmanager to avoid unnecessary gate changes""" - def pass_manager(self, pass_manager_config, optimization_level): + def pass_manager(self, pass_manager_config, optimization_level=None) -> PassManager: return PassManager( [ UnitarySynthesis( diff --git a/qiskit_aer/backends/statevector_simulator.py b/qiskit_aer/backends/statevector_simulator.py index 342997c49f..3b954494f1 100644 --- a/qiskit_aer/backends/statevector_simulator.py +++ b/qiskit_aer/backends/statevector_simulator.py @@ -231,6 +231,7 @@ class StatevectorSimulator(AerBackend): "save_state", "set_statevector", "reset", + "barrier", ] ), "gates": [], diff --git a/qiskit_aer/backends/unitary_simulator.py b/qiskit_aer/backends/unitary_simulator.py index ca28204a9a..d47ba54935 100644 --- a/qiskit_aer/backends/unitary_simulator.py +++ b/qiskit_aer/backends/unitary_simulator.py @@ -218,7 +218,9 @@ class UnitarySimulator(AerBackend): "pauli", ] ), - "custom_instructions": sorted(["save_unitary", "save_state", "set_unitary", "reset"]), + "custom_instructions": sorted( + ["save_unitary", "save_state", "set_unitary", "reset", "barrier"] + ), "gates": [], }