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

Qiskit / qiskit / 25515648637
88%

Build:
DEFAULT BRANCH: main
Ran 07 May 2026 07:20PM UTC
Jobs 1
Files 939
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

07 May 2026 06:22PM UTC coverage: 87.621% (-0.002%) from 87.623%
25515648637

push

github

web-flow
Parallelize the CommutationAnalysis pass (#16014)

* Parallelize the CommutationAnalysis pass

Building on top of #15988 which removed the internal caching from the
commutation checker. This commit parallelizes the commutation analysis
pass so that the analysis per qubit is done in multiple threads and
aggregated together in the end. The speed-up this enables is fairly
modest because we're spending more of the time in the serial portion of
the pass. But even so it's a simple code change that does speed the pass
and by extension CommutativeCancellation.

In general the pass could probably use a rearchitecting as I think a lot
of the issues stem with how it's collecting data which seems overly
specific to how the pass worked from Python. However, since there is a
CommutativeOptimization pass that is designed to replace the
CommutationAnalysis/CommutativeCancellation passes spending too much
time on this is probably not worth it.

The other change made to facilitate this is removing the scratch map
from the CommutationChecker. Specifically this required mutable access
to check if two gates commute but in a parallel context we won't be able
to get mutable access. This scratch space isn't a huge speedup as it
just saved an allocation when checking PPR commutations.

* Avoid IndexMap usage inside the pass

This commit moves away from using an IndexMap for the CommutationSet and
NodeIndices types and replaces both with an outer Vec. They were both
keyed on qubits which is a contiguous range of 0..N_u32. A vec is more
natural for this at the cost of allocating and creating a vec large enough
to store all the qubits even if there isn't an entry for each qubit.

This will have two advantages the first for the parallel path in this PR
this will result in a deterministic iteration order when we build the
output dict for the python pass. The second is it should be even faster
both for the serial and parallel.

* Fix rebase issues and run cargo fmt

* Propogate PyE... (continued)

100 of 107 new or added lines in 3 files covered. (93.46%)

22 existing lines in 5 files now uncovered.

107006 of 122124 relevant lines covered (87.62%)

961915.59 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
93.6
0.74% crates/transpiler/src/passes/commutation_analysis.rs
1
88.79
-0.1% crates/transpiler/src/commutation_checker.rs

Coverage Regressions

Lines Coverage ∆ File
8
73.93
-0.33% crates/circuit/src/parameter/symbol_expr.rs
6
92.29
-0.51% crates/qasm2/src/lex.rs
6
97.63
0.47% crates/qasm2/src/parse.rs
1
91.04
0.0% crates/circuit/src/parameter/parameter_expression.rs
1
93.82
-0.24% crates/qasm2/src/expr.rs
Jobs
ID Job ID Ran Files Coverage
1 25515648637.1 07 May 2026 07:20PM UTC 939
87.62
GitHub Action Run
Source Files on build 25515648637
  • Tree
  • List 939
  • Changed 11
  • Source Changed 6
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25515648637
  • c2521634 on github
  • Prev Build on gh-readonly-queue/main/pr-16144-a8e043fddae122499d830e3eb86ecd5917876622 (#25509310637)
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