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).

@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

coveralls commented Nov 26, 2024

Pull Request Test Coverage Report for Build 12050406543

Details

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

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/unitary_synthesis.rs 1 92.2%
crates/qasm2/src/lex.rs 2 91.48%
Totals Coverage Status
Change from base Build 12050036595: 0.007%
Covered Lines: 79049
Relevant Lines: 88912

💛 - Coveralls

@mtreinish
Copy link
Member

@Mergifyio rebase

* 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)
@mtreinish mtreinish force-pushed the mergify/bp/stable/1.3/pr-13454 branch from be85e24 to 4349397 Compare November 27, 2024 12:35
Copy link
Contributor Author

mergify bot commented Nov 27, 2024

rebase

✅ Branch has been successfully rebased

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