P300-Rieffel PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

An Introduction to Quantum Computing for Non-Physicists

ELEANOR RIEFFEL
FX Palo Alto Laboratory
AND
WOLFGANG POLAK

Richard Feynman’s observation that certain quantum mechanical effects cannot be


simulated efficiently on a computer led to speculation that computation in general could
be done more efficiently if it used these quantum effects. This speculation proved
justified when Peter Shor described a polynomial time quantum algorithm for factoring
integers.
In quantum systems, the computational space increases exponentially with the size
of the system, which enables exponential parallelism. This parallelism could lead to
exponentially faster quantum algorithms than possible classically. The catch is that
accessing the results, which requires measurement, proves tricky and requires new
nontraditional programming techniques.
The aim of this paper is to guide computer scientists through the barriers that
separate quantum computing from conventional computing. We introduce basic
principles of quantum mechanics to explain where the power of quantum computers
comes from and why it is difficult to harness. We describe quantum cryptography,
teleportation, and dense coding. Various approaches to exploiting the power of quantum
parallelism are explained. We conclude with a discussion of quantum error correction.

Categories and Subject Descriptors: A.1 [Introductory and Survey]


General Terms: Algorithms, Security, Theory
Additional Key Words and Phrases: Quantum computing, complexity, parallelism

1. INTRODUCTION and as no one was sure how to use the


quantum effects to speed up computation,
Richard Feynman observed in the early the field developed slowly. It wasn’t until
1980s [Feynman 1982] that certain quan- 1994, when Peter Shor surprised the world
tum mechanical effects cannot be simu- by describing a polynomial time quan-
lated efficiently on a classical computer. tum algorithm for factoring integers [Shor
This observation led to speculation that 1994; 1997], that the field of quantum
perhaps computation in general could be computing came into its own. This discov-
done more efficiently if it made use of these ery prompted a flurry of activity among
quantum effects. But building quantum experimentalists trying to build quan-
computers, computational machines that tum computers and theoreticians try-
use such quantum effects, proved tricky, ing to find other quantum algorithms.

Authors’ address: E. Rieffel, FX Palo Alto Laboratory, 3400 Hillview Av., Palo Alto, CA 94304; W. Polak,
Consultant.
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted
without fee provided that copies are not made or distributed for profit or direct commercial advantage and
that copies show this notice on the first page or initial screen of a display along with the full citation.
Copyrights for components of this work owned by others than ACM must be honored. Abstracting with
credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any
component of this work in other works, requires prior specific permission and/or a fee. Permissions may
be requested from Publications Dept, ACM Inc., 1515 Broadway, New York, NY 10036 USA, fax +1 (212)
869-0481, or permissions@acm.org.
°2001
c ACM 0360-0300/01/0900-0000 $5.00

ACM Computing Surveys, Vol. 32, No. 3, September 2000, pp. 300–335.
Introduction to Quantum Computing 301

Additional interest in the subject has been the quantum state so that a common
created by the invention of quantum key property of all of the output values such
distribution and, more recently, popular as the symmetry or period of a function
press accounts of experimental successes can be read off. This technique is used
in quantum teleportation and the demon- in Shor’s factorization algorithm. Another
stration of a 3-bit quantum computer. technique transforms the quantum state
The aim of this paper is to guide com- to increase the likelihood that output of
puter scientists and other nonphysicists interest will be read. Grover’s search algo-
through the conceptual and notational rithm makes use of such an amplification
barriers that separate quantum comput- technique. This paper describes quantum
ing from conventional computing and to parallelism in detail, and the techniques
acquaint them with this new and excit- currently known for harnessing its power.
ing field. It is important for the computer Section 2, following this introduction,
science community to understand these explains of the basic concepts of quan-
new developments since they may radi- tum mechanics that are important for
cally change the way we have to think quantum computation. This section can-
about computation, programming, and not give a comprehensive view of quan-
complexity. tum mechanics. Our aim is to provide the
Classically, the time it takes to do cer- reader with tools in the form of mathemat-
tain computations can be decreased by ics and notation with which to work with
using parallel processors. To achieve an the quantum mechanics involved in quan-
exponential decrease in time requires an tum computation. We hope that this paper
exponential increase in the number of will equip readers well enough that they
processors, and hence an exponential in- can freely explore the theoretical realm of
crease in the amount of physical space quantum computing.
needed. However, in quantum systems the Section 3 defines the quantum bit, or
amount of parallelism increases exponen- qubit. Unlike classical bits, a quantum bit
tially with the size of the system. Thus, can be put in a superposition state that en-
an exponential increase in parallelism re- codes both 0 and 1. There is no good classi-
quires only a linear increase in the amount cal explanation of superpositions: a quan-
of physical space needed. This effect is tum bit representing 0 and 1 can neither
called quantum parallelism [Deutsch and be viewed as “between” 0 and 1 nor can
Jozsa 1992]. it be viewed as a hidden unknown state
There is a catch, and a big catch at that represents either 0 or 1 with a certain
that. While a quantum system can per- probability. Even single quantum bits en-
form massive parallel computation, access able interesting applications. We describe
to the results of the computation is re- the use of a single quantum bit for secure
stricted. Accessing the results is equiva- key distribution.
lent to making a measurement, which dis- But the real power of quantum compu-
turbs the quantum state. This problem tation derives from the exponential state
makes the situation, on the face of it, seem spaces of multiple quantum bits: just as a
even worse than the classical situation; we single qubit can be in a superposition of
can only read the result of one parallel 0 and 1, a register of n qubits can be in
thread, and because measurement is prob- a superposition of all 2n possible values.
abilistic, we cannot even choose which one The “extra” states that have no classical
we get. analog and lead to the exponential size of
But in the past few years, various peo- the quantum state space are the entangled
ple have found clever ways of finessing states, like the state leading to the famous
the measurement problem to exploit the EPR1 paradox (see Section 3.4).
power of quantum parallelism. This sort We discuss the two types of opera-
of manipulation has no classical analog tions a quantum system can undergo:
and requires nontraditional programming
techniques. One technique manipulates 1 EPR = Einstein, Podolsky, and Rosen

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


302 E. Rieffel and W. Polak

measurement and quantum state trans- takes to compute the output for a single in-
formations. Most quantum algorithms in- put state on a classical computer, a quan-
volve a sequence of quantum state trans- tum computer can compute the values for
formations followed by a measurement. all input states. This process is known as
For classical computers there are sets quantum parallelism. However, measur-
of gates that are universal in the sense ing the output states will randomly yield
that any classical computation can be per- only one of the values in the superposition,
formed using a sequence of these gates. and at the same time destroy all of the
Similarly, there are sets of primitive quan- other results of the computation. Section 5
tum state transformations, called quan- describes this situation in detail. Sections
tum gates, that are universal for quantum 6 and 7 describe techniques for taking ad-
computation. Given enough quantum bits, vantage of quantum parallelism inspite of
it is possible to construct a universal quan- the severe constraints imposed by quan-
tum Turing machine. tum mechanics on what can be measured.
Quantum physics puts restrictions on Section 6 describes the details of Shor’s
the types of transformations that can be polynomial time factoring algorithm. The
done. In particular, all quantum state fastest known classical factoring algo-
transformations, and therefore all quan- rithm requires exponential time, and it is
tum gates and all quantum computations, generally believed that there is no classi-
must be reversible. Yet all classical algo- cal polynomial time factoring algorithm.
rithms can be made reversible and can Shor’s is a beautiful algorithm that takes
be computed on a quantum computer in advantage of quantum parallelism by us-
comparable time. Some common quantum ing a quantum analog of the Fourier trans-
gates are defined in Section 4. form.
Two applications combining quantum Lov Grover developed a technique for
gates and entangled states are described searching
√ an unstructured list of n items
in Section 4.2: teleportation and dense in O( n) steps on a quantum computer.
coding. Teleportation is the transfer of a Classical computers can do no better than
quantum state from one place to another O(n), so unstructured search on a quan-
through classical channels. That telepor- tum computer is provably more efficient
tation is possible is surprising, since quan- than search on a classical computer. How-
tum mechanics tells us that it is not pos- ever, the speed-up is only polynomial, not
sible to clone quantum states or even exponential, and it has been shown that
measure them without disturbing the Grover’s algorithm is optimal for quan-
state. Thus, it is not obvious what informa- tum computers. It seems likely that search
tion could be sent through classical chan- algorithms that could take advantage of
nels that could possibly enable the recon- some problem structure could do better.
struction of an unknown quantum state Tad Hogg, among others, has explored
at the other end. Dense coding, a dual to such possibilities. We describe various
teleportation, uses a single quantum bit to quantum search techniques in Section 7.
transmit two bits of classical information. It is as yet unknown whether the power
Both teleportation and dense coding rely of quantum parallelism can be harnessed
on the entangled states described in the for a wide variety of applications. One tan-
EPR experiment. talizing open question is whether quan-
It is only in Section 5 that we see tum computers can solve NP-complete
where an exponential speed-up over clas- problems in polynomial time.
sical computers might come from. The in- Perhaps the biggest open question is
put to a quantum computation can be put whether useful quantum computers can
in a superposition state that encodes all be built. There are a number of propos-
possible input values. Performing the com- als for building quantum computers us-
putation on this initial state will result in ing ion traps, nuclear magnetic resonance
superposition of all of the corresponding (NMR), and optical and solid-state tech-
output values. Thus, in the same time it niques. All of the current proposals have

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 303

scaling problems, so a breakthrough will vention of quantum error correction tech-


be needed to go beyond tens of qubits niques. Initially people thought quantum
to hundreds of qubits. While both optical error correction might be impossible be-
and solid-state techniques show promise, cause of the impossibility of reliably copy-
NMR and ion trap technologies are the ing unknown quantum states, but it turns
most advanced so far. out that it is possible to design quantum
In an ion trap quantum computer [Circ error correcting codes that detect certain
and Zoller 1995; Steane 1996] a linear se- kinds of errors and enable the reconstruc-
quence of ions representing the qubits are tion of the exact error-free quantum state.
confined by electric fields. Lasers are di- Quantum error correction is discussed in
rected at individual ions to perform single- Section 8.
bit quantum gates. Two-bit operations are Appendices provide background infor-
realized by using a laser on one qubit to mation on tensor products and continued
create an impulse that ripples through a fractions.
chain of ions to the second qubit, where
another laser pulse stops the rippling 2. QUANTUM MECHANICS
and performs the 2-bit operation. The ap-
proach requires that the ions be kept in Quantum mechanical phenomena are dif-
extreme vacuum and at extremely low ficult to understand, since most of our
temperatures. everyday experiences are not applicable.
The NMR approach has the advantage This paper cannot provide a deep un-
that it will work at room temperature and derstanding of quantum mechanics (see
that NMR technology in general is already Feynman et al. [1965], Liboff [1997], and
fairly advanced. The idea is to use macro- Greenstein and Zajonc [1997] for expo-
scopic amounts of matter and encode a sitions of quantum mechanics). Instead,
quantum bit in the average spin state of we will give some feeling as to the na-
a large number of nuclei. The spin states ture of quantum mechanics and some of
can be manipulated by magnetic fields, the mathematical formalisms needed to
and the average spin state can be mea- work with quantum mechanics to the ex-
sured with NMR techniques. The main tent needed for quantum computing.
problem with the technique is that it Quantum mechanics is a theory in the
doesn’t scale well; the measured signal mathematical sense: it is governed by a set
scales as 1/2n with the number of qubits of axioms. The consequences of the axioms
n. However, a recent proposal [Schulman describe the behavior of quantum systems.
and Vazirani 1998] has been made that The axioms lead to several apparent para-
may overcome this problem. NMR com- doxes: in the Compton effect it appears as
puters with three qubits have been built if an action precedes its cause; the EPR
successfully [Cory et al. 1998; Gershenfeld experiment makes it appear as if action
and Chuang 1997; Laflamme et al. 1997; over a distance faster than the speed of
Vandersypen et al. 1999]. This paper will light is possible. We will discuss the EPR
not discuss further the physical and en- experiment in detail in Section 3.4. Ver-
gineering problems of building quantum ification of most predictions is indirect,
computers. and requires careful experimental design
The greatest problem for building quan- and specialized equipment. We will begin,
tum computers is decoherence, the distor- however, with an experiment that requires
tion of the quantum state due to interac- only readily available equipment and that
tion with the environment. For some time will illustrate some of the key aspects of
it was feared that quantum computers quantum mechanics needed for quantum
could not be built because it would be im- computation.
possible to isolate them sufficiently from
2.1. Photon Polarization
the external environment. The break-
through came from the algorithmic rather Photons are the only particles that we
than the physical side, through the in- can observe directly. The following simple

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


304 E. Rieffel and W. Polak

experiment can be performed with mini- visible on the screen, exactly one eighth of
mal equipment: a strong light source, such the original amount of light.
as a laser pointer, and three polaroids
(polarization filters), which can be picked
up at any camera supply store. The ex-
periment demonstrates some of the prin-
ciples of quantum mechanics through pho-
tons and their polarization.

2.1.1 The Experiment. A beam of light


shines on a projection screen. Filters A,
B, and C are polarized horizontally, at Here we have a nonintuitive effect. Classi-
45◦ , and vertically, respectively, and can be cal experience suggests that adding a filter
placed so as to intersect the beam of light. should only be able to decrease the num-
First, insert filter A. Assuming the in- ber of photons getting through. How can it
coming light is randomly polarized, the increase it?
intensity of the output will have half of
the intensity of the incoming light. The 2.1.2 The Explanation. A photon’s polariza-
outgoing photons are now all horizontally tion state can be modeled by a unit vector
polarized. pointing in the appropriate direction. Any
arbitrary polarization can be expressed
as a linear combination a|↑i + b|→i of the
two basis vectors2 |→i (horizontal polar-
ization) and |↑i (vertical polarization).
Since we are only interested in the di-
rection of the polarization (the notion of
“magnitude” is not meaningful), the state
vector will be a unit vector (i.e., |a|2 +|b|2 =
The function of filter A cannot be ex- 1). In general, the polarization of a pho-
plained as a “sieve” that only lets those ton can be expressed as a|↑i + b|→i where
photons pass that happen to be already a and b are complex numbers3 such that
horizontally polarized. If that were the |a|2 + |b|2 = 1. Note, the choice of basis
case, few of the randomly polarized incom- for this representation is completely arbi-
ing electrons would be horizontally polar- trary: any two orthogonal unit vectors will
ized, so we would expect a much larger at- do (e.g., {|-i, |%i}).
tenuation of the light as it passes through The measurement postulate of quantum
the filter. mechanics states that any device measur-
Next, when filter C is inserted, the in- ing a two-dimensional system has an as-
tensity of the output drops to zero. None sociated orthonormal basis with respect to
of the horizontally polarized photons can which the quantum measurement takes
pass through the vertical filter. A sieve place. Measurement of a state transforms
model could explain this behavior. the state into one of the measuring de-
vice’s associated basis vectors. The prob-
ability that the state is measured as ba-
sis vector |ui is the square of the norm
of the amplitude of the component of the
original state in the direction of the ba-
sis vector |ui. For example, given a device

