Closed rmshaffer closed 5 months ago
I would like work on this issue as part of unitary hack.
With my local changes, test test_multi_bind_parameters
(and few others) are failing. But usually this test works fine. qubit
variable declared in this function is not causing any problems. Or is this issue valid only when using simulators?
@atharva-satpute can you share your local changes, for example, by pushing them to a branch or opening a draft PR? A draft PR would be best, since then we can trigger GitHub to run the unit tests and see the error messages.
The simulator is used in the issue description because currently the OpenQASM syntax is only validated by the simulator - there is not currently any syntax validation during the AutoQASM serialization process itself.
@rmshaffer, I have opened a draft PR
@rmshaffer, could you take a look at the comments
Sure - replied to your comment in the PR #28. Feel free to push a new revision to that PR whenever you're ready!
I have added the changes. Let me know if any keywords are missing or if the list needs to be somewhere else. Thanks!
Summary
In AutoQASM programs, Python symbol names which are reserved words in OpenQASM result in syntax errors in the serialized OpenQASM program. For example, a variable named
input
could be transpiled toinput_
to avoid this problem.Repro Steps
To reproduce the bug:
Expected Result
This should build and run the program successfully.
Actual Result
This fails because
input
is a reserved OpenQASM keyword, and so the generated OpenQASM program results in a syntax error.