diff --git a/qiskit/transpiler/preset_passmanagers/level1.py b/qiskit/transpiler/preset_passmanagers/level1.py index d878bd8c8f9c..3f894484f1a6 100644 --- a/qiskit/transpiler/preset_passmanagers/level1.py +++ b/qiskit/transpiler/preset_passmanagers/level1.py @@ -337,7 +337,8 @@ def _contains_delay(property_set): pm1.append(_direction_check) pm1.append(_direction, condition=_direction_condition) pm1.append(_reset) - pm1.append(_depth_check + _size_check + _opt + _unroll, do_while=_opt_control) + pm1.append(_depth_check + _size_check) + pm1.append(_opt + _unroll + _depth_check + _size_check, do_while=_opt_control) if inst_map and inst_map.has_custom_gate(): pm1.append(PulseGates(inst_map=inst_map)) if scheduling_method: diff --git a/qiskit/transpiler/preset_passmanagers/level2.py b/qiskit/transpiler/preset_passmanagers/level2.py index ac1585dd8c93..092ac6b0af32 100644 --- a/qiskit/transpiler/preset_passmanagers/level2.py +++ b/qiskit/transpiler/preset_passmanagers/level2.py @@ -325,7 +325,8 @@ def _contains_delay(property_set): pm2.append(_direction, condition=_direction_condition) pm2.append(_reset) - pm2.append(_depth_check + _size_check + _opt + _unroll, do_while=_opt_control) + pm2.append(_depth_check + _size_check) + pm2.append(_opt + _unroll + _depth_check + _size_check, do_while=_opt_control) if inst_map and inst_map.has_custom_gate(): pm2.append(PulseGates(inst_map=inst_map)) diff --git a/qiskit/transpiler/preset_passmanagers/level3.py b/qiskit/transpiler/preset_passmanagers/level3.py index fd46818e0e78..94f341d911b5 100644 --- a/qiskit/transpiler/preset_passmanagers/level3.py +++ b/qiskit/transpiler/preset_passmanagers/level3.py @@ -335,19 +335,21 @@ def _contains_delay(property_set): pm3.append(_direction_check) pm3.append(_direction, condition=_direction_condition) pm3.append(_reset) + pm3.append(_depth_check + _size_check) # For transpiling to a target we need to run GateDirection in the # optimization loop to correct for incorrect directions that might be # inserted by UnitarySynthesis which is direction aware but only via # the coupling map which with a target doesn't give a full picture if target is not None: pm3.append( - _depth_check + _size_check + _opt + _unroll + _direction, do_while=_opt_control + _opt + _unroll + _depth_check + _size_check + _direction, do_while=_opt_control ) else: - pm3.append(_depth_check + _size_check + _opt + _unroll, do_while=_opt_control) + pm3.append(_opt + _unroll + _depth_check + _size_check, do_while=_opt_control) else: pm3.append(_reset) - pm3.append(_depth_check + _size_check + _opt + _unroll, do_while=_opt_control) + pm3.append(_depth_check + _size_check) + pm3.append(_opt + _unroll + _depth_check + _size_check, do_while=_opt_control) if inst_map and inst_map.has_custom_gate(): pm3.append(PulseGates(inst_map=inst_map)) if scheduling_method: