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

Improve error message on bad OpenQASM 3 basis_gates argument #12945

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

jakelishman
Copy link
Member

Summary

If the user requests a basis-gate name that cannot be used (like a keyword), there is nothing sensible we can output for a circuit that contains one of those operations. The exporter was already correctly erroring in these cases, but the error message was quite opaque.

Details and comments

Fix #12886

If the user requests a basis-gate name that cannot be used (like a
keyword), there is nothing sensible we can output for a circuit that
contains one of those operations.  The exporter was already correctly
erroring in these cases, but the error message was quite opaque.
@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: qasm3 Related to OpenQASM 3 import or export labels Aug 12, 2024
@jakelishman jakelishman added this to the 1.2.0 milestone Aug 12, 2024
@jakelishman jakelishman requested a review from a team as a code owner August 12, 2024 12:24
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10351808315

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 25 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.02%) to 89.732%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.39%
crates/qasm2/src/lex.rs 4 92.73%
qiskit/synthesis/two_qubit/xx_decompose/decomposer.py 6 90.84%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 10339507099: -0.02%
Covered Lines: 67404
Relevant Lines: 75117

💛 - Coveralls

@Cryoris Cryoris self-assigned this Aug 12, 2024
@Cryoris Cryoris added this pull request to the merge queue Aug 12, 2024
@Cryoris
Copy link
Contributor

Cryoris commented Aug 12, 2024

@Mergifyio backport stable/1.2

Copy link
Contributor

mergify bot commented Aug 12, 2024

backport stable/1.2

✅ Backports have been created

Merged via the queue into Qiskit:main with commit fb9c0db Aug 12, 2024
15 checks passed
mergify bot pushed a commit that referenced this pull request Aug 12, 2024
If the user requests a basis-gate name that cannot be used (like a
keyword), there is nothing sensible we can output for a circuit that
contains one of those operations.  The exporter was already correctly
erroring in these cases, but the error message was quite opaque.

(cherry picked from commit fb9c0db)
@jakelishman jakelishman deleted the qasm3/basis-gates-error branch August 12, 2024 15:47
github-merge-queue bot pushed a commit that referenced this pull request Aug 12, 2024
… (#12946)

If the user requests a basis-gate name that cannot be used (like a
keyword), there is nothing sensible we can output for a circuit that
contains one of those operations.  The exporter was already correctly
erroring in these cases, but the error message was quite opaque.

(cherry picked from commit fb9c0db)

Co-authored-by: Jake Lishman <[email protected]>
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 raises an obscure error on invalid basis-gate name
4 participants