2The notation |→i is explained in Section 2.2.


Finally, after filter B is inserted between 3Imaginary coefficients correspond to circular
A and C, a small amount of light will be polarization.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 305

example, filter A measures the photon po-


larization with respect to the basis vector
|→i, corresponding to its polarization. The
photons that pass through filter A all have
polarization |→i. Those that are reflected
by the filter all have polarization |↑i.
Assuming that the light source produces
photons with random polarization, filter
A will measure 50% of all photons as
horizontally polarized. These photons will
pass through the filter and their state will
be |→i. Filter C will measure these pho-
tons with respect to |↑i. But the state
|→i = 0|↑i + 1|→i will be projected onto
|↑i with probability 0, and no photons will
Fig. 1. Measurement is a projection onto pass filter C.
the basis. Finally, filter B measures the quantum
state with respect to the basis
for measuring the polarization of photons
with associated basis {|↑i, |→i}, the state ½ ¾
1 1
|ψi = a|↑i + b|→i is measured as |↑i with √ (|↑i + |→i), √ (|↑i − |→i)
probability |a|2 and as |→i with probabil- 2 2
ity |b|2 (see Figure 1). Note that different
measuring devices will have different as- which we write as {|%i, |-i}. Note that
sociated bases, and measurements using |→i = √12 (|%i − |-i) and |↑i = √12 (|%i +
these devices will have different outcomes. |-i). Those photons that are measured as
As measurements are always made with |%i pass through the filter. Photons pass-
respect to an orthonormal basis, through- ing through A with state |→i will be mea-
out the rest of this paper all bases will be sured by B as |%i with probability 1/2,
assumed to be orthonormal. and so 50% of the photons passing through
Furthermore, measurement of the A will pass through B and be in state |%i.
quantum state will change the state to As before, these photons will be measured
the result of the measurement. That is, if by filter C as |↑i with probability 1/2. Thus
measurement of |ψi = a|↑i + b|→i results only one eighth of the original photons
in |↑i, then the state ψ changes to |↑i manage to pass through the sequence of
and a second measurement with respect filters A, B, and C.
to the same basis will return |↑i with
probability 1. Thus, unless the original 2.2. State Spaces and Bra/Ket Notation
state happened to be one of the basis
vectors, measurement will change that The state space of a quantum system, con-
state, and it is not possible to determine sisting of the positions, momentums, po-
what the original state was. larizations, spins, and so on of the vari-
Quantum mechanics can explain the po- ous particles, is modeled by a Hilbert space
larization experiment as follows. A po- of wave functions. We will not look at the
laroid measures the quantum state of pho- details of these wave functions. For quan-
tons with respect to the basis consisting tum computing we need only deal with fi-
of the vector corresponding to its polar- nite quantum systems and it suffices to
ization together with a vector orthogonal consider finite dimensional complex vec-
to its polarization. The photons that, after tor spaces with an inner product that are
being measured by the filter, match the fil- spanned by abstract wave functions such
ter’s polarization are let through. The oth- as |→i.
ers are reflected and now have a polariza- Quantum state spaces and the tranfor-
tion perpendicular to that of the filter. For mations acting on them can be described

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


306 E. Rieffel and W. Polak

in terms of vectors and matrices or in which explicitly specifies the result of a


the more compact bra/ket notation in- transformation on the basis vectors.
vented by Dirac [1958]. Kets like |xi de-
note column vectors and are typically used
3. QUANTUM BITS
to describe quantum states. The match-
ing bra, hx|, denotes the conjugate trans- A quantum bit, or qubit, is a unit vector
pose of |xi. For example, the orthonor- in a two-dimensional complex vector space
mal basis {|0i, |1i} can be expressed as for which a particular basis, denoted by
{(1, 0)T , (0, 1)T }. Any complex linear com- {|0i, |1i}, has been fixed. The orthonormal
bination of |0i and |1i, a|0i + b|1i, can be basis |0i and |1i may correspond to the |↑i
written (a, b)T . Note that the choice of the and |→i polarizations of a photon respec-
order of the basis vectors is arbitrary. For tively, or to the polarizations |%i and |-i.
example, representing |0i as (0, 1)T and |1i Or |0i and |1i could correspond to the spin-
as (1, 0)T would be fine as long as this is up and spin-down states of an electron.
done consistently. When talking about qubits, and quantum
Combining hx| and | yi as in hx|| yi, also computations in general, a fixed basis with
written as hx| yi, denotes the inner prod- respect to which all statements are made
uct of the two vectors. For instance, since has been chosen in advance. In particular,
|0i is a unit vector we have h0|0i = 1 and unless otherwise specified, all measure-
since |0i and |1i are orthogonal we have ments will be made with respect to the
h0|1i = 0. standard basis for quantum computation,
The notation |xih y| is the outer product {|0i, |1i}.
of |xi and h y|. For example, |0ih1| is the For the purposes of quantum computa-
transformation that maps |1i to |0i and |0i tion, the basis states |0i and |1i are taken
to (0, 0)T , since to represent the classical bit values 0 and 1
respectively. Unlike classical bits however,
|0ih1||1i = |0ih1|1i = |0i qubits can be in a superposition of |0i and
µ ¶
0 |1i such as a|0i + b|1i, where a and b are
|0ih1||0i = |0ih1|0i = 0|0i = . complex numbers such that |a|2 + |b|2 = 1.
0
Just as in the photon polarization case, if
such a superposition is measured with re-
Equivalently, |0ih1| can be written in ma- spect to the basis {|0i, |1i}, the probability
trix form, where |0i = (1, 0)T , h0| = (1, 0), that the measured value is |0i is |a|2 and
|1i = (0, 1)T , and h1| = (0, 1). Then the probability that the measured value is
µ ¶ µ ¶ |1i is |b|2 .
1 0 1 Even though a quantum bit can be put
|0ih1| = (0, 1) = .
0 0 0 in infinitely many superposition states, it
is only possible to extract a single classi-
This notation gives us a convenient way cal bit’s worth of information from a sin-
of specifying transformations on quantum gle quantum bit. The reason that no more
states in terms of what happens to the ba- information can be gained from a qubit
sis vectors (see Section 4). For example, than in a classical bit is that informa-
the transformation that exchanges |0i and tion can only be obtained by measurement.
|1i is given by the matrix When a qubit is measured, the measure-
ment changes the state to one of the basis
states in the way seen in the photon po-
X = |0ih1| + |1ih0|. larization experiment. As every measure-
ment can result in only one of two states,
In this paper we prefer the slightly more one of the basis vectors associated to the
intuitive notation given measuring device, so, just as in the
classical case, there are only two possi-
X : |0i → |1i ble results. As measurement changes the
|1i → |0i, state, one cannot measure the state of a

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 307

qubit in two different bases. Furthermore, 0 → |↑i


as we shall see in Section 4.1.2, quantum 1 → |→i
states cannot be cloned, so it is not possible
to measure a qubit in two ways, even indi- or
rectly by, say, copying the qubit and mea- 0 → |-i
suring the copy in a different basis from 1 → |%i.
the original.
Bob measures the state of the photons he
receives by randomly picking either ba-
3.1. Quantum Key Distribution
sis. After the bits have been transmitted,
Sequences of single qubits can be used to Bob and Alice communicate the basis they
transmit private keys on insecure chan- used for encoding and decoding of each bit
nels. In 1984 Bennett and Brassard de- over the open channel. With this informa-
scribed the first quantum key distribu- tion both can determine which bits have
tion scheme [Bennett and Brassard 1987; been transmitted correctly, by identifying
Bennett et al. 1992]. Classically, public key those bits for which the sending and re-
encryption techniques (e.g., RSA) are used ceiving bases agree. They will use these
for key distribution. bits as the key and discard all the others.
Consider the situation in which Alice On average, Alice and Bob will agree on
and Bob want to agree on a secret key 50% of all bits transmitted.
so that they can communicate privately. Suppose that Eve measures the state
They are connected by an ordinary bidirec- of the photons transmitted by Alice and
tional open channel and a unidirectional re-sends new photons with the measured
quantum channel, both of which can be ob- state. In this process she will use the
served by Eve, who wishes to eavesdrop on wrong basis approximately 50% of the
their conversation. This situation is illus- time, in which case she will re-send the bit
trated in the figure that follows. The quan- with the wrong basis. So when Bob mea-
tum channel allows Alice to send individ- sures a re-sent qubit with the correct ba-
ual particles (e.g., photons) to Bob who can sis, there will be a 25% probability that
measure their quantum state. Eve can at- he measures the wrong value. Thus any
tempt to measure the state of these parti- eavesdropper on the quantum channel is
cles and can resend the particles to Bob. bound to introduce a high error rate that
Alice and Bob can detect by communicat-
ing a sufficient number of parity bits of
their keys over the open channel. So, not
only is it likely that Eve’s version of the
key is 25% incorrect, but the fact that
someone is eavesdropping will be appar-
ent to Alice and Bob.
Other techniques for exploiting quan-
tum effects for key distribution have been
proposed. See, for example, Ekert et al.
[1992], Bennett [1992], and Lo and Chau
[1999]. But none of the quantum key dis-
tribution techniques are substitutes for
public key encryption schemes. Attacks
by eavesdroppers other than the one de-
To begin the process of establishing a scribed here are possible. Security against
secret key, Alice sends a sequence of bits to all such schemes is discussed in both
Bob by encoding each bit in the quantum Mayers [1998] and Lo and Chau [1999].
state of a photon as follows. For each bit, Quantum key distribution has been re-
Alice randomly uses one of the following alized over a distance of 24 km using
two bases for encoding each bit: standard fiber optical cables [Hughes et al.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


308 E. Rieffel and W. Polak

1997] and over 0.5 km through the atmo- {w1 , w2 } respectively. The cartesian prod-
sphere [Hughes et al. 1999]. uct of these two spaces can take as its
basis the union of the bases of its com-
ponent spaces {v1 , v2 , w1 , w2 }. Note that
3.2. Multiple Qubits the order of the basis was chosen arbi-
Imagine a macroscopic physical object trarily. In particular, the dimension of the
breaking apart and multiple pieces flying state space of multiple classical particles
off in different directions. The state of this grows linearly with the number of parti-
system can be described completely by de- cles, since dim(X ×Y ) = dim(X )+dim(Y ).
scribing the state of each of its compo- The tensor product of V and W has ba-
nent pieces separately. A surprising and sis {v1 ⊗ w1 , v1 ⊗ w2 , v2 ⊗ w1 , v2 ⊗ w2 }.
unintuitive aspect of the state space of Note that the order of the basis, again,
an n-particle quantum system is that the is arbitrary.5 So the state space for two
state of the system cannot always be de- qubits, each with basis {|0i, |1i}, has ba-
scribed in terms of the state of its compo- sis {|0i ⊗ |0i, |0i ⊗ |1i, |1i ⊗ |0i, |1i ⊗ |1i},
nent pieces. It is when examining systems which can be written more compactly as
of more than one qubit that one first gets a {|00i, |01i, |10i, |11i}. More generally, we
glimpse of where the computational power write |xi to mean |bn bn−1 . . . b0 i where bi
of quantum computers could come from. are the binary digits of the number x.
As we saw, the state of a qubit A basis for a 3-qubit system is
can be represented by a vector in the
{|000i, |001i, |010i, |011i,
two-dimensional complex vector space
spanned by |0i and |1i. In classical physics, |100i, |101i, |110i, |111i}
the possible states of a system of n par-
and in general an n-qubit system has 2n
ticles, whose individual states can be de-
basis vectors. We can now see the expo-
scribed by a vector in a two-dimensional
nential growth of the state space with the
vector space, form a vector space of 2n di-
number of quantum particles. The tensor
mensions. However, in a quantum system
product X ⊗ Y has dimension d im(X ) ×
the resulting state space is much larger; a
d im(Y ).
system of n qubits has a state space of 2n
The state |00i + |11i is an example of a
dimensions.4 It is this exponential growth
quantum state that cannot be described in
of the state space with the number of par-
terms of the state of each of its components
ticles that suggests a possible exponential
(qubits) separately. In other words, we
speed-up of computation on quantum com-
cannot find a1 , a2 , b1 , b2 such that (a1 |0i +
puters over classical computers.
b1 |1i) ⊗ (a2 |0i + b2 |1i) = |00i + |11i, since
Individual state spaces of n particles
combine classically through the cartesian
(a1 |0i + b1 |1i) ⊗ (a2 |0i + b2 |1i) = a1 a2 |00i
product. Quantum states, however, com-
bine through the tensor product. Details + a1 b2 |01i + b1 a2 |10i + b1 b2 |11i
on properties of tensor products and their
expression in terms of vectors and matri- and a1 b2 = 0 implies that either a1 a2 = 0
ces are given in Appendix A. Let us look or b1 b2 = 0. States that cannot be decom-
briefly at distinctions between the carte- posed in this way are called entangled
sian product and the tensor product that states. These states represent situations
will be crucial to understanding quantum that have no classical counterpart and for
computation. which we have no intuition. These are also
Let V and W be 2 two-dimensional com- the states that provide the exponential
plex vector spaces with bases {v1 , v2 } and growth of quantum state spaces with the
number of particles.
4 Actually, as we shall see, the state space is the set
of normalized vectors in this 2n dimensional space, 5 It is only when we use matrix notation to describe
just as the state a|0i + b|1i of a qubit is normalized state transformations that the order of basis vectors
so that |a|2 + |b|2 = 1. becomes relevant.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 309

Note that it would require vast re- as a series of single-bit measurements in


