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 handling of controlflow ops when control flow is in basis #8879

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

mtreinish
Copy link
Member

Summary

This commit fixes the handling of ControlFlowOps in the Unroll3QOrMore transpiler pass when the the control flow ops are in the basis set. Previously, the check for whether the operation was native to the target was done before recursing into the control flow block. This effectively skipped the conversion that should have happened in the block. To fix this the control flow operation handling is moved before the basis check. Later passes (mainly basis translation) will fail if the control flow operations aren't available on the target and we should always recursively unroll gates in this pass.

Details and comments

@mtreinish mtreinish added priority: high Changelog: None Do not include in changelog labels Oct 12, 2022
@mtreinish mtreinish added this to the 0.22 milestone Oct 12, 2022
@mtreinish mtreinish requested a review from a team as a code owner October 12, 2022 14:30
@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 the following people are requested to review this:

  • @Qiskit/terra-core

jakelishman
jakelishman previously approved these changes Oct 12, 2022
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the re-ordering!

@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Oct 12, 2022
@coveralls
Copy link

coveralls commented Oct 12, 2022

Pull Request Test Coverage Report for Build 3236102609

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 84.765%

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 91.49%
Totals Coverage Status
Change from base Build 3235718324: -0.001%
Covered Lines: 61935
Relevant Lines: 73067

💛 - Coveralls

@jakelishman
Copy link
Member

Just manually updating the PR so it'll automerge after only one run of tests rather than two, since this PR is on the critical path for 0.22rc2.

This commit fixes the handling of ControlFlowOps in the Unroll3QOrMore
transpiler pass when the the control flow ops are in the basis set.
Previously, the check for whether the operation was native to the target
was done before recursing into the control flow block. This effectively
skipped the conversion that should have happened in the block. To fix
this the control flow operation handling is moved before the basis
check. Later passes (mainly basis translation) will fail if the control
flow operations aren't available on the target and we should always
recursively unroll gates in this pass.
@mergify mergify bot merged commit 985b005 into Qiskit:main Oct 12, 2022
@mtreinish mtreinish deleted the fix-unroll3q-control-flow branch October 12, 2022 20:03
mergify bot pushed a commit that referenced this pull request Oct 12, 2022
This commit fixes the handling of ControlFlowOps in the Unroll3QOrMore
transpiler pass when the the control flow ops are in the basis set.
Previously, the check for whether the operation was native to the target
was done before recursing into the control flow block. This effectively
skipped the conversion that should have happened in the block. To fix
this the control flow operation handling is moved before the basis
check. Later passes (mainly basis translation) will fail if the control
flow operations aren't available on the target and we should always
recursively unroll gates in this pass.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 985b005)
mergify bot added a commit that referenced this pull request Oct 12, 2022
…#8887)

This commit fixes the handling of ControlFlowOps in the Unroll3QOrMore
transpiler pass when the the control flow ops are in the basis set.
Previously, the check for whether the operation was native to the target
was done before recursing into the control flow block. This effectively
skipped the conversion that should have happened in the block. To fix
this the control flow operation handling is moved before the basis
check. Later passes (mainly basis translation) will fail if the control
flow operations aren't available on the target and we should always
recursively unroll gates in this pass.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 985b005)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog priority: high stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants