<s>
In	O
quantum	O
information	O
theory	O
,	O
a	O
quantum	B-Application
circuit	I-Application
is	O
a	O
model	O
for	O
quantum	B-Architecture
computation	I-Architecture
,	O
similar	O
to	O
classical	O
circuits	O
,	O
in	O
which	O
a	O
computation	O
is	O
a	O
sequence	O
of	O
quantum	B-Application
gates	I-Application
,	O
measurements	O
,	O
initializations	O
of	O
qubits	O
to	O
known	O
values	O
,	O
and	O
possibly	O
other	O
actions	O
.	O
</s>
<s>
The	O
minimum	O
set	O
of	O
actions	O
that	O
a	O
circuit	O
needs	O
to	O
be	O
able	O
to	O
perform	O
on	O
the	O
qubits	O
to	O
enable	O
quantum	B-Architecture
computation	I-Architecture
is	O
known	O
as	O
DiVincenzo	O
's	O
criteria	O
.	O
</s>
<s>
The	O
graphical	O
depiction	O
of	O
quantum	B-Application
circuit	I-Application
elements	O
is	O
described	O
using	O
a	O
variant	O
of	O
the	O
Penrose	O
graphical	O
notation	O
.	O
</s>
<s>
Richard	O
Feynman	O
used	O
an	O
early	O
version	O
of	O
the	O
quantum	B-Application
circuit	I-Application
notation	O
in	O
1986	O
.	O
</s>
<s>
Most	O
elementary	O
logic	O
gates	O
of	O
a	O
classical	O
computer	O
are	O
not	O
reversible	B-Application
.	O
</s>
<s>
However	O
,	O
reversible	B-Application
gates	O
in	O
classical	O
computers	O
are	O
easily	O
constructed	O
for	O
bit	O
strings	O
of	O
any	O
length	O
;	O
moreover	O
,	O
these	O
are	O
actually	O
of	O
practical	O
interest	O
,	O
since	O
irreversible	O
gates	O
must	O
always	O
increase	O
physical	O
entropy	B-Algorithm
.	O
</s>
<s>
A	O
reversible	B-Application
gate	O
is	O
a	O
reversible	B-Application
function	O
on	O
n-bit	O
data	O
that	O
returns	O
n-bit	O
data	O
,	O
where	O
an	O
n-bit	O
data	O
is	O
a	O
string	O
of	O
bits	O
x1	O
,	O
x2	O
,	O
...	O
,	O
xn	O
of	O
length	O
n	O
.	O
The	O
set	O
of	O
n-bit	O
data	O
is	O
the	O
space	O
{0,1}n,	O
which	O
consists	O
of	O
2n	O
strings	O
of	O
0	O
's	O
and	O
1	O
's	O
.	O
</s>
<s>
More	O
precisely	O
:	O
an	O
n-bit	O
reversible	B-Application
gate	O
is	O
a	O
bijective	B-Algorithm
mapping	I-Algorithm
f	O
from	O
the	O
set	O
{0,1}n	O
of	O
n-bit	O
data	O
onto	O
itself	O
.	O
</s>
<s>
An	O
example	O
of	O
such	O
a	O
reversible	B-Application
gate	O
f	O
is	O
a	O
mapping	O
that	O
applies	O
a	O
fixed	O
permutation	O
to	O
its	O
inputs	O
.	O
</s>
<s>
The	O
quantum	O
logic	O
gates	O
are	O
reversible	B-Application
unitary	B-Algorithm
transformations	I-Algorithm
on	O
at	O
least	O
one	O
qubit	O
.	O
</s>
<s>
To	O
define	O
quantum	B-Application
gates	I-Application
,	O
we	O
first	O
need	O
to	O
specify	O
the	O
quantum	O
replacement	O
of	O
an	O
n-bit	O
datum	O
.	O
</s>
<s>
means	O
the	O
function	O
is	O
a	O
square-integrable	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
Quantum	O
logic	O
gates	O
,	O
in	O
contrast	O
to	O
classical	O
logic	O
gates	O
,	O
are	O
always	O
reversible	B-Application
.	O
</s>
<s>
One	O
requires	O
a	O
special	O
kind	O
of	O
reversible	B-Application
function	O
,	O
namely	O
a	O
unitary	B-Algorithm
mapping	I-Algorithm
,	O
that	O
is	O
,	O
a	O
linear	O
transformation	O
of	O
a	O
complex	O
inner	O
product	O
space	O
that	O
preserves	O
the	O
Hermitian	O
inner	O
product	O
.	O
</s>
<s>
An	O
n-qubit	O
(	O
reversible	B-Application
)	O
quantum	B-Application
gate	I-Application
is	O
a	O
unitary	B-Algorithm
mapping	I-Algorithm
U	O
from	O
the	O
space	O
HQB(n )	O
of	O
n-qubit	O
registers	O
onto	O
itself	O
.	O
</s>
<s>
A	O
reversible	B-Application
n-bit	O
classical	O
logic	O
gate	O
gives	O
rise	O
to	O
a	O
reversible	B-Application
n-bit	O
quantum	B-Application
gate	I-Application
as	O
follows	O
:	O
to	O
each	O
reversible	B-Application
n-bit	O
logic	O
gate	O
f	O
corresponds	O
a	O
quantum	B-Application
gate	I-Application
Wf	O
defined	O
as	O
follows	O
:	O
</s>
<s>
However	O
,	O
the	O
Hilbert-space	O
structure	O
of	O
the	O
qubits	O
permits	O
many	O
quantum	B-Application
gates	I-Application
that	O
are	O
not	O
induced	O
by	O
classical	O
ones	O
.	O
</s>
<s>
Again	O
,	O
we	O
consider	O
first	O
reversible	B-Application
classical	O
computation	O
.	O
</s>
<s>
Conceptually	O
,	O
there	O
is	O
no	O
difference	O
between	O
a	O
reversible	B-Application
n-bit	O
circuit	O
and	O
a	O
reversible	B-Application
n-bit	O
logic	O
gate	O
:	O
either	O
one	O
is	O
just	O
an	O
invertible	O
function	O
on	O
the	O
space	O
of	O
n	O
bit	O
data	O
.	O
</s>
<s>
However	O
,	O
as	O
mentioned	O
in	O
the	O
previous	O
section	O
,	O
for	O
engineering	O
reasons	O
we	O
would	O
like	O
to	O
have	O
a	O
small	O
number	O
of	O
simple	O
reversible	B-Application
gates	O
,	O
that	O
can	O
be	O
put	O
together	O
to	O
assemble	O
any	O
reversible	B-Application
circuit	I-Application
.	O
</s>
<s>
To	O
explain	O
this	O
assembly	O
process	O
,	O
suppose	O
we	O
have	O
a	O
reversible	B-Application
n-bit	O
gate	O
f	O
and	O
a	O
reversible	B-Application
m-bit	O
gate	O
g	O
.	O
Putting	O
them	O
together	O
means	O
producing	O
a	O
new	O
circuit	O
by	O
connecting	O
some	O
set	O
of	O
k	O
outputs	O
of	O
f	O
to	O
some	O
set	O
of	O
k	O
inputs	O
of	O
g	O
as	O
in	O
the	O
figure	O
below	O
.	O
</s>
<s>
The	O
resulting	O
circuit	O
is	O
also	O
reversible	B-Application
and	O
operates	O
on	O
n+mk	O
bits	O
.	O
</s>
<s>
In	O
composing	O
these	O
reversible	B-Application
machines	O
,	O
it	O
is	O
important	O
to	O
ensure	O
that	O
the	O
intermediate	O
machines	O
are	O
also	O
reversible	B-Application
.	O
</s>
<s>
This	O
condition	O
assures	O
that	O
intermediate	O
"	O
garbage	O
"	O
is	O
not	O
created	O
(	O
the	O
net	O
physical	O
effect	O
would	O
be	O
to	O
increase	O
entropy	B-Algorithm
,	O
which	O
is	O
one	O
of	O
the	O
motivations	O
for	O
going	O
through	O
this	O
exercise	O
)	O
.	O
</s>
<s>
Since	O
quantum	B-Architecture
computations	I-Architecture
are	O
reversible	B-Application
,	O
at	O
each	O
'	O
step	O
 '	O
the	O
number	O
of	O
lines	O
must	O
be	O
the	O
same	O
number	O
of	O
input	O
lines	O
.	O
</s>
<s>
This	O
means	O
that	O
each	O
intermediate	O
combination	O
in	O
a	O
quantum	B-Application
circuit	I-Application
is	O
a	O
bijective	B-Algorithm
function	I-Algorithm
of	O
the	O
input	O
.	O
</s>
<s>
Now	O
it	O
is	O
possible	O
to	O
show	O
that	O
the	O
Toffoli	O
gate	O
is	O
a	O
universal	B-Application
gate	I-Application
.	O
</s>
<s>
No	O
"	O
rubbish	O
"	O
is	O
ever	O
produced	O
,	O
and	O
so	O
this	O
computation	O
is	O
indeed	O
one	O
that	O
,	O
in	O
a	O
physical	O
sense	O
,	O
generates	O
no	O
entropy	B-Algorithm
.	O
</s>
<s>
More	O
generally	O
,	O
any	O
function	O
f	O
(	O
bijective	B-Algorithm
or	O
not	O
)	O
can	O
be	O
simulated	O
by	O
a	O
circuit	O
of	O
Toffoli	O
gates	O
.	O
</s>
<s>
For	O
quantum	B-Application
circuits	I-Application
a	O
similar	O
composition	O
of	O
qubit	O
gates	O
can	O
be	O
defined	O
.	O
</s>
<s>
That	O
is	O
,	O
associated	O
to	O
any	O
classical	O
assemblage	O
as	O
above	O
,	O
we	O
can	O
produce	O
a	O
reversible	B-Application
quantum	B-Application
circuit	I-Application
when	O
in	O
place	O
of	O
f	O
we	O
have	O
an	O
n-qubit	O
gate	O
U	O
and	O
in	O
place	O
of	O
g	O
we	O
have	O
an	O
m-qubit	O
gate	O
W	O
.	O
See	O
illustration	O
below	O
:	O
</s>
<s>
The	O
fact	O
that	O
connecting	O
gates	O
this	O
way	O
gives	O
rise	O
to	O
a	O
unitary	B-Algorithm
mapping	I-Algorithm
on	O
n+mk	O
qubit	O
space	O
is	O
easy	O
to	O
check	O
.	O
</s>
<s>
In	O
a	O
real	O
quantum	B-Architecture
computer	I-Architecture
the	O
physical	O
connection	O
between	O
the	O
gates	O
is	O
a	O
major	O
engineering	O
challenge	O
,	O
since	O
it	O
is	O
one	O
of	O
the	O
places	O
where	O
decoherence	O
may	O
occur	O
.	O
</s>
<s>
However	O
,	O
the	O
universality	O
theorem	O
for	O
the	O
quantum	O
case	O
is	O
somewhat	O
weaker	O
than	O
the	O
one	O
for	O
the	O
classical	O
case	O
;	O
it	O
asserts	O
only	O
that	O
any	O
reversible	B-Application
n-qubit	O
circuit	O
can	O
be	O
approximated	O
arbitrarily	O
well	O
by	O
circuits	O
assembled	O
from	O
these	O
two	O
elementary	O
gates	O
.	O
</s>
<s>
So	O
far	O
we	O
have	O
not	O
shown	O
how	O
quantum	B-Application
circuits	I-Application
are	O
used	O
to	O
perform	O
computations	O
.	O
</s>
<s>
being	O
a	O
prime	O
example	O
)	O
,	O
one	O
might	O
expect	O
that	O
some	O
quantum	B-Application
circuit	I-Application
could	O
be	O
designed	O
to	O
carry	O
out	O
the	O
transformation	O
U	O
.	O
</s>
<s>
This	O
does	O
not	O
prevent	O
quantum	B-Application
circuits	I-Application
for	O
the	O
discrete	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
from	O
being	O
used	O
as	O
intermediate	O
steps	O
in	O
other	O
quantum	B-Application
circuits	I-Application
,	O
but	O
the	O
use	O
is	O
more	O
subtle	O
.	O
</s>
<s>
In	O
fact	O
quantum	B-Architecture
computations	I-Architecture
are	O
probabilistic	O
.	O
</s>
