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

Qiskit / qiskit-terra / 5591129273
87%

Build:
DEFAULT BRANCH: main
Ran 18 Jul 2023 07:06PM UTC
Jobs 1
Files 1265
Run time 25s
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

pending completion
5591129273

push

github

web-flow
add control flow to CommutativeCancellation pass (#9143)

* add initial tests

* tests passing

* remove debug code

* fix test for clbits

* formatting

* Lift creation of PassManager out of loop

In _handle_control_flow_ops, a new PassManager was created for each ControlFlowOp
found. This commit moves the creation out of the loop over nodes. This should be
a bit more efficient.

I also considered mapped_blocks.clear() rather than reallocating. But in some
simpler tests of clearing rather than reallocating, this is actually less performant.
I think reallocating renders the code slightly more understandable.

* Test commutative cancellation does not cross block boundaries

These were requested in a review comment. The previous commit was
also requested in a review comment.

* Add release note for commutative cancellation in control flow blocks

* Include CommutativeAnalysis pass explicitly when doing control flow blocks

A new PassManager for CommutativeCancellation is constructed when descending into control flow blocks.
This commit explicitly includes a CommutativeAnalysis pass in this construction rather than relying on
`requires`. This change, while not necessary, is made for consistency with other explicit constructions
of PassManagers containing these passes.

* Use existing CommutativeCancellation pass in control flow op blocks

A previous commit made a copy of the pass being used in the parent context to be used
in the blocks of a control flow op. With this commit, we reuse the existing pass,
as it is immutable.

* Move import of PassManager from method to top of file

* Revert commit f8c2aaf because I missed a fix already to go

* Update qiskit/transpiler/passes/optimization/commutative_cancellation.py

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

---------

Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

72395 of 84139 relevant lines covered (86.04%)

45542.78 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5591129273.1 18 Jul 2023 07:06PM UTC 0
86.04
GitHub Action Run
Source Files on build 5591129273
Detailed source file information is not available for this build.
  • Back to Repo
  • 733f78cd on github
  • Prev Build on main (#5589940418)
  • Next Build on main (#5591232414)
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