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 order of input and gate declarations in QASM 3 exporter #7972

Merged
merged 2 commits into from
Apr 24, 2022

Conversation

jakelishman
Copy link
Member

Summary

The current reference grammar requires that inputs and outputs are
defined before any gate declarations, so previously exported OpenQASM 3
programmes could fail to parse with the reference implementation. It is
likely that the ordering is an arbitrary restriction and can be removed
from the grammar, but for the time being, we ought to match what is
written.

Details and comments

Fix #7964.

The current reference grammar requires that inputs and outputs are
defined before any gate declarations, so previously exported OpenQASM 3
programmes could fail to parse with the reference implementation.  It is
likely that the ordering is an arbitrary restriction and can be removed
from the grammar, but for the time being, we ought to match what is
written.
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog mod: qasm2 Relating to OpenQASM 2 import or export labels Apr 21, 2022
@jakelishman jakelishman added this to the 0.20.2 milestone Apr 21, 2022
@jakelishman jakelishman requested a review from a team as a code owner April 21, 2022 19:31
@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 Apr 21, 2022

Pull Request Test Coverage Report for Build 2216188543

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 84.243%

Totals Coverage Status
Change from base Build 2208196800: 0.0%
Covered Lines: 54072
Relevant Lines: 64186

💛 - Coveralls

@mergify mergify bot merged commit 446af33 into Qiskit:main Apr 24, 2022
mergify bot pushed a commit that referenced this pull request Apr 24, 2022
The current reference grammar requires that inputs and outputs are
defined before any gate declarations, so previously exported OpenQASM 3
programmes could fail to parse with the reference implementation.  It is
likely that the ordering is an arbitrary restriction and can be removed
from the grammar, but for the time being, we ought to match what is
written.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 446af33)
@jakelishman jakelishman deleted the fix/qasm3-input-ordering branch April 24, 2022 19:29
mergify bot added a commit that referenced this pull request Apr 25, 2022
…7984)

The current reference grammar requires that inputs and outputs are
defined before any gate declarations, so previously exported OpenQASM 3
programmes could fail to parse with the reference implementation.  It is
likely that the ordering is an arbitrary restriction and can be removed
from the grammar, but for the time being, we ought to match what is
written.

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

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
@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 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.

qasm3 exporter wrong placement of input declaration
4 participants