Closed mergify[bot] closed 2 weeks ago
Thank you for opening a new pull request.
Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.
While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.
One or more of the following people are relevant to this code:
@Qiskit/terra-core
@kevinhartman
@mtreinish
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
crates/accelerate/src/sabre/route.rs | 9 | 22 | 40.91% | ||
<!-- | Total: | 13 | 26 | 50.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/lex.rs | 5 | 92.48% | ||
crates/qasm2/src/parse.rs | 12 | 97.15% | ||
<!-- | Total: | 17 | --> |
Totals | |
---|---|
Change from base Build 10811747175: | -0.03% |
Covered Lines: | 66875 |
Relevant Lines: | 74506 |
Summary
Fixes #13081.
Details and comments
If a Sabre trial does not find a set of Swaps to route nodes, the "release valve" adds Swaps to route the two-qubit gate in between the the closest two qubits. In rare cases, this leads to more than one gate being routable, which was not handled correctly previously.
As I understand it this should only ever occur if the release-valve adds a single swap and we have a scenario like
If more than one swap gate is applied it should not be possible that two gates are routable, so the code now only checks for a second routable gate if we insert a single swap. If someone can find a counterexample we can change the code to check for any routable gate after the release valve 🙂
This is an automatic backport of pull request #13114 done by Mergify.