Skip to content

Controlled gates (other than RX,RY, RZ) with symbolic parameters don't compile #887

@steve-jeffrey

Description

@steve-jeffrey

Description

Controlled gates (other than RX, RY, RZ) with symbolic parameters will not compile.

Controlled RX, RY, RZ gates with symbolic parameters will compile (see related issue).

How to Reproduce

Either run the example code provided, or:

echo 'DECLARE phi REAL[1];CONTROLLED PHASE(phi) 1 0' | docker run --rm -i rigetti/quilc

and

echo 'DECLARE phi REAL[1];CONTROLLED XY(phi) 2 0 1' | docker run --rm -i rigetti/quilc

Code Snippet

from pyquil import Program, get_qc
from pyquil.gates import RY, XY, PHASE

program = Program()
phi = program.declare("phi", "REAL")
program += RY(phi, 0).controlled(1)  # Works
program += XY(1.23, 0, 1).controlled(2)  # Works
program += PHASE(phi, 0).controlled(1)  # Fails: Condition CL-QUIL::COMPILER-DOES-NOT-APPLY was signalled.
program += XY(phi, 0, 1).controlled(2)  # Fails: Condition CL-QUIL::UNKNOWN-GATE-PARAMETER was signalled.

qc = get_qc("3q-qvm")
native = qc.compiler.quil_to_native_quil(program)

Error Output

Condition CL-QUIL::COMPILER-DOES-NOT-APPLY was signalled

or

Condition CL-QUIL::UNKNOWN-GATE-PARAMETER was signalled

Environment

Quilc version 1.26.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions