Qasm refactor#295
Draft
Mayank447 wants to merge 5 commits intoqutip:masterfrom
Draft
Conversation
Member
|
Yes I agree there are some qutie complicated logic in qasm.py and many potential bugs. Basically we implemented our own parser for a qasm file. I think there should be a smarter way of doing it. I am surley happy to upgrade to qasm 3.0, also not against completely rewrite it if you find it a better approach. Would be good to keep the support of 2.0 if possible, because some platforms still only supports that. But this is open for discussion. |
Member
Author
|
Cool, I will work on resolving the bugs in openqasm 2. Unfortunately there is no parser for qasm 2 which converts For qasm3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pending
qasm-refactorfrom #290. There arecouplelots of pre-existing error in theqasm_processor.pyfile. Couple of variables are undefined e.g.curr_gate,reg_numand some are unused e.g.prev_token,gate_added(not sure whether some logic is missing or they are simply not needed).@BoxiLi I haven't looked at the conversion logic properly as my first aim was to refactor the 1200 line single
qasm.pyfile. I believe instead of fixing these errors as per OpenQASM 2.0 circuit conversion, we can directly upgrade to OpenQASM 3.0 (in accordance with #292) in this or another PR. Since OpenQASM 3.0 supports a lot of new features like loops, extern etc. the conversion logic would change anyways.