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

DEFCIRCUIT cannot parse a definition on fixed qubits #1744

Open
2 tasks done
mhodson-rigetti opened this issue Feb 26, 2024 · 0 comments
Open
2 tasks done

DEFCIRCUIT cannot parse a definition on fixed qubits #1744

mhodson-rigetti opened this issue Feb 26, 2024 · 0 comments
Labels
bug 🐛 An issue that needs fixing.

Comments

@mhodson-rigetti
Copy link
Contributor

Pre-Report Checklist

  • I am running the latest versions of pyQuil and the Forest SDK
  • I checked to make sure that this bug has not already been reported

Issue Description

The following pyquil program parses OK:

DEFCIRCUIT SX_CYCLE:
    RX(pi/2) 1
    RX(pi/2) 2
    RX(pi/2) 4
    RX(pi/2) 5

However, the following variant does not parse:

DEFCIRCUIT SX_CYCLE 1 2 4 5:
    RX(pi/2) 1
    RX(pi/2) 2
    RX(pi/2) 4
    RX(pi/2) 5

The error is:

PyProgramError: error while parsing: at line 1, column 1 (COMMAND(DEFCIRCUIT)): failed to parse arguments for DEFCIRCUIT

According to the the Quil spec a DEFCIRCUIT should support numeric qubit identifiers in this context. Labels are supported, but in this instance we're trying to define a circuit that is equivalent to a DEFCAL on specific qubits.

The following version works but would allow use on sites other than (1, 2, 4, 5):

DEFCIRCUIT SX_CYCLE q0 q1 q2 q3:
    RX(pi/2) q0
    RX(pi/2) q1
    RX(pi/2) q2
    RX(pi/2) q3

Environment Context

Operating System: Ubuntu LTS 20.04.3

Python Version (python -V): 3.10.12

Quilc Version (quilc --version): 1.26.0 (docker)

QVM Version (qvm --version): Latest (docker)

PyQuil version: 4.6.2

@mhodson-rigetti mhodson-rigetti added the bug 🐛 An issue that needs fixing. label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue that needs fixing.
Projects
None yet
Development

No branches or pull requests

1 participant