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

Qiskit / qiskit / 8925397998
90%
main: 88%

Build:
Build:
LAST BUILD BRANCH: lightcone-fix
DEFAULT BRANCH: main
Ran 02 May 2024 02:33PM UTC
Jobs 1
Files 830
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 02:13PM UTC coverage: 89.581% (-0.009%) from 89.59%
8925397998

push

github

web-flow
Add ElidePermutations transpiler pass (#9523)

* 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 routing the outp... (continued)

72 of 73 new or added lines in 4 files covered. (98.63%)

16 existing lines in 2 files now uncovered.

61824 of 69015 relevant lines covered (89.58%)

218064.01 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
97.73
qiskit/transpiler/passes/optimization/elide_permutations.py

Uncovered Existing Lines

Lines Coverage ∆ File
4
92.37
-0.25% crates/qasm2/src/lex.rs
12
97.15
-0.92% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 8925397998.1 02 May 2024 02:33PM UTC 830
89.58
GitHub Action Run
Source Files on build 8925397998
  • Tree
  • List 830
  • Changed 35
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 122c64e7 on github
  • Prev Build on gh-readonly-queue/main/pr-12322-c53984f10d4d814a62ce35c8b53fac7f632e1e40 (#8925354283)
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