<s>
Quil	B-Device
is	O
a	O
quantum	B-Architecture
instruction	B-General_Concept
set	I-General_Concept
architecture	I-General_Concept
that	O
first	O
introduced	O
a	O
shared	O
quantum/classical	O
memory	B-General_Concept
model	O
.	O
</s>
<s>
It	O
was	O
introduced	O
by	O
Robert	O
Smith	O
,	O
Michael	O
Curtis	O
,	O
and	O
William	O
Zeng	O
in	O
A	O
Practical	O
Quantum	B-Architecture
Instruction	B-General_Concept
Set	I-General_Concept
Architecture	I-General_Concept
.	O
</s>
<s>
Many	O
quantum	B-Device
algorithms	I-Device
(	O
including	O
quantum	B-Architecture
teleportation	O
,	O
quantum	B-Device
error	I-Device
correction	I-Device
,	O
simulation	O
,	O
and	O
optimization	O
algorithms	O
)	O
require	O
a	O
shared	B-Operating_System
memory	I-Operating_System
architecture	I-Operating_System
.	O
</s>
<s>
Quil	B-Device
is	O
being	O
developed	O
for	O
the	O
superconducting	O
quantum	B-Architecture
processors	I-Architecture
developed	O
by	O
Rigetti	O
Computing	O
through	O
the	O
Forest	O
quantum	B-General_Concept
programming	I-General_Concept
API	I-General_Concept
.	O
</s>
<s>
A	O
Python	B-Language
library	O
called	O
pyQuil	O
was	O
introduced	O
to	O
develop	O
Quil	B-Device
programs	O
with	O
higher	O
level	O
constructs	O
.	O
</s>
<s>
A	O
Quil	B-Device
backend	B-Architecture
is	O
also	O
supported	O
by	O
other	O
quantum	B-Architecture
programming	O
environments	O
.	O
</s>
<s>
In	O
the	O
paper	O
presented	O
by	O
Smith	O
,	O
Curtis	O
and	O
Zeng	O
,	O
Quil	B-Device
specifies	O
the	O
instruction	B-General_Concept
set	I-General_Concept
for	O
a	O
Quantum	B-Architecture
Abstract	O
Machine	O
(	O
QAM	O
,	O
)	O
akin	O
to	O
a	O
Turing	O
machine	O
,	O
yet	O
more	O
practical	O
for	O
accomplishing	O
"	O
real-world	O
"	O
tasks	O
.	O
</s>
<s>
The	O
state	O
of	O
the	O
QAM	O
can	O
be	O
represented	O
as	O
a	O
6-tuple	O
where	O
:	O
</s>
<s>
is	O
the	O
(	O
quantum	B-Architecture
)	O
state	O
of	O
a	O
fixed	O
but	O
arbitrary	O
number	O
of	O
qubits	O
indexed	O
using	O
a	O
0-based	O
indexing	O
.	O
</s>
<s>
is	O
a	O
classical	O
memory	B-General_Concept
of	O
a	O
number	O
of	O
classical	O
bits	O
indexed	O
using	O
a	O
0-based	O
indexing	O
.	O
</s>
<s>
a	O
fixed	O
but	O
arbitrary	O
list	O
of	O
static	O
gates	O
(	O
quantum	B-Architecture
gates	O
that	O
do	O
not	O
depend	O
on	O
parameters	O
like	O
the	O
Hadamard	O
gate	O
.	O
)	O
</s>
<s>
a	O
sequence	O
of	O
Quil	B-Device
instructions	O
to	O
be	O
executed	O
,	O
representing	O
the	O
program	O
.	O
</s>
<s>
an	O
integer	O
program	B-General_Concept
counter	I-General_Concept
pointing	O
to	O
the	O
next	B-General_Concept
instruction	I-General_Concept
to	O
be	O
executed	O
.	O
</s>
<s>
The	O
program	B-General_Concept
counter	I-General_Concept
is	O
incremented	O
after	O
every	O
instruction	O
,	O
except	O
for	O
special	O
control	O
flow	O
instructions	O
(	O
conditional	O
and	O
unconditional	O
jumps	B-General_Concept
,	O
and	O
the	O
special	O
HALT	O
instruction	O
that	O
halts	O
the	O
program	O
by	O
setting	O
to	O
.	O
</s>
<s>
The	O
semantics	B-Application
of	O
the	O
QAM	O
are	O
defined	O
using	O
tensor	O
products	O
of	O
Hilbert	O
spaces	O
and	O
the	O
linear	B-Architecture
maps	I-Architecture
between	O
them	O
.	O
</s>
<s>
Quil	B-Device
has	O
support	O
for	O
defining	O
possibly	O
parametrized	O
gates	O
in	O
matrix	O
form	O
(	O
the	O
language	O
does	O
not	O
include	O
a	O
way	O
to	O
verify	O
that	O
the	O
matrices	O
are	O
unitary	B-Algorithm
,	O
which	O
is	O
a	O
necessary	O
condition	O
for	O
the	O
physical	O
realizability	O
of	O
the	O
defined	O
gate	O
)	O
and	O
their	O
application	O
on	O
qubits	O
.	O
</s>
<s>
The	O
language	O
also	O
supports	O
macro-like	O
definitions	O
of	O
possibly	O
parametrized	O
quantum	B-Application
circuits	I-Application
and	O
their	O
expansion	O
,	O
qubit	O
measurement	O
and	O
recording	O
of	O
the	O
outcome	O
in	O
classical	O
memory	B-General_Concept
,	O
synchronization	O
with	O
classical	O
computers	O
with	O
the	O
WAIT	O
instruction	O
which	O
pauses	O
the	O
execution	O
of	O
a	O
Quil	B-Device
program	O
until	O
a	O
classical	O
program	O
has	O
ended	O
its	O
execution	O
,	O
conditional	O
and	O
unconditional	B-General_Concept
branching	I-General_Concept
,	O
pragma	O
support	O
,	O
as	O
well	O
as	O
inclusion	O
of	O
files	O
for	O
use	O
as	O
libraries	B-Library
(	O
a	O
standard	O
set	O
of	O
gates	O
is	O
provided	O
as	O
one	O
of	O
the	O
libraries	B-Library
.	O
)	O
</s>
<s>
Rigetti	O
Computing	O
developed	O
a	O
Quantum	B-Architecture
Virtual	B-Architecture
Machine	I-Architecture
in	O
Common	B-Language
Lisp	I-Language
that	O
simulates	O
the	O
defined	O
Quantum	B-Architecture
Abstract	O
Machine	O
on	O
a	O
classical	O
computer	O
and	O
is	O
capable	O
of	O
the	O
parsing	B-Language
and	O
execution	O
of	O
Quil	B-Device
programs	O
with	O
possibly	O
remote	O
execution	O
via	O
HTTP	O
.	O
</s>
<s>
The	O
following	O
example	O
demonstrates	O
the	O
classical	O
control	O
flow	O
needed	O
to	O
do	O
quantum	B-Architecture
teleportation	O
of	O
the	O
qubit	O
in	O
register	B-General_Concept
2	O
to	O
register	B-General_Concept
1	O
:	O
</s>
<s>
Examples	O
of	O
the	O
implementations	O
of	O
the	O
quantum	B-Algorithm
fourier	I-Algorithm
transform	I-Algorithm
and	O
the	O
variational	O
quantum	B-Architecture
Eigensolver	O
are	O
given	O
in	O
the	O
paper	O
.	O
</s>
