• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 6023513300
88%

Build:
DEFAULT BRANCH: main
Ran 30 Aug 2023 11:23AM UTC
Jobs 1
Files 1268
Run time 33s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Aug 2023 08:46AM UTC coverage: 87.25% (-0.02%) from 87.274%
6023513300

push

github

web-flow
Fix virtual/physical-qubit distinction in Sabre (#10712)

* Fix virtual/physical-qubit distinction in Sabre

`SabreLayout` in particular previously had a very confused notion of
virtual and physical qubits in Rust space; on each iteration, it rewrote
the `SabreDAG` to "apply" a layout.  This is not logically what
`SabreDAG` represents, though; that defines the circuit purely in terms
of virtual qubits, which by definition do not change as the mapping of
them to physical qubits changes.

This commit modifies that internal logic so that there is a clear
distinction between the virtual DAG and the changing layout.  This
significantly simplies the logic within the Sabre layout Rust component.
This commit is RNG-compatible with its parent.

The Python entry points to the Rust components of both layout and
routing are modified to return a final permutation, rather than a final
layout, as this is what `TranspileLayout.final_layout` actually is.

The application of the Sabre result to a DAG is also updated to reflect
the correct virtual/physical relationship.  With the roles of everything
clarified, this now means that in the Sabre layout case, it
automatically does the job of `ApplyLayout` _and_ the subsequent
swap-mapping in one iteration, rather than rewriting the DAG once with
`ApplyLayout` only to rewrite it immediately after with the swap-mapped
form; the initial layout is after all only valid as far as the first
inserted swap.

The Sabre routing inputs are slightly tweaked, so the clone of the
layout that the routing pass mutates to track its state as it progresses
happens internally.  _Technically_, there could have been situations
where it was preferable for the caller in Rust-space to give the output
object (if it didn't care about losing the initial layout), but in
practice, we always cloned on entry.  The cost of the layout clone is
not high even in the worst case, and this makes the ownership,
mutation and return-value interfaces clearer.

* Fix ... (continued)

171 of 171 new or added lines in 5 files covered. (100.0%)

74360 of 85226 relevant lines covered (87.25%)

60247.35 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6023513300.1 30 Aug 2023 11:22AM UTC 0
87.25
GitHub Action Run
Source Files on build 6023513300
Detailed source file information is not available for this build.
  • Back to Repo
  • dbc45063 on github
  • Prev Build on gh-readonly-queue/main/pr-10730-0a0e2627b2eaca3a1d0a8e9d65468aba27d432f6 (#6022637357)
  • Next Build on main (#6027473267)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc