KEMBAR78
(R1) QC Basic | PDF | Applied Mathematics | Algebra
0% found this document useful (0 votes)
8 views26 pages

(R1) QC Basic

This document is the first part of a tutorial series on quantum computation, presenting an overview of the field, including mathematical foundations, physical implementations, and key algorithmic constructs. It introduces concepts such as quantum bits (qubits), unitary operations, and the Bloch sphere, while also discussing the BB84 algorithm for secure key distribution. The tutorial aims to provide a broad understanding of quantum computation and its potential advantages over classical computation.

Uploaded by

Devesh Dewangan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views26 pages

(R1) QC Basic

This document is the first part of a tutorial series on quantum computation, presenting an overview of the field, including mathematical foundations, physical implementations, and key algorithmic constructs. It introduces concepts such as quantum bits (qubits), unitary operations, and the Bloch sphere, while also discussing the BB84 algorithm for secure key distribution. The tutorial aims to provide a broad understanding of quantum computation and its potential advantages over classical computation.

Uploaded by

Devesh Dewangan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

New Generation Computing, 30(2012)271-296

Ohmsha, Ltd. and Springer

Tutorial Part 1
Quantum Computation: a Tutorial

Benoı̂t VALIRON
University of Pennsylvania,
Department of Computer and Information Science,
3330 Walnut Street, Philadelphia,
Pennsylvania, 19104-6389, USA
benoit.valiron@monoidal.net

Received 28 April 2012

Abstract This tutorial is the first part of a series of two articles on


quantum computation. In this first paper, we present the field of quantum
computation from a broad perspective. We review the mathematical back-
ground and informally discuss physical implementations of quantum comput-
ers. Finally, we present the main primitives used in quantum algorithms.

Keywords: Quantum Computation, Quantum Algorithms, Quantum Com-


puters.

§1 Introduction
Whether the notion of data is thought of concretely or abstractly, it is
usually supposed to behave classically: a piece of data is supposed to be clonable,
erasable, readable as many times as needed, and is not supposed to change when
left untouched.
Quantum computation is a paradigm where data can be encoded with a
medium governed by the law of quantum physics. Although only rudimentary
quantum computers have been built so far, the laws of quantum physics are
mathematically well described. It is therefore possible to try to understand the
Supported by the Intelligence Advanced Research Projects Activity (IARPA) via De-
partment of Interior National Business Center contract number D11PC20168. The U.S.
Government is authorized to reproduce and distribute reprints for Governmental purposes
notwithstanding any copyright annotation thereon. Disclaimer: The views and conclu-
sions contained herein are those of the authors and should not be interpreted as necessarily
representing the official policies or endorsements, either expressed or implied, of IARPA,
DoI/NBC, or the U.S. Government.
272 B. Valiron

capabilities of quantum computation, and quantum information turns out to


behave substantially differently from conventional (classical) information.
Sections 2, 3 and 4 describe the mathematics needed for quantum com-
putation together with an overview of the theory of quantum computation. Sec-
tion 5 briefly presents the range of physical implementations of quantum devices.
Section 6 then discusses three subtle algorithmic constructions specific to quan-
tum computation that can be used in order to design algorithms able, in some
case, to outperform classical algorithms on particular problems.
This paper is the first part of diptych on quantum computation. The
second part20) will be concerned with a programmatic perspective on quantum
computation.

§2 One Quantum Bit


In classical computation, the smallest unit of data is the bit, element of
the two-element set {0, 1}. In quantum computation, the smallest unit of data
is a quantum bit, or qubit, defined as a ray in a 2-dimensional Hilbert space.

2.1 Mathematical Formalism


A Hilbert space is a complex vector space equipped with a notion of length
and a notion of orthogonality, both defined by a scalar product. In this section,
we develop the required notions for the 2-dimensional context.

Complex numbers. A complex number is of the form a + b · i, where a and b


are usual real numbers, and where i is a special symbol. Complex numbers can
be added and multiplied as follows: (a + b · i) + (c + d · i) = (a + c) + (b + d) · i
and (a + b · i)(c + d · i) = (ac − bd) + (ad + bc) · i. The symbol i has therefore the
property i2 = −1. Given a complex number α = a + b · i, the p conjugate of α is
the√complex number ᾱ = a − b · i. The norm of α is |α| = a2 + b2 , also equal
to ᾱα.
A complex number a + b · i can be seen as a point in the complex plane
with coordinates (a, b). One can therefore propose an alternative representation
for complex numbers using polar coordinates: the complex ρeφi corresponds to
ρ cos(φ)+ρ sin(φ)·i. If the polar representation of complex numbers does not play
well with addition, it supports multiplication: (ρ1 eφ1 i )(ρ2 eφ2 i ) = (ρ1 ρ2 )e(φ1 +φ2 )i
and conjugation: ρeφi = ρe−φi . The angle φ is called the phase and ρ the
amplitude of the complex number.

2-dimensional Hilbert space. The set of column vectors ( α β ) where α and β are
complex numbers can be equipped with a structure of vector space. If u = ( α β)
γ α+γ γα
and v = ( δ ), then u + v = ( β+δ ) and γu = ( γβ ). The scalar product of the
vectors u and v is the operation hu|vi = ᾱγ + β̄δ. It can also be seen as the
multiplication of the row-vector u∗ = (ᾱ β̄) with the column vector v (u∗ is
called the conjugate transpose of u): see Fig. 1(d). If hu|vi = 0, we say that u
and v are orthogonal. For example, ( 10 ) and ( 01 ) are orthogonal; so are ( 11 ) and
Quantum Computation: a Tutorial 273

„ «„ « „ « „ «„ « „ «
a b x y ax + bz ay + bt a b x ax + bz
= =
c d z t cx + dz cy + dt c d z cx + dz

(a) matrix-matrix (b) matrix-column vector

