Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Merged
merged 1 commit into from
Nov 27, 2024

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
@mtreinish mtreinish enabled auto-merge November 26, 2024 22:55
@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 mtreinish disabled auto-merge November 27, 2024 12:33
@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

@mtreinish mtreinish enabled auto-merge November 27, 2024 12:52
@mtreinish mtreinish added this pull request to the merge queue Nov 27, 2024
Merged via the queue into stable/1.3 with commit e44acfb Nov 27, 2024
19 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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: Done
Development

Successfully merging this pull request may close these issues.

4 participants