forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Sabre by default for optimization levels 1 and 2
This commit updates the preset pass manager construction to use the SabreLayout and SabreSwap passes by default for optimization level 1 and level 2. With the recently merged Qiskit#7977 the performance of the sabre swap pass has improved significantly enough to be considered for use by default with optimization levels 1 and 2. While for small numbers of target device qubits (< 30) the SabreLayout/SabreSwap pass doesn't quite match the runtime performance of DenseLayout/StochasticSwap it typically has better runtime performance for larger target devices. Additionally, the runtime performance of Sabre should also improve further after Qiskit#8388 is finished. However, the output quality from the sabre passes is typically better resulting in fewer swap gates being inserted. With the combination of better quality and comparable runtime performance it makes sense to use sabre as the default for optimization levels 1 and 2. For optimization level 0 stochastic swap is still used there because we want to continue to leverage TrivialLayout for that level and to get the full quality advantages SabreSwap and SabreLayout should be used together.
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
releasenotes/notes/sabres-for-everyone-3148ccf2064ccb0d.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
upgrade: | ||
- | | ||
The preset pass managers for levels 1 and 2, which will be used when | ||
``optimization_level=1`` or ``optimization_level=2`` with | ||
:func:`~.transpile` or :func:`~.generate_preset_pass_manager` and output | ||
from :func:`~.level_1_pass_manager` and :func:`~.level_2_pass_manager`, | ||
will now use :class:`~.SabreLayout` and :func:`~SabreSwap` by default | ||
instead of the previous defaults :class:`~.DenseLayout` and | ||
:class:`~.StochasticSwap`. This change was made to improve the output | ||
quality of the transpiler, the :class:`~.SabreLayout` and | ||
:func:`~SabreSwap` combination typically results in fewer | ||
:class:`~.SwapGate` objects being inserted into the output circuit. | ||
If you would like to use the previous default passes you can set | ||
``layout_method='dense'`` and ``routing_method='stochastic'`` on | ||
:func:`~.transpile` or :func:`~.generate_preset_pass_manager to | ||
leverage :class:`~.DenseLayout` and :class:`~.StochasticSwap` respectively. |