„ « „ « „ «
a ` ´ ax ay ` ´ x ` ´
x y = a b = ax + bz
c cx cy z

(c) column vector-row vector (d) row vector-column vector

Fig. 1 Matrix Multiplication

1
( −1 ). The scalar product induces a norm: ||u||2 = hu|ui. A normalized vector
is a vector of norm 1. A basis is a pair of vectors u and v that can generates
the whole space when linearly combined. The basis is orthonormal if u and v
are normalized and orthogonal. For example, ( 10 ) and ( 01 ) form an orthonormal
1
basis. So do √12 ( 11 ) and √12 ( −1 ).

Ray. A ray is an equivalence class of vectors stable by (non-zero) scalar multi-


plication. So ( α −α 2α
β ) is in the same ray as ( −β ) and ( 2β ). A corollary is that for
α
every non-zero vector ( β ), it is possible to find a normalized vector whose first
coordinate is a non-negative real number: if α = ρ1 eφ1 i and β = ρ2 eφ2 i , choose
√ 21 2 ( (φρ1−φ )i ).
ρ1 +ρ2 ρ2 e 2 1

Unitary map. Regarding quantum computation, a particularly interesting op-


eration on Hilbert space is the unitary map. It is simply a rotation, i.e. a change
of orthonormal basis, and it can be efficiently represented by a 2 × 2 matrix: if
α α α α
( 10 ) is sent to ( β11 ) and ( 01 ) is sent to ( β22 ), the unitary map is U = ( β11 β22 ). The
transformation U on a particular vector is the application of the matrix onto
that vector, and the composition of two unitaries is matrix multiplication (see
Fig. 1).

2.2 The Quantum Bit as Vector of Information


A quantum bit is merely a vector u = ( α β ) in the 2-dimensional Hilbert
space. In order to make computational sense out of it, we choose the orthonormal
basis ( 10 ), ( 01 ) that we write |0i, |1i. The vector u can then be seen as the
quantum superposition of the two classical boolean values false (0) and true (1):
α|0i + β|1i. The two values |0i and |1i are orthogonal to each other.
We will use the convention that |xi, |yi, |zi . . . refer to base states while
greek letters: |φi, |ψi, . . . refer to general quantum bits.

2.3 Operations
Since a quantum system comes equipped with a preferred basis |0i, |1i,
the operations are described in this basis.
274 B. Valiron

The first class of operations we can perform is the creation of a quantum


bit out of nothing. Both |0i and |1i can be created at wish. The second class
of allowed operations consists in unitaries, i.e. reversible operations. Beside the
identity I, some of the usual gates are the not-gate, the Hadamard, the phase
shift and the phase-flip:
µ ¶ µ ¶ µ ¶ µ ¶
0 1 1 1 1 1 0 1 0
N= , H= √ , Vθ = , Z= .
1 0 2 1 −1 0 eθi 0 −1
The gate N sends |0i to |1i and |1i to |0i: it effectively acts as a negation. The
Hadamard gate creates quantum superposition: it sends |0i to √12 (|0i + |1i).
The gate Vθ does not change the vector |0i but sends |1i to eθi |1i. Z is just Vπ .
Unitaries are only rotating the state of the quantum system. In order to
get some classical information out, the only available operation is the measure-
ment. It is a probabilistic operation defined as follows: if u = ( α β ) is a normalized
vector representing a quantum bit, the measure of u returns false with probabil-
ity |α|2 and true with probability |β|2 . Moreover, the state of the quantum bit
was modified by the measure: the quantum bit is in state ( 01 ) if the result of the
measure was true and ( 10 ) is the result was false. We say that the measurement
was performed against the basis ( 10 ), ( 01 ). In general, given a basis u0 , u1 , a
measurement of v against u0 , u1 returns true with probability |hu1 |vi|2 and false
with probability |hu0 |vi|2 . It turned v into u1 if the measurement returned true
and into u0 if it returned false.
Note that if we are physically restricted to measurements against the base
( 10 ), ( 01 ), it is still possible to simulate a measurement against an arbitrary basis
u0 , u1 by first applying the unitary sending u0 to ( 10 ) and u1 to ( 01 ) on the vector
under consideration, then measuring, then applying the unitary sending ( 10 ) and
( 01 ) respectively back to u0 and u1 .
Together with one quantum bit, one can already build a simple experi-
ment: the coin-toss. Create a quantum bit in state |0i, apply the Hadamard gate
to change the state of the qubit to √12 (|0i + |1i), the measure in the canonical
basis: we get true and false with equal probability.

Destructive measurements. A measurement can equivalently be thought of as


destroying the quantum bit we were considering. In the physical realization with
photons, this is what happen for example. It is not incompatible with the first
approach since one can always re-create a quantum bit in the canonical basis to
simulate a non-destructive measure.

2.4 The Bloch Sphere


The rays of C2 are in one-to-one correspondence with the points on the
unit sphere of R3 . In spherical coordinates, a point (θ, ϕ) with θ ∈ [0, π], ϕ ∈
[−π, π] is in correspondence with the ray of representative
µ ¶
cos θ2
r(θ, ϕ) = . (1)
eiϕ sin θ2
Quantum Computation: a Tutorial 275

Fig. 2 The Bloch Sphere

The correspondence is pictured in Fig. 2: index s indicates spherical coordinates;


index c indicates 3-dimensional coordinate; index H indicates coordinates in C2 .
This unit sphere is called the Bloch sphere.
Using the Bloch sphere, one can define three canonical “orthogonal” bases
for a quantum bit, as follows.
• (|0z i, |1z i) = (|0i, |1i) is the basis along z;
• (|0x i, |1x i) = ( √12 (|0i + |1i), √12 (|0i − |1i)) is the basis along x;
• (|0y i, |1y i) = ( √12 (|0i + i|1i), √12 (|0i − i|1i)) is the basis along y.

These three bases have a peculiar property: measuring |0z i and |1z i against
both the bases along x and y returns true and false with probability 12 : in other
words, two quantum bits in state |0z i and in state |1z i cannot be distinguished
by measurement against the basis x and y. This property is also true for the
qubits |0x i and |1x i when measured against the bases along y and z, and for the
qubits |0y i and |1y i measured against the bases along x and z.
In general, two rays in C2 are orthogonal if and only if their representa-
tions on the Bloch sphere are antipodal.

2.5 The BB84 Algorithm


We can use two of the bases described in Section 2.4 to securely create
secret keys for one-time pad encryption. This algorithm is called BB84 from the
seminal paper that presented it.2) The algorithm reads as follows.
• Alice creates two sequences of n random bits: the first sequence specifies
which of the basis x or z to use to encode each of the bit in the second
sequence.
276 B. Valiron

• Alice sends the encoded quantum bits to Bob


• Bob creates a sequence of n random bits: he measures each of the quan-
tum bits he receive using the basis specified by its sequence of bits.
• On a public classical channel (e.g. internet), Alice and Bob share the
basis for creation and measurement of quantum bits they used for each
quantum bits. They keep only the bits in the sequence where the bases
match: This is the shared secret key.
• If the quantum channel was noisy, or if an eavesdropper tampered with
it, the photons Bob received might not precisely match the one Alice
sent: This introduces errors in Bob’s measurements. Using successive
exchanges of parity information (called reconciliation phase 3) ), Alice and
Bob can recover the complete bit-string.
• If the error-rate is low enough (about 15%), it is then possible to produce
a shorter, but secret key using privacy amplification.4) If the error-rate is
too high, they just start over.
This protocol is provably secure: on average, an eavesdropper cannot get more
than a certain percentage of the secret key.
While quantum cryptography is not the subject of this tutorial, it is
nonetheless interesting to note that the technology is well-developed and mature
enough for companies to sell quantum-based cryptographic devices.9, 16) Commer-
cial devices that might not be as secure as their theoretical counterpart15) . . .

§3 Two Quantum Bits


If one quantum bit is enough to build the foundation for a cryptographic
system, it is not sufficient to perform general computation. In this section, we
add a second quantum bit to our system
The state of a 2-qubit system lives in the tensor product C2 ⊗ C2 . The
space C2 was generated by the base ( 10 ), ( 01 ), the space C2 ⊗C2 = C4 is generated
by
µ1¶ µ0¶ µ0¶ µ0¶
( 0 ) ⊗ ( 0 ) = 0 , ( 1 ) ⊗ ( 0 ) = 0 , ( 0 ) ⊗ ( 1 ) = 1 , ( 1 ) ⊗ ( 1 ) = 00 .
1 1 0 0 1 1 1 0 0 0 0
0 0 0 1

The vectors are respectively shortened in |00i, |01i, |10i, |11i: the space C ⊗ C2
2

can be seen as the space of “quantum superpositions” of pairs of booleans.

3.1 Operations
The operations one can perform on 2-quantum bit system are quite similar
to the one performed on only one quantum bit: One can create, measure, and
apply unitary operations.

Unitary operations. As for one-qubit system, it is possible to change a quantum


system through discrete, reversible operations that simply sends an orthonormal
basis to another orthonormal basis. The simplest solution to construct a unitary
operation on a 2-qubit system is to tensor two 1-qubit operations: U ⊗V applied
Quantum Computation: a Tutorial 277

on |xi ⊗ |yi is (U |xi) ⊗ (V |yi). For example, the mixing operation is H ⊗2 =


H ⊗ H: it sends |00i to (H|0i) ⊗ (H|0i) = 12 (|00i + |01i + |10i + |11i). But
this is (thankfully) not the only possibility: when written in the canonical basis
|00i, |01i, |10i, |11i, we have in particular the swap gate X and the control-not
gate NC defined by
µ1 0 0 0¶ µ1 0 0 0¶
X = 0 1 0 0 , NC = 00 10 00 01 .
0 0 1 0
0001 0010

The NC -gate comes from a generic process: If U is any unitary gate on n qubits,
one can construct UC = ( I0 U0 ), called controlled U , as the (n + 1)-qubit gate:
UC (|0i ⊗ |φi) = |0i ⊗ |φi, UC (|1i ⊗ |φi) = |1i ⊗ U |φi.
The gate U is applied on |ψi depending on the value of the first qubit. Note
that UC is also unitary, and can therefore be controlled. This yields multi-
controlled gates; for exemple the toffoli gate NCC acting on 3 qubits, sends |xyzi
to |xyi ⊗ |z ⊕ (xy)i.

Measurements. Measuring a 2-qubit system is similar as doing so in a 1-qubit


system. And despite the probabilistic nature of the operation, measuring first
the first qubit and then the second qubit is equivalent to doing it the other way
around. If the system is in state |φi = α|00i + β|01i + γ|10i + δ|11i, measuring
the first qubit then the second yields (modulo renormalization):

The norm of each of these vectors is the overall probability of getting to this state:
from |φi, in two steps we get (false, false) and the state |00i with probability
|α|2 ; in one step, we get true and the state |1i ⊗ (γ|0i + δ|1i) with probability
|γ|2 + |δ|2 .

3.2 Particular Properties


In this section, we discuss various specific properties of quantum compu-
tation when more than one quantum bit are available.

No Cloning. Consider a quantum bit in some unknown state |φi = α|0i + β|1i;
it is not possible to “clone” the state and get the two-qubit state |φi ⊗ |φi. The
reason is simple: the only operations we are allowed to perform are unitaries and
measurements, which are essentially linear maps. The cloning operation being
non-linear, it is therefore not implementable.
It is however possible to build a “copying” map G
α|0i + β|1i 7−→ α|00i + β|11i.
278 B. Valiron

But it does not satisfy the usual commutativity rule for duplication: if f is any
linear map C2 → C2 , then G ◦ f 6= (f ⊗ f ) ◦ G.

Entanglement. Another special property of quantum information is superposi-


tion: the 2-qubit state √12 (|00i + |11i) is a valid state, but cannot be written as
|φi ⊗ |ψi. We say that the two quantum bits are entangled.
The interesting aspect of entanglement is that the measurements of the
qubits are correlated. For example, measuring the first qubit in the state
√1 (|00i + |11i) with respect to the standard basis yields 0 with probability 1
2 2
and 1 with probability 12 . In the former case, the state of the 2-qubit system is
|00i, thus measuring the second qubit yields 0 with probability 1. In the latter,
the state of the system is |11i, and measuring the second quantum bit yields 1
with probability 1.
One can form a basis for C2 ⊗ C2 out of entangled states. For example,
an often used basis is the following set of orthonormal, entangled states:
√1 (|00i + |11i), √1 (|00i − |11i), √1 (|01i + |10i), √1 (|01i − |10i).
2 2 2 2

Probabilistic and quantum computation. From a classical perspective, a mea-


surement is a special form of coin-toss: Quantum computation can therefore
simulate probabilistic computation. Is quantum computation conservative over
probabilistic computation? It turns out not to be. In the following, we propose
a proof using the protocol described by Bell in 1964,1) yielding what is known
as Bell’s inequalities.
The argument goes as follows. Consider a quantum machine that maxi-
mally entangles two quantum bits A and B:
|φAB i = √1 (|0i ⊗ |1i − |1i ⊗ |0i)
2

and sends qubit A to Alice and qubit B to Bob. Suppose that they can inde-
pendently choose one of the following axes in the Bloch sphere (see Fig. 2) to
measure:
³√ ´ ³ √ ´
a = (0, 0, 1), b = 23 , 0, − 12 , c = − 23 , 0, − 12 .
They live in the xz-plane of the Bloch sphere and correspond respectively to the
bases in C2 :
√ √
3 3
|0a i = |0i, |0b i = 12 |0i + 2 |1i, |0c i = 12 |0i − 2 |1i,
√ √
3 3
|1a i = |1i |1b i = 2 |0i − 12 |1i, |1c i = 2 |0i + 12 |1i.
What is the probability of obtaining the same output when measuring A and B
with respect to two different bases?
If we forget about the quantum aspect of the protocol, we essentially
built two isolated probabilistic computations inputting an element from the set
{a, b, c} and outputting a probabilistic boolean.
Quantum Computation: a Tutorial 279

If we stay purely probabilistic, the result of measuring A and B along each


of the possible axis is predetermined. Let Px,y be the probability of obtaining
the same output while measuring A along x and B along y. We have
Pa,b + Pb,c + Pc,a > 1, (2)
since for any possible distribution of measurement values, there will always be
two values that will be equal. However, using the definition of measure against
arbitrary basis given in Section 2.3,
Px,y = |hφAB |0x 0y i|2 + |hφAB |1x 1y i|2 .
1
The computation shows that Px,y = 4 for x 6= y, x, y = a, b, c. In particular,
3
Pa,b + Pb,c + Pc,a = 4 < 1,
which violates Equation (2): Quantum computation is not conservative over
probabilistic computation.

§4 Many Quantum Bits


If the state of a 2-qubit system lives in C2 ⊗ C2 , not so surprisingly the
state of a 3-qubit system lives in C2 ⊗ C2 ⊗ C2 , that is, C8 , and its canonical
basis in lexicographic order is |000i, |001i, |010i, |011i, |100i, |101i, |110i, |111i.
n
Working with a n-quantum bit system means manipulating vectors in C2 , with
a basis made of strings of n booleans.
Measurements and unitaries extend fluently to the case of n quantum
bits. However, since the sizes of matrices become prohibitive, and since most
unitary operations are built out of smaller one, we prefer to write operations
on quantum bits using quantum circuits. At first sight, quantum circuits are
to quantum computation what classical boolean circuits are to classical com-
putation: descriptions of algorithms. However, it should be noted that unlike
classical circuits, for most physical implementations one cannot just “get from
a shelf” a component of a quantum circuit: the circuit is really a description of
logical operations to be performed on the system, and should be seen more as
the description of a procedure.

4.1 Universal Set of Gates


An interesting result coming from the theory of Lie algebras is that there
exist sets of unitary operations from which one can construct (using composition
and tensor) any given unitary gate up to a given error. These sets are called
universal sets of gates. Some examples are
• the set of all the unitary gates on C4 ;
• the set of all the unitary gates on C2 together with NC ;
• the set consisting of H, NC and V π .
4

In particular, this means that for every unitary map on n qubits, one can find a
quantum circuit using H, NC and V π that approximates it.
4
280 B. Valiron

4.2 Quantum Circuits


A quantum circuit is a graphical representation of a sequence of unitary
operations to be performed on quantum bits. Graphically, a quantum bit is a
wire, and a unitary is a (named) box. Several quantum bits are represented by
several parallel wires, read from top to bottom. For example, the circuit

represents a one-quantum-bit system on which one applies the Hadamard gate.


Two 1-qubit operations have special representation: the not-gate N and the
identity function are respectively denoted with

The notation for the gate N is due to its resemblance with the classical XOR
operation. The circuit

is a two-quantum-bit system on which one first applies a two-quantum-bit uni-


tary U , followed by the Hadamard gate on the second quantum bit. The unitary
map represented by this circuit is the map |φi 7−→ (I ⊗ H)(U |φi).
Two classes of gates have a particular representation and deserve special
attention. The first one is the class of swap gates. As we already saw in Sec-
tion 3.1, the swap X on 2 qubits, refers to a “physical” swap. One therefore
represents swaps as follows:

The former is X and sends |xi⊗|yi to |yi⊗|xi, while the latter sends |xi⊗|yi⊗|zi
to |zi ⊗ |xi ⊗ |yi.
The second kind of gates to have a special representation in quantum
circuits is the controlled gate. Since this gate acts conditionally on a quantum
bit, we write respectively

for the gate UC sending |0i ⊗ |yi to |0i ⊗ |yi and |1i ⊗ |yi to |1i ⊗ (U |yi) and
for the gate (N ⊗I)UC (N ⊗I) sending |0i ⊗ |yi to |0i ⊗ (U |yi) and |1i ⊗ |yi to
|1i ⊗ |yi.
Quantum Computation: a Tutorial 281

The notation is flexible. For example, the circuits

are all describing the map sending the basis element |1i ⊗ |0i ⊗ |zi to the state
|1i ⊗ |0i ⊗ (U |zi) and every other basis element to itself.

Creation and measurement. It is often useful to express creation of quantum


bits and measurements. The creation of a quantum bit in state |φi and the
measurement, making a classical bit out of a quantum bit, are respectively rep-
resented with the notations

So for example, the coin-toss is represented by the quantum circuit

4.3 A Simple Algorithm: Quantum Teleportation


A standard example of algorithm that mixes unitaries and measurements
operations is the so-called quantum teleportation algorithm. It allows one to
send the state of an unknown quantum bit from a location A to a location B
without having to look at it (i.e. without having to measure it). The trick is
to use an entangled pair of quantum bits shared between both locations. See
Fig. 3; we explain the 3 steps:

Fig. 3 Quantum Teleportation Protocol


282 B. Valiron

1. At location A, Alice and Bob create the initial entangled state √12 (|00i +
|11i) with qubits 2 and 3. Alice keeps qubit 2 and stays at location A,
while Bob takes qubit 3 and goes to location B.
2. Alice, to send qubit 1 in state |φi to Bob, applies a rotation on her two
qubits 1 and 2. She then measures the resulting 2-qubit state, gets two
classical bits (x, y) and sends them to Bob.
3. To transform qubit 3 to state |φi, Bob applies on it the transformation
Uxy , where U00 , U01 , U10 and U11 are respectively ( 10 01 ), ( 01 10 ), ( 10 -1
0 )
0 1 ).
and ( -1 0

Note that the entanglement of qubits 2 and 3 can be done ahead of time (so long
as they stay entangled).

Proof of the correctness of the protocol. If we apply the computation of Step (2)
to the two first qubits of
(α|0i + β|1i) ⊗ √1 (|00i + |11i) = √1 (α|000i + α|011i + β|100i + β|111i)
2 2
we get
³ ´
1
2 α(|000i + |100i) + α(|011i + |111i) + β(|010i − |110i) + β(|001i − |101i)
µ ¶
1 |00i ⊗ (α|0i + β|1i) + |01i ⊗ (β|0i + α|1i)
=
2 + |10i ⊗ (α|0i − β|1i) + |11i ⊗ (α|1i − β|0i)
Measuring the two first qubits, the third qubit becomes
α|0i + β|1i if 00 was measured,
β|0i + α|1i if 01 was measured,
α|0i − β|1i if 10 was measured,
α|1i − β|0i if 11 was measured.
Finally, if Uxy is applied in the case where x, y was the result of the measurement,
then the state of the last qubit is α|0i + β|1i, as desired.

§5 Physical Realization of Quantum Devices


Nowadays, more or less every physical realization of a computer uses sil-
icon and transistors. In the realm of quantum computers, several competing
physical implementations co-exist, both with their strengths and weaknesses. In
this section, we briefly review the (wide) range of existing physical implementa-
tions of quantum devices.

5.1 Decoherence and Errors


To encode a quantum bit, one needs to find a physical object with two
modes that are both distinguishable by a physical operation and whose states
can be regarded as being governed by the law of quantum physics. For example,
a book can be either opened or closed, but one can hardly argue that these two
modes can be placed into “quantum superposition.”
Quantum Computation: a Tutorial 283

However, for various physical objects, one can find such modes. Some
simple examples are photons: polarization, or location; trapped ions: electronic
state; electrons and nuclei: spin; in general: energy level, if discrete.
The main problem with an object governed by the law of quantum physics
is that it tends to interact with its environment. The state of the particle will
therefore change along time, a phenomenon known as decoherence. Depending
on the technology, the typical decoherence time for a quantum bit ranges from
1ms to several tens of seconds.14)
Together with imperfect gates, decoherence makes quantum information
extremely unstable. It renders the task of building a device hosting quantum
information very challenging.

5.2 Requirements
Requirements for a successful physical implementation are well summa-
rized by DiVincenzo8) and Ladd et al.14)
Scalability: Regardless of the physical apparatus, to be able to take advantage of
the efficiency of a given quantum algorithm, it has to be applied on a large enough
input size. This implies that the number of available quantum bits is large
enough. It also implies that one needs to be able to apply probably very many
operations on the quantum bits in a single run: we need the implementation to
scale both in space and in time, and to be highly parallel.
Set of universal gates: Any physical implementation will come with a set of
allowed operations on the device. Sure enough, we need to be able to allocate
and initialize quantum bits in a fixed state, and we need to be able to measure
the quantum bits with respect to a particular basis. But also, we need to be
able to construct an arbitrary unitary gate on a potentially arbitrary number
of quantum bits: a universal set of elementary gates is required for a successful
quantum device.
Timing issue: low error rate, fast gates and quantum bit stability. The algo-
rithms require many gates to be applied on many quantum bits. In order to
keep the probability of error low enough, the various gates need to be precise
enough. Since the run-time of interesting algorithms will probably be non-trivial,
the state of the quantum bits need to be stable enough in time and gates to be
applied fast both to allow many gates to be applied and to allow quantum error-
correction to succeed.
Ability to move quantum bits around: Finally, the quantum bits are represented
by the state of physical objects: 2-qubit operations (such as a control-gate, for
example) on non-adjacent quantum bits will generally require either moving the
physical objects near each other, or moving the quantum state themselves to
adjacent physical objects (e.g. by teleportation, or a series of swap operations).
The bottom line is that to realize a quantum computer, one has to con-
ciliate two rather opposite properties. On one hand, quantum bits have to be
isolated from the outer world; on the other hand, they have to interact with each
other, and with the devices actually performing the computation.
284 B. Valiron

5.3 Review of Techniques


In the following, we list a few of the physical realizations of quantum
devices, and discuss their relative advantages and drawbacks. For an in-depth,
technical description, see Chapter 7 of Nielsen and Chuang’s classic textbook,19)
or the more recent book from Chen et al.6) For an rapid overview of the current
state of the field, refer to Ladd et al.14)

Photons. Photons are reliable supports for quantum bits: they are relatively
free from decoherence, and they are easy to move around. There are several
ways to encode a quantum bit on a photon. The first one is simply by using
polarization to hold the state of the quantum bit: vertical polarization means
|0i, horizontal means |1i. But one can do other ways, for example by the location
of the photon. Depending on how the paths are designed and how the photon
is injected, the photon could experience one path or the other, or both at the
same time, creating a superposition of the state |0i and the state |1i.
Some experimental devices used to interact with photons are known tools
from linear optics:
• Laser. At very low intensity, produces photons one at a time.
• Polarizing beamsplitter. Separates incoming photons into separate paths,
depending on their polarization state. Combined with a pair of single-
photon detectors, the polarization state of a qubit can be measured.
• Mirror. used to change the direction of a photon in space.
• Polarization rotator. Can be realized by pieces of birefringent material:
the deeper the piece is, the bigger the phase shift is.
• (Regular) beamsplitter: thin layer of semi-refracting material. Can be
used for either coupling two polarization modes, or for separating a pho-
ton on two distinct paths.
Photons are therefore good candidates for moving as well as holding quan-
tum information: they are relatively resilient to decoherence, they are easily
routed, and many easy-to-deploy devices exist for performing one-qubit oper-
ations on them. Although the main caveat remains the interaction between
two photons, recent progress13, 14) tends to indicate how to overcome the prob-
lem. This makes quantum optics a potentially promising setting for a quantum
computer.

Trapped ions. Ions can be trapped in free space using suitable electric fields.
Provided that the ions are cooled enough, they are relatively resistant to decoher-
ence, and their decoherence time is several orders of magnitude longer than the
time needed for the basic operation of initialization, unitary maps and measure-
ment. This makes them good candidates as support for quantum computation.
Various research groups5) have experimented with using this technique to build
quantum memories with a number of quantum bits ranging from 4 (in 2000)5)
to 14 (in 201117) ).
Quantum Computation: a Tutorial 285

Ions are arranged spatially as an array. Initialization to base state is


realized by laser cooling. Interaction on single ion is performed using lasers
pulses, and entanglement can be done either by local interaction between ions,
or through photonic interaction. This has the advantage of allowing quantum
entanglement between potentially far-away quantum bits, and hints at how to
scale a quantum computation realized in this way. However, although at small
scale, one can keep a high-fidelity control, it remains to show how to scale this
fidelity to many qubits.

Quantum dots. Instead of confining quantum particles in free space, it is pos-


sible to store them on a solid host, such as a semiconductor, a piece of silicon
or a crystal. The binding onto the host can typically be done electrostatically.
The advantage is that the quantum “dot”, for example an electron, or a single
impurity such as an atom, does not need to be “trapped” in free space, but is
instead integrated once and for all into the structure and is arguably more sta-
ble. It is also potentially able to support room-temperature without hampering
the coherence time.
The vast variety of supporting hosts and dots makes this technique very
versatile and subject to extremely active research. Due to its wide range of
application, it is also able to bring insight to other techniques.

Nuclei of atoms. A naturally well-isolated system is the nucleus of an atom:


shielded behind many electronic layers, the nuclear spin of an atom is extremely
stable. It can then be reached and acted upon using an electromagnetic field,
a technique called nuclear magnetic resonance (NMR). The technique is the
following: a liquid at room temperature containing a particular molecule at
some concentration is designed. The molecule is chosen so that some of its
atoms can be either independently addressed or entangled with other using a
specific electromagnetic pulse. The molecule can be thought of as a quantum
memory of a certain (usually small) size, the last record being 12 quantum bits18)
in 2006: see Fig. 4(a) for the molecule. The atoms used as memory registers are
circled. Since the liquid contains many of these molecules, the computation is
run in parallel on all of them; this partially solves the problem of the probabilistic
nature of quantum computation: only one run is necessary.
A previous record21) was a famous experiment where Shor’s factoring al-
gorithm has been successfully applied to factor. . . the number 15. The reason
for the small input has to do with the small size of the quantum memory: the
“computer” had only 7 quantum bits available (see Fig. 4(b) for the molecule,
the circled atoms forming the memory), and Shor’s algorithm requires quite a
few auxiliary qubits. However, the fact that a complete algorithm was imple-
mented is a noteworthy milestone: albeit small, the apparatus can reasonably
be called a quantum computer.
One of the problem in this liquid-state NMR technique is the initialization
of the memory. The other problem lies in the fact that a particular molecule has
to be chosen for holding the memory: the method is not really scalable.
286 B. Valiron

(a) The histidine as a 12-qubit memory.18) (b) The perfluorobutadienyl iron


complex as a 7-qubit memory.21)

Fig. 4 Molecules as Quantum Memory

Superconductor. As photons, electrons are good support for quantum infor-


mation. The naı̈ve hardware where they are found, that is, electrical circuit,
does not form a good support for holding them: because of resistive power,
decoherence is extremely high.
There is however a state of the matter where resistivity is minimized: su-
perconductors. And indeed, quantum computing have been experimented using
this technology.14)
To date, the commercially most successful paradigm of computation using
superconducting quantum computation is called adiabatic quantum computa-
tion. Although this is out of the scope of this review, it is worth noting that
the company D-Wave7) sells a quantum device with 128 quantum bits, encoded
using superconducting techniques. Unfortunately, their device is not universal.
But it is working, and computationally expressive enough to perform discrete
optimization. Plus, it is no longer a lab experiment: it is a product that you
can actually purchase (for a whopping 10 millions dollars).

§6 A Tour of Quantum Algorithms


What can we do with quantum information, and what makes an algorithm
manipulating quantum information really quantum?
As we shall see in Section 6.1, classical circuits can be efficiently simulated
by quantum circuits: in particular, there is no particular “gain” in choosing
quantum computation in this situation. The real gain is when the algorithm
makes use of either entanglement, or more generally the interference brought by
complex coefficients.
Most of the existing “really” quantum algorithms are based on a few
quantum constructs described in Sections 6.2 to 6.4: quantum Fourier transform,
quantum walk and amplitude amplification. The rest if made of classical pre and
post-analysis, and possibly of an oracle: a quantum circuit corresponding to a
classical reversible operation (Section 6.1).
Despite the fact that only three main constructions are available to date,
the richness of their possibilities makes the search for quantum algorithms and
Quantum Computation: a Tutorial 287

optimizations over classical algorithms a vibrant area: the quantum algorithm


zoo of S. Jordan10) refers 45 algorithms and 160 papers with no less than 14
written between 2011 and 2012.

6.1 Reversible Classical Computation


What is the power of quantum computation with respect to classical com-
putation?
A restricted subset of unitaries (i.e. N , NC , NCC , X, . . . ) sends ba-
sis elements to basis elements: quantum circuits built from these components
are effectively classical, boolean computation. Although quantum circuits are
reversible operations, it turns out that one can simulate classical, boolean com-
putation with quantum computation, only using NC and NCC . If B is the set of
booleans values, and if the map f : Bm → Bn is a boolean function taking m ar-
guments and outputting a n-tuple of booleans, the map fˆ : Bm × Bn → Bm × Bn
sending (x, y) to (x, y ⊕ (f x)) is reversible. It is possible to build a quantum
circuit

that is effectively computing the operation fˆ, sending


P P
i αi |xi i ⊗ |yi i 7−→ i αi |x1 i ⊗ |yi ⊕ f (xi )i.

A dumb implementation. The simplest implementation one could think of uses a


series of multi-controlled operations implementing the truth table. For example,
for a function f : B3 → B2 , a possible truth table and its circuit implementation
is as follows.

0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 1 1 0 0 1 1 1
1 0 1 0 0 0 1 1

The circuit has one controlled-gate per non-zero output.

A compositional implementation. Although this encoding soundly encodes the


operation fˆ, it is not really efficient: the number of gates is exponential on the
number of inputs. It is possible to do a better, efficient implementation of fˆ,
compositionally on the definition of f .
If f is the “and” map B2 → B, the operation fˆ, with 3 inputs and 3
outputs is simply the gate NCC sending |xyzi to |xyi ⊗ |z ⊕ xyi. If f is the
“not” map, the operation fˆ, with 2 inputs and 2 outputs is simply the gate
(N ⊗I)NC (N ⊗I) sending |xyi to |xi ⊗ |(not x) ⊕ yi.
288 B. Valiron

(a) First draft (b) Final draft

Fig. 5 Implementation of the “Or” Operation

If the map f is f (x, y) = not ((not x) and (not y)), the operation fˆ can
be constructed in term of the elementary circuits not ˆ . A first draft of
ˆ and and
circuit is given in Fig. 5(a).
The problem with this circuit is that it has 3 input wires (x, y and z)
and 7 output wires. One has to “close” the wires starting with |0i. The obvious
candidate for this is the measurement operation: it makes sure that the quantum
bits that are measured are not anymore in superposition with the rest of the
system. However, before actually performing the measure, one has to “undo”
the operation we did on these wires. Indeed, we are working with quantum
bits and not mere classical booleans. Suppose that the state of the system
x, y, z is √12 (|00i + |11i) ⊗ |0i. By linearity, since |0000000i 7→ |0011100i and
|1100000i 7→ |1100011i, then
√1 (|00i + |11i) ⊗ |0000i ⊗ |0i 7→ √1 (|0011100i + |1100011i).
2 2

The quantum bits 3 to 6 in the output are not in a base state: measuring them
will send the whole system to |0011100i with probability 12 and to |1100011i
with probability 12 . This is not what we were looking for: the overall circuit
would send √12 (|000i + |110i) to a probabilistic distribution of states |000i and
|111i whereas we were expecting √12 (|000i + |111i).
Thanks to the unitarity of the elementary operations, it is possible to
“undo” the intermediate computations performed on the inner quantum bits.
The actual fˆ we want is the circuit of Figure 5(b). Now, if x, y, z were in state
√1 (|00i + |11i) ⊗ |0i, right before the measurement the system is in the state
2

√1 (|000000i + |1100001i).
2

Measuring (and forgetting) the inner quantum bits (number 3, 4, 5 and 6), we
get the state √12 (|000i + |111i), which is precisely the expected result.
Of course, in the case of the implementation of the “or” function, it is easy
to come up with a more resource-caring circuit. For example, the implementation
in term of truth table is probably more efficient. But if you consider more
Quantum Computation: a Tutorial 289

sophisticated computation such as an adder, even this simplistic compositional


implementation quickly becomes more interesting than the truth-table one.

Control structures and size of circuits. Unlike usual, classical computation, clas-
sical simulation using quantum circuit has some drawbacks.
The first one is that all classical loops have to be completely unwinded:
there is no “jump” operation, as the circuit only goes from left to right. This
makes quantum circuits similar to classical boolean circuits.
However,quantum circuits are even more constrained than classical,boolean
circuits: there is no real branching on test. Since tests are implemented with
controlled gates, both branches of the circuit will have to be computed.
Technically, this means that every single gates in a quantum circuit will
be executed, placing a relatively large overhead on the transformation classical-
to-quantum.

6.2 Quantum Phase Estimation


Certain interesting algorithms in algebra and number theory reduce to
the problem of order finding. For example, factorization is such a problem and
the acclaimed Shor’s factorization algorithm is using order finding as its core
component. Some other examples are the search for a discrete log and the
general hidden subgroup problem.
In classical mathematics, the order finding problem is not known to have
an efficient algorithm. Thus, in general, we do not associate the aforementioned
problems with it. However, in quantum computation, there exist such algo-
rithms: this is why we focus on it.

Order finding. The problem reads as follows: choose two coprime integers a and
N . A theorem states that there exists a number p > 0 such that ap = 1 mod N .
What is p?
Interestingly enough, this problem relates to quantum computation be-
cause the property that unitary matrices can be decomposed into
X
U= λj uj u∗j
j

where λj ’s are complex numbers and uj ’s are normalized, orthogonal column


vectors. As we saw in Section 2.1 and in Fig. 1, U uj = λj uj : we call uj an
eigenvector of U and λj a eigenvalue.
To see how one can relate this notion to order finding, assume for sim-
plicity that N = 2n and consider the operation Ua on n qubits sending |ji to
|j · a mod N i. This operator is unitary since a and N are coprime: the image
of {0 . . . N − 1} under j 7→ j · a is the whole set. In particular, since Uak sends
|ji to |j · ak mod N i, if ap = 1 mod N then the map Uap is the identity map.
Therefore, the eigenvalues of Ua are pth roots of the unity. A pth root of unity
is of the form e2π ik/p .
290 B. Valiron

Thus, an algorithm for eigenvalue estimation should be enough to retrieve


p (with some classical post-processing): we left the world of number theory and
we are back with operators: This is the realm of quantum computation.

Quantum phase estimation. Before solving the problem of estimating an eigen-


value, we first discuss a similar problem: quantum phase estimation. the ques-
P2n −1
tion is to estimate the parameter ω in the state |φi = √12n y=0 e2πiωy |yi.
The trick consists in decomposing ω as a floating point number in binary
notation. Note that without loss of generality,
P∞ one can assume that 0 6 ω < 1
since e2π i = 1. Then write ω as ω = i=1 x2ii where the xi ’s are 0 or 1. We
write ω = 0.x1 x2 x3 . . ., assuming a binary representation.
First, suppose that ω is equal to 0.x1 . In this case, n = 1 and
P1
|φi = √12 y=0 eπi(x1 y) |yi,

that is, |φi = √12 (|0i + (−1)x1 |1i). To retrieve the value x1 , it is enough to use
the Hadamard gate, since H|φi = |x1 i.
If now we are interested in ω = 0.x1 x2 , then ω = x21 + x222 and n = 2. The
state |φi is
3 3
1 X 2π i( x1 + x22 )y 1 X 22 π i(2x1 y) 22 π i(x2 y)
|φi = √ e 2 2 |yi = e2 e2 |yi.
22 y=0 2 y=0

Remembering that e2π i = 1, we can rewrite this sum as


1 1 1 1 1 1
|φi = (|00i + e 2 π i(2x1 ) e 2 π ix2 |01i + e 2 π i(2x2 ) |10i + e 2 π i(2x1 ) e 2 π i(3x2 ) |11i).
2
This factors as
1 1 1 1
|φi = (|0i + e 2 π i(2x2 ) |1i) ⊗ (|0i + e 2 π i(2x1 ) e 2 π ix2 |1i)
2
and it rewrites to
1
|φi = (|0i + e2π i (0.x2 ) |1i) ⊗ (|0i + e2π i (0.x1 x2 ) |1i). (3)
2
Convince yourself that H √12 (|0i + e2π i (0.x2 ) |1i) = |x2 i. If we write R2 for
( 10 e2πi(0.01)
0
), from |φi we can retrieve the values x1 and x2 with the circuit
Quantum Computation: a Tutorial 291

This scheme generalizes, and if Rn is ( 10 e2πi(0.0...01)


0
) and ω = 0.x1 . . . xn ,
then the circuit

computes |xn . . . x1 i out of |φi.

Quantum Fourier transform. The above general circuit computes the phase es-
P2n −1 x
timation, denoted QFT−1 : √12n y=0 e2πi 2n y |yi 7→ |xi. The reverse operation
is written QFT:
n
2 −1
1 X 2πi xn y
|xi 7−→ √ e 2 |yi
2n y=0
and is called quantum Fourier transform because of its resemblance to the dis-
crete Fourier transform. It is realized by inverting the circuit for the phase
estimation.

Estimation of eigenvalues. Suppose that the eigenvalue of an eigenvector for a


specific unitary map is of the form e2πiω . We are now ready to estimate the
value ω.
Suppose again that ω = 0.x1 x2 . Note that 2 · 0.x1 x2 = x1 .x2 and that
e2π ix1 .x2 = e2π i0.x2 . We have
³ ´
(UC )k √12 (|0i + |1i) ⊗ |φi = √12 (|0i + e2πi(kω) |1i) ⊗ |φi.
In particular,
³ ´
UC √1 (|0i
2
+ |1i) ⊗ |φi = √1 (|0i
2
+ e2πi(0.x1 x2 ) |1i) ⊗ |φi.
³ ´
(UC )2 √1 (|0i
2
+ |1i) ⊗ |φi = √1 (|0i
2
+ e2πi(0.x2 ) |1i) ⊗ |φi.

Using Equation (3) and the map QFT−1 , we solve the problem:

This circuit generalizes for arbitrary ω (albeit probabilistically). Adding more


(UC )k to the circuit allows the estimation of more digits of ω.
292 B. Valiron

6.3 Quantum Walk


Another useful construction is the notion of quantum walk. It is similar to
the random walk: instead of flipping a classical coin that creates a probabilistic
superposition, we flip a “quantum coin” creating quantum superposition instead.
To illustrate the difference, let us define a random walk, and then its quantum
counterpart.
Consider a ring of 16 connected nodes as follows:

Random walk. Start from the node 0000. At each step, toss a fair coin: if tail,
do not move, else move to the next node. The probability distributions over
the 5 first steps shows a wave of probabilistic values moving right and getting
diluted along the way:
0000 0001 0010 0011 0100 0101 0110 ...
1 0 0 0 0 0 0 ...
0.5 0.5 0 0 0 0 0 ...
0.25 0.5 0.25 0 0 0 0 ...
0.125 0.375 0.375 0.125 0 0 0 ...
0.0625 0.25 0.375 0.25 0.0625 0 0 ...
0.03125 0.15625 0.311 0.311 0.15625 0.03125 0 ...

Quantum walk. A quantum walk12) is performed similarly, except that every-


thing is in superposition, including the coin. The state of the computation
consists then of 4 quantum bits for the spacial location and one quantum bit for
the coin. The evolution is unitary: the coin-toss is a one-qubit unitary matrix
C and the spacial step-forward O is the map sending |ii to |i + 1i is i 6= 1111
and |1111i to |0000i. This operation is unitary: it sends a base to a base, and
it is obviously reversible. Also note that is is a purely classical operation: it
is an oracle (which is the reason why we choose O for its name), and one can
therefore implement it using the technique of Section 6.1. A sequence of 5 steps
is represented by the circuit

To retrieve a classical information, as usual, one simply measures the output.


What is a “fair” coin in this situation? If in the “quantum coin” compu-
tation, we were measuring the quantum bit right after C

(4)
then we would recover a classical, random walk: a reasonable notion of quantum
fair coin is a unitary matrix C such that the quantum coin (4) is a usual fair
Quantum Computation: a Tutorial 293

coin. An example of such a fair coin is the Hadamard gate √12 ( 11 −1


1
). After 5
steps the probability distribution over the space is described by
0000 0001 0010 0011 0100 0101 0110 ...
0.03125 0.15625 0.125 0.125 0.53125 0.03125 0 ...
This time the wave keeps its cohesion and the tip of the wave goes faster than
its probabilistic counterpart.
It has to do with the choice of the quantum coin and its initial value.
Intuitively, the idea is that the Hadamard gate tends to “mix”, or “annihilate”
the tail of the wave but strengthen the step-forward part of the computation.
If instead we had chosen the initial value |0i for the coin, the tail of the
wave would have been preserved instead. An indeed, the computation of the
probability distribution after 5 steps gives
0000 0001 0010 0011 0100 0101 0110 ...
0.03125 0.53125 0.125 0.125 0.15625 0.03125 0 ...

Use in algorithms. The quantum walk is a tool that can be used to explore
a graph. A made-up example where a quantum walk is more efficient than
a classical algorithm is the binary welded tree: two binary trees of the same
height are joined by a random welding. Starting at the root of one tree and not
knowing the welding, can you find an algorithm that will find the root of the
other tree? A random walk can of course be used, but as for the simple example
we saw, the probability gets diluted very fast. It is possible to do better with
a quantum walk, using the fact that interference can “cancel-out” some nodes
and concentrates the wave function on the exit node.
Of course, the algorithm is not off-the-shelf: the step function (the oracle),
the coin and the number of steps need to be fine-tuned. Nonetheless, various
algorithms successfully make use of the quantum walk.10)

6.4 Amplitude Amplification


A technique related to quantum walks is called amplitude amplification.
As for quantum walks, interference plays a central role in increasing the ampli-
tudes of the states we are interested in and lowering the amplitudes of the other
ones.

Grover’s algorithm. The older and most known algorithm based on this tech-
nique is due to Grover, and aims at answering the search problem: given a
boolean function of n inputs and one output, find an input to the function
whose image is 1. We assume that there are not so many such inputs. This
problem can be applied to a wide variety of problem. In this paragraph, we
follow the very clear explanation given by Kaye et al.11)
The tools for the algorithm are 3 unitary maps operating on n qubits:
an oracle O, computing O(|xi) = (−1)f (x) |xi; a n-shift operator U0⊥ sending
|00 . . . 0i to itself and all other base states |xi to −|xi; the mixing operator H ⊗n ,
294 B. Valiron

applying the Hadamard gate on n qubits.


Note that O is not of the canonical form Uf (|xi ⊗ |yi) = |xi ⊗ |y ⊕ f (x)i.
But from Uf we can construct O easily: since
Uf (|xi ⊗ √1 (|0i
2
− |1i)) = (−1)f (x) |xi ⊗ √1 (|0i
2
− |1i)
we can omit the last register and consider O as the map acting on the n first
qubits. The algorithm is a succession of the Grover iterate G

where G is

We know the action of O. What is the action of H ⊗n U0⊥ H ⊗n ? Consider the


P2n −1
maximally entangled state |φi = H ⊗n |00 . . . 0i = i=0 |ii, and let V|φi be the
one-dimensional space generated by |φi and V|φi⊥ its orthogonal subspace. Since
HH is the identity,
H ⊗n U0⊥ H ⊗n |φi = H ⊗n U0⊥ |00 . . . 0i = H ⊗n |00 . . . 0i = |φi.
Now, sure enough for any element |ψi in V|φi⊥ , H ⊗n |ψi is a superposition of base
states which does not contain |00 . . . 0i. Therefore U0⊥ (H ⊗n |ψi) = −H ⊗n |ψi,
and H ⊗n U0⊥ H ⊗n |ψi = −|ψi. So really, H ⊗n U0⊥ H ⊗n could be written as Uφ⊥ ,
to keep the same intuition as the notation for U0⊥ .
We are now ready to see the intuition behind the algorithm. Let us de-
compose it up to the first iteration. The very first step is to create the maximally
entangled state |φi. This state can be decomposed into a “good” subspace, the
subspace of all the |ii such as f (i) = 1 and a “bad” subspace, the subspace of
all the |ii such as f (i) = 0. We can then write
|φi = |φgood i + |φbad i.
The term |φgood i can be decomposed into ²|φi + δ|φ⊥ i, with |φ⊥ i in V|φi⊥ . Since
there are not so many solutions to f , the amplitude of |φgood i is small, and so
is ².
Applying G to |φi means first applying O: this sends |φi to |φbad i−|φgood i,
that can be re-written as (1 − 2²)|φi − 2δ|φ⊥ i. Applying the operation Uφ⊥ , the
state Uφ⊥ (G|φi) becomes
Uφ⊥ ((1 − 2²)|φi − 2δ|φ⊥ i) = (1 − 2²)|φi + 2δ|φ⊥ i
= (3 − 4²)|φgood i + (1 − 4²)|φbad i.
If ² is small enough (i.e. there are not so many i’s such that f (i) = 1), we
effectively increased the amplitude of the “good” states and decreased the am-
plitude of the “bad” states. Each iteration will emphasize the difference up to
an optimal number of iterations.
Quantum Computation: a Tutorial 295

In simple cases, this optimal can be computed exactly; in general, it can


only be approximated: again, the classical information we can retrieve from this
technique is probabilistic.

Use in algorithms. For many algorithms such as the NP-complete ones, the
only available classical algorithm is a brute-force search. With amplitude am-
plification, one can gain quadratic speedup on a (classical) brute-force search
algorithm.

6.5 Size of Circuits


It should be noted that for non-trivial size of inputs, the number of gates
in the circuits can quickly become daunting. If one takes into account that each
oracle is devised as shown in Section 6.1, the number of auxiliary quantum bit
also grow very fast, yielding complex data-structures.
The fact that the complexity of the quantum algorithm is more manage-
able than the one of a corresponding classical algorithm is only saying that there
exists an input size for which the quantum algorithm outperforms the classical
algorithm. In the event of an actual quantum computer with a finite memory,
thorough resource estimation needs to be performed, and heavy code optimiza-
tion needs to be performed.
Quantum programming language may bring a benefit to this problem.

§7 Conclusion
We are nowhere close to real, complete, scalable quantum computers.
However, many experimentation are realized in a very wide spectrum of ap-
proaches, letting us dream for the possibility of a programmable device at the
edge between the classical and the quantum world.
Despite the strange nature of quantum information and its probabilistic
interaction with the classical world, various quantum algorithms make it possi-
ble to compute differently and, in some case, theoretically faster than classical
algorithms.
This is where we close this first part of the tutorial. The second and
last part will present quantum computation from a programmer’s perspective:
why we need quantum programming languages in the first place, what are the
challenged and what is the state of the art.

Acknowledgements
We would like to thank Thomas Chapuran for his careful proof-reading
of Section 5 and his helpful comments.

References
1) Bell, J. S., “On the Einstein Podolsky Rosen paradox,” Physics, 1, pp. 195–200,
1964.
296 B. Valiron

2) Bennett, C. H. and Brassard, G., “Quantum cryptography: Public key dis-


tribution and coin tossing,” in Proc. of the IEEE Int. Conf. on Computers,
Systems, and Signal Processing, pp. 175–179, 1984.
3) Bennett, C. H. et al., “Experimental quantum cryptography,” J. Cryptology,
5, 1, pp. 3–28, 1992.
4) Bennett, C. H. et al. “Generalized privacy amplification,” IEEE Transactions
on Information Theory, 41, 6, pp. 1915–1923, 1995.
5) Blatt, R. and Wineland, D., “Entangled states of trapped atomic ions,” Nature,
453, pp. 1008–1015, 2008.
6) Chen, G. et al., Quantum Computing Devices: Principles, Designs, and Anal-
ysis, Chapman and Hall/CRC, 2007.
7) D-Wave, http://www.dwavesys.com/, electronic resource.
8) DiVincenzo, D. P., “The physical implementation of quantum computation,”
Fortschr. Phys, 48 pp. 771–783, 2000.
9) IDQ, http://www.idquantique.com/, electronic resource.
10) Jordan, S., http://math.nist.gov/quantum/zoo/, electronic resource.
11) Kaye, P., Laflamme, R., Mosca, M., An Introduction to Quantum Computing,
Oxford University Press, 2007.
12) Kempe, J., “Quantum random walks: An introductory overview,” Contempo-
rary Physics, 44, 4, pp. 307–327, 2003.
13) Knill, E., Laflamme, R. and Milburn, G. J., “A scheme for efficient quantum
computation with linear optics,” Nature, 409, pp. 46–52, 2001.
14) Ladd, T. D. et al., “Quantum computers,” Nature, 464, pp. 45–53, 2010.
15) Lydersen, L. et al., “Hacking commercial quantum cryptography systems by
tailored bright illumination,” Nature Photonics, 2010.
16) magiQ, http://www.magiqtech.com/MagiQ/Home.html, electronic resource.
17) Monz, T. et al., “14-qubit entanglement: Creation and coherence,” Phys. Rev.
Lett., 106, p. 130506, 2011.
18) Negrevergne, C. et al., “Benchmarking quantum control methods on a 12-qubit
system,” Phys. Rev. Lett., 96, p. 170501, 2006.
19) Nielsen, M. A. and Chuang, I. L., Quantum Computation and Quantum Infor-
mation, Cambridge University Press, 2002.
20) Valiron, B., “Quantum computation: from a programmer’s perspective,” New
Generation Computing, 31, 1. To appear.
21) Vandersypen, L. M. K. et al., “Experimental realization of shor’s quantum
factoring algorithm using nuclear magnetic resonance,” Nature, 414, pp. 883–
887, 2001.

Benoı̂t Valiron, Ph.D.: Originally from France, he did his M.Sc and
Ph.D. in Canada. Working under Peter Selinger’s supervision, he
explored the semantics of quantum programming. After 3 years
in France, he is currently doing post-doctoral research at the
University of Pennsylvania, working with Jonathan M. Smith on
the IARPA-funded project PLATO to design a scalable quantum
programming environment.

You might also like