A :py~pyquil.quil.Program
is effectively a list of gates and instructions which can be created using the function documented in this section:
>>> p = Program()
>>> p += H(qubit=0)
>>> p += RY(angle=pi/3, qubit=1)
>>> p += CNOT(0, 1)
...
pyquil.gates
Physical quantum processors can enact a subset of all named gates. Luckily, a small set of gates is universal for quantum computation, so all named gates can be enacted by suitable combinations of physically realizable gates. Rigetti's superconducting quantum processors can perform :pyRX
with angle=+-pi/2
or angle=+-pi
, :pyRZ
with an arbitrary angle, and :pyCZ
interactions between neighboring qubits. Rigetti QPUs can natively measure in the computational (Z) basis.
RX RZ CZ MEASURE
In general, you will write a quantum program using the full suite of Quil gates and instructions and use the Quil compiler <compiler>
to compile programs into the target instruction set (ISA). The full list of quantum gates and classical Quil instructions is enumerated here.
Single-qubit gates
I X Y Z H S T RX RY RZ PHASE
Multi-qubit gates
CZ CNOT CCNOT CPHASE00 CPHASE01 CPHASE10 CPHASE SWAP CSWAP ISWAP PSWAP
Classical instructions
WAIT RESET NOP HALT MEASURE NEG NOT AND OR IOR XOR MOVE EXCHANGE LOAD STORE CONVERT ADD SUB MUL DIV EQ LT LE GT GE
Collections
QUANTUM_GATES STANDARD_INSTRUCTIONS