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

Allow circuits w/ control flow in O2 and O3 #10372

Merged
merged 8 commits into from
Jul 21, 2023

Conversation

kevinhartman
Copy link
Contributor

@kevinhartman kevinhartman commented Jul 3, 2023

Summary

Remove guards to restrict circuits with control flow from being transpiled at optimization levels 2 and 3.

Details and comments

Depends on:

Resolves #9431
Resolves #9432

@kevinhartman kevinhartman requested a review from a team as a code owner July 3, 2023 03:22
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@jakelishman jakelishman added this to the 0.25.0 milestone Jul 3, 2023
@jakelishman jakelishman added the Changelog: New Feature Include in the "Added" section of the changelog label Jul 3, 2023
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

Just a quick inline comment, I also think we should have some expansion of the test coverage here, places like: https://github.com/Qiskit/qiskit-terra/blob/main/test/python/compiler/test_transpiler.py#L1762, https://github.com/Qiskit/qiskit-terra/blob/main/test/python/compiler/test_transpiler.py#L1784, https://github.com/Qiskit/qiskit-terra/blob/main/test/python/compiler/test_transpiler.py#L1821, and https://github.com/Qiskit/qiskit-terra/blob/main/test/python/compiler/test_transpiler.py#L1531 would be simple enough to update the ddt decorator. But there are probably a few other control flow tests we should parameterize on multiple optimization levels with this PR.

mtreinish
mtreinish previously approved these changes Jul 20, 2023
@mtreinish mtreinish enabled auto-merge July 20, 2023 21:29
@jakelishman jakelishman linked an issue Jul 20, 2023 that may be closed by this pull request
10 tasks
mtreinish
mtreinish previously approved these changes Jul 20, 2023
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix

@coveralls
Copy link

coveralls commented Jul 20, 2023

Pull Request Test Coverage Report for Build 5621665928

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 20 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.02%) to 85.902%

Files with Coverage Reduction New Missed Lines %
qiskit/extensions/unitary.py 1 93.75%
crates/qasm2/src/lex.rs 3 91.9%
qiskit/transpiler/preset_passmanagers/common.py 4 89.47%
crates/qasm2/src/parse.rs 12 96.65%
Totals Coverage Status
Change from base Build 5616952279: -0.02%
Covered Lines: 72864
Relevant Lines: 84822

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Jul 20, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 21, 2023
@jakelishman jakelishman added this pull request to the merge queue Jul 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 21, 2023
In CI we're seeing a reliable failure on windows when scipy is calling
LAPACK. This appears to be unrelated to the change in this PR branch and
is isolated to specific windows environments. This commit adds a skip
condition to skip that one test to workaround the failure in CI. The
wider issue with scipy compatibility on windows is being tracked in
issue Qiskit#10345, when we have a conclusion to that and can reliably run
this test we should remove this skip condition.
@mtreinish mtreinish enabled auto-merge July 21, 2023 11:09
@mtreinish mtreinish added this pull request to the merge queue Jul 21, 2023
Merged via the queue into Qiskit:main with commit 4737e87 Jul 21, 2023
to24toro pushed a commit to to24toro/qiskit-terra that referenced this pull request Aug 3, 2023
* Allow control flow in opt levels 2 and 3.

* Add release note.

* Enable testing for opt 2 and 3.

* Remove guard on translation_method='synthesis'.

* Fix test for synthesis guard.

* Skip o3 qpy full path transpile test on windows

In CI we're seeing a reliable failure on windows when scipy is calling
LAPACK. This appears to be unrelated to the change in this PR branch and
is isolated to specific windows environments. This commit adds a skip
condition to skip that one test to workaround the failure in CI. The
wider issue with scipy compatibility on windows is being tracked in
issue Qiskit#10345, when we have a conclusion to that and can reliably run
this test we should remove this skip condition.

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog priority: high
Projects
None yet
6 participants