Simplify Sabre release-valve calculation#15897
Merged
alexanderivrii merged 1 commit intoQiskit:mainfrom Mar 29, 2026
Merged
Conversation
There is an edge case in release-valve handling where, if the shortest path is a single swap (but the heuristics have been chosen such that it is unselectable normally), it is possible for the release valve to cause _two_ gates to be routed. The previous handling of this path was written in quite a complicated manner, likely to be able to use `closest_node` by name from its discovery earlier in the release-valve process. Instead, it is easier to recognise that, given a single swap: * the two qubits cannot be part of the same gate, or the gate would have been routable _without_ the swap; * the `closest_node` must touch one of these qubits because of the the Dijkstra search; * therefore we can simply add any routable gate that touches _either_ qubit without risk of duplication or forgetting `closest_swap`.
Collaborator
|
One or more of the following people are relevant to this code:
|
Member
Author
|
In rebasing the rest of the chain around this, I discovered more why I'd previously folded this into an earlier commit (without particularly noticing) - the |
jakelishman
added a commit
to jakelishman/qiskit-terra
that referenced
this pull request
Mar 29, 2026
There is an edge case in release-valve handling where, if the shortest path is a single swap (but the heuristics have been chosen such that it is unselectable normally), it is possible for the release valve to cause _two_ gates to be routed. The previous handling of this path was written in quite a complicated manner, likely to be able to use `closest_node` by name from its discovery earlier in the release-valve process. Instead, it is easier to recognise that, given a single swap: * the two qubits cannot be part of the same gate, or the gate would have been routable _without_ the swap; * the `closest_node` must touch one of these qubits because of the the Dijkstra search; * therefore we can simply add any routable gate that touches _either_ qubit without risk of duplication or forgetting `closest_swap`.
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
* Simply Sabre release-valve calculation (#15897) There is an edge case in release-valve handling where, if the shortest path is a single swap (but the heuristics have been chosen such that it is unselectable normally), it is possible for the release valve to cause _two_ gates to be routed. The previous handling of this path was written in quite a complicated manner, likely to be able to use `closest_node` by name from its discovery earlier in the release-valve process. Instead, it is easier to recognise that, given a single swap: * the two qubits cannot be part of the same gate, or the gate would have been routable _without_ the swap; * the `closest_node` must touch one of these qubits because of the the Dijkstra search; * therefore we can simply add any routable gate that touches _either_ qubit without risk of duplication or forgetting `closest_swap`. * Add explicit turbofish typing
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is an edge case in release-valve handling where, if the shortest path is a single swap (but the heuristics have been chosen such that it is unselectable normally), it is possible for the release valve to cause two gates to be routed. The previous handling of this path was written in quite a complicated manner, likely to be able to use
closest_nodeby name from its discovery earlier in the release-valve process.Instead, it is easier to recognise that, given a single swap:
closest_nodemust touch one of these qubits because of the the Dijkstra search;closest_swap.Summary
Details and comments
This was separated out from #14909 owing to #14909 (comment).