Skip to content

Commit

Permalink
Remove unsupported PassManager for scheduling stage
Browse files Browse the repository at this point in the history
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 Qiskit#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.
  • Loading branch information
mtreinish committed Aug 14, 2023
1 parent c626be7 commit 1300312
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions qiskit/transpiler/preset_passmanagers/level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1300312

Please sign in to comment.