Skip to content

Commit

Permalink
Change the default routing_method to sabre (#12806)
Browse files Browse the repository at this point in the history
* change the default routing_method to sabre

* reno

* Update releasenotes/notes/sabre_level0-1524f01965257f3f.yaml

Co-authored-by: Matthew Treinish <[email protected]>

---------

Co-authored-by: Matthew Treinish <[email protected]>
  • Loading branch information
1ucian0 and mtreinish authored Jul 29, 2024
1 parent b23c545 commit b985b96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit/transpiler/preset_passmanagers/level0.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def level_0_pass_manager(pass_manager_config: PassManagerConfig) -> StagedPassMa
initial_layout = pass_manager_config.initial_layout
init_method = pass_manager_config.init_method or "default"
layout_method = pass_manager_config.layout_method or "default"
routing_method = pass_manager_config.routing_method or "stochastic"
routing_method = pass_manager_config.routing_method or "sabre"
translation_method = pass_manager_config.translation_method or "translator"
optimization_method = pass_manager_config.optimization_method or "default"
scheduling_method = pass_manager_config.scheduling_method or "default"
Expand Down
13 changes: 13 additions & 0 deletions releasenotes/notes/sabre_level0-1524f01965257f3f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
upgrade_transpiler:
- |
The default routing pass used by optimization level 0 for :func:`.generate_preset_pass_manager`
and :func:`.transpile` has been changed from :class:`.StochasticSwap` to :class:`.SabreSwap`.
The :class:`.SabreSwap` pass performs exactly the same function but performs better in both
runtime and output quality (in number of swap gates and depth) compared to
:class:`.StochasticSwap`. For ``optimization_level=0`` this shouldn't matter because it's not
expected to run routing for the typical use case of level 0.
If you were relying on the previous default routing algorithm for any reason you can use the
``routing_method`` argument for :func:`.transpile` and :func:`.generate_preset_pass_manager`
to ``"stochastic"`` to use the :class:`.StochasticSwap` pass.

0 comments on commit b985b96

Please sign in to comment.