Skip to content

Commit 0c6acb7

Browse files
Change the default routing_method to sabre (#12806) (#12847)
* 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]> (cherry picked from commit b985b96) Co-authored-by: Luciano Bello <[email protected]>
1 parent 0093c65 commit 0c6acb7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

qiskit/transpiler/preset_passmanagers/level0.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def level_0_pass_manager(pass_manager_config: PassManagerConfig) -> StagedPassMa
4848
initial_layout = pass_manager_config.initial_layout
4949
init_method = pass_manager_config.init_method or "default"
5050
layout_method = pass_manager_config.layout_method or "default"
51-
routing_method = pass_manager_config.routing_method or "stochastic"
51+
routing_method = pass_manager_config.routing_method or "sabre"
5252
translation_method = pass_manager_config.translation_method or "translator"
5353
optimization_method = pass_manager_config.optimization_method or "default"
5454
scheduling_method = pass_manager_config.scheduling_method or "default"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
upgrade_transpiler:
3+
- |
4+
The default routing pass used by optimization level 0 for :func:`.generate_preset_pass_manager`
5+
and :func:`.transpile` has been changed from :class:`.StochasticSwap` to :class:`.SabreSwap`.
6+
The :class:`.SabreSwap` pass performs exactly the same function but performs better in both
7+
runtime and output quality (in number of swap gates and depth) compared to
8+
:class:`.StochasticSwap`. For ``optimization_level=0`` this shouldn't matter because it's not
9+
expected to run routing for the typical use case of level 0.
10+
11+
If you were relying on the previous default routing algorithm for any reason you can use the
12+
``routing_method`` argument for :func:`.transpile` and :func:`.generate_preset_pass_manager`
13+
to ``"stochastic"`` to use the :class:`.StochasticSwap` pass.

0 commit comments

Comments
 (0)