sources to simulate even a small quan- the standard basis. Other sorts of mea-
tum system on traditional computers. The surements are possible, such as measur-
evolution of quantum systems is exponen- ing whether two qubits have the same
tially faster than their classical simula- value without learning the actual value
tions. The reason for the potential power of the two qubits. But such measurements
of quantum computers is the possibility of are equivalent to unitary transformations
exploiting the quantum state evolution as followed by a standard measurement of in-
a computational mechanism. dividual qubits, and so it suffices to look
only at standard measurements.
3.3. Measurement In the two-qubit example, the state
space is a cartesian product of the sub-
The experiment in Section 2.1.2 illus- space consisting of all states whose first
trates how measurement of a single qubit qubit is in the state |0i and the orthog-
projects the quantum state on to one of the onal subspace of states whose first qubit
basis states associated with the measur- is in the state |1i. Any quantum state
ing device. The result of a measurement is can be written as the sum of two vectors,
probabilistic and the process of measure- one in each of the subspaces. A measure-
ment changes the state to that measured. ment of k qubits in the standard basis
Let us look at an example of measure- has 2k possible outcomes mi . Any device
ment in a two-qubit system. Any two-qubit measuring k qubits of an n-qubit system
state can be expressed as a|00i + b|01i + splits of the 2n -dimensional state space H
c|10i + d |11i, where a, b, c, and d are com- into a cartesian product of orthogonal sub-
plex numbers such that |a|2 + |b|2 + |c|2 + spaces S1 , . . . , S2k with H = S1 × · · · × S2k ,
|d |2 = 1. Suppose we wish to measure such that the value of the k qubits be-
the first qubit with respect to the stan- ing measured is mi and the state after
dard basis {|0i, |1i}. For convenience we measurement is in space the space Si for
will rewrite the state as follows: some i. The device randomly chooses one
of the Si ’s, with probability the square of
a|00i + b|01i + c|10i + d |11i the amplitude of the component of ψ in
= |0i ⊗ (a|0i + b|1i) + |1i ⊗ (c|0i + d |1i) Si , and projects the state into that com-
= u|0i ⊗ (a/u|0i + b/u|1i) + v|1i ponent, scaling to give length 1. Equiva-
lently, the probability that the result of the
⊗ (c/v|0i + d /v|1i). measurement is a given value is the sum
p p of the squares of the the absolute values
For u = |a|2 + |b|2 and v = |c|2 + |d |2 of the amplitudes of all basis vectors com-
the vectors a/u|0i + b/u|1i and c/v|0i + patible with that value of the measure-
d /v|1i are of unit length. Once the state ment.
has been rewritten as above, as a tensor Measurement gives another way of
product of the bit being measured and a thinking about entangled particles. Par-
second vector of unit length, the probabal- ticles are not entangled if the measure-
istic result of a measurement is easy to ment of one has no effect on the other.
read off. Measurement of the first bit will For instance, the state √12 (|00i + |11i) is
with probability u2 = |a|2 + |b|2 return entangled, since the probability that the
|0i, projecting the state to |0i ⊗ (a/u|0i + first bit is measured to be |0i is 1/2 if the
b/u|1i), or with probability v = |c|2 + |d |2 second bit has not been measured. How-
yield |1i, projecting the state to |1i ⊗ ever, if the second bit had been measured,
(c/v|0i + d /v|1i). As |0i ⊗ (a/u|0i + b/u|1i) the probability that the first bit is mea-
and |1i ⊗ (c/v|0i + d /v|1i) are both unit sured as |0i is either 1 or 0, depending on
vectors, no scaling is necessary. Measur- whether the second bit was measured as
ing the second bit works similarly. |0i or |1i respectively. Thus the probable
For the purposes of quantum computa- result of measuring the first bit is changed
tion, multibit measurement can be treated by a measurement of the second bit. On

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


310 E. Rieffel and W. Polak

the other hand, the state √12 (|00i + |01i) There are two standard ways that peo-
is not entangled: since √12 (|00i + |01i) = ple use to describe entangled states and
|0i ⊗ √12 (|0i + |1i), any measurement of the their measurement. Both have their posi-
tive aspects, but both are incorrect and can
first bit will yield |0i regardless of whether
lead to misunderstandings. Let us exam-
the second bit was measured. Similarly,
ine both in turn.
the second bit has a fifty-fifty chance of be-
Einstein, Podolsky, and Rosen proposed
ing measured as |0i regardless of whether
that each particle has some internal state
the first bit was measured or not. Note
that completely determines what the re-
that entanglement, in the sense that mea-
sult of any given measurement will be.
surement of one particle has an effect
This state is, for the moment, hidden from
on measurements of another particle, is
us, and therefore the best we can currently
equivalent to our previous definition of en-
do is to give probabilistic predictions. Such
tangled states as states that cannot be
a theory is known as a local hidden vari-
written as a tensor product of individual
able theory. The simplest hidden variable
states.
theory for an EPR pair is that the par-
ticles are either both in state |0i or both
3.4. The EPR Paradox in state |1i, we just don’t happen to know
which. In such a theory no communication
Einstein, Podolsky, and Rosen proposed a between possibly distant particles is nec-
gedanken experiment that uses entangled essary to explain the correlated measure-
particles in a manner that seemed to vi- ments. However, this point of view can-
olate fundamental principles of relativity. not explain the results of measurements
Imagine a source that generates two maxi- with respect to a different basis. In fact,
mally entangled particles √12 |00i + √12 |11i, Bell showed that any local hidden vari-
called an EPR pair, and sends one each able theory predicts that certain measure-
to Alice and Bob. ments will satisfy an inequality, known as
Bell’s inequality. However, the result of ac-
tual experiments performing these mea-
surements show that Bell’s inequality is
violated. Thus quantum mechanics cannot
be explained by any local hidden variable
theory. See Greenstein and Zajonc [1997]
for a highly readable account of Bell’s the-
orem and related experiments.
The second standard description is in
Alice and Bob can be arbitrarily far terms of cause and effect. For example,
apart. Suppose that Alice measures her we said earlier that a measurement per-
particle and observes state |0i. This means formed by Alice affects a measurement
that the combined state will now be |00i, performed by Bob. However, this view is
and if now Bob measures his particle he incorrect also, and results, as Einstein,
will also observe |0i. Similarly, if Alice Podolsky, and Rosen recognized, in deep
measures |1i, so will Bob. Note that the inconsistencies when combined with rela-
change of the combined quantum state oc- tivity theory. It is possible to set up the
curs instantaneously even though the two EPR scenario so that one observer sees
particles may be arbitrarily far apart. It Alice measure first, then Bob, while an-
appears that this would enable Alice and other observer sees Bob measure first,
Bob to communicate faster than the speed then Alice. According to relativity, physics
of light. Further analysis, as we shall see, must equally well explain the observa-
shows that even though there is a coupling tions of the first observer as the second.
between the two particles, there is no way While our terminology of cause and ef-
for Alice or Bob to use this mechanism to fect cannot be compatible with both ob-
communicate. servers, the actual experimental values

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 311

are invariant under change of observer. 4.1. Simple Quantum Gates


The experimental results can be explained
The following are some examples of use-
equally well by Bob’s measuring first and
ful single-qubit quantum state transfor-
causing a change in the state of Alice’s par-
mations. Because of linearity, the transfor-
ticle, as the other way around. This sym-
mations are fully specified by their effect
metry shows that Alice and Bob cannot, in
on the basis vectors. The associated ma-
fact, use their EPR pair to communicate
trix, with {|0i, |1i} as the preferred ordered
faster than the speed of light, and thus re-
basis, is also shown.
solves the apparent paradox. All that can
be said is that Alice and Bob will observe µ ¶
the same random behavior. I : |0i → |0i 1 0
As we will see in the section on dense |1i → |1i 0 1
coding and teleportation, EPR pairs can µ ¶
be used to aid communication, albeit X : |0i → |1i 0 1
communication slower than the speed of |1i → |0i 1 0
¶µ
light. Y : |0i → −|1i 0 1
|1i → |0i −1 0
µ ¶
4. QUANTUM GATES Z : |0i → |0i 1 0
|1i → −|1i 0 −1
So far we have looked at static quantum
systems, which change only when mea-
sured. The dynamics of a quantum system, The names of these transformations are
when not being measured, are governed conventional. I is the identity transforma-
by Schrödinger’s equation; the dynamics tion, X is negation, Z is a phase shift op-
must take states to states in a way that eration, and Y = Z X is a combination of
preserves orthogonality. For a complex both. The X transformation was discussed
vector space, linear transformations that previously in Section 2.2. It can be readily
preserve orthogonality are unitary trans- verified that these gates are unitary. For
formations, defined as follows. Any linear example
transformation on a complex vector space
can be described by a matrix. Let M ∗ de- µ ¶µ ¶
0 −1 0 1
note the conjugate transpose of the ma- YY∗ = = I.
1 0 −1 0
trix M . A matrix M is unitary (describes
a unitary transformation) if M M ∗ = I .
Any unitary transformation of a quan- The controlled-NOT gate, Cnot , operates
tum state space is a legitimate quan- on two qubits as follows: it changes the
tum transformation, and vice versa. One second bit if the first bit is 1 and leaves
can think of unitary transformations this bit unchanged otherwise. The vec-
as being rotations of a complex vector tors |00i, |01i, |10i, and |11i form an or-
space. thonormal basis for the state space of
One important consequence of the a two-qubit system, a four-dimensional
fact that quantum transformations are complex vector space. In order to repre-
unitary is that they are reversible. sent transformations of this space in ma-
Thus quantum gates must be reversible. trix notation we need to choose an isomor-
Bennett, Fredkin, and Toffoli had al- phism between this space and the space
ready looked at reversible versions of stan- of complex 4-tuples. There is no reason,
dard computing models showing that all other than convention, to pick one iso-
classical computations can be done re- morphism over another. The one we use
versibly. See Feynman’s Lectures on Com- here associates |00i, |01i, |10i, and |11i
putation [Feynman 1996] for an account to the standard 4-tuple basis (1, 0, 0, 0)T ,
of reversible computation and its rela- (0, 1, 0, 0)T , (0, 0, 1, 0)T , and (0, 0, 0, 1)T ,
tion to the energy of computation and in that order. The Cnot transformation has
information. representations

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


312 E. Rieffel and W. Polak
 
Cnot : |00i → |00i 1 0 0 0 4.1.1 The Walsh–Hadamard Transformation.
|01i → |01i 0 1 0 0 Another important single-bit transfor-
.
|10i → |11i 0 0 0 1 mation is the Hadamard transformation,
|11i → |10i 0 0 1 0 defined by

H : |0i → √1 (|0i + |1i)


The transformation Cnot is unitary since 2
∗ |1i → √1 (|0i − |1i).
Cnot = Cnot and Cnot Cnot = I . The Cnot gate 2
cannot be decomposed into a tensor prod-
uct of two single-bit transformations. The transformation H has a number
It is useful to have graphical represen- of important applications. When applied
tations of quantum state transformations, to |0i, H creates a superposition state
especially when several transformations √1 (|0i + |1i). Applied to n bits individu-
are combined. The controlled-NOT gate Cnot 2
is typically represented by a circuit of the ally, H generates a superposition of all 2n
form possible states, which can be viewed as
the binary representation of the numbers
from 0 to 2n − 1.
(H ⊗ H ⊗ · · · ⊗ H)|00 . . . 0i
1
= √ ((|0i + |1i) ⊗ (|0i + |1i)
2n
The open circle indicates the control bit, ⊗ · · · ⊗ (|0i + |1i))
and the × indicates the conditional nega- 2 −1
1 X
n

tion of the subject bit. In general there can =√ |xi.


be multiple control bits. Some authors use 2n x=0
a solid circle to indicate negative control,
in which the subject bit is toggled when The transformation that applies H to
the control bit is 0. n bits is called the Walsh, or Walsh–
Similarly, the controlled-controlled-NOT, Hadamard, transformation W . It can be
which negates the last bit of three if and defined as a recursive decomposition of the
only if the first two are both 1, has the form
following graphical representation.
W1 = H, Wn+1 = H ⊗ Wn .

4.1.2 No Cloning. The unitary property im-


plies that quantum states cannot be copied
or cloned. The no cloning proof given
here, originally due to Wootters and Zurek
[1982], is a simple application of the lin-
earity of unitary transformations.
Assume that U is a unitary transforma-
tion that clones, in that U (|a0i) = |aai
Single bit operations are graphically for all quantum states |ai. Let |ai and |bi
represented by appropriately labeled be two orthogonal quantum states. Say
boxes as shown. U (|a0i) = |aai√ and U (|b0i) = |bbi. Con-
sider |ci = (1/ 2)(|ai + |bi). By linearity,

1
U (|c0i) = √ (U (|a0i) + U (|b0i))
2
1
= √ (|aai + |bbi).
2

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 313

But if U is a cloning transformation then The key to both dense coding and tele-
portation is the use of entangled particles.
U (|c0i) = |cci = 1/2(|aai + |abi The initial set up is the same for both pro-
cesses. Alice and Bob wish to communi-
+ |bai + |bbi), cate. Each is sent one of the entangled par-
√ ticles making up an EPR pair,
which is not equal to (1/ 2)(|aai + |bbi).
Thus there is no unitary operation that 1
ψ0 = √ (|00i + |11i).
can reliably clone unknown quantum 2
states. It is clear that cloning is not possi-
ble by using measurement, since measure- Say Alice is sent the first particle, and
ment is both probabalistic and destructive Bob the second. Until a particle is trans-
of states not in the measuring device’s as- mitted, only Alice can perform transfor-
sociated subspaces. mations on her particle, and only Bob can
It is important to understand what sort perform transformations on his.
of cloning is and isn’t allowed. It is pos-
sible to clone a known quantum state.
4.2.1 Dense Coding. Alice. Alice receives
What the no cloning principle tells us
two classical bits, encoding the num-
is that it is impossible to reliably clone
bers 0 through 3. Depending on this
an unknown quantum state. Also, it is
number Alice performs one of the trans-
possible to obtain n particles in an en-
formations {I, X , Y, Z } on her qubit of the
tangled state a|00 . . . 0i + b|11 . . . 1i from
an unknown state a|0i + b|1i. Each of
these particles will behave in exactly the
same way when measured with respect to
the standard basis for quantum compu-
tation {|00 . . . 0i, |00 . . . 01i, . . . , |11 . . . 1i},
but not when measured with respect to
other bases. It is not possible to create the
n-particle state (a|0i + b|1i) ⊗ . . . ⊗ (a|0i +
b|1i) from an unknown state a|0i + b|1i.

4.2. Examples
The use of simple quantum gates can be
studied with two simple examples: dense
entangled pair ψ0 . Transforming just one
coding and teleportation.
bit of an entangled pair means performing
Dense coding uses one quantum bit to-
the identity transformation on the other
gether with an EPR pair to encode and
bit. The resulting state is shown in the
transmit two classical bits. Since EPR
table.
pairs can be distributed ahead of time,
only one qubit (particle) needs to be physi-
cally transmitted to communicate two bits Value Transformation New state
of information. This result is surprising 0 ψ0 = (I ⊗ I )ψ0 √1 (|00i + |11i)
2
since, as was discussed in Section 3, only 1 ψ1 = (X ⊗ I )ψ0 √1 (|10i + |01i)
2
one classical bit’s worth of information can 2 ψ2 = (Y ⊗ I )ψ0 √1 (−|10i + |01i)
be extracted from a qubit. Teleportation 2
is the opposite of dense coding, in that it 3 ψ3 = (Z ⊗ I )ψ0 √1 (|00i − |11i)
2
uses two classical bits to transmit a single
qubit. Teleportation is surprising in light Alice then sends her qubit to Bob.
of the no cloning principle of quantum me-
chanics, in that it enables the transmis- Bob. Bob applies a controlled-NOT to the
sion of an unknown quantum state. two qubits of the entangled pair.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


314 E. Rieffel and W. Polak

Initial state Controlled-NOT First bit Second bit


ψ0 = √12 (|00i + |11i) √1 (|00i + |10i)
2
√1 (|0i + |1i)
2
|0i
ψ1 = √1 (|10i + |01i)
2
√1 (|11i + |01i)
2
√1 (|1i + |0i)
2
|1i
ψ2 = √12 (−|10i + |01i) √1 (−|11i + |01i)
2
√1 (−|1i + |0i)
2
|1i
ψ3 = √12 (|00i − |11i) √1 (|00i − |10i)
2
√1 (|0i − |1i)
2
|0i

Note that Bob can now measure the sec- Alice. Alice has a qubit whose state she
ond qubit without disturbing the quantum doesn’t know. She wants to send the state
state. If the measurement returns |0i then of ths qubit
the encoded value was either 0 or 3, if the
measurement returns |1i then the encoded φ = a|0i + b|1i
value was either 1 or 2.
Bob now applies H to the first bit: to Bob through classical channels. As with

Initial state First bit ¡ H(First bit) ¢


ψ0 √1 (|0i + |1i) √1 √1 (|0i + |1i) + √1 (|0i − |1i) = |0i
2¡ 2
2 2 ¢
ψ1 √1 (|1i + |0i) √1 √1 (|0i − |1i) + √1 (|0i + |1i) = |0i

2 2 2 ¢
ψ2 √1 (−|1i + |0i) √1 − √1 (|0i − |1i) + √1 (|0i + |1i) = |1i
2 ¡
2 2 2 ¢
ψ3 √1 (|0i − |1i)
2
√1 √1 (|0i + |1i) − √1 (|0i − |1i) = |1i
2 2 2

Finally, Bob measures the resulting bit, dense coding, Alice and Bob each possess
which allows him to distinguish between one qubit of an entangled pair
0 and 3, and 1 and 2.
1
ψ0 = √ (|00i + |11i).
4.2.2 Teleportation. The objective is to 2
transmit the quantum state of a particle
using classical bits and reconstruct the Alice applies the decoding step of dense
exact quantum state at the receiver. coding to the qubit φ to be transmitted and
Since quantum state cannot be copied, her half of the entangled pair. The starting
the quantum state of the given particle state is quantum state
will necessarily be destroyed. Single-bit
teleportation has been realized experi- 1
mentally [Boschi et al. 1998; Bouwmeester φ ⊗ ψ0 = √ (a|0i ⊗ (|00i + |11i)
et al. 1997; Nielsen et al. 1998]. 2
+ b|1i ⊗ (|00i + |11i))
1
= √ (a|000i + a|011i + b|100i
2
+ b|111i),

of which Alice controls the first two bits


and Bob controls the last one. Alice now
applies Cnot ⊗ I and H ⊗ I ⊗ I to this
state:

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 315

(H ⊗ I ⊗ I )(Cnot ⊗ I )(φ ⊗ ψ0 ) 5. QUANTUM COMPUTERS


1 This section discusses how quantum me-
= (H ⊗ I ⊗ I )(Cnot ⊗ I ) √ (a|000i chanics can be used to perform compu-
2
tations and how these computations are
+ a|011i + b|100i + b|111i) qualitatively different from those per-
1 formed by a conventional computer. Re-
= (H ⊗ I ⊗ I ) √ (a|000i + a|011i call from Section 4 that all quantum state
2 transformations have to be reversible.
+ b|110i + b|101i) While the classical NOT gate is reversible,
AND, OR, and NAND gates are not. Thus
1 it is not obvious that quantum trans-
= (a(|000i + |011i + |100i + |111i)
2 formations can carry out all classical
+ b(|010i + |001i − |110i − |101i)) computations. The first subsection de-
scribes complete sets of reversible gates
1 that can perform any classical computa-
= (|00i(a|0i + b|1i) + |01i(a|1i
2 tion on a quantum computer. Further-
+ b|0i) + |10i(a|0i − b|1i) more, it describes sets of gates with which
all quantum computations can be done.
+ |11i(a|1i − b|0i)) The second subsection discusses quantum
parallelism.
Alice measures the first two qubits to get
one of |00i, |01i, |10i, or |11i with equal 5.1. Quantum Gate Arrays
probability. Depending on the result of the The bra/ket notation is useful in defining
measurement, the quantum state of Bob’s complex unitary operations. For two arbi-
qubit is projected to a|0i + b|1i, a|1i + b|0i, trary unitary transformations U1 and U2 ,
a|0i − b|1i, or a|1i − b|0i respectively. Alice the “conditional” transformation |0ih0| ⊗
sends the result of her measurement as U1 + |1ih1| ⊗ U2 is also unitary. The
two classical bits to Bob. controlled-NOT gate can be defined by
Note that when she measured it, Alice
irretrievably altered the state of her orig- Cnot = |0ih0| ⊗ I + |1ih1| ⊗ X .
inal qubit φ, whose state she is in the pro-
cess of sending to Bob. This loss of the orig- The three-bit controlled-controlled-NOT
inal state is the reason teleportation does gate or Toffoli gate of Section 4 is also an
not violate the no cloning principle. instance of this conditional definition:
Bob. When Bob receives the two classi-
cal bits from Alice he knows how the state T = |0ih0| ⊗ I ⊗ I + |1ih1| ⊗ Cnot .
of his half of the entangled pair compares
to the original state of Alice’s qubit. The Toffoli gate T can be used to construct
complete set of boolean connectives, as can
be seen from the fact that it can be used to
Bits received State Decoding construct the AND and NOT operators in the
00 a|0i + b|1i I following way:
01 a|1i + b|0i X
10 a|0i − b|1i Z T |1, 1, xi = |1, 1, ¬xi
11 a|1i − b|0i Y
T |x, y, 0i = |x, y, x ∧ yi

Bob can reconstruct the original state of The T gate is sufficient to construct arbi-
Alice’s qubit, φ, by applying the appropri- trary combinatorial circuits.
ate decoding transformation to his part of The following quantum circuit, for ex-
the entangled pair. Note that this is the ample, implements a 1 bit full adder using
encoding step of dense coding. Toffoli and controlled-NOT gates:

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


316 E. Rieffel and W. Polak

where x and y are the data bits, s is their


sum (modulo 2), c is the incoming carry While the T and F gates are complete
bit, and c0 is the new carry bit. Vedral, for combinatorial circuits, they cannot
Barenco, and Ekert [1996] define more achieve arbitrary quantum state trans-
complex circuits that include in-place ad- formations. In order to realize arbitrary
dition and modular addition. unitary transformations,7 single-bit rota-
The Fredkin gate is a “controlled swap” tions need to be included. Barenco et al.
and can be defined as [1995] show that Cnot together with all
1-bit quantum gates is a universal gate
F = |0ih0| ⊗ I ⊗ I + |1ih1| ⊗ S set. It suffices to include the following 1-bit
transformations
where S is the swap operation µ ¶ µ iα ¶
cos α sin α e 0
,
− sin α cos α 0 e−iα
S = |00ih00|+|01ih10|+|10ih01|+|11ih11|.
for all 0 ≤ α ≤ 2π together with the Cnot to
The reader can verify that F , like T , is obtain a universal set of gates. As we shall
complete for combinatorial circuits. see, such nonclassical transformations are
Deutsch has shown [1985] that it is crucial for exploiting the power of quan-
possible to construct reversible quantum tum computers.
gates for any classically computable func-
tion. In fact, it is possible to conceive 5.2. Quantum Parallelism
of a universal quantum Turing machine
[Bernstein and Vazirani 1997]. In this con- What happens if U f is applied to input
struction we must assume a sufficient sup- that is in a superposition? The answer
ply of bits that correspond to the tape of a is easy but powerful: since U f is a lin-
Turing machine. ear transformation, it is applied to all ba-
Knowing that an arbitrary classical sis vectors in the superposition simulta-
function f with m input and k output neously and will generate a superposition
bits can be implemented on quantum of the results. In this way, it is possible to
computer, we assume the existence of a compute f (x) for n values of x in a sin-
quantum gate array U f that implements gle application of U f . This effect is called
f . U f is a m + k–bit transformation of the quantum parallelism.
form U f : |x, yi → |x, y ⊕ f (x)i, where ⊕ The power of quantum algorithms
denotes the bitwise exclusive-OR.6 Quan- comes from taking advantage of quan-
tum gate arrays U f , defined in this way, tum parallelism and entanglement. So
are unitary for any function f . To compute most quantum algorithms begin by com-
f (x) we apply U f to |xi tensored with puting a function of interest on a super-
k zeros |x, 0i. Since f (x) ⊕ f (x) = 0 we position of all values as follows. Start
have U f U f = I . Graphically the trans- with an n-qubit state |00 . . . 0i. Apply the
formation U f : |x, yi → |x, y ⊕ f (x)i is
depicted as 7 More precisely, we mean arbitrary unitary trans-
formations up to a constant phase factor. A constant
phase shift of the state has no physical, and therefore
6 ⊕ is not the direct sum of vectors. no computational, significance.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 317

Walsh–Hadamard transformation W of 1
Section 4.1.1 to get a superposition T (H|0i ⊗ H|0i ⊗ |0i) = (|000i + |010i
2
1 + |100i + |111i).
√ (|00 . . . 0i + |00 . . . 1i + · · · + |11 . . . 1i)
2n
2n −1
The resulting superposition can be viewed
1 X as a truth table for the conjunction, or
=√ |xi more generally as the graph of a function.
2n x=0
In the output the values of x, y, and x ∧ y
which should be viewed as the superposi- are entangled in such a way that measur-
tion of all integers 0 ≤ x < 2n . Add a k-bit ing the result will give one line of the truth
register |0i then by linearity table, or more generally one point of graph
of the function. Note that the bits can be
µ 2n −1 ¶ 2n −1 measured in any order: measuring the re-
1 X 1 X
Uf √ |x, 0i = √ U f (|x, 0i) sult will project the state to a superposi-
2n x=0 2n x=0 tion of the set of all input values for which
2 −1 f produces this result, and measuring the
1 X
n

= √ |x, f (x)i input will project the result to the corre-


2n x=0 sponding function value.
Measuring at this point gives no ad-
where f (x) is the function of interest. Note vantage over classical parallelism because
that since n qubits enable working simul- only one result is obtained, and worse still
taneously with 2n states, quantum paral- one cannot even choose which result one
lelism circumvents the time/space trade- gets. The heart of any quantum algorithm
off of classical parallelism through its is the way in which it manipulates quan-
ability to provide an exponential amount tum parallelism so that desired results
of computational space in a linear amount will be measured with high probability.
of physical space. This sort of manipulation has no classical
Consider the trivial example of a analog and requires nontraditional pro-
controlled-controlled-NOT (Toffoli) gate, T , gramming techniques. We list a couple of
that computes the conjunction of two val- the techniques currently known.
ues: r Amplify output values of interest. The
general idea is to transform the state in
such a way that values of interest have
a larger amplitude and therefore have
a higher probability of being measured.
Examples of this approach will be de-
scribed in Section 7.
r Find common properties of all the val-
ues of f (x). This idea is exploited in
Now take as input a superposition of all Shor’s algorithm, which uses a quantum
possible bit combinations of x and y to- Fourier transformation to obtain the pe-
gether with the necessary 0: riod of f .
6. SHOR’S ALGORITHM
H|0i ⊗ H|0i ⊗ |0i
1 1 In 1994, inspired by work of Daniel Si-
= √ (|0i + |1i) ⊗ √ (|0i + |1i) ⊗ |0i mon (later published in Simon [1997]),
2 2
Peter Shor found a bounded probabil-
1 ity polynomial time algorithm for fac-
= (|000i + |010i + |100i + |110i).
2 toring n-digit numbers on a quantum
computer. Since the 1970s people have
Apply T to the superposition of inputs to searched for efficient algorithms for factor-
get a superposition of the results, namely ing integers. The most efficient classical

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


318 E. Rieffel and W. Polak

algorithm known today is that of Lenstra r is a function concentrated near multi-


