Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Quilt RFC #45

Open
12 tasks
kalzoo opened this issue Oct 15, 2020 · 2 comments
Open
12 tasks

Improve Quilt RFC #45

kalzoo opened this issue Oct 15, 2020 · 2 comments

Comments

@kalzoo
Copy link
Contributor

kalzoo commented Oct 15, 2020

Related to rigetti/pyquil#1257, which will by default serve as the reference implementation of Quilt.

Mismatches between RFC and implemented grammar:

  • OpModifier used in place of GateModifier: CalibrationDefinition :: DEFCAL OpModifier* Name ( Parameter+ ) Qubit+ : Instruction+
  • SetPhase :: SET-PHASE Frame Float should be SetPhase :: SET-PHASE Frame Expression to match grammar
  • The inline spec for DEFCAL MEASURE shows a Name: MeasureCalibrationDefinition :: DEFCAL Name Qubit? Parameter : Instruction+, but the example doesn't match that spec: DEFCAL MEASURE 0 %dest:, and the implemented grammar is defMeasCalibration : DEFCAL MEASURE qubitOrFormal ( name )? COLON ( NEWLINE TAB instr )* ; which disagrees with both (example shows a variable not name)

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 required expression could match as an identifier. Is that worth reconsideration?
  • DEFCIRCUIT includes CircuitGates within its instruction block, which is the version of Gate with variable qubits. DELAY and FENCE, though, just allow variable qubits in the base instruction instead of a distinct CircuitDelay or CalibrationDelay. Is it worth reconsideration of CircuitGate to collapse it with Gate for consistency?
@braised-babbage
Copy link
Contributor

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

@kalzoo
Copy link
Contributor Author

kalzoo commented Oct 16, 2020

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)? ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants