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

Qiskit / qiskit / 27166881025
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: dynamic_range_expr
DEFAULT BRANCH: main
Ran 08 Jun 2026 09:39PM UTC
Jobs 1
Files 946
Run time 3min
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

08 Jun 2026 09:04PM UTC coverage: 87.53% (-0.002%) from 87.532%
27166881025

push

github

web-flow
Use toposort instead of topological_op_nodes for DAG reconstruction (#15987)

* Use toposort instead of topological_op_nodes for DAG reconstruction

This commit switches the topological sort function we use in transpiler
passes when reconstructing a dag from scratch. In several passes where
we typically replace or remove a large numbers of gates we iterate over
the input dag in topological order and construct a copy of it making the
alterations as we go. Right now when we do this we rely on
`DAGCircuit::topological_op_nodes` which makes sense because it's or
built-in method for iterating over a dag's op node in topological
ordering. Internally this uses rustworkx's lexicographical topological
sort function with our custom sort function that maintains our desired
tie breaker using the bits of a node. However, since #14762 where we're
asserting structural equality in passes we don't need to use that sort
anymore for these reconstruction cases. We just need a consistent
topological sort. In optimizing #13419 one thing that showed in profiles
was that for very large circuits the overhead of the lexicographical
topological sort for the iteration. The toposort function in petgraph
is lower overhead because it doesn't need to work about the
lexicographical tie breaker. By switching to use this instead we can
reduce the overhead of the final sort in all these passes. In asv
benchmarking this commit speeds up transpiler benchmarks are 2-5%
faster (although without asv flagging it as significant).

* Add a dedicated rebuilder function instead of inlining toposort

This commit adds a new method to DAGCircuit that is designed to replace
the explicit rebuilding of a dag that is done in several passes. The
previous commit updated the common pattern of rebuilding the dag to use
toposort instead of topological_sort, but this wasn't the cleanest
interface and it was resulting in some ugliness between the API
boundaries. To facilitate making the more performant path ea... (continued)

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

22 existing lines in 4 files now uncovered.

110424 of 126156 relevant lines covered (87.53%)

952611.26 hits per line

Coverage Regressions

Lines Coverage ∆ File
8
91.0
-1.54% crates/qasm2/src/lex.rs
7
73.97
-0.2% crates/circuit/src/parameter/symbol_expr.rs
6
97.15
0.47% crates/qasm2/src/parse.rs
1
93.82
-0.24% crates/qasm2/src/expr.rs
Jobs
ID Job ID Ran Files Coverage
1 27166881025.1 08 Jun 2026 09:39PM UTC 946
87.53
GitHub Action Run
Source Files on build 27166881025
  • Tree
  • List 946
  • Changed 9
  • Source Changed 5
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27166881025
  • 503b067e on github
  • Prev Build on gh-readonly-queue/main/pr-16337-f69cc530b938201f660d5c6649e5543d74ffc4bd (#27166459506)
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