-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Preliminary support for parsing OpenQASM 3.0 #6797
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
Conversation
dstrain115
commented
Nov 18, 2024
- This adjusts the lexer and parser to handle programs from OpenQASM 3.0.
- This adjusts the lexer and parser to handle programs from OpenQASM 3.0.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6797 +/- ##
=======================================
Coverage 97.85% 97.85%
=======================================
Files 1084 1084
Lines 93680 93715 +35
=======================================
+ Hits 91671 91706 +35
Misses 2009 2009 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@@ -315,13 +322,19 @@ def p_circuit_empty(self, p): | |||
|
|||
def p_new_reg(self, p): | |||
"""new_reg : QREG ID '[' NATURAL_NUMBER ']' ';' | |||
| CREG ID '[' NATURAL_NUMBER ']' ';'""" | |||
name, length = p[2], p[4] | |||
| QUBIT '[' NATURAL_NUMBER ']' ID ';' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OpenQASM 3 seems to allow scalar qubits defined as qubit some_name;
.
Would it be feasible to handle it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added scalar qubits (and bits)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please see the inline question.
Co-authored-by: Pavol Juhas <[email protected]>
* Preliminary support for parsing OpenQASM 3.0 - This adjusts the lexer and parser to handle programs from OpenQASM 3.0. - This also adds the capability for scalar qubits.