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 OpenQASM 3 built-ins with classical conditions #8731

Merged
merged 3 commits into from
Sep 13, 2022

Conversation

jakelishman
Copy link
Member

Summary

The .condition attribute for Instruction instances corresponding to OpenQASM 3 built-ins (such as reset and measure) would previously be ignored. This now correctly nests them inside a a branching statement in the exporter, so the condition is preserved.

Details and comments

Fix #8730.

The `.condition` attribute for `Instruction` instances corresponding to
OpenQASM 3 built-ins (such as `reset` and `measure`) would previously be
ignored.  This now correctly nests them inside a a branching statement
in the exporter, so the condition is preserved.
@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: qasm2 Relating to OpenQASM 2 import or export labels Sep 12, 2022
@jakelishman jakelishman added this to the 0.22 milestone Sep 12, 2022
@jakelishman jakelishman requested a review from a team as a code owner September 12, 2022 20:27
@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

@coveralls
Copy link

coveralls commented Sep 12, 2022

Pull Request Test Coverage Report for Build 3046252536

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

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 89.36%
Totals Coverage Status
Change from base Build 3041852746: -0.004%
Covered Lines: 57878
Relevant Lines: 68643

💛 - Coveralls

@mergify mergify bot merged commit bcec9a3 into Qiskit:main Sep 13, 2022
@jakelishman jakelishman deleted the qasm3/fix-conditional-instruction branch September 21, 2022 22:56
@jakelishman jakelishman added mod: qasm3 Related to OpenQASM 3 import or export and removed mod: qasm2 Relating to OpenQASM 2 import or export labels Jun 15, 2023
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 mod: qasm3 Related to OpenQASM 3 import or export
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditional Measurement is not conditional when exported to OpenQASM 3
4 participants