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

Qiskit / qiskit / 6870747806
88%

Build:
DEFAULT BRANCH: main
Ran 14 Nov 2023 11:43PM UTC
Jobs 1
Files 1109
Run time 1min
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

14 Nov 2023 10:15PM UTC coverage: 85.919% (-0.003%) from 85.922%
6870747806

push

github

web-flow
Speed up InverseCancellation when there's nothing to cancel (#11211)

* Speed up InverseCancellation when there's nothing to cancel

In the cases when there is nothing to cancel in the DAGCircuit the
InverseCancellation pass would iterate over the entire circuit twice,
once to search for self inverse gates and then a second time to search
for other inverse pairs. This is typically fairly fast because the
actual search is done in rust, but there is a python callback function
that is called for each node. Depending on the size of the circuit this
could add up to a significant amount of time. This commit updates the
logic in the pass to first check if there are any operations being asked
to cancel for either stage, and if there are then only do the iteration
if there are any gates in the circuit in the set of intructions that
will be cancelled, which means we'll need to do an iteration. These
checks are all O(1) for any sized dag, so they're much lower overhead
and will mean the pass executes much faster in the case when there isn't
anything to cancel.

* Speed-up when there is a partial match

Building off of the previous commit this speeds up the inverse
cancellation pass when only some of the inverse pairs are not present in
the DAG, but others are present. In this case the previous commit would
still iterate over the full dag multiple times even when we know some of
the inverse pairs are not present in the DAG. This commit updates the
logic to not call collect_runs() if we know it's going to be empty or
there is no cancellation opportunity.

* Expand test coverage

* Add more tests

* Fix handling of parameterized gates

This commit adds a fix for an issue that was caught while tuning the
performance of the pass. If a parameterized self inverse was passed in
the pass would incorrectly treat all instances of that parameterized'
gate as being a self inverse without checking the parameter values.
This commit corrects this oversight to handle this case t... (continued)

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

10 existing lines in 2 files now uncovered.

65955 of 76764 relevant lines covered (85.92%)

100010.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6870747806.1 14 Nov 2023 11:43PM UTC 0
85.92
GitHub Action Run
Source Files on build 6870747806
Detailed source file information is not available for this build.
  • Back to Repo
  • 258fb234 on github
  • Prev Build on gh-readonly-queue/main/pr-11241-d418d8e240deb37e866095bef758ae593889064b (#6870068113)
  • Next Build on main (#6879718232)
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