Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InverseCancellation to run in classical blocks (backport #13454) #13496

Open
wants to merge 1 commit into
base: stable/1.3
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 26, 2024

Fix issue #13437.

Summary

The InverseCancellation pass cancels pairs of gates that are inverses of each other; it now behaves as expected when running inside classical blocks of a control flow.

Details and comments

This PR fixed the bug reported in #13437 by adding the decorator @control_flow.trivial_recurse so that the pass can be iterated over all control-flow nodes.


This is an automatic backport of pull request #13454 done by [Mergify](https://mergify.com).

* Fix an issue that `InverseCancellation` does not run in classical blocks (#13437)

* Add test functions for  pass running in classical blocks.

* Reformat test function file

* Add a release note

(cherry picked from commit 6025b7c)
@mergify mergify bot requested a review from a team as a code owner November 26, 2024 22:47
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@github-actions github-actions bot added Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo labels Nov 26, 2024
@github-actions github-actions bot added this to the 1.3.0 milestone Nov 26, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12040310201

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.01%) to 88.931%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/two_qubit_decompose.rs 1 91.96%
crates/qasm2/src/lex.rs 4 92.48%
Totals Coverage Status
Change from base Build 12040220193: 0.01%
Covered Lines: 79070
Relevant Lines: 88912

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants