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

Qiskit / qiskit / 8928460387
90%
main: 88%

Build:
Build:
LAST BUILD BRANCH: substitute_pi4_rotations
DEFAULT BRANCH: main
Ran 02 May 2024 06:27PM UTC
Jobs 1
Files 831
Run time 2min
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

02 May 2024 05:51PM UTC coverage: 89.615% (+0.005%) from 89.61%
8928460387

push

github

web-flow
Add ElidePermutations pass to optimization level 3 (#12111)

* Add ElideSwaps transpiler pass

This commit adds a new transpiler pass ElideSwaps which is a logical
optimization pass designed to run prior to layout or any other physical
embedding steps in the transpiler pipeline. It traverses the DAG in
topological order and when a swap gate is encountered it removes that
gate and instead permutes the logical qubits for any subsequent gates
in the DAG. This will eliminate any swaps in a circuit not caused by
routing. Additionally, this pass is added to the preset pass manager for
optimization level 3, we can consider adding it to other levels too if
we think it makes sense (there is little overhead, and almost 0 if there
are no swaps).

One thing to note is that this pass does not recurse into control flow
blocks at all, it treats them as black box operations. So if any control
flow blocks contain swap gates those will not be optimized away. This
change was made because mapping the permutation outside and inside any
control flow block was larger in scope than what the intent for this
pass was. That type of work is better suited for the routing passes
which already have to reason about this.

* Update tests with optimization level 3

* Pass final layout from ElideSwap to output

The new ElideSwap pass is causing an output permutation just as a
routing pass would. This information needs to be passed through to the
output in case there is no layout or routing run. In those cases the
information about the output permutation caused by the swap elision will
be lost and doing layout aware operations like Operator.from_circuit()
will not be able to reason about the permutation. This commit fixes this
by inserting the original layout and qubit mapping into the property set
along with the final layout. Then the base pass class and pass manager
class are updated to use the original layout as the initial layout if
one isn't set. In cases where we run layout and ro... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

16 existing lines in 2 files now uncovered.

62219 of 69429 relevant lines covered (89.62%)

229181.15 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
4
92.88
1.02% crates/qasm2/src/lex.rs
12
96.69
0.0% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 8928460387.1 02 May 2024 06:27PM UTC 831
89.62
GitHub Action Run
Source Files on build 8928460387
  • Tree
  • List 831
  • Changed 30
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 43c065fc on github
  • Prev Build on gh-readonly-queue/main/pr-11811-f34fb21219077311eb0e3f35e732c50ba4eb4101 (#8928056849)
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