Skip to content

Commit

Permalink
Remove duplicate optimization loop in level 3 PassManager (#8785)
Browse files Browse the repository at this point in the history
For some time (I expect since #6403 but maybe before) we've been running
the optimization loop for optimization level 3 twice for no reason. This
is clearly a mistake as it adds a single extra run of all the optimization
passes since we've already reached a steady state in depth and size by this
point. This is just a waste of time and was unintentional. This commit
removes the unintended duplication.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mtreinish and mergify[bot] authored Sep 24, 2022
1 parent ae0ceee commit 09706be
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions qiskit/transpiler/preset_passmanagers/level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ def _unroll_condition(property_set):
optimization.append(
_opt + _unroll_if_out_of_basis + _depth_check + _size_check, do_while=_opt_control
)
opt_loop = _depth_check + _opt + _unroll_if_out_of_basis
optimization.append(opt_loop, do_while=_opt_control)
else:
optimization = plugin_manager.get_passmanager_stage(
"optimization", optimization_method, pass_manager_config, optimization_level=3
Expand Down

0 comments on commit 09706be

Please sign in to comment.