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

Quilt spec improvements #46

Closed
wants to merge 16 commits into from
Closed

Conversation

braised-babbage
Copy link
Contributor

@braised-babbage braised-babbage commented Oct 16, 2020

Starting this as a draft, but this is intended to address #45 + whatever related follow up is appropriate. cc: @stylewarning who may have an interest in these changes.

Aside from typo fixes, there are a few more significant changes.

Clarification around standard vs implementation-specific features

The body of DEFFRAME contains "frame attributes", some of which are sensible to standardize (e.g. every frame has an INITIAL-FREQUENCY), whereas other attributes may be specific to a hardware implementation.

The "template waveforms" may be considered vendor specific. This is because the specific templates available may depend on the Quilt translator (if statically resolving waveforms) or the specifics of lower level control software and hardware. Likewise, even for seemingly standard shapes, like a gaussian, there may be constraints on the template parameters (e.g. perhaps on some hardware these may refer to memory regions, whereas for other hardware they must be constant).

Removal of parametric DEFWAVEFORM and waveform expressions

I'm also suggesting to remove parametric waveform definitions, i.e. DEFWAVEFORM foo(%bar): .... The reason for this is twofold:

  • There was broad consensus in supporting template waveforms with named parameters such as foo(a: 1, b: 2), since these are much easier for a human to reason about. This is slightly at odds with the originally proposed syntax around parametric DEFWAVEFORM, which was intended to mirror that of parametric gates.
  • I don't think parametric waveform definitions are that useful. For those parametric waveforms representing "vectorized" arithmetic, one can easily use frame mutations (e.g. SET-SCALE) or adjust accordingly during readout (e.g. an additive shift there). I don't see practically how someone would do something more complicated than this: certainly they aren't going to write 1000 expressions by hand, and if designing a waveform in MATLAB or numpy they will just end up dumping the samples directly.

For similar reasons, I changed an example in which a waveform was used as part of an algebraic expression representing "vectorized arithmetic" of some sort.

Erik Davis added 8 commits October 15, 2020 14:15
With parametric compilation, we can handle mixed real + parameter
arithmetic in frame mutations. However, if parametric compilation were
not available, then arguments to frame mutations would need to be
immediate/literal real values.
@notmgsk
Copy link
Member

notmgsk commented Oct 20, 2020

RE parametric waveforms: What are the negatives of keeping them? Are they complicated from an implementation perspective? I'm not against holding back a feature because it's not useful, but I wonder if it might end up being a nice-to-have and does it cost us much to implement?

@braised-babbage
Copy link
Contributor Author

braised-babbage commented Oct 21, 2020

RE parametric waveforms: What are the negatives of keeping them? Are they complicated from an implementation perspective? I'm not against holding back a feature because it's not useful, but I wonder if it might end up being a nice-to-have and does it cost us much to implement?

The negatives are just that they aren't currently implemented, the proposed syntax is caught between the Quil circuit style and the Quilt template waveform style, and as far as I can tell there is not a clear case for this feature. I think if we want to include something like this, there needs to be more thought about it. For example, what might even be more useful is to develop the notion of "waveform expressions", e.g. something like

DEFWAVEFORM foo:
    ...

PULSE 0 "rf" (alpha*foo+1)

This was also suggested by the spec, but never made explicit, and would require some clarification around what sort of expressions are allowed and how they are to be evaluated.

What I hoped to do by removing these is not to keep them out of the spec forever, but simply to turn the tables and get some clarity and motivation on these features before standardizing them. I would hope that e.g. Rigetti would be able to experiment with these even before they are made officially part of the standard.

rfcs/analog/spec_changes.md Outdated Show resolved Hide resolved
Some examples of the template waveforms made available by Rigetti include:

```
Waveform :: flat '(' duration: Expression, iq: Expression ')'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this block be examples in quilt rather than in unimplemented grammar?

notmgsk and others added 5 commits November 3, 2020 11:21
* Update proposal.md using pyquil quilt-demo branch changes

* Merge pyquil Quil antlr grammar

* Remove TODO item

* remove duplication
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

Successfully merging this pull request may close these issues.

3 participants