and Lenstra [1993], which is exponential ples of Nr . If the period r divides N evenly,
in the size of the input. The input is the list the result is a function that has nonzero
of digits of M , which has size n ∼ log M . values only at multiples of Nr . Otherwise,
People were confident enough that no effi- the result will approximate this behavior,
cient algorithm existed, that the security and there will be nonzero terms at integers
of cryptographic systems, like the widely close to multiples of Nr .
used RSA algorithm, depend on the dif- The Fast Fourier transform (FFT) is a
ficulty of this problem. Shor’s result sur- version of DFT where N is a power of 2.
prised the community at large, prompting The quantum Fourier transform (QFT) is
widespread interest in quantum comput- a variant of the discrete Fourier trans-
ing. form, which, like FFT, uses powers of 2.
Most factoring algorithms, including The quantum Fourier transform operates
Shor’s, use a standard reduction of the on the amplitude of the quantum state, by
factoring problem to the problem of find- sending
ing the period of a function. Shor uses X X
quantum parallelism in the standard way g (x)|xi → G(c)|ci,
to obtain a superposition of all the values x c
of the function in one step. He then com-
putes the quantum Fourier transform of where G(c) is the discrete Fourier trans-
the function, which, like classical Fourier form of g (x), and x and c both range over
transforms, puts all the amplitude of the the binary representations for the integers
function into multiples of the reciprocal of between 0 and N − 1. If the state were
the period. With high probability, measur- measured after the Fourier transform was
ing the state yields the period, which in performed, the probability that the result
turn is used to factor the integer M . was |ci would be |G(c)|2 . Note that the
This description captures the essence quantum Fourier transform does not out-
of the quantum algorithm but is some- put a function the way the U f transforma-
thing of an oversimplification. The biggest tion does; no output appears in an extra
complication is that the quantum Fourier register.
transform is based on the fast Fourier Applying the quantum Fourier trans-
transform and thus gives only approxi- form to a periodic function g (x) with pe-
mate results in most cases. Thus extract- riod
ing the period is trickier than outlined P r, we would expect to end up with
c G(c)|ci, where G(c) is zero except at
here, but the techniques for extracting the multiples of Nr . Thus, when the state is
period are classical. measured, the result would be a multiple
We will first describe the quantum of Nr , say j Nr . But as described above, the
Fourier transform and then give a detailed quantum Fourier transform only gives ap-
outline of Shor’s algorithm. proximate results for periods that are not
a power of two (i.e., do not divide N ). How-
6.1. The Quantum Fourier Transform ever the larger the power of two used as a
base for the transform, the better the ap-
Fourier transforms in general map from proximation. The quantum Fourier trans-
the time domain to the frequency domain. form UQFT with base N = 2m is defined
So Fourier transforms map functions of pe- by
riod r to functions that have nonzero val-
ues only at multiples of the frequency 2π 2 −1 µ ¶
1 X
m
r
. 2πicx
The discrete Fourier transform (DFT) op- UQFT : |xi → √ exp |ci.
erates on N equally spaced samples in the 2m c=0 2m
interval [0, 2π) for some N and outputs a
function whose domain is the integers be- In order for Shor’s algorithm to be
tween 0 and N − 1. The discrete Fourier a polynomial algorithm, the quantum
transform of a (sampled) function of period Fourier transform must be efficiently

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 319

computable. Shor shows that the quan- Example. Suppose a = 11 were ran-
tum Fourier transform with base 2m can be domly chosen. Since M 2 = 441 ≤ 29 <
constructed using only m(m+1) 2
gates. The 882 = 2M 2 , we find m = 9. Thus, a total
construction makes use of two types of of 14 quantum bits, 9 for x and 5 for f (x),
gates. One is a gate to perform the famil- are required to compute the superposition
iar Hadamard transformation H. We will of equation 1.
denote by H j the Hadamard transforma-
Step 2. A state whose amplitude has the same
tion applied to the j th bit. The other type
period as f . The quantum Fourier trans-
of gate performs 2-bit transformations of
form acts on the amplitude function as-
the form
  sociated with the input state. In order to
1 0 0 0 use the quantum Fourier transform to ob-
0 1 0 0  tain the period of f , a state is constructed
S j,k =  0 0 1 0  ,
whose amplitude function has the same
0 0 0 eiθk− j period as f .
To construct such a state, measure the
where θk− j = π/2k− j . This transformation last dlog2 M e qubits of the state of Eq. 1
acts on the kth and j th bits of a larger that encode f (x). A random value u is ob-
register. The quantum Fourier transform tained. The value u is not of interest in it-
is given by self; only the effect the measurement has
on our set of superpositions is of inter-
H0 S0,1 . . . S0,m−1 H1 . . . Hm−3 est. This measurement projects the state
Sm−3,m−2 Sm−3,m−1 Hm−2 Sm−2,m−1 Hm−1 space onto the subspace compatible with
the measured value, so the state after
followed by a bit reversal transformation. measurement is
If FFT is followed by measurement, as in X
Shor’s algorithm, the bit reversal can be C g (x)|x, ui,
performed classically. See Shor [1997] for x
more details.
for some scale factor C where
6.2. A Detailed Outline of Shor’s algorithm ½
1 if f (x) = u
The detailed steps of Shor’s algorithm are g (x) =
0 otherwise.
illustrated with a running example where
we factor M = 21. Note that the x’s that actually appear in
Step 1. Quantum parallelism. Choose an the sum, those with g (x) 6= 0, differ from
integer a arbitrarily. If a is not relatively each other by multiples of the period; thus
prime to M , we have found a factor of M . g (x) is the function we are looking for. If
Otherwise apply the rest of the algorithm. we could measure two successive x’s in the
Let m be such that M 2 ≤ 2m < 2M 2 . sum, we would have the period. Unfortu-
[This choice is made so that the approxi- nately the laws of quantum physics permit
mation used in Step 3 for functions whose only one measurement.
period is not a power of 2 will be good Example. Suppose that random mea-
enough for the rest of the algorithm to surement of the superposition of
work.] Use quantum parallelism as de- Eq. 1 produces 8. The state after this
scribed in Section 5.2 to compute f (x) = measurement8 (Figure 2) clearly shows
a x mod M for all integers from 0 to 2m − 1. the periodicity of f .
The function is thus encoded in the quan-
tum state Step 3. Applying a quantum Fourier trans-
form. The |ui part of the state will not be
2 −1
1 X
m

√ |x, f (x)i. (1) 8 Only the 9 bits of x are shown in Figure 2; the bits
2m x=0 of f (x) are known from the measurement.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


320 E. Rieffel and W. Polak

Fig. 2. Probabilities for measuring x when measuring the state C6x∈X |x, 8i
obtained in Step 2, where X = {x|211x mod 21 = 8}}.

used, so we will no longer write it. Ap- reducing the fraction 2vm (= rj ) to its lowest
ply the quantum Fourier transform to the terms will yield a fraction whose denom-
state obtained in Step 2. inator q is the period r. The fact that
P P in general the quantum Fourier trans-
U Q F T : x g (x)|xi → c G(c)|ci
form only approximately gives multiples
of the scaled frequency complicates the
Standard Fourier analysis tells us that extraction of the period from the measure-
when the period r of the function g (x) ment. When the period is not a power
defined in Step 2 is a power of 2, the re- of 2, a good guess for the period can be
sult of the quantum Fourier transform is obtained using the continued fraction
¯
X ¯ 2m À expansion of 2vm . This classical technique
c j ¯¯ j , is described in Appendix B.
j
r
Example. Say that measurement of the
where the amplitude is 0 except at multi- state returns v = 427. Since v and 2m
ples of 2m /r. When the period r does not are relatively prime, the period r will
divide 2m , the transform approximates the most likely not divide 2m and the contin-
exact case, so most of the amplitude is at- ued fraction expansion described in Ap-
m
tached to integers close to multiples of 2r . pendix B needs to be applied. The follow-
ing is a trace of the algorithm described in
Example. Figure 3 shows the result of Appendix B:
applying the quantum Fourier transform
to the state obtained in Step 2. Note
that Figure 3 is the graph of the fast i ai pi qi ²i
Fourier transform of the function shown 0 0 0 1 0.8339844
in Figure 2. In this particular example the 1 1 1 1 0.1990632
period of f does not divide 2m . 2 5 5 6 0.02352941
3 42 211 253 0.5
Step 4. Extracting the period. Measure the
state in the standard basis for quantum which terminates with 6 = q2 < M ≤ q3 .
computation, and call the result v. In the Thus, q = 6 is likely to be the period of f .
case where the period happens to be a
power of 2, so that the quantum Fourier Step 5. Finding a factor of M . When our
transform gives exactly multiples of 2m /r, guess for the period, q, is even, use the
the period is easy to extract. In this case, Euclidean algorithm to efficiently check
m
v = j 2r for some j . Most of the time j and whether either aq/2 + 1 or aq/2 − 1 has a
r will be relatively prime, in which case nontrivial common factor with M .

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 321

Fig. 3. Probability distribution of the quantum state after Fourier transfor-


mation.

The reason why aq/2 + 1 or aq/2 − 1 is 6.2.1 A Comment on Step 2 of Shor’s Algorithm.
likely to have a nontrivial common fac- The measurement in Step 2 can be skipped
tor with M is as follows. If q is indeed entirely. More generally Bernstein and
the period of f (x) = a x mod M , then Vazirani [1997] show that measurements
aq = 1 mod M, since aq a x = a x mod M for in the middle of an algorithm can always
all x. If q is even, we can write be avoided. If the measurement in Step 2
is omitted, the state consists of a superpo-
(aq/2 + 1)(aq/2 − 1) = 0 mod M . sitions of several periodic functions all of
which have the same period. By the linear-
Thus, as long as neither aq/2 +1 nor aq/2 −1 ity of quantum algorithms, applying the
is a multiple of M , either aq/2 +1 or aq/2 −1 quantum Fourier transformation leads to
has a nontrivial common factor with M . a superposition of the Fourier transforms
of these functions, each of which is entan-
Example. Since 6 is even either a6/2 −1 = gled with the corresponding u and there-
113 − 1 = 1330 or a6/2 + 1 = 113 + 1 = fore do not interfere with each other. Mea-
1332 will have a common factor with M. In surement gives a value from one of these
this particular example we find two factors Fourier transforms. Seeing how this argu-
gcd(21, 1330) = 7 and gcd(21, 1332) = 3. ment can be formalized illustrates some
of the subtleties of working with quan-
Step 6. Repeating the algorithm, if necessary.
tum superpostions. Apply the quantum
Various things could have gone wrong so
Fourier transform tensored with the iden-
that this process does not yield a factor of 2n −1
tity, U Q F T ⊗ I, to C6x=0 |x, f (x)i to get
M:
1. The value v was not close enough to a 2X
n
−1 2X
m
−1 µ ¶
0 2πicx
m
multiple of 2r . C exp |c, f (x)i,
2m
x=0 c=0
2. The period r and the multiplier j could
have had a common factor so that the
which is equal to
denominator q was actually a factor of
the period, not the period itself. X X X µ ¶
2πicx
3. Step 5 yields M as M ’s factor. C0 exp |c, ui
2m
4. The period of f (x) = a x mod M is odd. u x| f (x)=u c

Shor shows that few repetitions of this al- for u in the range of f (x). What results
gorithm yields a factor of M with high is a superposition of the results of Step 3
probability. for all possible u’s. The quantum Fourier

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


322 E. Rieffel and W. Polak

transform is being applied to a family and the structure can be exploited to


of separate functions g u indexed by u construct efficient algorithms. In other
where cases, like constraint satisfaction prob-
½ lems such as 3-SAT or graph colorabil-
1 if f (x) = u ity, the problem structure can be exploited
gu =
0 otherwise, for heuristic algorithms that yield effi-
cient solution for some problem instances.
all with the same period. Note that the am- But in the general case of an unstruc-
plitudes in states with different u’s never tured problem, randomly testing the truth
interfere (add or cancel) with each other. of statements P (xi ) one by one is the
The transform U Q F T ⊗ I as applied above best that can be done classically. For a
can be written search space of size N , the general un-
structured search problem requires O(N )
−1
X 2X
n
evaluations of P . On a quantum computer,
UQ F T ⊗ I : C g u (x)|x, f (x)i however, Grover showed that the unstruc-
u∈R x=0 tured search problem can be solved
√ with
−1 2X
−1 bounded probability within O( N ) eval-
X 2X
n n

→C 0
G u (c)|c, ui, uations of P . Thus Grover’s search algo-
rithm [Grover 1996] is provably more ef-
u∈R x=0 c=0
ficient than any algorithm that could run
where G u (c) is the discrete Fourier trans- on a classical computer.
form of g u (x) and R is the range of f (x). While Grover’s algorithm is optimal
Measure c and run Steps 4 and 5 as [Bennett et al. 1997; Boyer et al. 1996;
before. Zalka 1997] for completely unstructured
searches, most search problems involve
searching a structured solution space.
7. SEARCH PROBLEMS
Just as there are classical heuristic al-
A large class of problems can be speci- gorithms that exploit problem structure,
fied as search problems of the form “find one would expect that there are more
some x in a set of possible solutions such efficient quantum algorithms for cer-
that statement P (x) is true.” Such prob- tain structured problem instances. Cerf
lems range from database search to sort- et al. [1998] use Grover’s search al-
ing to graph coloring. For example, the gorithm in place of classical searches
graph coloring problem can be viewed as a within a heuristic algorithm to show that
search for an assignment of colors to ver- a quadratic speed-up is possible over
tices so that the statement “all adjacent a particularly simple classical heuristic
vertices have different colors” is true. Sim- for solving NP-hard problems. Brassard
ilarly, a sorting problem can be viewed as et al. [1998], using the techniques of
a search for a permutation for which the Grover’s search algorithm in a less obvious
statement “the permutation x takes the way, show that general heuristic searches
initial state to the desired sorted state” is have quantum analogs with quadratic
true. speed-up.
An unstructured search problem is one There is hope that for certain struc-
where nothing is know (or no assumption tured problems a speed-up greater than
are used) about the structure of the solu- quadratic is possible. Such algorithms will
tion space and the statement P . For exam- likely require new approaches that are not
ple, determining P (x0 ) provides no infor- merely quantum implementations of clas-
mation about the possible value of P (x1 ) sical algorithms. Shor’s algorithm, when
for x0 6= x1 . A structured search problem viewed as a search for factors, is an ex-
is one where information about the search ample of an algorithm that achieves expo-
space and statement P can be exploited. nential speed-up by using problem struc-
For instance, searching an alphabet- ture (number theory) in new ways unique
ized list is a structured search problem to quantum computation.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 323

