From 1300312d346f7e1147f7a10813bfd1bdfd97494e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 14 Aug 2023 12:45:30 -0400 Subject: [PATCH] Remove unsupported PassManager for scheduling stage In optimization level 3's preset pass manager there was handling for a PassManager object coming in via the `scheduling_method` argument. This is not a valid type for the scheduling method argument and would result in an error higher up in the call stack and also would not work for any other optimization level. This was a leftover from #8648 which added the option for backends to set alternate defaults for the scheduling stage. An earlier iteration of that PR was using a PassManager returned by the backend instead of the plugin interface. The handling for the PassManager input was not removed when that PR was updated to use the plugin interface. This commit corrects the oversight and removes the stray condition that would never work. --- qiskit/transpiler/preset_passmanagers/level3.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/qiskit/transpiler/preset_passmanagers/level3.py b/qiskit/transpiler/preset_passmanagers/level3.py index 53c4f148d711..4ad71538a28b 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -295,13 +295,9 @@ def _unroll_condition(property_set): else: pre_optimization = common.generate_pre_op_passmanager(remove_reset_in_zero=True) - if isinstance(scheduling_method, PassManager): - sched = scheduling_method - - else: - sched = plugin_manager.get_passmanager_stage( - "scheduling", scheduling_method, pass_manager_config, optimization_level=3 - ) + sched = plugin_manager.get_passmanager_stage( + "scheduling", scheduling_method, pass_manager_config, optimization_level=3 + ) return StagedPassManager( init=init,