{{ArticleInfo |
title = Basic concepts in quantum computation |
author = [[Artur Ekert]], [[Patrick Hayden]], [[Hitoshi Inamori]] |
arxiv = quant-ph/0011013 |
journal = lectures given at les Houches Summer School on "Coherent Matter Waves", July-August 1999 |
keywords = basic concepts, quantum computing |
comments = converted to wiki format by [[User:Burgarth|Burgarth]] 22:37, 8 Jun 2005 (BST)
}}
= Qubits, gates and networks =
Consider the two binary strings,
The first one can represent, for example, the number (in binary)
and the second one the number In general three physical bits can
be prepared in different configurations that can
represent, for example, the integers from to However, a
register composed of three classical bits can store only one
number at a given moment of time. Enter qubits and quantum
registers:
A ''qubit'' is a quantum system in which the Boolean states
and are represented by a prescribed pair of normalised and
mutually orthogonal quantum states labeled as [[Basic_concepts_in_quantum_computation#Bibliography|Sch95]]. The two states form a `computational
basis' and any other (pure) state of the qubit can be written as a
superposition for some and such that A qubit is
typically a microscopic system, such as an atom, a nuclear spin, or
a polarised photon. A collection of qubits is called a
''quantum register'' of size .
We shall assume that information is stored in the registers in
binary form. For example, the number is represented by a register
in state . In more
compact notation: stands for the tensor product
, where , and it represents
a quantum register prepared with the value
. There are
states of this kind, representing all binary strings of length
or numbers from to , and they form a convenient
computational basis. In the following ( is a
binary string of length ) implies that belongs to the computational basis.
Thus a quantum register of size three can store individual numbers
such as or ,
but, it can also store the two of them simultaneously. For if we
take the first qubit and instead of setting it to or
we prepare a superposition then we obtain
In fact we can prepare this register in a superposition of all
eight numbers -- it is enough to put each qubit into the
superposition This gives
which can also be written in binary as (ignoring the normalisation
constant ),
or in decimal notation as
or simply as
These preparations, and any other manipulations on qubits, have to
be performed by unitary operations. A ''quantum logic gate'' is
a device which performs a fixed unitary operation on selected
qubits in a fixed period of time and a ''quantum network'' is a
device consisting of quantum logic gates whose computational steps
are synchronised in time [[Basic_concepts_in_quantum_computation#Bibliography|Deu89]]. The outputs of some of the
gates are connected by wires to the inputs of others. The
''size'' of the network is the number of gates it contains.
The most common quantum gate is the Hadamard gate, a single
qubit gate performing the unitary transformation known as the
Hadamard transform. It is defined as
[[Image:../sites/default/files/wiki_images/6/62/Img44.png]]
The matrix is written in the computational basis
and the diagram on
the right provides a schematic representation of the gate
acting on a qubit in state , with .
And here is a network, of size three, which affects the Hadamard
transform on three qubits. If they are initially in state
then the output is the superposition of all eight
numbers from to
[[Image:../sites/default/files/wiki_images/a/a6/Img49.png]]
If the three qubits are initially in some other state from the
computational basis then the result is a superposition of all
numbers from to but exactly half of them will appear in the
superposition with the minus sign, for example,
[[Image:../sites/default/files/wiki_images/7/71/Img50.png]]
In general, if we start with a register of size in some state
then
where the product of and
is taken bit by bit:
We will need another single qubit gate -- the phase shift gate
defined as and , or,
in matrix notation,
[[Image:../sites/default/files/wiki_images/4/4f/Img59.png]]
The Hadamard gate and the phase gate can be combined to construct
the following network (of size four), which generates the most
general pure state of a single qubit (up to a global phase),
[[Image:../sites/default/files/wiki_images/2/27/Img60.png]]
Consequently, the Hadamard and phase gates are sufficient to construct
''any'' unitary operation on a single qubit.
Thus the Hadamard gates and the phase gates can be used to
transform the input state of
the qubit register into any state of the type where
is an arbitrary superposition of
and These are rather special -qubit states, called
the product states or the separable states. In general, a quantum
register of size can be prepared in states which are not
separable -- they are known as entangled states. For example, for
two qubits (), the state
is separable, and , whilst the state
is entangled (), because it cannot be written
as a tensor product.
In order to entangle two (or more qubits) we have to extend our
repertoire of quantum gates to two-qubit gates. The most popular
two-qubit gate is the controlled-NOT (C-NOT), also known
as the XOR or the measurement gate. It flips the second
(target) qubit if the first (control) qubit is and does nothing if the control qubit is . The gate is represented by the unitary matrix
[[Image:../sites/default/files/wiki_images/5/57/Img76.png]]
where and denotes XOR or addition modulo 2. If
we apply the C-NOT to Boolean data in which the target qubit
is
and the control is either or then the effect is to
leave the control unchanged while the target becomes a copy of the control, ''i.e.''
One might suppose that this gate could also be used to copy superpositions
such as so that
for any This is not so! The unitarity of the C-NOT
requires that the gate turns superpositions in the control qubit into
''entanglement'' of the control and the target. If the control qubit is in a
superposition state
\noindent and the target in then the
C-NOT generates the entangled state
Let us notice in passing that it is impossible to construct a
universal quantum cloning machine effecting
the transformation in Eq.(\ref{cloning}), or even the more general
where refers to the state of the rest of the world and is ''any'' quantum state [[Basic_concepts_in_quantum_computation#Bibliography|WZ82]]. To see this take any
two normalised states and which are
non-identical () and non-orthogonal ( ), and run the cloning machine,
As this must be a unitary transformation which preserves the inner
product hence we must require
and this can only be satisfied when
or , which contradicts our assumptions. Thus states of qubits,
unlike states of classical bits, cannot be faithfully cloned. This
leads to interesting applications, quantum cryptography being one
such.
Another common two-qubit gate is the controlled phase shift gate
defined as
[[Image:../sites/default/files/wiki_images/d/d7/Img99.png]]
Again, the matrix is written in the computational basis
and the diagram on the right shows the structure of the gate.
More generally, these various 2-qubit controlled gates are all
of the form controlled-, for some single-qubit unitary
transformation .
The controlled- gate applies the identity transformation to the auxiliary
(lower) qubit when the control qubit is in state
and applies an arbitrary prescribed when the
control qubit is in state . The gate maps
to
and to ,
and is graphically represented as
[[Image:../sites/default/files/wiki_images/4/46/Img106.png]]
The Hadamard gate, all phase gates, and the C-NOT, form an
infinite ''universal set of gates''
''i.e.'' if the C-NOT gate as well as the
Hadamard and all phase gates are available then any -qubit
unitary operation can be simulated exactly with such
gates [[Basic_concepts_in_quantum_computation#Bibliography|BBC95]]. (Here and in the following we use the asymptotic
notation -- means bounded above by for some
constant for sufficiently large .) This is not the only
universal set of gates. In fact, almost any gate which can entangle
two qubits can be used as a universal gate [[Basic_concepts_in_quantum_computation#Bibliography|BDEJ95,Llo95]].
Mathematically, an elegant choice is a pair of the Hadamard and the
controlled- (C-) where is described by the unitary matrix
[[Image:../sites/default/files/wiki_images/8/80/Img112.png]]
:
:
The two gates form a finite universal set of gates --
networks containing only a finite number of these gates can
approximate any unitary transformation on two
(and more) qubits. More precisely, if is any two-qubit gate and
then there exists a quantum network of size
(where is a constant) consisting
of only and C- gates which computes a unitary operation
that is within distance from
[[Basic_concepts_in_quantum_computation#Bibliography|Sol99]]. The metric is induced by the Euclidean norm
- we say that is within distance
from if there exists a unit complex number (phase
factor) such that .
Thus if is substituted for in a quantum network
then the final state approximates the final state of the original
network as follows: .
The probability of any specified measurement outcome on the final
state is affected by at most .
A ''quantum computer'' will be viewed here as a quantum network
(or a family of quantum networks)and quantum computation is defined
as a unitary evolution of the network which takes its initial state
"input" into some final state "output". We have chosen the
network model of computation, rather than Turing machines, because
it is relatively simple and easy to work with and because it is
much more relevant when it comes to physical implementation of
quantum computation.
= Quantum arithmetic and function evaluations =
Let us now describe how quantum computers actually compute, how
they add and multiply numbers, and how they evaluate Boolean
functions by means of unitary operations. Here and in the following
we will often use the modular arithmetic [[Basic_concepts_in_quantum_computation#Bibliography|HW79]]. Recall that
denotes the remainder obtained by dividing integer into integer
, which is always a number less than . Basically
if for some integer . This is expressed by saying that
is ''congruent'' to modulo or that is the ''residue'' of modulo . For example, . Modular arithmetic is commutative, associative, and
distributive.
Thus, if you need to calculate, say, do not use the
naive approach and perform seven multiplications and one huge
modular reduction. Instead, perform three smaller multiplications
and three smaller reductions,
This kind of arithmetic is ideal for computers as it restricts the
range of all intermediate results. For -bit modulus , the
intermediate results of any addition, subtraction or multiplication
will not be more than bits long. In quantum registers of size
, addition modulo is one of the most common operations; for
all and for any ,
is a well defined unitary transformation.
The tricky bit in the modular arithmetic is the inverse operation,
and here we need some basic number theory. An integer is
said to be ''prime'' if it is divisible only by 1 and (we
consider only positive divisors). Otherwise, is called
''composite''. The greatest common divisor of two integers
and is the greatest positive integer denoted
that divides both and . Two integers and are said to
be ''coprime'' or ''relatively prime'' if .
Given two integers and that are coprime, it can be shown
that there exists an unique integer such
that [[Basic_concepts_in_quantum_computation#Bibliography|HW79]]. The integer is called
''inverse modulo '' of , and denoted . For
example, modulo we find that , since . This bizarre arithmetic
and the notation is due to Karl Friedrich Gauss (1777-1855). It was
first introduced in his ''Disquistiones Arithmeticae'' in
1801.
In quantum computers addition, multiplication, and any other
arithmetic operation have to be embedded in unitary evolution. We
will stick to the Hadamard and the controlled- (C-), and use
them as building blocks for all other gates and eventually for
quantum adders and multipliers.
If we apply C- four times we get identity, so any three
subsequent applications of C- give the inverse of
C-, which
will be called C-. Now, if we have a couple of the
C- gates and a couple of the Hadamard gates we can build the
C-NOT as follows
[[Image:../sites/default/files/wiki_images/c/c4/Img151.png]]
:
:
:
:
A single qubit operation NOT can be performed via a
C-NOT gate if
the control qubit is set to and viewed as an auxiliary
qubit. This is not to say that we want to do it in practice. The
C-NOT gate is much more difficult to build than a single qubit NOT.
Right now we are looking into the mathematical structure of quantum
Boolean networks and do not care about practicalities. Our two
elementary gates also allow us to construct a very useful gate called
the controlled-controlled-NOT gate (-NOT)
or the Toffoli
gate [[Basic_concepts_in_quantum_computation#Bibliography|Tof81]]. The construction is given by the following
network,
[[Image:../sites/default/files/wiki_images/7/75/Toffoli.PNG]]
[[Image:../sites/default/files/wiki_images/3/3c/Img153.png]]
This gate has two control qubits (the top two wires on the diagram)
and one target qubit which is negated only when the two controls
are in the state . The -NOT gate gives
us the logical connectives we need for arithmetic. If the target is
initially set to the gate acts as a reversible AND
gate - after the gate operation the target becomes the logical AND
of the two control qubits.
Once we have in our repertoire operations such as NOT,
AND, and
C-NOT, all of them implemented as unitary operations, we can, at
least in principle, evaluate any Boolean function
which map bits of input
into bits of output. A simple concatenation of the Toffoli gate
and the C-NOT gives a simplified quantum adder, shown below, which
is a good starting point for constructing full adders, multipliers
and more elaborate networks.
[[Image:../sites/default/files/wiki_images/a/ab/Img161.png]]
We can view the Toffoli gate and the evolution given by
Eq.~(\ref{andgate}) as a quantum implementation of a Boolean
function defined by
.
The operation
AND is not reversible, so we had to embed it in the reversible
operation -NOT. If the third bit is initially set to
rather than then the value of is negated. In
general we write the action of the Toffoli gate as the function
evaluation,
This is how we compute any Boolean function
on a quantum computer. We
require at least two quantum registers; the first one, of size ,
to store the arguments of and the second one, of size , to
store the values of . The function evaluation is then a unitary
evolution of the two registers,
for any . (In the following, if there is no danger of
confusion, we may simplify the notation and omit the
suffix.)
For example, a network computing such that acts as follows
which can be written as
''e.g.'' which explains why .
In fact, for these kind of operations we also need a third register
with the so-called working bits which are set to zero at the input
and return to zero at the output but which can take non-zero values
during the computation.
What makes quantum function evaluation really interesting is its
action on a superposition of different inputs , for example,
produces for all in a single run. The snag is that we
cannot get them all from the entangled state
because any bit by bit measurement on the
first register will yield one particular value
and the second register will then be found
with the value .
= Algorithms and their complexity =
In order to solve a particular problem, computers, be it classical
or quantum, follow a precise set of instructions that can be
mechanically applied to yield the solution to any given instance of
the problem. A specification of this set of instructions is called
an algorithm. Examples of algorithms are the procedures taught in
elementary schools for adding and multiplying whole numbers; when
these procedures are mechanically applied, they always yield the
correct result for any pair of whole numbers. Any algorithm can be
represented by a family of Boolean networks ,
where the network acts on all possible input instances of
size bits. Any useful algorithm should have such a family
specified by an example network and ''a simple rule''
explaining how to construct the network from the network
. These are called ''uniform'' families of
networks [[Basic_concepts_in_quantum_computation#Bibliography|Pap94]].\footnote{This means that the network model
is not a self-contained model of computation. We need an algorithm,
a Turing machine, which maps each into an explicit description
of .}
The quantum Hadamard transform defined by Eq.(\ref{Had}) has a
uniform family of networks whose size is growing as with the
number of input qubits. Another good example of a uniform family of
networks is the quantum Fourier transform (QFT) [[Basic_concepts_in_quantum_computation#Bibliography|Cop94]]
defined in the computational basis as the unitary operation
Suppose we want to ''construct'' such a unitary evolution of
qubits using our repertoire of quantum logic gates. We can start
with a single qubit and notice that in this case the QFT is reduced
to applying a Hadamard gate. Then we can take two qubits and notice
that the QFT can be implemented with two Hadamard gates and the
controlled phase shift in between. Progressing this way we
can construct the three qubit QFT and the four qubit QFT, whose
network looks like this:
[[Image:../sites/default/files/wiki_images/5/50/Img191.png]]
(''N.B.'' there are three different types of
the gate in the network above: ,
and .)
The general case of qubits requires a trivial extension of the
network following the same sequence pattern of gates and
. The QFT network operating on qubits contains
Hadamard gates and phase shifts , in
total elementary gates.
The big issue in designing algorithms or their corresponding families of
networks is the optimal use of physical resources required to solve
a problem. Complexity theory is concerned with the inherent cost of
computation in terms of some designated elementary operations,
memory usage, or network size. An algorithm is said to be fast or
efficient if the number of elementary operations taken to execute
it increases no faster than a polynomial function of the size of
the input. We generally take the input size to be the total number
of bits needed to specify the input (for example, a number
requires bits of binary storage in a computer). In the
language of network complexity - an algorithm is said to be
''efficient'' if it has a uniform and polynomial-size network
family ( for some constant )[[Basic_concepts_in_quantum_computation#Bibliography|Pap94]]. For example,
the quantum Fourier transform can be performed in an efficient way
because it has a uniform family of networks whose size grows only
as a quadratic function of the size of the input,
''i.e.'' .
Changing from one set of gates to another, ''e.g.'' constructing the
QFT out of the Hadamard and the controlled- gates with a
prescribed precision , can only affect the network size
by a multiplicative constant which does not affect the quadratic
scaling with . Thus the complexity of the QFT is no
matter which set of adequate gates we use. Problems which do not
have efficient algorithms are known as hard problems.
Elementary arithmetic operations taught at schools, such as long
addition, multiplication or division of