You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rmshaffer
changed the title
Program class generates invalid OpenQASM (subroutine access to input variables)
AutoQASM Program class generates invalid OpenQASM (subroutine access to input variables)
Apr 15, 2024
rmshaffer
transferred this issue from amazon-braket/amazon-braket-sdk-python
May 8, 2024
rmshaffer
changed the title
AutoQASM Program class generates invalid OpenQASM (subroutine access to input variables)
AutoQASM generates OpenQASM which assumes subroutine access to input variables
May 8, 2024
The following code is technically against the OpenQASM spec, as you can only close over global const variables (https://openqasm.com/language/scope.html#subroutine-and-gate-scope)
We may want to choose to interpret this as inputs allowed, since it's ambiguous whether those can change at runtime (be overwritten)
Note that the generated
rx_alpha
subroutine references thealpha
input variable, which is defined only at global scope.The text was updated successfully, but these errors were encountered: