Commit b2d4c87
authored
Simply Sabre release-valve calculation (Qiskit#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`.1 parent 2941838 commit b2d4c87
1 file changed
Lines changed: 5 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
| 706 | + | |
| 707 | + | |
713 | 708 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
727 | 712 | | |
728 | 713 | | |
729 | 714 | | |
| |||
0 commit comments