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

Documentation around DELAY feels unclear #47

Open
notmgsk opened this issue Oct 30, 2020 · 1 comment
Open

Documentation around DELAY feels unclear #47

notmgsk opened this issue Oct 30, 2020 · 1 comment
Assignees

Comments

@notmgsk
Copy link
Member

notmgsk commented Oct 30, 2020

The proposal says

A DELAY instruction is equivalent to a NONBLOCKING no-operation on all specified frames. For example, DELAY 0 "xy" 1.0 delays frame 0 "xy" by one second.

If the DELAY instruction presents a list of qubits with no frame names, all frames on exactly these qubits are delayed. Thus DELAY 0 1.0 delays all one qubit frames on qubit 0, but does not affect 0 1 "cz".

The pyquil docstring for DELAY says

def DELAY(*args) -> Union[DelayFrames, DelayQubits]:
    """
    Produce a DELAY instruction.

    Note: There are two variants of DELAY. One applies to specific frames on some
    qubit, e.g. `DELAY 0 "rf" "ff" 1.0` delays the `"rf"` and `"ff"` frames on 0.
    It is also possible to delay all frames on some qubits, e.g. `DELAY 0 1 2 1.0`.

    :param args: A list of delay targets, ending with a duration.
    :returns: A DelayFrames or DelayQubits instance.
    """

The proposal definition seems to not exclude the following which delays specific frames on a number of qubits: DELAY q1 q2 ... qN f1 f2 ... fM <delay>. The second definition however does exclude that.

Questions:

  • Is it correct that the example above should be an error.
  • If yes -- why? Seems like an odd use case to exclude, so I wonder if there is a reason that is not obvious to me?
@braised-babbage
Copy link
Contributor

The PyQuil docstring is a typo, it should be possible to delay a frame which is on multiple qubits. The PyQuil DelayFrames instruction allows for this too.

At the language level I think there are two main motives:

  • The basic objects on which delays are applied are frames, but the syntactic question is whether we force people to write out all delayed frames individually or to allow for more abbreviated syntax. The DELAY q1 ... qN f1 ... fM <time> syntax was just a lightweight abbreviation
  • Sometimes users may need to delay on some qubits without knowing precisely what frames are on those. This is why we allow the DELAY q1 ... qN <time> syntax.

In PyQuil the two separate varieties are represented by two separate instruction classes.

@stylewarning stylewarning added 2024.1 Changes for the 2024.1 specification. and removed 2024.1 Changes for the 2024.1 specification. labels Feb 15, 2024
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

4 participants