Environment information
Any environment
Description
Two aspects of the OpenQASM standard are not respected by the current implementation for custom gates:
- Custom gate definitions cannot access underlying registers, only the qubits that were passed to them. The current implementation assumes this is possible, so dome of the parsing and data dependency logic is incorrect, and assertions can access quantum registers even in custom gate definitions.
- Custom gate definitions should also support angle parameters, which, at the moment, they don't.
Expected behavior
Something like this should not work:
qreg q[3];
gate test t {
assert-ent t, q[0];
}
Something like this should work:
How to Reproduce
Run the two code snippets above in the debugger.
Environment information
Any environment
Description
Two aspects of the OpenQASM standard are not respected by the current implementation for custom gates:
Expected behavior
Something like this should not work:
Something like this should work:
How to Reproduce
Run the two code snippets above in the debugger.