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:
- [ ]
OpModifierused in place ofGateModifier:CalibrationDefinition :: DEFCAL OpModifier* Name ( Parameter+ ) Qubit+ : Instruction+ - [ ]
SetPhase :: SET-PHASE Frame Floatshould beSetPhase :: SET-PHASE Frame Expressionto match grammar - [ ] The inline spec for
DEFCAL MEASUREshows 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 avariablenotname)
Doc Improvements & Bugfixes:
- [ ] No
DEFFRAMEexample - [ ] Raw-capture example uses
CAPTUREkeyword: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-FREQUENCYmissing in spec but present in grammar - [ ]
LTinstruction in example not described in spec (here or in main spec):LT %dest iq[0] 0.5 # thresholding
Spec improvements:
- [ ]
DELAYgrammar is the only item which requires left recursion, because the requiredexpressioncould match as anidentifier. Is that worth reconsideration? - [ ]
DEFCIRCUITincludesCircuitGates within its instruction block, which is the version ofGatewith variable qubits.DELAYandFENCE, though, just allow variable qubits in the base instruction instead of a distinctCircuitDelayorCalibrationDelay. Is it worth reconsideration ofCircuitGateto collapse it withGatefor 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)? ;