2 −1
1 X
n
Tad Hogg has developed heuristic quan-
tum search algorithms that exploit prob- √ |x, P (x)i. (2)
lem structure. His approach is distincly 2n x=0
nonclassical and uses unique properties of The difficult step is to obtain a useful re-
quantum computation. One problem with sult from this superposition.
this approach is that, like most heuristic For any x0 such that P (x0 ) is true, |x0 , 1i
algorithms, the use of problem structure will be part of the superposition of Eq. 2.
is complicated enough that it is hard to Since the amplitude of such a state is √12n ,
determine the probability that a single
the probability that a random measure-
execution of an algorithm will give a cor-
ment of the superposition produces x0 is
rect answer. Therefore, it is unknown how
only 2−n . The trick is to change the quan-
efficient Hogg’s algorithms are. Classi-
tum state in Eq. 2 so as to greatly increase
cally the efficiency of heuristic algorithms
the amplitude of vectors |x0 , 1i for which
is estimated by empirically testing the
P is true and decrease the amplitude of
algorithm. But as there is an exponential
vectors |x, 0i for which P is false.
slowdown when simulating a quantum
Once such a transformation of the quan-
computer on a classical one, empirical test-
tum state has been performed, one can
ing of quantum algorithms is currently in-
simply measure the last qubit of the quan-
feasible except in small cases. Small cases
tum state which represents P (x). Because
indicate that Hogg’s algorithms are more
of the amplitude change, there is a high
efficient than Grover’s algorithm applied
probability that the result will be 1. If
to structured search problems, but that
this is the case, the measurement has pro-
the speed-up is likely to be only polyno-
jected the state of Eq. 2 onto the subspace
mial. While less interesting theoretically,
√1 6 k |xi , 1i where k is the number of so-
even a small polynomial speed-up on av- k i=1
erage for these computationally difficult lutions. Further measurement of the re-
problems is of significant practical inter- maining bits will provide one of these so-
est. Until sufficiently large quantum com- lutions. If the measurement of qubit P (x)
puters are built, or better techniques for yields 0, then the whole process is started
analyzing such algorithms are found, the over and the superposition of Eq. 2 must
efficiency cannot be determined for sure. be computed again.
Grover’s algorithm then consists of the
following steps:
7.1. Grover’s Search Algorithm
1. Prepare a register containing a super-
Grover’s algorithm searches an unstruc- position of all possible values xi ∈
tured list of size N for an x that makes a [0 . . . 2n − 1].
statement true. Let n be such that 2n ≥ N , 2. Compute P (xi ) on this register.
and let U p be the quantum gate that im- 3. Change amplitude a j to −a j for x j such
plements the classical function P (x) that that P (x j ) = 1. An efficient algorithm
tests the truth of the statement, where for changing selected signs is described
true is encoded as 1. in Section 7.1.2. A plot of the ampli-
tudes after this step is shown here.
U P : |x, 0i → |x, P (x)i

The first step is the standard one


for quantum computing described in
Section 5.2. Compute P for all possible in-
puts xi , by applying U P to a register con- 4. Apply inversion about the average to in-
taining the superposition √12n 6x=0
n−1
|xi of all crease amplitude of x j with P (x j ) = 1.
n
2 possible inputs x together with a regis- The quantum algorithm to efficiently
ter set to 0, leading to the superposition perform inversion about the average is

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


324 E. Rieffel and W. Polak

given in Section 7.1.1. The resulting not increase the overall complexity of the
amplitudes are shown, where the am- algorithm.
plitude of all the xi ’s with P (xi ) = 0 have Grover has extended his algorithm to
been diminished imperceptibly. achieve quadratic speed-up for other non-
search problems such as computing the
mean and median of a function [Grover
1998]. Using similar techniques Grover
has also shown that certain search prob-
lems that classically run in O(log N ) can
be solved in O(1) on a quantum computer.
Grover’s search can used as a subrou-
tine in other quantum computations, since
Biron et al. [1998] show how the technique
π
√ can be used with arbitrary initial ampli-
5. Repeat steps 2 through 4 2n times. tude
4 √ distributions while still maintaining
6. Read the result. O( N ) complexity.
Boyer et al. [1996] provide a detailed
analysis of the performance of Grover’s al- 7.1.1 Inversion about the Average. To perform
gorithm. They prove that Grover’s algo- inversion about the average on a quantum
rithm is optimal up to a constant factor; computer the inversion must be a unitary
no quantum algorithm can perform an un- transformation. Furthermore, in order for
structured search faster. They also show the algorithm
√ as a whole to solve the prob-
lem in O( N ) time, the inversion must be
that if there is only a single√ x0 such that able to be performed efficiently. As will be
P (x0 ) is true, then after π8 2n iterations
of steps 2 through shown shortly, the inversion can be accom-
√ 4 the failure rate is 0.5. plished with O(n) = O(log(N )) quantum
After iterating π4 2n times the failure rate
gates.
drops to 2−n . Interestingly, additional it-
It is easy to see that the transformation
erations will increase
√ the failure rate. For
example, after π2 2n iterations the failure
rate is close to 1. X
N −1 X
N −1

There are many classical algorithms ai |xi i → (2A − ai )|xi i,


in which a procedure is repeated over i=0 i=0
and over again for ever better results.
Repeating quantum procedures may im- where A denotes the average of the ai ’s, is
prove results for a while, but after a performed by the N × N matrix
sufficient number of repetitions the re-
sults will get worse again. Quantum proce- 2 
dures are unitary transformations, which N
−1 2
N
... 2
N
 2 
are rotations of complex space, and thus  2
−1 ... 2

while a repeated applications of a quan- D= N N N .
 ... ... ... ... 
tum transform may rotate the state closer 2 2
... 2
−1
and closer to the desired state for a while, N N N
eventually it will rotate past the desired
state to get farther and farther from the Since D D ∗ = I , D is unitary and is
desired state. Thus to obtain useful re- therefore a possible quantum state trans-
sults from a repeated application of a formation.
quantum transformation, one must know We now turn to the question of how ef-
when to stop. Brassard et al. [1998] de- ficiently the transformation can be per-
scribe an extension of Grover’s algorithm formed, and show that it can be decom-
that uses Fourier transforms to determine posed into O(n) = O(log(N )) elementary
the number of solutions and the optimal quantum gates. Following Grover, D can
number of iterations. The extension does be defined as D = W RW , where W is

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 325
Ã
the Walsh–Hadamard transform defined 1 X
in Section 4 and =√ |x, 0 ⊕ 0i
2n+1
  X
x∈X 0
X
1 0 ... 0
0 −1 0 . . .  + |x, 0 ⊕ 1i − |x, 1 ⊕ 0i
R= .
0 ... ... 0  x∈X 1
!
x∈X 0
0 . . . 0 −1 X
− |x, 1 ⊕ 1i
To see that D = W RW , consider R = x∈X 1
R 0 − I where I is the identity and Ã
1 X X
  =√ |x, 0i + |x, 1i
2 0 ... 0 2n+1
0 0 0 0 . . . x∈X 0 x∈X 1
R = .
0 ... ... 0 !
X X
0 ... 0 0 − |x, 1i − |x, 0i
x∈X 0 x∈X 1
Now W RW = W (R 0 − I )W = W R 0 W − I .
It is easily verified that à !
1 X X
2 2  =√ |xi − |xi ⊗b
. . . N2 2n x∈X 0 x∈X 1
N N
2 2 2 
 N N N . . .
W R0W =   2 ... ... 2 
 Thus the amplitude of the states in X 1
N N  have been inverted as desired.
N
2
. . . N2 N2

and thus W R 0 W − I = D. 7.2. Heuristic Search


7.2.1 A Note on the Walsh–Hadamard Trans-
7.1.2 Changing the Sign. We still have to ex-
form. Another representation for the
plain how to invert the amplitude of the
Walsh–Hadamard transformation of Sec-
desired result. We show, more generally, a
tion 4.1.1 is useful for understanding how
surprisingly simple way to invert the am-
to use the Walsh–Hadamard transforma-
plitude of exactly those states with P (x) =
tion in constructing quantum algorithms.
1 for a general P .
The n-bit Walsh–Hadamard transforma-
Let U P be the gate array that per-
tion is a 2n × 2n matrix W with entries
forms the computation U P : |x, bi →
Wrs where both r and s range from 0 to
|x, b ⊕ P (x)i. Apply U P to the superposi-
P 2n − 1. We will show that
tion |ψi = √12n n−1 x=0 |xi and choose b =
√1 |0i − |1i to end up in a state where
2 1
the sign of all x with P (x) = 1 has been Wrs = √ (−1)r·s
changed, and b is unchanged. 2n
To see this, let X 0 = {x|P (x) = 0} and
X 1 = {x|P (x) = 1}, and consider the ap- where r · s is the number of common 1
plication of U P . bits in the the binary representations of r
and s.
U P (|ψ, bi) To see this equality, note that
Ã
1 X X X
=√ UP |x, 0i + |x, 0i W (|ri) = Wrs |si.
2n+1 x∈X 0 x∈X 1 s
!
X X Let rn−1 . . . r0 be the binary representation
− |x, 1i − |x, 1i of r and sn−1 . . . s0 be the binary represen-
x∈X 0 x∈X 1 tation of s.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


326 E. Rieffel and W. Polak

Fig. 4. Lattice of variable assignments in a CSP.

W (|ri) = (H ⊗ · · · ⊗ H)(|rn−1 i ⊗ · · · ⊗ |r0 i) Using the standard correspondence be-


tween sets of enumerated elements and bi-
1 nary sequences, in which a 1 in the nth
= √ (|0i + (−1)rn−1 |1i) ⊗ · · ·
2n place corresponds to inclusion of the nth
element and a 0 corresponds to exclusion,
⊗ (|0i + (−1)r0 |1i) standard basis vectors for a quantum state
2 −1 space can be put in one to one correspon-
1 X
n

=√ (−1)sn−1 rn−1 |sn−1 i ⊗ · · · dence with the sets. For example, Figure 5
2n s=0 shows the lattice of Figure 4 rewritten in
ket notation, where the elements v1 = 0,
⊗ (−1)s0 r0 |s0 i v1 = 1, v2 = 0 and v2 = 1 have been enu-
merated in that order.
2 −1
1 X
n
If a state violates a constraint, then so
=√ (−1)s·r |si. do all states above it in the lattice. The
2n s=0
approach Hogg takes in designing quan-
tum algorithms for constraint satisfaction
7.2.2 Overview of Hogg’s Algorithms. A con- problems is to begin with all the amplitude
straint satisfaction problem (CSP) has n concentrated in the |0 . . . 0i state and to
variables V = {v1 , . . . , vn } which can take iteratively move amplitude up the lattice
m different values X = {x1 , . . . , xm } sub- from sets to supersets and away from sets
ject to certain constraints C1 , . . . , Cl . So- that violate the constraints. Note that this
lutions to a constraint satisfaction prob- algorithm begins differently than Shor’s
lem lie in the space of assignments of xi ’s algorithm and Grover’s algorithm, which
to v j ’s, V × X . There is a natural lattice both begin by computing a function on a
structure on this space given by set con- superposition of all the input values at
tainment. Figure 4 shows the assignment once.
space and its lattice structure for n = 2, Hogg gives two ways [Hogg 1996; 1998]
m = 2, x1 = 0, and x2 = 1. Note that of constructing a unitary matrix for
the lattice includes both incomplete and moving amplitude up the lattice. We will
inconsistent assignments. describe both methods, and then describe

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 327

Fig. 5. Lattice of variable assignments in ket form.

how he moves amplitude away from bad  


0 0 0 0 0 0 0 1
sets.  √1 0 0 0 0 0 0 0
 3 
Moving amplitude up: Method 1. There is  1 
√ 0 0 0 0 0 0 0
an obvious transformation that moves  3 
0 √1 √1 0 0 0 0 0
amplitude from sets to supersets. Any  
 √1 2 2

amplitude associated to the empty set is  3 0 0 0 0 0 0 0
 
evenly distributed among all sets with 0 √1 0 0 √1 0 0 0
 2 2 
