From c0bc0cb8f06efa6863300b6e79ac30c6211eeffd Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 21 Aug 2023 21:52:53 -0400 Subject: [PATCH] Remove unsupported PassManager for scheduling stage (#10623) 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 caa6cb6f48f9..8b5e0ef36472 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -283,13 +283,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,