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
For DEFGATE and DEFCIRCUIT, the order of definitions is irrelevant; if there are multiple top-level definitions the behavior at gate/circuit application is undefined. As discussed elsewhere, this is convenient for the parser, since it does not need to keep positions of definitions and can worry about name resolution after parsing raw quil.
The proposed DEFCAL semantics:
Calibrations can be parameterized and include concrete values, which are resolved in "Haskell-style", with later definitions being prioritized over earlier ones.
This is incompatible with the current machinery.
Here are a few options:
The behavior is undefined when there are multiple DEFCAL with the same name. personally, I think this is too strict.
We adopt the last-to-first convention, but behavior is only well-defined if all DEFCAL are in the same .quil file. This is workable but feels like a hack.
We adopt something like a most-specific-first convention, where calibration definitions are ordered by the number of constant params/args, ordered left-to-right, and the behavior is otherwise ill-specified.
To elaborate on the latter: RX(pi/2) 0
could match (ordered by priority):
For
DEFGATE
andDEFCIRCUIT
, the order of definitions is irrelevant; if there are multiple top-level definitions the behavior at gate/circuit application is undefined. As discussed elsewhere, this is convenient for the parser, since it does not need to keep positions of definitions and can worry about name resolution after parsing raw quil.The proposed
DEFCAL
semantics:This is incompatible with the current machinery.
Here are a few options:
The behavior is undefined when there are multiple
DEFCAL
with the same name. personally, I think this is too strict.We adopt the last-to-first convention, but behavior is only well-defined if all
DEFCAL
are in the same .quil file. This is workable but feels like a hack.We adopt something like a most-specific-first convention, where calibration definitions are ordered by the number of constant params/args, ordered left-to-right, and the behavior is otherwise ill-specified.
To elaborate on the latter:
RX(pi/2) 0
could match (ordered by priority):
regardless of the position of these declarations in the source file.
The text was updated successfully, but these errors were encountered: