quil
quil copied to clipboard
Improve Quilt RFC
Related to https://github.com/rigetti/pyquil/pull/1257, which will by default serve as the reference implementation of Quilt.
Mismatches between RFC and implemented grammar:
- [ ]
OpModifier
used in place ofGateModifier
:CalibrationDefinition :: DEFCAL OpModifier* Name ( Parameter+ ) Qubit+ : Instruction+
- [ ]
SetPhase :: SET-PHASE Frame Float
should beSetPhase :: SET-PHASE Frame Expression
to match grammar - [ ] The inline spec for
DEFCAL MEASURE
shows aName
:MeasureCalibrationDefinition :: DEFCAL Name Qubit? Parameter : Instruction+
, but the example doesn't match that spec:DEFCAL MEASURE 0 %dest:
, and the implemented grammar isdefMeasCalibration : DEFCAL MEASURE qubitOrFormal ( name )? COLON ( NEWLINE TAB instr )* ;
which disagrees with both (example shows avariable
notname
)
Doc Improvements & Bugfixes:
- [ ] No
DEFFRAME
example - [ ] Raw-capture example uses
CAPTURE
keyword:CAPTURE 0 "out" 200e-6 iqs
- [ ] Example for DEFCAL MEASURE missing
MEASURE
- [ ] Typo:
There is also support for shifted the phase
- [ ] Are all frame attributes optional in a
DEFFRAME
? - [ ] Frame attribute
CENTER-FREQUENCY
missing in spec but present in grammar - [ ]
LT
instruction in example not described in spec (here or in main spec):LT %dest iq[0] 0.5 # thresholding
Spec improvements:
- [ ]
DELAY
grammar is the only item which requires left recursion, because the requiredexpression
could match as anidentifier
. Is that worth reconsideration? - [ ]
DEFCIRCUIT
includesCircuitGate
s within its instruction block, which is the version ofGate
with variable qubits.DELAY
andFENCE
, though, just allow variable qubits in the base instruction instead of a distinctCircuitDelay
orCalibrationDelay
. Is it worth reconsideration ofCircuitGate
to collapse it withGate
for consistency?
Just a comment here -- working on a PR that addresses some of the other points
LT
was afaik not in the original Quil spec, but is part of the "typed memory" extension, and documented here https://github.com/rigetti/quil/blob/master/rfcs/typed-memory.md
Another: an example of CAPTURE 0 "out" flat(1e-6, 2+3i) iq
doesn't name the parameters in the waveform invocation, which the grammar requires:
namedParam : IDENTIFIER COLON expression ;
waveform : waveformName (LPAREN namedParam ( COMMA namedParam )* RPAREN)? ;
This example, which invokes a waveform as part of an expression:
PULSE 0 "xy" flat(duration: 1e-6, iq: 2+3i)*%theta/(2*pi)
# Pulse definition:
pulse : NONBLOCKING? PULSE frame waveform ;
# Waveform definition:
waveform : waveformName (LPAREN namedParam ( COMMA namedParam )* RPAREN)? ;