Quil is a
quantum
instruction set architecture that first introduced a shared quantum/classical memory model. It was introduced by Robert Smith, Michael Curtis, and William Zeng in A Practical Quantum Instruction Set Architecture.
[1] Many
quantum algorithms (including
quantum teleportation,
quantum error correction, simulation,
[2]
[3] and optimization algorithms
[4]) require a
shared memory architecture. Quil is being developed for the superconducting quantum processors developed by
Rigetti Computing through the Forest
quantum programming API.
[5]
[6] A
Python library called pyQuil
was introduced to develop Quil programs with higher level constructs. A Quil
backend is also supported by other quantum programming environments.
[7]
[8]
In the paper presented by Smith, Curtis and Zeng, Quil specifies the instruction set for a Quantum Abstract Machine (QAM,) akin to a Turing machine, yet more practical for accomplishing "real-world" tasks. [1] The state of the QAM can be represented as a 6- tuple where:
HALT
instruction that halts the program by setting to .The semantics of the QAM are defined using tensor products of Hilbert spaces and the linear maps between them. [1]
Quil has support for defining possibly parametrized gates in matrix form (the language does not include a way to verify that the matrices are
unitary, which is a necessary condition for the physical realizability of the defined gate) and their application on qubits. The language also supports
macro-like definitions of possibly parametrized
quantum circuits and their expansion, qubit
measurement and recording of the outcome in classical memory, synchronization with classical computers with the WAIT
instruction which pauses the execution of a Quil program until a classical program has ended its execution, conditional and unconditional
branching,
pragma support, as well as inclusion of files for use as
libraries (a standard set of gates is provided as one of the libraries.)
Rigetti Computing developed a quantum virtual machine in Common Lisp that simulates the defined Quantum Abstract Machine on a classical computer and is capable of the parsing and execution of Quil programs with possibly remote execution via HTTP. [9]
The following example demonstrates the classical control flow needed to do quantum teleportation of the qubit in register 2 to register 1: [10] [11]
# Declare classical memory
DECLARE ro BIT2
# Create Bell Pair
H 0
CNOT 0 1
# Teleport
CNOT 2 0
H 2
MEASURE 2 ro0
MEASURE 0 ro1
# Classically communicate measurements
JUMP-UNLESS @SKIP ro1
X 1
LABEL @SKIP
JUMP-UNLESS @END ro0
Z 1
LABEL @END
Examples of the implementations of the quantum fourier transform and the variational quantum Eigensolver are given in the paper.
Quil is a
quantum
instruction set architecture that first introduced a shared quantum/classical memory model. It was introduced by Robert Smith, Michael Curtis, and William Zeng in A Practical Quantum Instruction Set Architecture.
[1] Many
quantum algorithms (including
quantum teleportation,
quantum error correction, simulation,
[2]
[3] and optimization algorithms
[4]) require a
shared memory architecture. Quil is being developed for the superconducting quantum processors developed by
Rigetti Computing through the Forest
quantum programming API.
[5]
[6] A
Python library called pyQuil
was introduced to develop Quil programs with higher level constructs. A Quil
backend is also supported by other quantum programming environments.
[7]
[8]
In the paper presented by Smith, Curtis and Zeng, Quil specifies the instruction set for a Quantum Abstract Machine (QAM,) akin to a Turing machine, yet more practical for accomplishing "real-world" tasks. [1] The state of the QAM can be represented as a 6- tuple where:
HALT
instruction that halts the program by setting to .The semantics of the QAM are defined using tensor products of Hilbert spaces and the linear maps between them. [1]
Quil has support for defining possibly parametrized gates in matrix form (the language does not include a way to verify that the matrices are
unitary, which is a necessary condition for the physical realizability of the defined gate) and their application on qubits. The language also supports
macro-like definitions of possibly parametrized
quantum circuits and their expansion, qubit
measurement and recording of the outcome in classical memory, synchronization with classical computers with the WAIT
instruction which pauses the execution of a Quil program until a classical program has ended its execution, conditional and unconditional
branching,
pragma support, as well as inclusion of files for use as
libraries (a standard set of gates is provided as one of the libraries.)
Rigetti Computing developed a quantum virtual machine in Common Lisp that simulates the defined Quantum Abstract Machine on a classical computer and is capable of the parsing and execution of Quil programs with possibly remote execution via HTTP. [9]
The following example demonstrates the classical control flow needed to do quantum teleportation of the qubit in register 2 to register 1: [10] [11]
# Declare classical memory
DECLARE ro BIT2
# Create Bell Pair
H 0
CNOT 0 1
# Teleport
CNOT 2 0
H 2
MEASURE 2 ro0
MEASURE 0 ro1
# Classically communicate measurements
JUMP-UNLESS @SKIP ro1
X 1
LABEL @SKIP
JUMP-UNLESS @END ro0
Z 1
LABEL @END
Examples of the implementations of the quantum fourier transform and the variational quantum Eigensolver are given in the paper.