-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support standalone Var
s in OQ3 exporter
#12308
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 8916639862Details
💛 - Coveralls |
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.
I took a look at the second commit while we wait for #12307 to merge. Overall it looks fine to me, but I'm also not super familiar with the internals of the oq3 exporter so I don't have the most critical eye while looking at this code. I just had some quick questions inline.
This adds the remaining support needed for the OpenQASM 3 exporter to support standalone variables. The way the circuit model handles closures over these variables makes it much easier to support these than it was to handle free-form control-flow operations. This PR somewhat refactors small parts of the exporter to better isolate the "top-level program" statement construction and analysis from the "build a scoped set of instructions" logic, which makes it rather easier to handle things like declaring IO variables only in the global scope, but locally declared variables in _all_ relevant scopes.
* Support standalone `Var`s in OQ3 exporter This adds the remaining support needed for the OpenQASM 3 exporter to support standalone variables. The way the circuit model handles closures over these variables makes it much easier to support these than it was to handle free-form control-flow operations. This PR somewhat refactors small parts of the exporter to better isolate the "top-level program" statement construction and analysis from the "build a scoped set of instructions" logic, which makes it rather easier to handle things like declaring IO variables only in the global scope, but locally declared variables in _all_ relevant scopes. * Remove references to QSS * Clarify comment about forward declarations * Add test for parameter/gate clash resolution
Summary
This adds the remaining support needed for the OpenQASM 3 exporter to support standalone variables. The way the circuit model handles closures over these variables makes it much easier to support these than it was to handle free-form control-flow operations.
This PR somewhat refactors small parts of the exporter to better isolate the "top-level program" statement construction and analysis from the "build a scoped set of instructions" logic, which makes it rather easier to handle things like declaring IO variables only in the global scope, but locally declared variables in all relevant scopes.
Details and comments
Close #10929
Depends on #12307 because of the need to decouple the visualisers more from OQ3.