Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sabre layout and routing transpiler passes #4537

Merged
merged 36 commits into from
Jun 23, 2020
Merged

Conversation

ajavadia
Copy link
Member

@ajavadia ajavadia commented Jun 2, 2020

Adding a layout and routing method from https://arxiv.org/abs/1809.02573 (by @skywalker2012).

The initial layout selection is especially good in this method and finds high-quality initial placements very fast. I allow this layout method to be combined with any of the other available routing methods as well through selection of layout_method and routing_method. But Sabre's own routing method is also quite good - it anticipates upcoming gates via look ahead, and gives you the ability to trade off parallelism vs. number of gates.

I have not made this part of the default pipeline yet, but I think I'll do that once I do more randomized testing.

@ajavadia ajavadia requested a review from a team as a code owner June 2, 2020 18:06
@1ucian0 1ucian0 self-assigned this Jun 4, 2020
@ajavadia ajavadia added this to the 0.15 milestone Jun 18, 2020
@gushuli
Copy link
Contributor

gushuli commented Jun 18, 2020

It looks good to me.

qiskit/circuit/bit.py Outdated Show resolved Hide resolved
@mergify mergify bot merged commit fab61d2 into Qiskit:master Jun 23, 2020
@ajavadia ajavadia added the Changelog: New Feature Include in the "Added" section of the changelog label Aug 3, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* add SABRE swap pass

* add SABRE layout bidirectional search pass

* expose sabre via preset passmanagers

* undo deprecation for Layout.combine_into_edge_map

* add Approx2qDecompose and SimplifyU3 passes

* allow synthesis_fidelity in global transpile options

* stopgap fix for circuits with regs in sabre_layout

* add test

* add tests

* clean up sabre swap

* restore lost qasm test files

* fix tests

* leave SimplifyU3 for later

* leave Approx2qDecompose for later

* Release notes

Co-authored-by: Gushu Li <[email protected]>

* lint

* update level 3

* lint

* lint relax

* regenerate mapper tests

* make set to list conversion deterministic

* cleaning the diff a bit

* test.python.transpiler.test_coupling.CouplingTest.test_make_symmetric

* make randomization of SabreSwap controllable via seed

* control randomization of SabreSwap via seed

* move imports

* test.python.transpiler.test_coupling.CouplingTest.test_neighbors

* test.python.dagcircuit.test_dagcircuit.TestDagNodeSelection.test_front_layer

* fix doc

* Update test/python/transpiler/test_sabre_swap.py

Co-authored-by: Luciano Bello <[email protected]>

* Update qiskit/transpiler/passes/routing/sabre_swap.py

Co-authored-by: Luciano Bello <[email protected]>

* add note and test for neighbors

* lint

* release note

Co-authored-by: Gushu Li <[email protected]>
Co-authored-by: Luciano Bello <[email protected]>
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Sep 1, 2023
The custom `decay` heuristic is supposed to penalise increases in depth
in the output.  The output space of qubits are the physical qubits, so
the depth is defined in relation to those.  Since its introduction in
Qiskitgh-4537, this heuristic has instead been tracking the depth on the
virtual qubits, which due to the swaps is not necessarily related to the
depth in the output.

Notably, this commit actually makes the depth for routing large
volumetric circuits slightly _worse_ on average (at least for heavy-hex
topologies).  This may be because the effect on the heuristic is
overweighted, or that the depth tracking resets after each gate is
routed (and occasionally in between) to be flat across all qubits,
rather than reflecting the actual depth each qubit is subject to.
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Sep 5, 2023
The custom `decay` heuristic is supposed to penalise increases in depth
in the output.  The output space of qubits are the physical qubits, so
the depth is defined in relation to those.  Since its introduction in
Qiskitgh-4537, this heuristic has instead been tracking the depth on the
virtual qubits, which due to the swaps is not necessarily related to the
depth in the output.

Notably, this commit actually makes the depth for routing large
volumetric circuits slightly _worse_ on average (at least for heavy-hex
topologies).  This may be because the effect on the heuristic is
overweighted, or that the depth tracking resets after each gate is
routed (and occasionally in between) to be flat across all qubits,
rather than reflecting the actual depth each qubit is subject to.
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Sep 5, 2023
The custom `decay` heuristic is supposed to penalise increases in depth
in the output.  The output space of qubits are the physical qubits, so
the depth is defined in relation to those.  Since its introduction in
Qiskitgh-4537, this heuristic has instead been tracking the depth on the
virtual qubits, which due to the swaps is not necessarily related to the
depth in the output.

Notably, this commit actually makes the depth for routing large
volumetric circuits slightly _worse_ on average (at least for heavy-hex
topologies).  This may be because the effect on the heuristic is
overweighted, or that the depth tracking resets after each gate is
routed (and occasionally in between) to be flat across all qubits,
rather than reflecting the actual depth each qubit is subject to.
github-merge-queue bot pushed a commit that referenced this pull request Sep 7, 2023
The custom `decay` heuristic is supposed to penalise increases in depth
in the output.  The output space of qubits are the physical qubits, so
the depth is defined in relation to those.  Since its introduction in
gh-4537, this heuristic has instead been tracking the depth on the
virtual qubits, which due to the swaps is not necessarily related to the
depth in the output.

Notably, this commit actually makes the depth for routing large
volumetric circuits slightly _worse_ on average (at least for heavy-hex
topologies).  This may be because the effect on the heuristic is
overweighted, or that the depth tracking resets after each gate is
routed (and occasionally in between) to be flat across all qubits,
rather than reflecting the actual depth each qubit is subject to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants