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

fix: no percent symbol in variable qubit outputs #293

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

genos
Copy link
Contributor

@genos genos commented Oct 3, 2023

In this pyQuil issue, we saw that the v3 version of pyQuil can't parse DEFCALS with a variable qubit; e.g.

DEFCAL I %q:
	DELAY q 4e-8

would cause pyQuil to crash, complaining about the % symbol. While the spec claims this is a valid way of writing variable qubits for calibrations, the percent symbol prefix is only otherwise used for parameters (e.g. angles for rotational gates), not for qubits themselves. This PR changes how variable qubits are printed, removing the % prefix.

If this change is merged into quil-rs, chances are we probably want to update the spec accordingly as well.

In [this pyQuil issue](rigetti/pyquil#1673),
we saw that the v3 version of pyQuil can't parse `DEFCALS` with a
variable qubit; e.g.

```
DEFCAL I %q:
	DELAY q 4e-8
```

would cause pyQuil to crash, complaining about the `%` symbol. While the
[spec claims](https://quil-lang.github.io/#12-6Defining-Calibrations)
this is a valid way of writing variable qubits for calibrations, the
percent symbol prefix is only otherwise used for parameters (e.g. angles
for rotational gates), not for qubits themselves. This PR changes how
variable qubits are printed, removing the `%` prefix.

If this change is merged into `quil-rs`, chances are we probably want
to update the spec accordingly as well.
@notmgsk
Copy link
Contributor

notmgsk commented Oct 4, 2023

quil-lang/quil#66

Copy link
Contributor

@Shadow53 Shadow53 left a comment

Choose a reason for hiding this comment

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

LGTM. Hopefully the spec is able to be updated soon.

@genos genos merged commit 4807de0 into main Oct 10, 2023
8 checks passed
@genos genos deleted the variable-qubit branch October 10, 2023 22:54
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