openqasm
openqasm copied to clipboard
"Rotary pulse" description is unclear/ambiguous
From the section on "Circuit timing", we have the following description.
Instructions other than delay can also have variable duration, if they are explicitly defined as such. They can be called by passing a valid duration as their duration. Consider for example a rotation called rotary that is applied for the entire duration of some other gate.
const amp = /* number */; stretch a; rotary(amp)[250ns] q; // square brackets indicates duration rotary(amp)[a] q; // a rotation that will stretch as needed
However, there is no guide as to how one could "define an instruction to have a variable duration". In a related note, looking at the formal grammar qasm3.g4, it appears that "rotary" is hard coded as a timingInstructionName. This instruction name is discarded in qasm_parser.visitTimingInstruction which returns a DelayInstruction regardless. In a third related note, I find it odd that a DelayInstruction takes arguments.
I agree that this is unclear and ambiguous. It is also unclear how this would be realized in practice with the integrated defcal layer. I would vote to remove this until this is worked more thoroughly with a pressing use-case. Thoughts @levbishop?