a single element. Any amplitude associ- 0 0 √1 0 √1 0 0 0
ated to a set with a single element is 2 2
evenly distributed among all two-element 0 0 0 1 0 1 1 0
sets that contain that element and so
on. For the lattice of a three element Unfortunately this transformation is
set not unitary. Hogg [1996] uses the fact that
the closest (in a suitable metric) unitary
matrix U M to an arbitrary matrix M can
be found using M ’s singular value decom-
position M = U DV T , where D is a diago-
nal matrix and U and V are unitary ma-
trices. The product U M = U V T gives the
closest unitary matrix to M . Provided that
U M is sufficiently close to M , U M will be-
have in a similar way to M and will there-
fore do a reasonably job of moving ampli-
tude from sets to their supersets.
We want to transform Moving amplitude up: Method 2. The sec-
√ ond approach [Hogg 1998] uses the Walsh–
|000i → 1/ 3(|001i + |010i + |100i Hadamard transformation. Hogg assumes
√ that the desired matrix has form W DW ,
|001i → 1/ 3(|011i + |110i + |101i
where W is the Walsh–Hadamard trans-
... formation and D is a diagonal matrix
whose entries depend only on the size of
The complete matrix for this transforma- the sets. Hogg calculates the entries for D
tion looks like (as usual the basis vectors that maximize the movement of amplitude
are ordered according to their binary rep- from a set to its supersets. This calculation
resentation) exploits the property

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


328 E. Rieffel and W. Polak

Wrs = √1 (−1)|r·s| = √1 (−1)|r∩s| in an unintended and often nonunitary


N N
fashion.
Steane [1998] estimates that the deco-
shown in Section 7.2.1. herence of any system likely to be built
Moving amplitude away from bad sets. To is 107 times too large to be able to run
effect moving amplitude away from sets Shor’s algorithm as it stands on a 130-digit
that violate the constraints, Hogg suggests number. However, adding error correction
adjusting the phases of the sets, depend- algorithms to Shor’s algorithm mitigates
ing on the extent to which they violate the the effect of decoherence, making it again
constraints, in such a way that the am- look possible that a system could be built
plitude distributed to sets that have bad on which Shor’s algorithm could be run for
subsets cancels, whereas the amplitude large numbers.
distributed to sets from all good subsets On the surface, quantum error correc-
adds. Different choices here will work tion is similar to classical error correct-
more or less effectively depending on the ing codes in that redundant bits are used
particular problem. One choice he sug- to detect and correct errors, but the sit-
gests is inverting the phase of all bad uation for quantum error correction is
sets which will result in some cancela- somewhat more complicated than in the
tion in the amplitude of supersets be- classical case, since we are not deal-
tween the amplitude coming from good ing with binary data but with quantum
subsets and bad subsets. This phase in- states.
version can be done as in Grover’s al- Quantum error correction must recon-
gorithm (Section 7.1.2) with a P that struct the exact encoded quantum state.
tests whether a given state satisfies all Given the impossibility of cloning or copy-
of the constraints or not. Another sug- ing the quantum state, this reconstruction
gestion is to give random phases to the appears harder than in the classical case.
bad sets so that on average the contribu- However, it turns out that classical tech-
tion to the amplitude of a superset from niques can be modified to work for quan-
bad subsets is zero. Other choices are tum systems.
possible.
Because the canceling resulting from 8.1. Characterization of Errors
the phase changes varies from problem
In the following it is assumed that all er-
to problem, the probability of obtaining
rors are the result of quantum interaction
a solution is difficult to analyze. A few
between a set of qubits and the environ-
small experiments have been done, and
ment. The possible errors for each single
the guess is that the cost of the search
qubit considered are linear combinations
still grows exponentially, but consider-
of no errors (I ), bit flip errors (X ), phase
ably more slowly than in the unstructured
errors (Z ), and bit flip phase errors (Y ).
case. But until sufficiently large quantum
A general single bit error is thus a trans-
computers are built or better techniques
formation e1 I + e2 X + e3 Y + e4 Z . Interac-
for analyzing such algorithms are found,
tion with the environment transforms sin-
the efficiency cannot be determined for
gle qubits according to
sure.
|ψi → (e1 I + e2 X + e3 Y + e4 Z )|ψi
X
8. QUANTUM ERROR CORRECTION = ei Ei |ψi.
i
One fundamental problem in building
quantum computers is the need to isolate For the general case of quantum regis-
the quantum state. An interaction of parti- ters, possible errors are expressed as lin-
cles representing qubits with the external ear combinations of unitary error opera-
environment disturbs the quantum state tors Ei . These could be combinations of
and causes it to decohere, or transform single-bit errors, such as tensor products

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 329

of the single-bit error transformations Ei0 |φ, i0 i


{I, X , Y, Z }, or more general multibit
transformations. In any case, an error can 3. Apply the inverse error transformation
be written as 6i ei Ei for some error opera- Ei−1
0
to the first n + k qubits of Ei0 |φ, i0 i
tors Ei and coefficients ei . to get the corrected state |φi.
Note that Step 2 projects a superposi-
8.2. Recovery of Quantum State tion of multiple error transformations into
a single error. Consequently, only one in-
An error correcting code for a set of er- verse error transformation is required in
rors Ei consists of a mapping C that em- Step 3.
beds n data bits in n + k code bits together
with a syndrome extraction operator SC
that maps n + k code bits to the set of 8.3. Error Correction Example
indices of correctable errors Ei such that Consider the trivial error correcting code
i = SC (Ei (C(x))). If y = E j (C(x)) for some C that maps |0i → |000i and |1i → |111i.
unknown but correctable error, then er- C can correct single bit flip errors
ror SC ( y) can be used to recover a prop-
erly encoded value C(x) (i.e., E S−1C ( y) ( y) =
C(x)). E = {I ⊗I ⊗I, X ⊗I ⊗I, I ⊗X ⊗I, I ⊗I ⊗X }.
Now consider the case of a quantum reg-
ister. First, the state of the register can The syndrome extraction operator is
be in a superposition of basis vectors. Fur-
thermore, the error can be a combination
S : |x0 , x1 , x2 , 0, 0, 0i → |x0 , x1 , x2 , x0
of correctable error operators Ei . It turns
out that it is still possible to recover the XOR x1 , x0 XOR x2 , x1 XOR x2 i,
encoded quantum state.
Given an error correcting code C with with the corresponding error correction
syndrome extraction operator SC , an operators shown in the table. Note that
n-bit quantum state |ψi is encoded in Ei = Ei−1 for this example.
a n + k–bit quantum state |φi = C|ψi.
Assume that decoherence leads to an
error state 6i ei Ei |φi for some combina- Bit flipped Syndrome Error correction
tion of correctable errors Ei . The origi- none |000i none
nal encoded state |φi can be recovered as 0 |110i X ⊗I⊗I
follows: 1 |101i I⊗X ⊗I
2 |011i I⊗I⊗X
1. Apply the syndrome extraction opera-
tor SC to the quantum state padded
with sufficient |0i bits: Consider the quantum bit |ψi = √1 (|0i−
2
à ! |1i), which is encoded as
X
SC ei Ei |φi ⊗ |0i
i 1
X C|ψi = |φi = √ (|000i − |111i),
= ei (Ei |φi ⊗ |ii). 2
i

Quantum parallelism gives a superpo- and the error


sition of different errors each associated
with their respective error index i. 4 3
E= X ⊗ I ⊗ I + I ⊗ X ⊗ I.
2. Measure the |ii component of the result. 5 5
This yields some (random) value i0 and
projects the state to The resulting error state is

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


330 E. Rieffel and W. Polak
µ ¶
4 3 part of the error can be removed by ap-
E|φi = X ⊗I⊗I+ I⊗X ⊗I plying the inverse error operator X ⊗ I ⊗
5 5
µ ¶ I , corresponding to the measured value
1
× √ (|000i − |111i) |110i, to the first three bits, to produce
2
µ ¶
4 1 1
= X ⊗ I ⊗ I √ (|000i − |111i) √ (|000i − |111i) = C|ψi = |φi.
5 2
µ ¶ 2
3 1
+ I ⊗ X ⊗ I √ (|000i − |111i)
5 2 9. CONCLUSIONS
4
= √ X ⊗ I ⊗ I (|000i − |111i) Quantum computing is a new, emerging
5 2 field that has the potential to dramatically
3 change the way we think about computa-
+ √ I ⊗ X ⊗ I (|000i − |111i)
5 2 tion, programming, and complexity. The
4 challenge for computer scientists and oth-
= √ (|100i − |011i) ers is to develop new programming tech-
5 2 niques appropriate for quantum comput-
3 ers. Quantum entanglement and phase
+ √ (|010i − |101i). cancellation introduce a new dimension to
5 2
computation. Programming no longer con-
Next apply the syndrome extraction to sists of merely formulating step-by-step
(E|φi) ⊗ |000i as follows: algorithms but requires new techniques of
adjusting phases and mixing and diffusing
amplitudes to extract useful output.
SC ((E|φi) ⊗ |000i)
We have tried to give an accurate
4 account of the state-of-the-art of quan-
= SC ( √ (|100000i − |011000i)
5 2 tum computing for computer scientists
3 and other nonphysicists. We have de-
+ √ (|010000i − |101000i)) scribed some of the quantum mechani-
5 2 cal effects, such as the exponential state
4 space, the entangled states, and the lin-
= √ (|100110i − |011110i)
5 2 earity of quantum state transformations,
3 that make quantum parallelism possi-
+ √ (|010101i − |101101i) ble. Even though quantum computations
5 2 must be linear and reversible, any clas-
4 sical algorithm can be implemented on a
= √ (|100i − |011i) ⊗ |110i
5 2 quantum computer. But the real power of
3 these new machines, the exponential par-
+ √ (|010i − |101i) ⊗ |101i. allelism, can only be exploited using new,
5 2 innovative programming techniques. Peo-
ple have only recently begun to research
Measuring the last three bits of this state such techniques.
yields either |110i or |101i. Assuming the We have described Shor’s polynomial-
measurement produces the former, the time factorization algorithm, which stim-
state becomes ulated the field of quantum computing.
Given a practical quantum computer,
1 Shor’s algorithm would make many
√ (|100i − |011i) ⊗ |110i.
2 present cryptographic methods obsolete.
Grover’s search algorithm, while only pro-
The measurement has the almost mag- viding a polynomial speed-up, proves that
ical effect of causing all but one summand quantum computers are strictly more pow-
of the error to disappear. The remaining erful than classical ones. Even though

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 331

Grover’s algorithm has been shown to be and Clearwater [1998] contains an in-
optimal, there is hope that faster algo- troduction to early results in quantum
rithms can be found by exploiting prop- complexity.
erties of the problem structure. We have Of course, there are daunting physical
described one such approach taken by problems that must be overcome if any-
Hogg. one is ever to build a useful quantum
There are a few other known quantum computer. Decoherence, the distortion of
algorithms that we did not discuss. Jones the quantum state due to interaction with
and Mosca [1998] describe the implemen- the environment, is a key problem. A big
tation on a 2-bit quantum computer of breakthrough for dealing with decoher-
a constant time algorithm [Deutsch and ence came from the algorithmic, rather
Jozsa 1992] that can distinguish whether than the physical, side of the field with the
a function is balanced or constant. Grover development of quantum error correction
[1998] describes an efficient algorithm for techniques. We have described some of the
estimating the median of a set of values principles involved. Further advances in
and both Grover [1998] and Terhal and quantum error correction and the devel-
Smolin [1997], using different methods, opment of robust algorithms will be as im-
can solve the coin weighing problem in a portant for the development of practical
single step. quantum computers as advances in the
Beyond these algorithms not much more hardware side.
is known about what could be done with
a practical quantum computer. It is an
9.1. Further Reading
open question whether or not we can
find quantum algorithms that provide ex- Andrew Steane’s survey article “Quan-
ponential speed-up for problems other tum Computing” [Steane 1998] is aimed at
than factoring. There is some speculation physicists. We recommend reading his pa-
among physicists that quantum transfor- per for his viewpoint on this subject, par-
mations might be slightly nonlinear. So ticularly for his description of connections
far all experiments that have been done between information theory and quantum
are consistent with the standard linear computing and for his discussion of er-
quantum mechanics, but a slight nonlin- ror correction, of which he was one of the
earity is still possible. Abrams and Lloyd main developers. He also has an overview
[1998] show that even a very slight nonlin- of the physics involved in actually build-
earity could be exploited to solve all NP- ing quantum computers and a survey of
hard problems on a quantum computer in what had been done up to July 1997. His
polynomial time. This result further high- article contains a more detailed history
lights the fact that computation is funda- of the ideas related to quantum comput-
mentally a physical process, and that what ing than the present paper, and has more
can be computed efficiently may depend on references as well. Another shorter and
subtle issues in physics. very readable tutorial can be found in
The unique properties of quantum com- Berthiaume [1997].
puters give rise to new kinds of complex- Richard Feynman’s Lectures on Compu-
ity classes. For instance, BQP is the set tation [Feynman 1996] contains a reprint
of all languages accepted by a quantum of the lecture “Quantum Mechanical Com-
Turing machine in polynomial time with puters” [Feynman 1985], which began the
bounded probability of error. Details of whole field. It also discusses the thermo-
the extensive research done in the field dynamics of computations, which is closely
of quantum complexity theory is beyond tied with reversible computing and infor-
the scope of this paper. The interested mation theory.
reader may start by consulting Bennett Colin Williams and Scott Clearwater’s
et al. [1997] and Watrous [1998] respec- book Explorations in Quantum Comput-
tively for analyses of time and space com- ing [Williams and Clearwater 1998] comes
plexity of quantum computation. Williams with software, in the form of Mathematica

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


332 E. Rieffel and W. Polak

notebooks, that simulates some quantum The conjugate transpose distributes


algorithms such as Shor’s algorithm. over tensor products; that is,
The second half of the October 1997 is-
sue of the SIAM Journal of Computing (A ⊗ B)∗ = A∗ ⊗ B∗ .
contains six seminal articles on quantum
computing, including four we have already A matrix U is unitary if its conjugate
cited [Bennett et al. 1997; Bernstein and transpose is its inverse: U ∗ U = I.
Vazirani 1997; Shor 1997; Simon 1997]. The tensor product of several matrices
Most of the articles referenced in this is unitary if and only if each one of the
paper, and many more, can be found at matrices is unitary up to a constant. Let
the Los Alamos preprint server: http:// U = A1 ⊗ A2 ⊗ · · · ⊗ An . Then U is unitary
xxx.lanl.gov/archive/quant-ph. Links if Ai∗ Ai = ki I and 5i ki = 1.
to research projects and other informa-
¡ ¢
tion about quantum computing can be U ∗ U = A∗1 ⊗ A∗2 ⊗ · · · ⊗ A∗n
found on our web site http://www.fxpal.
xerox.com/Quantum Computing. × (A1 ⊗ A2 ⊗ · · · ⊗ An )
= A∗1 A1 ⊗ A∗2 A2 ⊗ · · · ⊗ A∗n An
APPENDIX
= k1 I ⊗ · · · ⊗ kn I
A. TENSOR PRODUCTS
=I
The tensor product (⊗) of a n-dimensional
and a k-dimensional vector is a nk-
dimensional vector. Similarly, if A and where each I refers to the identity matrix
B are transformations on n-dimensional of appropriate dimension.
and k-dimensional vectors respectively, For example, the distributive law allows
then A ⊗ B9 is a transformation on nk- computations of the form:
dimensional vectors.
The exact mathematical details of ten- (a0 |0i + b0 |1i) ⊗ (a1 |0i + b1 |1i)
sor products are beyond the scope of this
paper (see Hungerford [1974] for a com- = (a0 |0i ⊗ a1 |0i) + (b0 |1i ⊗ a1 |0i)
prehensive treatment). For our purposes + (a0 |0i ⊗ b1 |1i) + (b0 |1i ⊗ b1 |1i)
the following algebraic rules are sufficient
to calculate with tensor products. For ma- = a0 a1 ((|0i ⊗ |0i) + b0 a1 (|1i ⊗ |0i)
trices A, B, C, D, U , vectors u, x, y, and
scalars a, b, the following hold: + a0 b1 (|0i ⊗ |1i) + b0 b1 (|1i ⊗ |1i)
= a0 a1 (|00i + b0 a1 |10i + a0 b1 |01i
(A ⊗ B)(C ⊗ D) = AC ⊗ BD
+ b0 b1 |11i
(A ⊗ B)(x ⊗ y) = Ax ⊗ B y
(x + y) ⊗ u = x ⊗u+ y ⊗u
u ⊗ (x + y) = u⊗x +u⊗ y B. CONTINUED FRACTIONS AND
EXTRACTING THE PERIOD FROM THE
ax ⊗ by = ab(x ⊗ y)
MEASUREMENT IN SHOR’S ALGORITHM
µ ¶ µ ¶
A B A⊗U B⊗U In the general case where the period r does
⊗U = , not divide 2m ; the value v measured in
C D C⊗U D⊗U
Step 4 of Shor’s algorithm will be, with
which is specialized for scalars a, b, c, d to high probability, close to some multiple of
2m m
µ ¶ µ ¶ r
, say j 2r .
a b aU bU The aim is to extract the period r from
⊗U = .
c d cU dU the measured value v. Shor shows that,
with high probability, v is within 12 of some
m
9 Technically, this is a right Kronecker product. j 2r . Thus

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 333
¯ ¯
¯ m¯ j
¯v − j 2 ¯ < 1 r
, because it has denominator less than
¯ r ¯ 2 M . We take the denominator q of the ob-
tained fraction as our guess for the period,
for some j , which implies that which will work when j and r are rela-
tively prime.
¯ ¯
¯ v j ¯¯ 1 1
¯
¯ 2m − r ¯ < 2 · 2m < 2M 2 . ACKNOWLEDGMENTS
The authors would like to thank Tad Hogg and
The difference 0
between two distinct frac- Carlos Mochon for many enjoyable conversations
tions qp and qp0 with denominators less than about quantum computing and for their feedback
M is bounded on an earlier draft of this paper. We are also grate-
ful to Lee Corbin, David Goldberg, Lov Grover,
¯ ¯ ¯ 0 ¯
¯p 0¯ ¯ 0 ¯ Norman Hardy, Vaughan Pratt, Marc Rieffel, and
¯ − p ¯ = ¯ pq − p q ¯ > 1 . the anonymous referees for detailed comments on
¯q q0 ¯ ¯ qq 0 ¯ M2 earlier drafts of this paper. Finally, we would like
to thank FXPAL for enthusiastically supporting this
Thus there is at most one fraction qp with work.
denominator q < M such that | 2vm − qp | <
1
M2
. In the high-probability case that v is
m REFERENCES
within 12 of j 2r , this fraction will be rj .
The unique fraction with denominator ABRAMS, D. S. AND LLOYD, S. 1998. Nonlinear quan-
less than M that is within M1 2 of 2vm can tum mechanics implies polynomial-time solution
for NP-complete and #p problems. Los Alamos
be obtained efficiently from the continued Physics Preprint Archive, http://xxx.lanl.
fraction expansion of 2vm as follows. Using gov/abs/quant-ph/9801041.
the sequences BARENCO, A., BENNETT, C. H., CLEVE, R., DIVINCENZO,
D. P., MARGOLUS, N. H., SHOR, P. W., SLEATOR,
· ¸ T., SMOLIN, J. A., AND WEINFURTER, H. 1995.
v
a0 = Elementary gates for quantum computation.
2m Physical Review A 52, 5, 3457–3467. Preprint at
Los Alamos Physics Preprint Archive, http://
v
²0 = m − a0 xxx.lanl.gov/abs/quant-ph/9503016 and at
2 http://vesta.physics.ucla.edu/cgi-bin/
· ¸ uncompress ps cgi?torgats1.ps.
1
an = BENNETT, C. H. 1992. Quantum cryptography using
²n−1 any two nonorthogonal states. Physical Review
Letters 68, 3121–3124.
1
²n = − an BENNETT, C. H., BERNSTEIN, E., BRASSARD, G., AND
²n−1 VAZIRANI, U. V. 1997. Strengths and weak-
p0 = a0 nesses of quantum computing. Society for In-
dustrial and Applied Mathematics Journal
p1 = a1 a0 + 1 on Computing 26, 5, 1510–1523. Preprint
at Los Alamos Physics Preprint Archive,
pn = an pn−1 + pn−2 http://xxx.lanl.gov/abs/quant-ph/9701001.
q0 = 1 BENNETT, C. H. AND BRASSARD, G. 1987. Quantum
public key distribution reinvented. SIGACT
q1 = a1 News (ACM Special Interest Group on Automata
qn = an qn−1 + qn−2 , and Computability Theory) 18, 51–53.
BENNETT, C. H., BRASSARD, G., AND EKERT, A. K.
1992. Quantum cryptography. Scientific Amer-
compute the first fraction qpnn such that ican 267, 4 (Oct.), 50.
qn < M ≤ qn+1 . See any standard num- BERNSTEIN, E. AND VAZIRANI, U. V. 1997. Quantum
ber theory text, such as Hardy and Wright complexity theory. Society for Industrial and Ap-
[1979], for why this procedure works. plied Mathematics Journal on Computing 26, 5,
In the high probability case when 2vm is 1411–1473. A preliminary version of this paper
appeared in the Proceedings of the 25th Associ-
within M1 2 of a multiple rj of 1r , the frac- ation for Computing Machinery Symposium on
tion obtained from the above procedure is the Theory of Computing.

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


334 E. Rieffel and W. Polak

BERTHIAUME. 1997. Quantum computation. In ALAN FEYNMAN, R. 1985. Quantum mechanical comput-
L. SELMAN, ED., Complexity Theory Retrospective, ers. Optics News 11, 11–20. Also in Foundations
In Honor of Juris Hartmanis on the Occasion of of Physics, 16(6), 507–531, 1986.
His Sixtieth Birthday, (July 5, 1988), Vol. 2, 23– FEYNMAN, R. 1996. In Feynman Lectures on Compu-
51. tation. A. J. HEY AND R. W. ALLEN EDS., Addison-
BIRON, D., BIHAM, O., BIHAM, E., GRASSEL, M., AND LI- Wesley.
DAR, D. A. 1998. Generalized grover search al-
FEYNMAN, R. P., LEIGHTON, R. B., AND SANDS, M.
gorithm for arbitrary initial amplitude distri- 1965. Lectures on Physics, Vol. III. Addison-
bution. Los Alamos Physics Preprint Archive, Wesley.
http://xxx.lanl.gov/abs/quant-ph/9801066.
GERSHENFELD, N. A. AND CHUANG, I. L. 1997.
BOSCHI, D., BRANCA, S., MARTINI, F. D., HARDY, L., AND Bulk spin resonance quantum computing. Sci-
POPESCU, S. 1998. Experimental realization of ence 275, 350–356.
teleporting an unknown pure quantum state via
dual classical and einstein-podolski-rosen chan- GREENSTEIN, G. AND ZAJONC, A. G. 1997. The Quan-
nels. Physical Review Letters 80, 1121–1125. tum Challenge. Jones and Bartlett Publishers,
Sudbury, Mass.
BOUWMEESTER, D., PAN, J.-W., MATTLE, K., EIBL,
M., WEINFURTER, H., AND ZEILINGER, A. GROVER, L. K. 1996. A fast quantum mechanical al-
1997. Experimental quantum teleportation. gorithm for database search. In Proceedings of
Nature 390, 575. the 28th Annual ACM Symposium on the The-
ory of Computing (Philadelphia, Pennsylvania,
BOYER, M., BRASSARD, G., HøYER, P., AND TAPP, A. 1996.
22–24 May 1996), pp. 212–219.
Tight bounds on quantum search. In Proceed-
ings of the Workshop on Physics of Computation: GROVER, L. K. 1998. A framework for fast quan-
PhysComp ’96 (Los Alamitos, CA, 1996), 36–43. tum mechanical algorithms. Proceedings of the
Institute of Electrical and Electronic Engineers 30th Annual ACM Symposium on the The-
Computer Society Press. Preprint at Los Alamos ory of Computing, 53–62. Preprint at Los
Physics Preprint Archive, http://xxx.lanl. Alamos Physics Preprint Archive, http://xxx.
gov/abs/quant-ph/9605034. lanl.gov/abs/quant-ph/9711043.
BRASSARD, G., HøYER, P., AND TAPP, A. 1998. HARDY, G. H. AND WRIGHT, E. M. 1979. An Introduc-
Quantum counting. Preprint at Los Alamos tion to the Theory of Numbers. Oxford University
Physics Preprint Archive, http://xxx.lanl. Press.
gov/abs/quant-ph/9805082. HOGG, T. 1996. Quantum computing and phase
CERF, N. J., GROVER, L. K., AND WILLIAMS, C. P. 1998. transitions in combinatorial search. Journal
Nested quantum search and np-complete prob- of Artificial Intelligence Research 4, 91–
lems. Preprint at Los Alamos Physics Preprint 128. Preprint at Los Alamos Physics Preprint
Archive, http://xxx.lanl.gov/abs/ Archive, http://xxx.lanl.gov/abs/quant-ph/
quant-ph/9806078. 9508012.
CIRAC, J. I. AND ZOLLER, P. 1995. Quantum compu- HOGG, T. 1998. Highly structured searches with
tations with cold trapped ions. Physical Review quantum computers. Physical Review Letters 80,
Letters 74, 4091–4094. 2473–2473.
CORY, D. G., MASS, W., PRICE, M., KNILL, E., HUGHES, R. J., BUTTLER, W. T., KWIAT, P. G.,
LAFLAMME, R., ZUREK, W. H., HAVEL, T. F., AND LAMOREAUX, S. K., MORGAN, G. L., NORDHOLT,
SOMAROO, S. S. 1998. Experimental quantum J. E., AND PETERSON, C. G. 1999. Practical Quan-
error correction. Preprint at Los Alamos Physics tum Cryptography for Secure Free-Space Com-
Preprint Archive, http://xxx.lanl.gov/abs/ munications. Preprint at Los Alamos Physics
quant-ph/9802018. Preprint Archive, http://xxx.lanl.gov/abs/
DEUTSCH, D. 1985. Quantum theory, the Church- quant-ph/9905009.
Turing principle and the universal quantum HUGHES, R. J., BUTTLER, W. T., KWIAT, P. G., LUTHER,
computer. Proceedings of the Royal Society of G. G., MORGAN, G. L., NORDHOLT, J. E., PETERSON,
London Series A A400, 97–117. C. G., AND SIMMONS, C. M. 1997. Secure commu-
DEUTSCH, D. AND JOZSA, R. 1992. Rapid solution of nications using quantum cryptography. In S. P.
problems by quantum computation. Proceedings HOTALING AND A. R. PIRICH EDS., Photonic Quan-
of the Royal Society of London Series A A439, tum Computing, Vol. 3076, 2–11.
553–558. HUNGERFORD, T. A. 1974. Algebra. Springer Verlag,
DIRAC, P. 1958. The Principles of Quantum Mechan- New York, Heidelberg, Berlin.
ics (4th ed.). Oxford University Press. JONES, J. A. AND MOSCA, M. 1998. Implementation
EKERT, A. K., RARITY, J., TAPSTER, P., AND PALMA, G. of a quantum algorithm on a nuclear mag-
1992. Practical quantum cryptography based netic resonance quantum computer. Journal of
on two-photon interferometry. Physical Review Chemical Physics 109, 5, 1648–1653. Preprint
Letters 69, 1293–1295. at Los Alamos Physics Preprint Archive,
FEYNMAN, R. 1982. Simulating physics with com- http://xxx.lanl.gov/abs/quant-ph/9801027.
puters. International Journal of Theoretical LAFLAMME, R., KNILL, E., ZUREK, W., CATASTI, P., AND
Physics 21, 6&7, 467–488. MARIAPPAN, S. 1997. NMR GHZ. Los Alamos

ACM Computing Surveys, Vol. 32, No. 3, September 2000.


Introduction to Quantum Computing 335

Physics Preprint Archive, http://xxx.lanl. peared in the Proceedings of the 35th Annual
gov/abs/quant-ph/9709025. Symposium on Foundations of Computer Sci-
LENSTRA, A. AND LENSTRA, H. EDS. 1993. The Devel- ence.
opment of the Number Field Sieve, Vol. 1554 of STEANE, A. 1996. The Ion Trap Quantum Informa-
Lecture Notes in Mathematics. Springer Verlag. tion Processor. Los Alamos Physics Preprint
LIBOFF, R. L. 1997. Introductory Quantum Mechan- Archive, http://xxx.lanl.gov/abs/quant-ph/
ics (3rd ed.). Addison-Wesley, Reading, Mass. 9608011.
LO, H.-K. AND CHAU, H. F. 1999. Unconditional secu- STEANE, A. 1998. Quantum computing. Reports on
rity of quantum key distribution over arbitrarily Progress in Physics 61, 2, 117–173. Preprint at
long distances. Science 283, 2050–2056. Los Alamos Physics Preprint Archive, http://
MAYERS, D. 1998. Unconditional Security in Quan- xxx.lanl.gov/abs/quant-ph/9708022.
tum Cryptography. Preprint at Los Alamos TERHAL, B. M. AND SMOLIN, J. A. 1997. Single Quan-
Physics Preprint Archive, http://xxx.lanl. tum Querying of a Database. Los Alamos Physics
gov/abs/quant-ph/9802025. Preprint Archive, http://xxx.lanl.gov/abs/
NIELSEN, M. A., KNILL, E., AND LAFLAMME, R. 1998. quant-ph/9705041.
Complete Quantum Teleportation using Nuclear VANDERSYPEN, L. M. K., YANNONI, C. Y., SHERWOOD,
Magnetic Resonance. Preprint at Los Alamos M. H., AND CHUANG, I. L. 1999. Realization
Physics Preprint Archive, http://xxx.lanl. of Effective Pure States for Bulk Quantum
gov/abs/quant-ph/9811020. Computation. Preprint at Los Alamos Physics
SCHULMAN, L. J. AND VAZIRANI, U. 1998. Scalable Preprint Archive, http://xxx.lanl.gov/abs/
NMR Quantum Computation. Los Alamos quant-ph/9905041.
Physics Preprint Archive, http://xxx.lanl. VEDRAL, V., BARENCO, A., AND EKERT, A. K. 1996.
gov/abs/quant-ph/9804060. Quantum Networks for Elementary Arithmetic
SHOR, P. W. 1994. Algorithms for quantum compu- Operations. Physical Review A. Preprint at Los
tation: Discrete log and factoring. In Proceedings Alamos Physics Preprint Archive, http://xxx.
of the 35th Annual Symposium on Foundations lanl.gov/abs/quant-ph/9511018.
of Computer Science (Nov.), 124–134. Institute WATROUS, J. 1998. Relationships between quan-
of Electrical and Electronic Engineers Computer tum and classical space-bounded complexity
Society Press. ftp://netlib.att.com/netlib/ classes. In 13th Annual IEEE Conference on
att/math/shor/quantum.algorithms.ps.Z. Computational Complexity (June 1998), 210–
SHOR, P. W. 1997. Polynomial-time algorithms for 227.
prime factorization and discrete logarithms on WILLIAMS, C. P. AND CLEARWATER, S. H. 1998. Explo-
a quantum computer. Society for Industrial rations in Quantum Computing. Telos, Springer-
and Applied Mathematics Journal on Comput- Verlag.
ing 26, 5, 1484–1509. Expanded version of Shor WOOTTERS, W. K. AND ZUREK, W. H. 1982. A single
[1994]. quantum cannot be cloned. Nature 299, 802.
SIMON, D. R. 1997. On the power of quantum compu- ZALKA, C. 1997. Grover’s Quantum Searching
tation. Society for Industrial and Applied Math- Algorithm is Optimal. Los Alamos Physics
ematics Journal on Computing 26, 5, 1474– Preprint Archive, http://xxx.lanl.gov/abs/
1483. A preliminary version of this paper ap- quant-ph/9711070.

Accepted September 1999

ACM Computing Surveys, Vol. 32, No. 3, September 2000.

You might also like