Académique Documents
Professionnel Documents
Culture Documents
Adventures
in Computer
Science
From Classical Bits to Quantum Bits
Adventures in Computer Science
Vicente Moret-Bonillo
Adventures in
Computer Science
From Classical Bits to Quantum Bits
Vicente Moret-Bonillo
Departamento de Computación
Universidad de A Coru~na
A Coru~na, Spain
Would you tell me, please, which way I ought to go from here? said Alice. That depends a
good deal on where you want to get to, said the Cat. I don’t much care where, said Alice.
Then it doesn’t matter which way you go, said the Cat.
Lewis Carroll
vii
viii Preface
Just to reiterate—although this book does not contain anything particularly new,
it is to be hoped that the reader will find novelty in the way the material is presented.
Enjoy!
A Coru~
na, Spain Vicente Moret-Bonillo
2017
Contents
xi
xii Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Chapter 1
The Universe of Binary Numbers
Before we start reflecting on difficult problems, we will review certain more or less
trivial concepts that are related to the peculiar entities and techniques already
implemented in our computers so that they can compute. Our computers are based
on binary logic, which uses the concept of bit to represent something that is true
(denoted by |1〉) or false (denoted by |0〉). As for the strange bar-and-angle-bracket
symbol, its exact meaning will become clear later. For the moment accept that if
the state of something is true, then the representation of that state is |1〉, and if the
state of something is false, then the representation of that state is |0〉. But let we
pose two questions:
• What kind of a thing is a bit?
• Is there a formal definition for the concept of bit?
X fPð AÞ ¼ Pð BÞ g
That is to say, we denote by X the circumstance that events A and B are equally
likely. According to this, the official definition of bit could be translated as follows:
In this expression, {A,B/X} means A or B given X, and, from our point of view,
the problem of the official definition lies in the term ‘election’. The interpretation of
this term might be confusing.
The definition given by the “Diccionario de Computación (In Spanish)”
published by McGraw-Hill in 1991 establishes that a bit is “the unit of information
equivalent to a binary decision.” This definition is almost the same as the previous
definition, with “election,” however, replaced by the stronger term “decision.” This
definition seems to be also ambiguous and imprecise.
A second meaning of the term given in the same dictionary establishes that “a bit
is a non-dimensional unit of the capacity of storage that expresses the capacity of
storage as the base 2 logarithm of X, X being the number of possible states of the
device”. This statement goes directly to the domain of axiomatic definitions. But. . .
what “device” is referred to here? And. . . why “base 2” and not, for example, “base-
5”? The reason for this base will be discussed later on in the text.
Let us leave aside academic sources of definitions for the moment. The author of
this text did once an experiment consisting of asking some of his closest col-
leagues—all professionals in the computer sciences—for their own definitions of
bit. Their definitions are as follows:
• A mathematical representation of the two possible states of a switch that uses a
base 2 number system.
• A minimum unit of information of an alphabet with just two symbols.
• The smallest unit of information in a machine.
1.1 Looking for the Bit 3
• A binary digit.
• A unit of numbering that can take the values 0 or 1.
• The minimum quantity of information that can be stored and transmitted by a
computer system.
The full list of definitions, included the academic ones, can be classified into
three different categories:
(a) Those that emphasize conceptual nuances.
(b) Those that focus on units of information.
(c) Those that highlight the binary nature of the bit.
It is clear that the bit exists by definition, exactly for the same reason that the
color red is red because scientists decided that, in the visible spectrum of light, the
700–635 nm wavelength interval corresponds exactly to the color red. But do we
really need scientists to identify colors? After all, ordinary people recognized colors
long before scientists formally defined them.
Following this rather crazy line of reasoning, there must be something essential
and intuitive in colors that means that they can be recognized without needing a
definition or some kind of formal characterization. And this is exactly what we are
going to explore regarding the bit. In particular we will try to find answers to the
following questions:
(a) Is there something apart from its own definition that justifies the concept of bit?
(b) Is there something that allows us to identify the bit as a basic unit of
information?
(c) Is there something that allows us to establish the binary nature of the bit?
But first let us digress briefly. In almost all scientific problems it is possible to
reason following one of two different strategies:
• From data to conclusions. In artificial intelligence, this is data-driven reasoning.
• From a hypothesis to data that confirm the hypothesis. In artificial intelligence,
this is backward reasoning.
In both cases knowledge is necessary, and the only difference is in how this
knowledge is applied.
In data-driven reasoning, if we know that our knowledge base Θ includes five
rules (or chunks of knowledge) as our axioms:
Θ ¼ fR 1 ; R2 ; R3 ; R4 ; R5 g
R1 Axiom1 : IF A THEN B
R2 Axiom2 : IF B AND C THEN D
4 1 The Universe of Binary Numbers
and if we also know that the set of data Δ for our problem is
Δ ¼ fA; C; E; Fg
But now we have to stop since we have no further knowledge that will yield new
information. This is the way data-driven reasoning works.
If, on the other hand, we want to apply a backward-reasoning process, we first
need a working hypothesis, for example D, and then have to use our axioms to look
for information that will confirm or reject this hypothesis.
Using the same example as above, to confirm D we need to use Axiom2 (because
D is in the conclusion part of the axiom). Since all the axioms are true, we require
the condition component of Axiom2 also to be true. But for B and C in the condition
component, C but not B is in Δ, and so we need B in order to confirm our initial
working hypothesis D. B therefore has to be considered as a new working hypoth-
esis. In order to confirm B, we have to use Axiom1, which needs A in its condition
component. Since A is in Δ, then we can apply Axiom1 to deduce B. Once we know
that B is true, then we can apply Axiom2 and deduce D. This is how backward
reasoning works.
Note that the set of axioms Θ and the initial set of data Δ are exactly the same in
both cases, yet the final result is different. Thus, denoting by Ψ the information
obtained after reasoning with our data and axioms, the results are
The difference between the two processes is not related to the actual information
used, but to the way in which this information is used. Something similar occurs in
physics with electromagnetism. We can begin with Coulomb’s law and arrive at
Maxwell’s equations, or we can start with Maxwell’s equations and arrive at
Coulomb’s law. Again, the way we apply our knowledge is different.
And what link is there between the above arguments and the concept of bit?
None, in fact. The idea was to highlight how information and knowledge can be
1.1 Looking for the Bit 5
used in many different ways to produce different results (if you have trouble
believing that, ask a politician!).
Returning now to the bit, let us explore some ideas. Suppose that we do not know
what exactly a bit is, that is to say, we have no definition. Could we justify its
existence or even find some kind of proof to demonstrate that there is a formal
definition?
Assume that we have a problem about which, initially, we know almost nothing
other than
1. We know we have a problem.
2. The problem may have a solution.
If there is a solution, it has to be one of the solutions si in a given space S of
possible solutions.
Since we do not know the solution to our problem, all si 2 S are equally likely
(that is to say, any possible solution may be the real solution.) What we can do is
gradually seek out information that can be used to discard some of the initial
options in S. The more relevant the information collected and applied to our
problem, the smaller the remaining space of possible solutions. This situation is
illustrated in Fig. 1.1.
We will now formalize the problem in mathematical terms. Let N be the a priori
number of equally likely possible solutions to our problem that can be represented
with n symbols. We will use information to reduce the size of N, assuming all
information is relevant. Therefore, the more information we use, the more options
can be discarded, thereby reducing the size of N. We define the quantity of
information Ψ using Claude Shannon’s formula:
Ψ ¼ k loge ðN Þ
INFORMATION
SPACE OF SPACE OF
SPACE OF POSSIBLE SOLUTIONS POSSIBLE POSSIBLE SOLUTION
SOLUTIONS SOLUTIONS
systems (or spaces of different solutions) with N1 and N2 equally probable events,
respectively. If we consider the system as a whole, the entire space of solutions will
be
N ¼ N1 N2
The situation is similar to what happens when we have two different and
independent sets of elements:
Although not strictly necessary, we will assume that each element in Ω1 and Ω2
has a given probability of occurring:
Ψ ¼ k loge ðN Þ
then
Ψ ¼ k loge ðN Þ ¼ k loge ðN 1 N 2 Þ
¼ k loge ðN 1 Þ þ k loge ðN 2 Þ ¼ Ψ1 þ Ψ2
And that’s it. Thanks to the logarithm we were able to build something coherent
and nicely structured. We will go a step further in our thinking. Above we said “Let
N be the a priori number of equally likely possible solutions to our problem that can
be represented with n symbols.” But if we have n symbols then how many equally
likely states can be represented?
The answer is evident: N ¼ 2n. Thus, if n ¼ 3 (for example, A, B, C such that A,
B, C 2 {0, 1}), then the N equally likely states are those reflected in Table 1.1.
Thus, if we take N ¼ 2n to be equivalent to the quantity of information in a given
system, then
1
kloge ð2Þ ¼ 1 ! k ¼
loge ð2Þ
Going back to Ψ ¼ k loge(N ), with some further work we obtain the following
result:
loge ðN Þ
Ψ ¼ k loge ðN Þ ¼ ¼ log2 ðN Þ ¼ n
loge ð2Þ
And here we have the formal definition of the bit! If the reader does not believe
the mathematical equality
loge ðN Þ
¼ log2 ðN Þ
loge ð2Þ
loge ðN Þ
A¼ ! loge ðN Þ ¼ A loge ð2Þ
loge ð2Þ
Then
How can we use a single bit? What is it about bits that justifies their use? Both
questions are academic, of course, since we already know that bits perform their job
in computers, and computers do quite a lot of things. However, it is clear by now
that a bit is nothing more than a binary digit that is expressed in the base 2 number
system. We can also do the same things with bits that can be done with any other
number written in any other number base. The reason for using bits is fundamen-
tally practical; among many other things, they enable fast computation. In any case,
it is easy to change from one to another number base. In our examples and
discussion, we will focus mainly, although not exclusively, on whole numbers
(integers).
Base 10 to Base 2
To convert a base 10 integer to a base 2 integer, we first divide the base 10 number
by two. The remainder of this quotient is referred to as the least significant bit. We
divide the resulting integer by two successively until the quotient becomes zero.
This is illustrated below with the example of the base 10 integer 131, which we
want to represent in base 2:
Now, starting with the most significant bit and ending with the least significant
bit, we can write the remainders to obtain
ð131Þ10 ¼ ð10000011Þ2
1 0 0 0 0 0 1 1
128 ¼ 27). However, we still need 23 to obtain 151 (because 151 128 ¼ 23). This
value will be achieved by distributing more numbers 1 and 0 among the powers of
two, in such a way that the sum yields the result we are seeking. In the example, the
correct powers of two are 4, 2, 1 and 0, and the resulting numbers are 16, 4, 2 and
1, respectively. In other words
ð151Þ10 ¼ 1 27 þ 0 26 þ 0 25 þ 1 24 þ 0 23
þ1 22 þ 1 21 þ 1 20 ¼ ð10010111Þ2
0:3125 2 ¼ 0:625 ! 0
0:6250 2 ¼ 1:250 ! 1
0:2500 2 ¼ 0:500 ! 0
0:5000 2 ¼ 1:000 ! 1
Base 2 to Base 10
If we want to do the reverse and convert an integer from base 2 to base 10, we do the
following:
Beginning on the right side of the binary number, multiply each bit by 2 and then
raise the result to the consecutive power, according to the relative position of the
corresponding bit and beginning with the power of 0. After completing the multi-
plications, add all the partial results to obtain the number in base 10.
By way of an example,
Therefore
ð110101Þ2 ¼ ð53Þ10
10 1 The Universe of Binary Numbers
The procedure is the same for a non-integer, except that we need to take into
account that, because 0 is to the left of the decimal, the digits to the right are raised
to negative powers. For example,
Note that we can work with many different number bases, although computer
science, for practical and historical reasons, works with base 2, base 8 or base 16.
To conclude this section, Table 1.2 shows conversions between the main number
bases.
We are now going to look at bits from a totally different perspective. Imagine we
have the circuits illustrated in Figs. 1.2 and 1.3 and Table 1.3.
According to the circuit analogy, bits can be represented as follows:
1
Bit 0
0
1.3 Single Bits Represented with Stickers 11
0
Bit 1
1
Let us try to explain what we did. Up to now, we have considered the concept of
bit from a very static point of view:
1. A bit is 1 if something is true.
2. A bit is 0 if something is false.
But bits need to be implemented in some physical device, for example, in
circuits as depicted above. If the circuit is ON the sticker is happy. Conversely, if
the circuit is OFF then the sticker is sad. However, the ON or OFF state applies to
the whole circuit; in other words, it is not possible for half the circuit to be in the ON
12 1 The Universe of Binary Numbers
state and the other half to be in the OFF state. Let us put two marks, A and B, in the
circuit in such a way that A is before the sticker and B is after the sticker. A and
B must always be in the same state, independently of the state of the whole circuit.
In other words
If A ¼ 0 and B ¼ 0 ! Bit is 0 ! Circuit OFF
If A ¼ 1 and B ¼ 1 ! Bit is 1 ! Circuit ON
If A ¼ 0 and B ¼ 1 ! Illogical
If A ¼ 1 and B ¼ 0 ! Illogical
Now, looking at Table 1.3 and remembering that A is located before the sticker,
and B is located after the sticker, the following cases are represented:
Case 1: Circuit is ON There is a Bit 1
A ¼ 1 and B ¼ 0 is false
A ¼ 1 and B ¼ 1 is true
Case 2: Circuit is OFF There is a Bit 0
A ¼ 0 and B ¼ 0 is true
A ¼ 0 and B ¼ 1 is false
The above cases can clearly be represented as a matrix. From Table 1.3 we can
verify that this is true, because if a bit is represented by a column matrix then
1
Bit is 0 j0i when, given A ¼ 0, then B ¼ 0 )
0
0
Bit is 1 j1i when, given A ¼ 1, then B ¼ 1 )
1
Up to now we have learned something about bits and about how number bases can
be changed in order to be able to work with bits. Now we take things further and
discuss binary logic, without which current computers could not work. Binary logic
was developed at the beginning of the nineteenth century by the mathematician
George Boole in order to investigate the fundamental laws of human reasoning.
In binary logic, variables can only have two values, traditionally designated as
true and false, and usually represented as 1 and 0, respectively. At a given moment,
the same variable can only be in one of these states. This is why binary logic
handles logic states, not real quantities. In other words, 0 and 1, even though they
are numbers, do not represent numerical quantities. They are, rather, symbols of
two different states that cannot coexist at the same time (at least in a classical
system; matters are different in quantum systems).
In binary logic systems, variables are represented in base 2. The reason is almost
trivial, since the establishment of a direct relationship between the numerical values
and their corresponding logic states is immediate. Nevertheless, base 2 (or any
another number base) and binary logic are totally different concepts. This is one of
the reasons why, for the moment, we will use the following notation:
An important feature of logic values is that they allow logic operations. A logic
operation assigns a true or false value to a combination of conditions for one or
more factors. The factors in a classical logic operation can only be true or false, and
consequently the result of a logic operation can also only be true or false. Table 1.4
depicts some of these logic operations.
Let us now experiment with these logic operations. Let R be the result of some
logic operation and let x, y, z. . . be the variables involved in the logic operation.
Binary Equality
The result for R after applying binary equality to a variable x is very simple:
If x is true, then R is true.
If x is false, then R is false.
If we use the particular notation introduced at the beginning of this chapter,
Table 1.5 is the truth table that illustrates binary equality.
To visualize how binary equality works, suppose that we have a car with an
automatic light detector: when it is dark the car lights turn on, and when it is not
dark the car lights turn off. The logic representation of this example is thus
Binary Negation
The car example can also be used to illustrate binary negation; we only need to
change ‘darkness’ to ‘brightness’. Thus
Binary Disjunction
If x is true, or y is true, or both x and y are true, then R is true, otherwise R is false.
1.4 Binary Logic 15
Table 1.7 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 _ |y〉
binary disjunction
|0〉 |0〉 |0〉
|0〉 |1〉 |1〉
|1〉 |0〉 |1〉
|1〉 |1〉 |1〉
Table 1.8 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 |y〉
binary exclusive disjunction
|0〉 |0〉 |0〉
|0〉 |1〉 |1〉
|1〉 |0〉 |1〉
|1〉 |1〉 |0〉
Since the logic operation involves two variables there are four possible combi-
nations. Table 1.8 depicts the truth table for binary exclusive disjunction.
To illustrate again using the car example, we are on a long trip and decide to
listen to some music to make our trip less boring. The car has both a radio and a CD
player and we can choose between the radio or an Eric Clapton CD. We cannot
connect both simultaneously since we would only hear what would sound like a
swarm of crickets. Thus
Table 1.9 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 # |y〉
binary conjoint negation
|0〉 |0〉 |1〉
|0〉 |1〉 |0〉
|1〉 |0〉 |0〉
|1〉 |1〉 |0〉
Table 1.10 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 ^ |y〉
binary conjunction
|0〉 |0〉 |0〉
|0〉 |1〉 |0〉
|1〉 |0〉 |0〉
|1〉 |1〉 |1〉
The results for binary conjoint negation are shown in Table 1.9.
Again we use our car to illustrate. We are driving through the desert of Arizona.
It is three o’clock in the afternoon and a merciless sun is shining in a cloudless sky.
The temperature outside the car is 110 F (43 C). Disastrously, both a conventional
electric fan we have installed in our car and the air conditioning stop working. Thus
Binary Conjunction
Binary conjunction is performed using the AND operator (symbol ^). The result
R of binary conjunction applied to two variables x and y is the following:
Again we have two variables with four possible combinations. Table 1.10 shows
the truth table for binary conjunction.
Let us go back to the previously mentioned example of a toxic-substance test
while driving. After the breathalyzer test, the police officer can record the results as
follows:
1.4 Binary Logic 17
Table 1.11 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 " |y〉
binary exclusion
|0〉 |0〉 |1〉
|0〉 |1〉 |1〉
|1〉 |0〉 |1〉
|1〉 |1〉 |0〉
Binary Exclusion
Binary exclusion, the negation of binary conjunction, is performed using the NAND
operator (symbol "). The result R of binary exclusion applied to two variables x and
y is as follows:
The two variables again mean four possible combinations. Table 1.11 depicts the
results for binary exclusion.
We have been driving for a long time and are tired so we decide that now is a
good moment to stop at a gas station to eventually refuel or to add water to the
radiator.
Simple binary implication, performed by the operator IMP (symbol !), is a rather
different logic operation from those described above, as it relies greatly on its own
definition, as follows:
Table 1.12 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 ! |y〉
simple binary implication
|0〉 |0〉 |1〉
|0〉 |1〉 |1〉
|1〉 |0〉 |0〉
|1〉 |1〉 |1〉
Table 1.13 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 $ |y〉
double binary implication
|0〉 |0〉 |1〉
|0〉 |1〉 |0〉
|1〉 |0〉 |0〉
|1〉 |1〉 |1〉
Assume we park the car for a time and look up at the sky, analyzing the causal
relation between rain and the presence of clouds, bearing in mind that whenever it
rains there are clouds, but that it does not always rain when there are clouds.
Double binary implication, performed using the XNOR operator (symbol $),
indicates equivalence. Again we need to consider the logical expression as a
whole, so that what is true or false is the logical expression itself. The result R of
double binary implication applied to two variables x and y is as follows:
Table 1.15 All binary logic operations that can be defined for two binary variables, x and y
x y 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Fig. 1.4 Some logic gates with their associated symbols and functions
It is evident that we can obtain 24 (¼ 16) possible outcomes for logic operations
on two binary variables x and y, as represented in Table 1.15.
Left as a task for the reader is to associate the bold numbers in Table 1.15 with
the logic operations they represent.
We need one or more physical devices, which we call logic gates, in order to
implement logic operations in a computer. Logic gates are elementary units used in
the design of current computers to enable these to compute. These logic gates have
one or more input lines and one output line. The basic logic gates are NOT (also
called INV), AND, NAND, OR, NOR, XOR and XNOR. These gates have associ-
ated symbols, as illustrated in Fig. 1.4.
We can do many things with these logic gates, as we will see shortly. However,
our main interest is in special sets of universal gates that allow us to implement
absolutely any logic function. For example, the set formed by the gates {AND, OR,
NOT} is universal, as are the sets {AND, NOT}, {OR, NOT}, {NAND} and
{NOR}. A group of logic gates is also universal when it can implement all the
gates belonging to another universal set. We will return to these universal logic gate
sets below.
20 1 The Universe of Binary Numbers
With the resources presented above we can perform some simple but interesting
computations. The only requirement is to put our neurons to work and use our skills
to connect up logic gates so as to build the architecture necessary to resolve a given
problem. Since we are dealing with binary systems, we will use digits that can be
either 0 or 1.
The Half Adder
A ¼ 001101
B ¼ 010110
R ¼ 100011
We can visualize this by considering conveyor belts (A, B and R) that transport
boxes. A box may contain a ball (the bit of this box is 1) or may be empty (the bit of
this box is 0). Figure 1.5 illustrates this example.
The following restrictions apply:
1. A and B must have the same number of boxes.
2. The number of boxes in A and B must be at least as large as the number of bits
reflecting the largest number we want to sum.
3. The result of the sum will be represented by the contents of R.
4. R must have at least one box more than A and B (why?).
5. Each box in A, B or R must either contain a single ball or be empty.
6. Addition must be performed from right to left by emptying the contents of
A and B into the corresponding box in R, which must initially be empty.
7. No box may have more than one ball.
1 1
0 0 1 0 0 0 1 0
0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0
0 1 1 0 0 1 1 0
0 0 0
0 0 0 1 0 0 0
8. In the case of one ball entering an already occupied box, the second ball is
placed in the nearest empty box to the left and the ball already present in R is
discarded.
9. In the case of two balls entering an empty box, one ball is placed in the nearest
empty box to the left and the other is discarded.
10. In the case of two balls entering an already occupied box, one of the three is
placed in the nearest empty box to the left, one is discarded, and one remains in
this box.
11. The process continues until there are no more balls to add.
Another example, shown in Fig. 1.6, clarifies this sum-and-carry movement to
the left.
We should now be able to establish the basic rules for the binary sum of two bits,
Bit_1 and Bit_2. In Table 1.16 illustrating the process, |S〉 means sum and |K〉
means carry.
Above we built a device capable of summing two sequences of bits. Figure 1.7
depicts the basic architecture of what is called, for obvious reasons, a Half Adder
(think why!). The generalization of the Half Adder, called the Full Adder, will be
analyzed in depth later.
22 1 The Universe of Binary Numbers
Table 1.17 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 ^ |y〉
binary conjunction
|0〉 |0〉 |0〉
|0〉 |1〉 |0〉
|1〉 |0〉 |0〉
|1〉 |1〉 |1〉
Table 1.18 Truth table for |x〉 |y〉 |R〉 ¼ |x〉 |y〉
exclusive disjunction
|0〉 |0〉 |0〉
|0〉 |1〉 |1〉
|1〉 |0〉 |1〉
|1〉 |1〉 |0〉
We now return to the logic operation called binary conjunction, whose truth
table is reproduced again in Table 1.17.
It can be observed that binary conjunction and the carry operation in the Half
Adder are one and the same. The Half Adder carry can be directly obtained using
the inputs of the Half Adder as the inputs of the logic gate AND. We can also obtain
the bit for the sum using exclusive disjunction, whose truth table is reproduced in
Table 1.18.
One of the stated goals of this book was to stimulate reasoning by analogy. In all
areas of human learning there are smart, creative people capable of converting the
learning of abstract notions—usually tedious—into something fun and fascinating.
One such individual was Arthur Compton, a US physicist, who, by playing billiards
with electrons, discovered the laws that govern the decrease in energy (increase in
wavelength) in electromagnetic radiation resulting from electron scattering. For this
discovery, of what came to be called Compton scattering, he was awarded the
Nobel Prize in Physics in 1927.
Edward Fredkin and Tommaso Toffoli did something similar when they used
billiard balls (bits) on a billiard table (computer) to simulate bit movement through
logic gates. They imposed the following restrictions:
The launching of balls represents the input to the system.
The distribution of balls represents the output of the system.
The balls move diagonally through a flat mesh.
The balls obey classical mechanical laws.
There is no friction.
Collisions are perfectly elastic.
Let us now consider the schematic representation in Fig. 1.8.
1.7 A Peculiar Way to Compute 23
We assume that Ball_1 and Ball_2 (which look exactly the same) can be absent
or present. If we use our particular notation for possible states, then
We have exactly the same situation for both Output_1 and Output_2. Thus
But how are the inputs and outputs related? Bearing in mind that we cannot
distinguish between Ball_1 and Ball_2, we can verify the following relations:
jOutput 1〉 ¼j0〉
jBall 1〉 ¼j0〉 and jBall 2〉 ¼j0〉 Case 1
jBall 1〉 ¼j1〉 and jBall 2〉 ¼j0〉 Case 2
jOutput 2〉 ¼j0〉
jBall 1〉 ¼j0〉 and jBall 2〉 ¼j0〉 Case 3
jBall 1〉 ¼j0〉 and jBall 2〉 ¼j1〉 Case 4
jOutput 1〉 ¼j1〉
jBall 1〉 ¼j1〉 and jBall 2〉 ¼j1〉 Case 5
jBall 1〉 ¼j0〉 and jBall 2〉 ¼j1〉 Case 6
jOutput 2〉 ¼j1〉
jBall 1〉 ¼j1〉 and jBall 2〉 ¼j1〉 Case 7
jBall 1〉 ¼j1〉 and jBall 2〉 ¼j0〉 Case 8
24 1 The Universe of Binary Numbers
B1 O1 B1 O1 B1 O1 B1 O1
B2 O2 B2 O2 B2 O2 B2 O2
B1 O1 B1 O1 B1 O1 B1 O1
B2 O2 B2 O2 B2 O2 B2 O2
Fig. 1.9 All eight possible situations in our peculiar billiard game
Recall that, some lines ago, we referred to the fact that the set of logic gates
formed of {AND, OR, NOT} is universal and also that the logic gate sets formed of
{AND, NOT}, {OR, NOT}, {NAND} and {NOR} are complete. Could we then not
claim that our system of billiard balls is, in reality, a universal set of binary
operators? We will return to this question and to billiard ball computing later,
after we have explored what is referred to as reversible computation.
Our main goal in this chapter is to stimulate reasoning by analogy and to show that
the same concept can be viewed from several different perspectives. The material
presented here is illustrated with a good number of examples. Some of the sections
are very speculative, and may appear chaotic. Conversely, the rest of the sections
follow a very strict organization. The choice depended on the type of material
presented and discussed in each section. We start with an almost surprising ques-
tion: what is a bit? Rather that define it, we introduce it by using Shannon’s amount
1.9 Glossary of Terms and Notation Used in This Chapter 25
Terms
• Axiom: a proposition that is assumed without proof for the sake of studying its
consequences.
• Backward reasoning: proving a goal by recursively breaking it down into
sub-goals and trying to prove these until facts are derived. Facts are goals with
no sub-goals and are therefore always true.
• Binary logic: classical propositional two-valued logic, often called Boolean
logic in engineering.
• Data-driven reasoning: the construction of goals or the drawing of inferences
from a set of facts.
• Joint probability: given at least two random variables x, y,... defined in a
probability space, the joint probability distribution for x, y,... gives the proba-
bility that each of x, y,... falls within a particular range or discrete set of values
specified for that variable.
• Logarithm: the exponent of the power to which a base number must be raised to
equal a given number.
• Remainder: the portion of the dividend that is not evenly divisible by the divisor.
• Rule base: a set of rules that apply to a given inferential process. Each rule has an
IF-part (the condition), a THEN-part (the conclusion) and, optionally, an ELSE-
part.
• Symbol: a letter, figure, or other character or mark or combination thereof used
to designate something.
Notation
To be able to talk about reversible computing, we need to define two new logic
operations called fanout and exchange.
Fanout (FO) is an operation that divides a single input into two or more outputs
with the same value as the input value, as illustrated in Fig. 2.1.
Exchange (EX) is an operation in which the pair of input connections in a
two-line system is exchanged, as illustrated in Fig. 2.2.
These two simple operations are ideal for a discussion of reversibility concepts
and reversible computation and, in the remainder of this chapter, we will broadly
draw on Feynman Lectures on Computation. Accordingly, we will assume that we
have a sufficient number of |0〉and |1〉bits to design our reversible system.
First of all, the logic operations AND, NAND, OR and XOR are not reversible;
in other words, we cannot reconstruct the inputs from the outputs. In fact, it is
evident that, with irreversible operations, we lose information that cannot be
retrieved. But is there some way to avoid this information loss? Let us try to define
a reversible operation as a logic operation that has sufficient information in the
outputs to allow the inputs to be reconstructed.
B A
Similar to the N gate, but not identical, is a gate usually called controlled binary
negation or, more simply, controlled-NOT (CN), a device that operates on two
inputs to generate two outputs. Figure 2.3 illustrates a standard representation of the
CN gate.
In the CN reversible logic gate, the symbol ♦ is a NOT operation that is
controlled by the input of the control line •. The way CN operates is as follows:
j A0 i ¼ j Ai, always
Ifj Ai ¼ j 0i, thenj B0 i ¼ j Bi
Ifj Ai ¼ j 1i, thenj B0 i ¼ NOTj Bi
2.2 The Toffoli Gate 29
Table 2.1 Truth table for the |A〉 |B〉 |A0 〉 |B0 〉
CN gate
|0〉 |0〉 |0〉 |0〉
|0〉 |1〉 |0〉 |1〉
|1〉 |0〉 |1〉 |1〉
|1〉 |1〉 |1〉 |0〉
We have to interpret the above rules as follows: if the input to the control line
A (•) is |1〉
, then the output of the controlled line B (♦) is the negation of the input
value of B. Conversely, if the input to the control line A (•) is |0〉, then the output of
the controlled line B (♦) has the same value as its input value. The value of the input
in the control line (•) activates a NOT in the controlled line (♦), but the output of the
control line (•) is always the same as the input value. Table 2.1 is the truth table of
the CN gate.
0
Lcan interpret B as the output of a binary exclusive disjunction, or
Clearly we
XOR, gate ( ), with inputs A and B:
M
B0 ¼ A B
However, note that the two operations are not the same, since the CN gate
generates two outputs, whereas the XOR gate generates only one output. And what
about the reversibility of CN? We can easily verify that CN is perfectly reversible
since, once its outputs are known, we can always reproduce the inputs. We can
check the reversibility of CN just by applying this gate twice, as illustrated in
Fig. 2.4 and in Table 2.2.
We can do many things with CN gates, but this gate is not universal. We want to
do “everything” with our computers, but in a reversible manner, so, as well as the
NOT and CN gates, we need a universal set of operators.
j A0 i ¼ j Ai always
j B0 i ¼ j Bi always
j Ai ¼ j 1i and j Bi ¼ j 1i ! j C0 i ¼ NOT j Ci
j Ai ¼ j 0i or j Bi ¼ j 0i or ðjAi ¼ j0i and jBi ¼ j0iÞ ! j C0 i ¼ j Ci
Thus:
If we set |A〉¼ |B〉¼ |1〉 , then the corresponding CCN output is the negation of
the input state of line C.
If at least one of the control lines, A or B, is in state |0〉
, then the CCN gate does
not change the value on line C. Table 2.3 shows the truth table for the CCN gate.
We can check the reversibility of the corresponding operation by applying CCN
twice, as illustrated in Fig. 2.6 and Table 2.4.
2.3 The Fredkin Gate 31
j A0 i ¼ j Ai always
If j Ai ¼ j 0i, then j B0 i ¼ j Bi and j C0 i ¼ j Ci
If j Ai ¼ j 1i, then j B0 i ¼ j Ci and j C0 i ¼ j Bi
32 2 Back and Forth Computing
Table 2.5 Truth table for the |A〉 |B〉 |C〉 |A0 〉 |B0 〉 |C0 〉
Fredkin gate
|0〉 |0〉 |0〉 |0〉 |0〉 |0〉
|0〉 |0〉 |1〉 |0〉 |0〉 |1〉
|0〉 |1〉 |0〉 |0〉 |1〉 |0〉
|0〉 |1〉 |1〉 |0〉 |1〉 |1〉
|1〉 |0〉 |0〉 |1〉 |0〉 |0〉
|1〉 |0〉 |1〉 |1〉 |1〉 |0〉
|1〉 |1〉 |0〉 |1〉 |0〉 |1〉
|1〉 |1〉 |1〉 |1〉 |1〉 |1〉
Table 2.7 Intermediate results for the Fredkin gate used to reproduce a conventional NAND
following the procedure: FB0C0, A0 ! FC1D1, E1 ! FB2C2, D2. The NAND gate appears in |C3〉
(a)
|A1〉 |B1〉 |C1〉 |D1〉 |E1〉
|0〉 |0〉 |0〉 |1〉 |1〉
|0〉 |1〉 |0〉 |1〉 |1〉
|1〉 |0〉 |0〉 |1〉 |1〉
|1〉 |0〉 |1〉 |1〉 |1〉
(b)
|A2〉 |B2〉 |C2〉 |D2〉 |E2〉
|0〉 |0〉 |1〉 |0〉 |1〉
|0〉 |1〉 |1〉 |0〉 |1〉
|1〉 |0〉 |1〉 |0〉 |1〉
|1〉 |0〉 |1〉 |1〉 |1〉
(c)
|A3〉 |B3〉 |C3〉 |D3〉 |E3〉
|0〉 |0〉 |1〉 |0〉 |1〉
|0〉 |1〉 |1〉 |0〉 |1〉
|1〉 |0〉 |1〉 |0〉 |1〉
|1〉 |1〉 |0〉 |1〉 |1〉
The logic operator AND can be built from CCN by setting |C〉¼ |0〉and feeding the
gate with A and B, as illustrated in Table 2.8. Note that |C0 〉is the result of |A〉^ |B〉
.
Construction of NAND from CCN
The logic operation NAND can be built from CCN by setting |C〉¼ |1〉and feeding
the gate with A and B, as illustrated in Table 2.9.
34 2 Back and Forth Computing
The logic operator XOR can be built from CCN, by setting |A〉¼ |1〉(or |B〉¼ |1〉 )
and feeding the gate with B and C (A and C), as illustrated in Table 2.10.
We will return later to the construction of logic gates from reversible operators.
We have already looked at the Half Adder, an architecture capable of adding single
bits. We also stated that we wanted to generalize the Half Adder and turn it into a
full adder, that is to say, a new device that can accept the carry of previous
operations. However, we will go further and design a reversible full adder; as a
consequence, we will know both the result of the operation and the corresponding
inputs.
Figure 2.8 shows the basic architecture of a single-bit full adder, where C is a bit
that represents an input carry whose value comes from previous additions (hence
the name full adder). Nevertheless, since this operation requires three inputs and
generates two outputs, it is not reversible, as it is not possible to reconstruct the
three inputs from the result S and the new carry K (the output carry).
The problem is that if we want a reversible full adder, we need more information
in the output. More precisely, we need two extra lines in the output, and one extra
line in the input configured with a fixed value, for example, |0〉 . We can proceed as
follows:
1. Use N, CN and CCN, or only CCN, which, as we already know, is a universal
reversible gate.
2. Build the AND, OR and XOR operators with which to design the full adder.
3. Include the two extra lines of output necessary for the system to work properly.
2.6 Back to Billiards 35
4. Organize the whole system so that the four output lines are the results of the
operations S and K and of the original inputs A and B.
Figure 2.9 illustrates the basic architecture of the full adder (to be analyzed later
in greater detail). In the meantime, the reader can try to develop the proper internal
structure for the full adder, taking into account the explanation above.
Let us return to computation with billiard balls, but now adopting a reversible
perspective. We first have to make some changes to allow reversible operations and
so will work with the conventional (reversible) FO operation.
Figure 2.10 illustrates how FO is very simple to implement with billiard balls:
the only thing to remember is the basic structure for a collision between balls A and
B and to include a new restriction: |A〉¼ |1〉 . In other words, we need a ball in A.
With the new restriction, |A〉¼ |1〉 , line A behaves as a control line in the input to
the system. Clearly, therefore
A
W
X
B Z
Fig. 2.10 An alternative way of representing the basic structure of a collision between two billiard
balls. A and B are the inputs of the system. W, X, Y, and Z are the corresponding possible outputs
result is a double FO. Another component is a redirection gate, which reflects a ball
that bumps against it and changes its direction. Figure 2.11 illustrates four of these
redirection gates.
The devices we still need are not so many and can be easily implemented in our
billiard engine. These components will enable us to build all types of gates for the
billiard ball setup, including CCN and Fredkin gates, which, as we already know,
are universal reversible operators. The conclusion is clear: it is possible to design a
reversible computer with billiard balls!
We have seen that we can build CN, CCN and Fredkin gates with billiard balls. We
have also seen that if we can build universal gates, such as the Fredkin gate, then we
can build everything, and, besides, the system will be reversible.
Looking now at reversibility from another point of view, how much information
do we need in the output of our device to be able to reproduce the input and,
therefore, to perform reversible computing? We answer this question by recalling
that
1. N accepts one input and gives back one output.
2.9 Glossary of Terms and Notation Used in This Chapter 37
Terms
• Free energy: a thermodynamic property that expresses the capacity of a system
to perform work under certain conditions.
• Full adder: an adder of binary numbers that accounts for values carried in as well
as out. A one-bit full adder adds three one-bit numbers, often written as A, B and
Cin; A and B are the operands, and Cin is a bit carried in from the previous less
significant stage. The full adder is usually a component in a cascade of adders
that sum binary numbers (eight-, 16-, 32-bit etc.). The circuit produces a two-bit
output: output carry and sum.
• Half Adder: a combinational arithmetic circuit that adds two numbers, producing
a sum bit (S) and a carry bit (C) as output.
• Reversible computing: a model of computing where the computational process
is to some extent reversible (in time). In a computational model that uses
transitions from one state of the abstract machine to another, a necessary
condition for reversibility is a one-to-one mapping from states to their
successors.
38 2 Back and Forth Computing
• Universal gate: AND, NOT and OR are basic gates which we can combine to
create any logic gate or any Boolean expression. NOR and NAND gates have the
particular property that either one of them can create any logical Boolean
expression if arranged properly. We examine the operation of each gate sepa-
rately as universal gates.
Notation
FO fanout operation
EX exchange operation
N, NOT NOT operator
♦, ▄ NOT operation in a controlled line
(•) control line
CN controlled-NOT gate
CCN controlled-controlled-NOT gate
F Fredkin gate
S SUM bit
K CARRY bit
Chapter 3
Reversible Architectures
Below we focus on reversible architectures for the most useful conventional logic
gates.
Reversible NAND
Table 3.1 Reversible NAND |A1〉 |B1〉 |C1〉 |A2〉 |B2〉 |C2〉
truth table
|0〉 |0〉 |1〉 |0〉 |0〉 |1〉
|0〉 |1〉 |1〉 |0〉 |1〉 |1〉
|1〉 |0〉 |1〉 |1〉 |0〉 |1〉
|1〉 |1〉 |1〉 |1〉 |1〉 |0〉
3.1 Basic Reversible Logic Gate Architectures 41
Reversible XOR
Table 3.8 Reversible AND |A1〉 |B1〉 |C1〉 |A2〉 |B2〉 |C2〉
truth table
|0〉 |0〉 |0〉 |0〉 |0〉 |0〉
|0〉 |1〉 |0〉 |0〉 |1〉 |0〉
|1〉 |0〉 |0〉 |1〉 |0〉 |0〉
|1〉 |1〉 |0〉 |1〉 |1〉 |1〉
jA0 ; B0 ; C0 ; D0 i ¼ j0; 0; 0; 0i
and the representation of the reversible full adder is read from left to right.
Fig. 3.12 Basic architecture of a general-purpose reversible computer system that does not
generate disorder
b. The data register, Y, initially in the state |Y1〉¼ |data〉(0-bits and 1-bits
that define our problem), is processed by M, which performs the reversible
computations on Y1. Y1 is then transferred to the next phase with a new state
|Y2〉¼ |result〉 .
c. The control register, Z, initially in the state |Z1〉¼ |0〉(all the control register bits
are 0), is also processed by M and will be used to control the computation
process. Z1 is transferred to the next phase with a new state |Z2〉¼ |garbage〉 ,
containing the process history necessary to ensure reversibility.
Phase 2
a. Register X, up to now in the state |X2〉¼ |0〉 , receives the pertinent information
regarding the FO operation on Y2. The result of the computations is copied from
Y to X. X2 is then transferred to the next phase with its new state |X3〉¼ |result〉.
b. Register Y, which is in the state |Y2〉¼ |result〉 , is transferred after the FO
operation to the next phase with the state |Y3〉¼ |result〉 .
c. Register Z goes directly to the next phase with the state |Z3〉¼ |garbage〉 .
Phase 3
a. Register X is no longer modified. Its final state is |X*〉¼ |result〉 .
b. Register Y, which is actually in the state |Y3〉¼ |result〉 , is now processed by W,
which undoes, in reverse order, the operations of M, thereby reconstructing the
data set. Its final state is |Y*〉¼ |data〉.
c. Register Z, which is actually in state |Z3〉¼ |garbage〉 , is now processed by W,
which undoes, in reverse order, the operations of M, thereby reconstructing the
set of zeros. Its final state is |Z*〉¼ |0〉 .
The final result of the computation—absolutely reversible—includes a register
with the initial data, a register with the results of the computation, and a register
with the control zeros. Everything is perfectly neat and tidy and there is no garbage
information. This was possible because we used an extra register initially filled with
zeros. Note that M is a reversible logic system capable of making computations as
complicated as we wish. W is not only capable of undoing M’s operations in reverse
order but is also itself reversible.
logic gate whose output information is the same as the input information is
reversible, and, furthermore, the information remains constant, which means that
the necessary energy to perform a computation (ideally) also remains constant. In
other words, reversible computing can be performed with no loss of energy.
The mathematical idea of conventional reversible computation was introduced
by Yves Lecerf in 1963 and further developed by Charles H. Bennett in 1973. These
authors showed that it is theoretically possible to construct a reversible Turing
machine with no energy restrictions. Bennett also showed that irreversible gates are
not essential in computation processes. However, reversibility is fundamental to
quantum computation. In building quantum machines, we have to take into account
the laws of quantum physics, and, because these laws are reversible in time, we are
forced to perform reversible operations.
In reversible machines the bits are likely to go back and forth in an uncontrolled
way. Therefore, in order to drive computation in a given direction the system needs
a push, and for this it needs energy and some disorder. Before we go on to consider
these ideas in more depth, we need to understand what happens when computer
components are small enough for quantum phenomena to acquire importance. This
will be discussed in the next chapter.
Reversibility is put into practice in accordance with the basic principles described
in the previous chapter. Several architectures are proposed to convert the conven-
tional non-reversible logic operators into reversible operators. We also design an
architecture for a reversible full adder, a physical device that does something. We
then generalize these ideas in order to define a general-purpose reversible computer.
Our first attempt works perfectly, but generates a great deal of garbage information
(disorder), so we design a second architecture that does not generate disorder, and
explore it in some depth. We conclude with some comments concerning the energy
used in reversible computations and briefly mention reversibility in relation to
quantum computing. In this sense, reversibility acts as a bridge between conven-
tional computing and quantum computing.
Terms
• Quantum computation: a kind of computation that makes direct use of quantum
mechanical phenomena, such as superposition and entanglement, to perform
operations on data. Quantum computers are different from our digital electronic
computers based on transistors. Whereas digital computers require data to be
3.6 Glossary of Terms and Notation Used in This Chapter 51
encoded in binary digits (always in one of two states, 0 or 1), quantum compu-
tation uses quantum bits, which can be in a superposition of states.
• Turing machine: a hypothetical device with a set of logical rules of computation,
used in mathematical studies of the computability of numbers and in mathemat-
ical theories of automata and computers.
Notation
▄ NOT operator in a controlled line
M A set of reversible operations
W (or M1) Counter-clockwise operations of M
Chapter 4
The Principles of Quantum Mechanics
In the 1960s, Rolf Landauer tried to find out whether physical laws imposed
limitations on computation. More precisely, he was interested in the reason for
energy loss in computers: was it inherent to the laws of physics or due to a defect in
the available technology?
One of the problems of current high-speed computers is eliminating the heat
produced during computation. On the other hand, as technology evolves, it also
increases the scale of integration of electronic devices; thus, for example, more
transistors can fit in a given space. Engineers design progressively smaller compo-
nents with which to build computers. Indeed, we might say that we are already
living in the microscopic world. In this context, the restrictions usually imposed by
quantum mechanics are extremely important.
It is clear that we cannot build infinitely small computers, since we always need
something on which to write and store growing amounts of information. We also
need some physical property that allows the writing and storage of such informa-
tion. In this context, a physical property of some microscopic systems (such as the
atom), called spin, can be used for our purposes. Systems with natural spin have
measurable physical attributes to which we can assign numbers in such a way that
each number represents a state. But before we go any further, we need to make a
historical detour into the field of Quantum Mechanics.
Going back in time to the nineteenth century, certain experiments and the discovery
of natural radioactivity confirmed that atoms and molecules are, at least in part,
composed of charged particles. In 1909, Ernest Rutherford demonstrated the
Energetic State 2
Energetic State 1
Emission of a Absorption of a
quantum of energy quantum of energy
Fig. 4.1 Quantum nature of the universe. Emission and absorption of discrete quantities of energy
between two allowed energy states
4.1 History and Basic Concepts of Quantum Mechanics 55
Fig. 4.2 The dual particle-wave nature of light: left, photons behaving as particles, and right,
photons behaving as waves
Fig. 4.3 An image showing particle-wave duality. In the microscopic world, all depends on how
we look at something, but a cylinder remains a cylinder
h h
λðeÞ ¼ ¼
mðeÞ vðeÞ pðeÞ
In this equation
• h is the Planck constant
• λ(e) is the electron wavelength
• m(e) is the electron mass
• p(e) is the linear momentum of the electron
• v(e) is the electron velocity
Assume now that v(e) ¼ c, where c is the speed of light in a vacuum. In
accordance with Einstein, the total energy of a particle (in our case, an electron e)
is therefore
E ¼ m c2
hc h
m c2 ¼ h ν ¼ !λ¼
λ mc
In view of these results, in 1932 Otto Stern postulated that the wave-like effects
were the result of a general law of motion. Almost at the same time that these ideas
were being consolidated, engineers started to consider new applications. Electronic
microscopy, for instance, is a practical application of the dual nature of particles.
However, despite this dual nature, photons (particles of light) are not the same as
electrons (waves of matter). The difference is summarized in Table 4.1.
We will now look at one of the most important, and controversial, concepts in
Quantum Mechanics: the uncertainty principle introduced by Werner Heisenberg.
The questions we need to answer are
How can we describe the position of a particle?
What is the right procedure for determining this position?
The obvious answer to both questions would seem to be “by observing the
particle.” But in the world of very small things, observing is not that easy. Imagine
a microscope that can be used to observe an electron. To see the electron, we have
to project a beam of light or some kind of appropriate radiation onto it. But an
electron is so small that even a single photon of light would change its position. So
in the precise instant we want to measure the position, the position changes.
Heisenberg demonstrated that it was not possible to contrive a method to locate
the position of a subatomic particle unless we admitted some absolute uncertainty
with regard to its exact velocity, since it is impossible to simultaneously and
accurately measure both position and velocity. This is also the reason why we
cannot achieve complete absence of energy, even at the absolute zero point.
Particles at the zero point with absolutely no energy would remain totally motion-
less (zero velocity), so their position could easily be measured. However, in
4.2 Heisenberg’s Uncertainty Principle 57
then a very simple dimensional analysis shows that both uncertainties have the
same dimensional result: M L2 T1, where M is mass, L is length and T is time.
In an attempt to demonstrate that the Heisenberg uncertainty principle was
wrong, Einstein proposed the experiment depicted in Fig. 4.4.
Fig. 4.4 Einstein’s experiment to intend to demonstrate that the Heisenberg uncertainty principle
was wrong
58 4 The Principles of Quantum Mechanics
A
W/2 C
a
O O
W/2
B
In accordance with the condition of the first diffraction minimum, the difference
between the distance traveled by the particles going through A and going through O
has to be one half of the associated wavelength (λ/2), as illustrated in Fig. 4.6.
The proof is as follows:
1. We calculate the value of α corresponding to the first diffraction minimum.
2. We draw AC such that AD ¼ CD, with OC representing the difference between
the distances traveled by the particles going through A and through O.
3. The distance OD is large relative to W, so AD and OD are almost parallel,
meaning that the angle ACO is almost a right angle. Hence, OAC ¼ α.
4. Steps 2 and 3 imply that
W
OC ¼ sin ðαÞ
2
λ ¼ W sin ðαÞ
However, since the uncertainties have not been defined with precision, we have
to conclude that
Δx Δpx h
From the above result we can conclude that the simple fact of measuring causes a
change in the state of a system which is of the order of magnitude of the Planck
constant h.
d2 x
F¼m
dt2
Then
d2 x ¼ F m1 dt2
Assuming that
x ¼ gðt; c1 ; c2 Þ
If the particle is moving with velocity v0 at an arbitrary initial time t0, then
d
v0 ¼ f gðt; c1 ; c2 Þ gt¼t0
dt
• t is time
• g is a generic function
• v is the particle velocity
• c1 and c2 are integration constants
We can now easily calculate c1 and c2. In classical mechanics, if we know x,
v and F we can predict the state of a particle in motion. However, matters are
somewhat different in the microscopic world. In quantum mechanics the state of a
system is described by means of a wave function:
Ψ ¼ Ψ ðx; tÞ
Bearing in mind the wave-like behavior of small particles, the starting point for
developing an equation to describe waves of matter is the equation developed by
Louis de Broglie:
h
p¼mv¼
λ
We also have to take into account that the total energy E of the particle is the sum
of its kinetic energy K and its potential energy V:
E¼KþV
However
1
K ¼ m v2
2
Thus
1
m v2 þ V ¼ E
2
And
h h2
v¼ ! ¼EV
mλ 2 m λ2
1 2m
¼ ðE V Þ
λ 2
h2
62 4 The Principles of Quantum Mechanics
d2 8π 2 m
2
Ψð x Þ ¼ 2 ð E V Þ Ψð x Þ
dx h
This last equation is valid when potential energy V is constant. However, let us
consider the above equation to be also valid when V is not constant. Conversely,
V can vary along the x-axis. In mathematical terms this is represented as
V ¼ V ðxÞ
d2 8π 2 m
2
ΨðxÞ ¼ 2 ½E V ðxÞ ΨðxÞ
dx h
If we include time in the potential energy of our system, then the basic equation
reflecting a one-dimensional quantum system for a single time-dependent particle is
as follows:
then
h dΨðx; tÞ h2 d2 Ψðx; tÞ
¼ 2 þ V ðx; tÞΨðx; tÞ
2πi dt 8π m dx2
In this equation, V(x, t) is the potential energy of our quantum system. But
Schr€
odinger’s equation is not only difficult to interpret, but also (with the exception
4.3 Schr€odinger’s Equation 63
of some very rare quantum systems) impossible to solve analytically. There is also
another question: what is the real physical sense of the Schr€odinger equation?
Heisenberg indicated that the classical state and the quantum state have to be
interpreted differently since they are concerned with different things. The problem
of the physical interpretation of Schr€odinger’s equation was finally resolved by the
mathematician Max Born. For a given time t,
jΨðx; tÞj2
Let us approach the same problem from a different point of view and obtain a
similar result. Our starting point will be the time-dependent Schr€odinger equation:
In the words of Ira Levine, this equation is no less than impressive. Nevertheless,
there are situations in which potential energy does not vary over time. In such cases
we can experiment to see what happens. Assume that
Then
dψðx; tÞ df ðtÞ
¼ ψ ðxÞ
dt dt
And
d2 Ψðx; tÞ d2 ψ ðxÞ
¼ f ð tÞ
dx2 dx2
h d f ðt Þ h2 d2 ψ ðxÞ
ψ ðxÞ ¼ f ð tÞ þ V ðxÞψ ðxÞf ðtÞ
2πi dt 8 π2 m dx2
h d f ðtÞ h2 d2 ψ ð x Þ
f 1 ðtÞ ¼ ψ 1
ð xÞ þ V ðxÞ
2πi dt 8 π2 m dx2
h2 1 d2 ψ ð x Þ
ψ ð x Þ þ V ðxÞ
8 π2 m dx2
Since the two terms are independent and are related by equality, they must
represent a constant magnitude (energy, perhaps?). So, if we denote this constant
magnitude by E, the result is
4.4 Schr€odinger’s Equation Revisited 65
h d f ðtÞ h2 d2 ψ ð x Þ
E¼ f 1 ðtÞ ¼ ψ 1 ðxÞ þ V ðx Þ
2πi dt 8π m
2 dx2
And
2πi
loge f ðtÞ ¼ E t þ cte
h
Therefore
f ðtÞ ¼ ecte e ¼ A e
2πi 2πi
h Et h Et
In this last equation, the arbitrary constant A ¼ ecte can be omitted since it does
not affect the generality of the formula. We therefore conclude that
f ðt Þ ¼ e
2πi
h Et
h2 d2
Eψ ðxÞ ¼ ψ ðxÞ þ V ðxÞψ ðxÞ
8 π 2 m dx2
d2 8π 2 m
ψ ð x Þ þ ½E V ðxÞψ ðxÞ ¼ 0
dx2 h2
We have seen this equation before. It is, in fact, the one-dimensional, time-
independent Schr€odinger equation, where E represents the total energy in the
system. Recalling the equation that defines f(t), we can obtain the wave function
for the probability density steady state as follows:
f ðt Þ ¼ e
2πi
h Et
yields
If : V ¼ V ðxÞ ! Ψ ðx; tÞ ¼ ψ ðxÞ e
2πi
h Et
Note that quantum equations work with complex numbers, which are also at the
heart of quantum computing. This issue will be discussed later in some detail.
66 4 The Principles of Quantum Mechanics
Postulate III For each observable (physical) property, quantum mechanics defines
a linear Hermitian operator. To find this operator, we have to write the classical
expression of the observable property in terms of the Cartesian coordinates and the
corresponding linear momentum. We then have to replace each x coordinate by the
operator x (that is, multiply by x) and replace each linear momentum px by the
operator ihd/dx.
Postulate IV Independently of the state function of the system, the only values that
we can obtain from a measurement of the observable A are the eigenvalues a of
b fi ¼ a fi
A
form a complete set. This last statement means that any state function Ψ that
satisfies the selfsame conditions can be represented as the linear combination of
the eigenstates of A:
X
Ψ¼ ci ψ i
i
where the symbol (*) means conjugate (remember that we are working with
complex numbers).
bþE
A b ðxÞ þ Ef
b f ðxÞ ¼ Af b ðx Þ
n o
bE
A b Ef
b f ðx Þ ¼ A b ðx Þ
We can also define an algebra of quantum operators using the following ele-
b and E
ments: Assume we have two operators A b
b¼E
A b ¼ Ef
b $ 8f Af b
bE
• Not always A b¼E b Ab
• The commutator of two operators is defined:
b E
A; b ¼AbE
bE b
bA
b2 ¼ A
A bA
b
bþE
A b b bb
I ¼A bb
I þE I
b E
A bþb
I ¼A bE
bþA bbI
Thus:
If f(x) is an eigenfunction of A b with eigenvalue k, then c f(x) is also an
eigenfunction.
Also associated with the quantum operators is the notion of average value.
Consider a physical magnitude E. When the state function Ψ is not an eigenfunction
of the associated operator E, b measuring E gives us just one possible value. We now
consider the average value of E for a system whose state is Ψ. Since the experi-
mental result of the average value of E forces us to consider a large number of
systems, all in the same state Ψ, we need to measure E for each system. The average
value of E is the arithmetical average of the observed values. For example,
if e1, e2,. . . are the values observed for E, then the average value of E, denoted
by〈E〉 , for a large number N of systems is as follows:
PN
ei
hEi ¼ i¼1
N
The same result can be obtained if we sum all the possible values of E, that is to
say, if we sum the different ei that can be obtained, multiplying each by the number
of times that it has been observed:
P
ne e X ne X
h Ei ¼ e ¼ e¼ Pe e
N e
N e
is the probability of observing the particle under consideration between (x) and
(x + dx). Therefore
ð
þ1
b is the operator
On the other hand, if E(x) is a property that depends on x, and if E
associated with E(x), then
ð
hEi ¼ Ψ ∗ E Ψ dx
Ψ∗ Ψ
Braðψ Þ ¼ h ψ j¼ ða bÞ
and
n1
n ¼j n i ¼ ! hn j¼ ð n∗
1 n∗
2 Þ
n2
4.6 Some Quantum Operators 71
Then
n1
hm j ni ¼ ð m∗
1 m∗
2 Þ ¼ m∗ ∗
1 n1 þ m2 n2
n2
Then
2i
hm j ni ¼ ð 1 i 2 þ i Þ
1 2i
¼ ð1 iÞ ð2 iÞ þ ð2 þ iÞ ð1 2iÞ ¼ 5 6i
And
!
1þi
hmjmi ¼ ð 1 i 2 þ i Þ ¼
2i
ð1 iÞ ð1 þ iÞ þ ð2 þ iÞ ð2 iÞ ¼ 7
ð 7Þ ∗ ¼ ð 7Þ
Terms
• Absolute zero point: the point at which the fundamental particles of nature have
minimal vibrational motion, retaining only quantum mechanical, zero-point-
energy-induced particle motion.
• Alpha particle: positively charged particle consisting of two protons and two
neutrons, emitted in radioactive decay or nuclear fission. Also the nucleus of a
helium atom.
• Average value: a quantity intermediate to a set of quantities.
• Black body: a hypothetical body that absorbs but does not reflect electromag-
netic radiation incident on its surface.
• Complex number: a mathematical expression (a + bi) in which a and b are real
numbers and i2 ¼ 1.
• Differential equation: an equation involving differentials or derivatives.
• Diffraction: the spreading of waves around obstacles.
• Eigenfunction: any non-zero function f for a linear operator A defined in some
function space that returns from the operator exactly as is, except for a multi-
plicative scaling factor.
• Eigenstate: a quantum-mechanical state corresponding to an eigenvalue of a
wave equation.
4.8 Glossary of Terms and Notation Used in This Chapter 73
Notation
λ Wavelength
h Planck constant
c Speed of light in a vacuum
ν Frequency
Ψ(x, t) Wave function
b
H Hamilton operator or Hamiltonian
b
A A generic operator
b E
A; b Commutator of two operators
h-i Average value
m A vector m
Chapter 5
Introducing Quantum Computing
Microchips are small and they will become even smaller, because the smaller an
electronic device, the faster its processing speed. However, we can neither design
nor implement infinitely small chips, since there is a limit beyond which they will
not work properly. When we reach the nanometer scale, electrons escape from the
channels through which they circulate because of a typically quantum phenomenon
called the tunnel effect. Colloquially we can say that a classical particle cannot
breach an obstacle (like a wall). But since electrons are quantum particles and have
wave-like behavior, a part of them can penetrate walls that confine them. The signal
can thus escape from the channel where it is supposed to circulate, and the chip fails
to work.
Because traditional digital computation has arrived at scales of only some tens of
nanometers, it is now approaching its limits. The evidence that this is the case
sowed the seed for current ideas about quantum computation and quantum
computers.
The essential ideas underpinning quantum computing arose in the early 1980s in the
mind of Paul Benioff, who was working on some fundamental principles of
quantum mechanics using traditional computers (Turing machines). In 1981 Rich-
ard Feynman proposed a quantum approach to computation, suggesting that com-
plex calculations could be performed faster by a quantum computer. In 1985 David
Deutsch described the first universal quantum computer that could simulate any
other quantum computer (the extended Church-Turing principle). The idea thus
arose that a quantum computer could execute quantum algorithms, and by the early
1990s, the theory began to produce practical results in the form of the first quantum
algorithms, the first quantum applications and the first quantum computers.
In 1993 Dan Simon highlighted the advantages of the quantum computer over
the traditional computer, and also compared classical and quantum probability. The
foundations were thus laid for the development of genuinely practical algorithms.
In the same year Charles Bennett expounded the idea of quantum teleportation,
which opened the door to the development of quantum communications.
Between 1994 and 1995 Peter Shor developed a quantum algorithm capable of
calculating the prime factors of numbers much faster than a traditional computer.
Shor’s algorithm, which enabled many of the systems currently used in cryptogra-
phy to be broken, served to demonstrate, once and for all, that the quantum
approach was a research field with great potential. Shor also proposed a system
for quantum error corrections.
In 1996 Lov Grover proposed a quantum mechanical algorithm for data retrieval
from large databases. Although the improvement implied by Grover’s algorithm
was not as spectacular as that achieved with factorial calculations or physical
simulations, its range of applications is much greater. Like other quantum algo-
rithms, Grover’s algorithm is probabilistic in nature.
In 1997 the first practical experiments opened the door to the implementation of
theoretically described quantum calculations and quantum approaches. These
experiments included safe communication using quantum cryptography (success-
fully performed to a distance of 23 km) and quantum teleportation of a photon. In
1998 Los Alamos and Massachusetts Institute of Technology (MIT) researchers
propagated the first qubit through a solution of amino acids in an experiment that
was the first step in analyzing the information that could be transported by a qubit.
Switching our focus now to quantum computers, in 1998 the first two-qubit
machine was built at University of California, Berkeley. A year later, IBM built the
first three-qubit machine, capable of executing, for the first time, Grover’s
algorithm.
In 2000 IBM went further and built a five-qubit quantum computer, capable of
running a research algorithm forming part of Shor’s algorithm and performing the
corresponding task in one simple step (when a conventional computer would have
required numerous iterations). In the same year, Los Alamos scientists developed a
seven-qubit quantum computer, which, in 2001, scientists from IBM and Stanford
University successfully used to demonstrate Shor’s algorithm. The experiment
involved using 1018 molecules, each with seven active nuclear spins, to yield the
correct result of 3 and 5 for factorization of the number 15.
In 2005 the Institute of Quantum Optics and Quantum Information of the
University of Innsbruck (Austria) announced that their scientists had created the
first qubyte (a series of eight qubits) using ion-trapping techniques. In 2006
scientists from the University of Waterloo, the Perimeter Institute for Theoretical
Physics (both in Canada) and MIT developed a 12-qubit system.
5.1 A Brief Overview of Quantum Computing 77
values at the same time (the coherent superposition property). The three-bit vector
can thus perform eight parallel operations, which is to say that the number of
operations is exponential in the number of qubits. This parallelism (to which we
will return later) is an intrinsic characteristic of quantum computing.
Quantum computing therefore represents an impressive advance over conven-
tional computing. A quantum computer with 30 qubits, for example, is equivalent to
a conventional processor working at a speed of 10 teraflops (a teraflop is equal to
one trillion floating-point operations per second). Compare this to today’s com-
puters, which work in the order of the gigaflop (one billion floating-point operations
per second).
From a practical perspective, the main focuses of interest are issues related to
physical support, data transmission, quantum algorithm design and quantum
architectures.
The problem of physical support is still unresolved. Quantum computation
requires the following conditions to be satisfied:
1. The system has to be initialized, that is, we have to start from a well-known and
controlled state.
2. It must be possible to manipulate qubits in a controlled way, with operations that
form a universal set of logic gates in order to be able to reproduce any other
possible logic gate.
3. The quantum system has to maintain its quantum coherence throughout the
experiment.
4. It must be possible to read the final state of the system after a computation.
5. The system has to be scalable, so that the number of qubits can be increased to
tackle problems implying a greater computational burden.
As for data transmission, scientists from the Max Planck and Niels Bohr
laboratories have obtained interesting results on the transmission of quantum
information to distances of about 100 km using just beams of light. The results
point to close to 70% success in transmissions.
Quantum algorithms as designed so far—including the Shor, Grover and
Deutsch-Jozsa algorithms—are very reliable and comparable to those used in the
conventional machines of today. Finally, several notable models and architectures
exist, such as the quantum computers proposed by Benioff, Feynman and Deutsch.
Undoubtedly, quantum computing has attracted great interest due to its great
potential. Quantum computers have been proposed as an alternative to classical
computers for solving specific kinds of problems such as the factorization of
integers, discrete logarithm issues and the simulation of quantum systems. Feyn-
man wrote, as far back as 1982, that quantum computers would be effective as
universal simulators of quantum systems; by 1996 Feynman’s conjecture was
shown to be correct. However, as in any emerging discipline, appropriate solutions
still need to be found to many problems.
As mentioned, a major problem is decoherence, which causes the quantum
system to lose its unitary properties; more specifically, quantum algorithm steps
become irreversible. The ratio of errors is proportional to the ratio between the time
5.1 A Brief Overview of Quantum Computing 79
employed to perform a given computation and the decoherence time of the quantum
system, so quantum computations ideally need to be completed in a shorter time
than the decoherence time. However, if errors are few, quantum error correction
procedures can be effectively used and, in this case, the time needed to perform the
computation can be longer that the decoherence time (in theory, even
arbitrarily long).
Another major problem is scalability, especially bearing in mind the large
number of qubits necessary to perform calculations that involve error corrections.
The design of a quantum architecture capable of handling a sufficient number of
qubits is currently a necessary next step for progress in this area.
In order to discuss concepts defining the basic unit of information used in
quantum computing (the qubit), we must first explore Schumacher compression,
which can be considered the quantum analogy of Shannon’s classical information
formula. Benjamin Schumacher, one of the physicists accredited with coining the
term “qubit,” discovered that quantum states can be interpreted as a type of
information and proposed a method for encoding this information and storing it
in the smallest possible number of quantum states.
A qubit is a system with two quantum states that can only be adequately
described by the laws of quantum mechanics. When we make a measurement, the
quantum states of the qubit collapse and the qubit becomes a conventional bit
(a direct consequence of Heisenberg’s uncertainty principle). We can also say that a
qubit is the information contained in a two-state quantum system. In this sense, a
qubit is a unit of quantum information and therefore must be consistent with the
corresponding theory. The concept of qubit is fundamental to quantum computing
and quantum cryptography. Its importance is related to both the amount of infor-
mation contained in a qubit and how this information can be manipulated. Both
these features of a qubit are critical and render it qualitatively different from a
classical bit. Some logic operations performed with qubits are not possible with
bits. The qubit, moreover, is an abstract concept and is not associated with any
particular physical system.
Mathematically, a qubit can be described as a vector of module 1 in a
two-dimensional complex vector space. The two basic states of a qubit—corresponding
to the conventional bits 0 and 1—are ket zero ¼ |0〉 and ket one ¼ |1〉. However,
the qubit can exist in a state of quantum superposition, which is a linear combination of
the two basic states:
jφi ¼ α0 j0iþ α1 j1i
The classical theory of computation usually did not refer to the physics of the device,
as it was assumed that the theory was independent of actual construction. However,
Deutsch and Feynman, among others, demonstrated that this idea was false by
showing how information and, more precisely, computation, was linked to the laws
of physics. This connection established between two apparently independent fields—
computation and quantum mechanics—was the origin of quantum computing.
Generally speaking, we can say that computation is the creation of sets of
symbols (results) from some other initial sets of symbols (data). If we interpret
the symbols as physical objects, the computation corresponds to the evolution of the
states of the system. If the evolution follows the laws of quantum mechanics, then
we have quantum computing.
The possibility that a quantum Turing machine could do something of a specif-
ically quantum nature was suggested by Richard Feynman in 1982. This is because
the dimension of the Hilbert space accessible to the system increases exponentially
in line with the number of amplitudes that have to be processed and stored.
Accordingly, what Feynman described was a universal quantum simulator of the
behavior of any finite physical system.
Quantum computing is based on the quantum properties of qubits, and qubits
have to be manipulated in accordance with the laws and restrictions of quantum
mechanics. Therefore, before continuing to explore this new computational para-
digm, we need to recall the basic principles and terminology of the quantum
approach, but this time from a more formal perspective.
We will start with the classical model of computation and its basic unit of
information, the bit, with its two values 0 and 1. From a formal point of view, a
bit is an element of the set:
V ¼ f0; 1g
functions. Recall that the set of logic gates {NOT, OR, AND} is universal and so
allows us to define any Boolean function.
In the quantum computation model the basic unit of information is the qubit,
which can be in two different states, denoted |0〉 and |1〉. Physically a qubit can be
considered to be a quantum system of two states. The best-known quantum system
of two states is the spin of an electron. In a system of this type we can represent the
spin (½) by the state |0〉 and the spin +(½) by the state |1〉.
Formalizing, we will call a qubit the elementary quantum system, that is to say,
the quantum system of two states. Quantum systems of n qubits are described by
means of vectors in a Hilbert space whose dimension is 2n. This allows us to encode
an exponential quantity of information in the state of a quantum system of n qubits.
Any transformation of the state of the system results in the simultaneous modifica-
tion of all the stored information. In order to know the state of a qubit, we have to
interact with it, that is, make a measurement. However, in accordance with
Heisenberg’s uncertainty principle, the measurement of a quantum state is a core
problem for quantum computations. Quantum measurements are not deterministic
and if we measure two identical states the results may not necessarily be the same.
For this reason, measurement in quantum computation is a random experiment.
Now for some formal definitions, starting with the qubit. The qubit is the
simplest non-trivial element in the Hilbert space of wave functions of two dimen-
sions, generated by the kets {|0〉, |1〉}. These kets—elements in the basis space—
are represented as follows:
1 0
j0i ¼ ; j 1i ¼
0 1
These two column vectors are orthonormal, which means that under the scalar
(or inner) product 〈x | y〉 defined in the space, they behave as follows:
h0j0i ¼ h1j1i ¼ 1;h0j1i ¼ h1j0i ¼ 0
In these equations the bra row vectors {〈0|, 〈1|} are represented as follows:
h0j ¼ ð1 0Þ;h1j ¼ ð0 1Þ
Thus
1
h0j0i ¼ ð1 0Þ ¼1
0
0
h1j1i ¼ ð 0 1Þ ¼1
1
and
0
h0j1i ¼ ð 1 0Þ ¼0
1
5.2 The Formalism of Quantum Computing 83
1
h1j0i ¼ ð 0 1Þ ¼0
0
jα0 j2 þ jα1 j2 ¼ 1
This equation simply ensures that we obtain one state or the other after mea-
surement. Because of its quantum nature, any measurement of the qubit inevitably
alters the state and breaks superposition, resulting in collapse into the basis state
resulting from the measurement, with {α0, α1} transformed irreversibly into {0, 1}.
We will return to this question later.
The qubit may alternatively be described by means of a density matrix. In this
case, for a qubit in state |φ〉, the corresponding operator is as follows:
ρφ ¼ jφi hφj
In contrast with the state vector, the density matrix is clearly defined. Density
matrices describe qubits whose states are not well known (that is, mixed states). In
general, we can write the density matrix of any qubit in the form
!
1 X 3
ρ¼ 1þ ci σ i
2 i¼1
In the above equation, 1 is the identity matrix (22) and σi are the Pauli
matrices, which, in their linear representation for the case of spin ½, take the
following form:
0 1 0 i 1 0
σx ¼ ; σy ¼ ; σz ¼
1 0 i 0 0 1
The probability of finding the state |φ〉 after a given measurement is given by
Pφ ¼ hφ jρjφi
84 5 Introducing Quantum Computing
The most general normalized one-qubit that can be built is the linear superposition
of two elements of the basis:
As mentioned, a qubit can be in two possible states but can also be in interme-
diate states, that is to say, in states that are linear combination of |0〉 and |1〉. Thus,
for example, the spin of an electron can be in the state
φ ¼ ð1=2Þj0iþ √3=2 j1i
V ¼ Lðj0i; j1iÞ
is an orthonormal basis and the states are unitary vectors. A qubit can therefore be in
any state (the coefficients designate amplitudes):
It is relatively easy to understand the basis states but not so easy to understand
the intermediate states. Returning to the example of electron spin and analyzing an
intermediate state, the qubit φ does not have a well-defined spin. Remember that the
spin of an electron is a physical magnitude that is quantified, which is why the
intermediate state φ does not have a defined spin.
We return now to the issue of information. The information contained in a qubit
is obviously very small, so, to be able to represent greater amounts of information,
we need n-qubit systems. If we want to describe the state of a system that consists
not only of a qubit but of a set of n qubits, the laws of quantum mechanics tell us
that we have to obtain the tensor product of the n single qubits.
To start with a simple example, suppose that n ¼ 2 represents the spin of a
system of two electrons. The spin of each electron can be in two states. When
combined, four states for the two-qubit system are generated: |00〉, |01〉, |10〉 and
|11〉.
For this two-qubit, the space dimension is 22 and the space basis is as follows:
jxi i vj ¼ xi ; vj ¼ xi vj
The relations expressed by this equation allow us to define the basis of the four-
dimensional space as follows:
fj0i j0i; j0i j1i; j1i j0i; j1i j1ig
This is an orthonormal basis with states that are unitary vectors. Hence, a
two-qubit can be found in any state of the form
φ ¼ α0 j00iþ α1 j01iþ α2 j10iþ α3 j11i
α0 , α1 , α2 , α3 2 C
The vectors of the basis B2 correspond to the different tensor products of the
vectors of B:
Assume we have a two-qubit and that this two-qubit is entangled, that is it cannot
be described in terms of the states of the single qubits that compose the system.
From a more formal point of view, this means that the two-qubit cannot be
represented as the tensor product of two states for single qubits. For example, the
two-qubit
φ ¼ ð1=4Þj00iþ √3=4 j01iþ √3=4 j10iþ ð3=4Þj11i
α0 β1 ¼ √3=4
α1 β0 ¼ √3=4
α1 β1 ¼ 3=4
In fact, almost all states are entangled. If we choose the coefficients α, β, c and
d (which define points on the sphere of radius 1 centered in the origin in R8) at
random, then the probability of an entangled state is 1.
Let us now try to generalize these ideas. Recall that the most general normalized
two-qubit |x1 x2〉 ¼ |x1〉 |x2〉 that can be built in R8 is the linear superposition of
the four elements of the basis, that is to say
jx1 x2 i ¼ α0 j00iþ α1 j01iþ α2 j10iþ α3 j11i
α0 , α1 , α2 , α3 2 C
2X
2
1
jαi j2 ¼ 1
i¼0
88 5 Introducing Quantum Computing
where
Bn ¼ ½j0 00〉; j0 01〉; j0 10〉 . . . j1 11〉
is an orthonormal basis called the computational basis. A generic vector of the basis
Bn can be viewed as a tensor product:
jx1 x2 . . . xn 〉 ¼ jx1 i jx2 i jxn i
x1, x2 . . . xn 2 f0; 1g
is nothing other than the linear superposition of the 2n elements of the basis, such
that
2X
n
1 2X
n
1
jx1 ; x2 . . . xn i ¼ αi jii; α0 . . . αn1 2 C; jαi j2 ¼ 1
i¼0 i¼0
where the positions or indexes {1–4} indicate each single qubit and the values {0,1}
indicate the state of each single qubit. The direct product between states of single
qubits allows the state of the n-qubit to be constructed, for example
1=√2 ðj0〉1 þ j1〉1 Þ 1=√2 ðj0〉2 j1〉2 Þ ¼ ð1=2Þðj00〉 j01〉 þ j10〉 j11〉Þ
Decomposing it into single qubits is not possible—and this is precisely why such
states are used in quantum teleportation (discussed further below). What is impor-
tant to note here is that the states of qubits in entangled systems are not independent.
Qubits can be represented in other ways. Increasingly common is a quantum
computation convention, based on the following equivalence:
jx1 x2 . . . xm i jxi
The relationship between basis vectors and chains of n single bits is important
for encoding the information in a given n-qubit. The use of natural numbers reflects
our predilection for using numbers in base 10. With this notation, a general n-qubit
can be written as follows:
2X
n
1 2X
n
1
φ¼ αx jxi; jαx j2 ¼ 1
x¼0 x¼0
Note that the dimension of the space is exponential, specifically 2n. This key
property of quantum parallelism reflects the enormous capacity of n-qubits to store
information. For example, the pair of numbers (131,211) can be encoded as a chain
of 16 bits (eight for each number) that can be represented by means of the 16-qubit
φ1 ¼ j1000001111010011i ¼ j27641i
A 16-qubit can encode much more information. For example, the state
90 5 Introducing Quantum Computing
X
1 65535
φ2 ¼ jxi
256 x¼0
is a linear combination of all the pairs of numbers of eight binary digits from (0,0) to
(255,255) inclusive: the first eight qubits encode the first number of the pair and the
other eight qubits encode the second number in the pair.
To facilitate information encoding, we can group qubits in registers. Formally a
register of size k is a consecutive set of k qubits, which we denote by |x〉, |y〉, |z〉,. . .,
where the numbers x, y, z,. . . are numbers with k binary digits. In the previous
example with 16 qubits, if we say that |x〉 is the complete register of 16 qubits, |y〉 is
the register of the first eight qubits and |z〉 is the register of the last eight qubits. The
states φ1 and φ2 can thus be written as follows:
φ1 ¼ j10000011i j11010011i ¼ j131i j211i
1 X255 X
255
φ2 ¼ jyi jzi
256 y¼0 z¼0
We are now going to talk about the problem of measuring qubits. Let us analyze
what happens when we try to measure the following qubit:
φ ¼ ð1=2Þj0iþ √3=2 j1i
To make the measurement we will use the device depicted in Fig. 5.2. We will
use electrons as the physical system on which to write information. Measurement
consists of launching the electron through the small hole in the first wall. When the
electron goes through the hole, it encounters a magnetic field that diverts its path
according to its spin until finally it manages to go through one of the two holes in
the second wall.
In the left part of Fig. 5.2, we have pure single qubits and we want the electron to
go through one of the two holes in the second wall. If the electron reaches an
intermediate position between these holes, then its spin is not quantified. In the right
part of Fig. 5.2, the qubit φ is in an intermediate state and so does not have well-
defined spin. In this case, the electron can be deflected downwards or upwards.
Let us try to explain why the electron has a given possibility of exiting through
the upper hole or the lower hole. If it is only possible to exit through one of the
5.4 Qubits and Measurement 91
⎪1〉
⎪0〉
⎪1〉
⎪0〉
⎪1〉 ⎪0〉
⎪1〉
⎪0〉
Fig. 5.2 Measuring the qubits |0〉, |1〉 and |φ〉. Because |φ〉 does not have a well-defined spin,
both the probabilities of exiting through the upper and lower hole in the wall are non-zero
holes, say the upper hole, then this means that the system is in the state |1〉 and the
electron would have a well-defined spin. But if the electron exits through the lower
hole, its spin after measurement can only be –½ and its state is |0〉. Analogously, if
the electron exits through the upper hole, its spin after measurement can only be +½
and its state is |1〉. Measurement, in addition to yielding incomplete information on
the qubit, modifies it. The process of measurement somehow forces the qubit to opt
for one of the two states of the basis.
Once measurement of the qubit has been qualitatively analyzed, it is now
appropriate to quantitatively describe the entire process. Returning to the quantum
mechanical postulates, we establish that the probability P0 or P1 that the final state
of the qubit is |0〉 or |1〉 is equal to the square of the module of the amplitude of |0〉
or |1〉, respectively, in the linear combination of the states of the basis. Thus, for the
qubit φ in the example the final result will be |0〉 with probability P0 ¼ ¼ and |1〉
with probability P1 ¼ ¾. Table 5.1 summarizes the process of measuring a qubit
and the result of the measurement is the conventional bit 0 or 1 if the final state is
|0〉 or |1〉, respectively.
In a two-qubit we can measure either the first or the second qubit (the process in
both cases is similar). Assume we measure the first qubit. The following example
illustrates the process:
φ ¼ 1=√3 j00iþ 1=√3 j01iþ 1=√3 j10i
After measurement, the first qubit has to be in state |0〉 or state |1〉. Therefore, the
two-qubit, after measurement, has to be in one of the following states:
92 5 Introducing Quantum Computing
Table 5.1 Summary of the Initial state Measurement Final state Probability
process of measuring a qubit
α |0〉 + β |1〉 0 (α/|α|) |0〉 P0 ¼ |α|2
α |0〉 + β |1〉 1 (β/|β|) |1〉 P1 ¼ |β|2
jα0 j2 þ jα1 j2 ¼ 1
or
j1i ½β0 j0iþ β1 j1i ¼ β0 j10iþ β1 j11i
β0 , β1 2 C
jβ0 j2 þ jβ1 j2 ¼ 1
However, in order to obtain the state resulting from the measurement, we need to
write φ as the linear combination of two states, φ0 and φ1, in which the first qubit is
in state |0〉 and |1〉, respectively. When we apply the qubit restrictions, we obtain
the following expressions:
Then
Therefore
φ ¼ √2=√3 φ0 þ 1=√3 φ1
φ0 ¼ 1=√2 j00iþ 1=√2 j01i
φ1 ¼ j10i
Accordingly, if the result of the measurement is 0 the final state is φ0 and if 1, φ1.
The probability P0 or P1 that the measure is 0 or 1 is equal to the square of the
5.4 Qubits and Measurement 93
module of the coefficient of φ0 or φ1, respectively. Table 5.2 depicts the measure-
ment process for this particular case.
The probability P0 and the final state φ0 also have another interpretation: φ0 is
the normalized orthogonal projection of φ in the subspace L (|00〉, |01〉), and P0 is
the square of the norm of this projection, that is, the sum of the squares of the
modules of the amplitudes of |00〉 and |01〉 in the state φ. Obviously, the interpre-
tation of P1 and φ1 is analogous. We will illustrate this with some examples.
Let |x〉 be a normalized qubit. If we perform a measurement on the basis {|u0〉,
|u1〉}, the probability of finding the qubit in the state |ui〉, denoted P(|ui〉), is
given by
The measurement of the qubit |x〉 ¼ α0 |0〉 + α1 |1〉 in the canonical basis {|0〉,
|1〉} generates the following probabilities:
The measurement of the qubit |x〉 ¼ α0 |0〉 + α1 |1〉 in the non-canonical basis
{|0〉 + |1〉, |0〉 |1〉} generates the following probabilities:
Table 5.2 Process of measuring the qubit: φ ¼ (1/√3) |00〉 + (1/√3) |01〉 + (1/√3) |10〉
Initial state Measurement Final state Probability
φ ¼ (1/√3) |00〉 + (1/√3) |01〉 + (1/√3) |10〉 0 φ0 ¼ (1/√2) |00〉 + P0 ¼ 2/3
(1/√2) |01〉
φ ¼ (1/√3) |00〉 + (1/√3) |01〉 + (1/√3) |10〉 1 φ1 ¼ |10〉 P1 ¼ 1/3
94 5 Introducing Quantum Computing
If we obtain the state |0〉, then the two-qubit evolves to a new normalized state
given by
α0 j00〉 þ α1 j01〉
jx0 y0 〉 ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
jα0 j2 þ jα1 j2
If we obtain the state |1〉, then the two-qubit evolves to a new normalized state
given by
α2 j10〉 þ α3 j11〉
jx0 y0 〉 ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
jα2 j2 þjα3 j2
Similar expressions are obtained for the results of measurement of the second
qubit of the two-qubit.
Generalizing these ideas, in a system of n qubits we can measure any one of the
qubits, for example, the k-th qubit. The process, analogous to that for a two-qubit
system, can be described according to the following equations:
2X
n
1
Initial state ¼ αx j x〉; Measurement ¼ 0
x¼0
1 X
Final state ¼ φ0 ¼ pffiffiffiffiffi αx j x〉
P0 x¼0
0 x < 2n
X
P0 ¼ jαx j2
x¼0
0 x < 2n
5.5 Putting It All Together 95
2X
n
1
Initial state ¼ αx j x〉; Measurement ¼ 1
x¼0
1 X
Final state ¼ φ1 ¼ pffiffiffiffiffi αx j x〉
P1 x¼1
0 x < 2n
X
P1 ¼ jαx j2
x¼1
0 x < 2n
such that α, β, c, d 2 C.
The tensor product of these two qubits generates the two-qubit
jxi jyi ¼ jx; yi ¼ ðαj0iþ βj1iÞ ðcj0iþ dj1iÞ
¼ αc j0; 0iþ αdj0; 1iþ βcj1; 0iþ βdj1; 1i
and therefore
1
jφi ¼ ðj00i j01iþ j10i j11iÞ
2
1 1 1 1
¼ pffiffiffij0iþ pffiffiffij1i pffiffiffij0i pffiffiffij1i
2 2 2 2
does not have a solution. Surprisingly, however, the analysis of the behavior of a
quantum system when measurement is made allows the observer to verify whether
or not the system is entangled. Thus, a system is entangled if the measurement of
one of its components affects the measurement of the other components, and
otherwise it is not entangled. To illustrate these ideas with some examples, consider
the following non-entangled system:
jφ〉 ¼ 1=2 ðj0; 0〉 j0; 1〉 þ j1; 0〉 j1; 1〉Þ
The probabilities after measurement of the first qubit (P1) and the second qubit
(P2) are as follows:
1
P1 ðj0〉Þ ¼ P1 ðj1〉Þ ¼ P2 ðj0〉Þ ¼ P2 ðj1〉Þ ¼
2
1
jφ〉 ¼ pffiffiffi ðj00〉 j01〉Þ
2
• If we obtain the state |1〉, then the system evolves to the new normalized state
1
jφ〉 ¼ pffiffiffi ðj10〉 j11〉Þ
2
In other words, the measurement of the first qubit does not affect the measure-
ment of the second qubit. But what happens when we measure an entangled system?
Consider the following:
1
jφ〉 ¼ pffiffiffi ðj01〉þj10〉Þ
2
However, if after measuring the first qubit we obtain |0〉, then the system evolves
to the new normalized state
jφ〉 ¼ j01〉
However, if after measuring the first qubit we obtain |1〉, then the system evolves
to the new normalized state
jφ〉 ¼ j10〉
In this case the measurement of the first qubit affects the measurement of the
second qubit.
98 5 Introducing Quantum Computing
then the application U transforms states into states, that is to say, it preserves the
norm and, according to the postulates of quantum mechanics, is linear. Therefore,
U can only be a unitary transformation, i.e., a linear operator whose inverse is its
adjoint, and the following property applies:
U{ U ¼ I
In the above equation, the two registers have n qubits. The transformation, if it
exists, has to produce the following result:
U ðφ j0iÞ ¼ φ φ
However, the transformation U does not exist for all n-qubits φ. To understand
why, let us assume that U is a unitary transformation in a space of dimension 2n
such that
5.6 Constructing Algorithms with Qubits 99
Accordingly
U ðφ j0iÞ ¼ 1=√2 ðU ðjαi j0iÞ þ U ðjβi j0iÞÞ
¼ 1=√2 ðjαi jαiþ jβi jβi Þ 6¼ φ φ
Consider an n-qubit |φ〉(t) ¼ |x1 . . . xn〉 and assume that the evolution of the quantum
system in a computation step, and after application of the operator U, is given by
Ujφð0Þ〉 !jφð1Þ〉
This means that the input information can be obtained from the output informa-
tion. Thus, from a function f of n bits to m bits a reversible function, fReversible, can
be built from m + n bits to m + n bits as follows:
f : x ! f ðxÞ ) f Reversible ; ðx; yÞ ! ðx; y f ðxÞÞ
In the above expression x has n bits, and y and f(x) both have m bits.
A function f can thus be implemented by means of a quantum circuit Uf provided
it fulfils the reversibility conditions. Uf performs the following transformation:
Uf jx, y〉 !jx, y f ðxÞ〉
The quantum gates that operate on a one-qubit (one qubit of input and one qubit of
output) have associated 22 matrices. We have already seen that, in order to
represent the kets 0 and 1 as vectors, the criteria are as follows:
1 0
j0〉 ¼ ; j1〉 ¼
0 1
Below we will perform operations with some of these gates, beginning with
identity (I ). Although the behavior of I does not modify the qubit on which it
acts, it is useful to illustrate how the associated unitary matrix is constructed.
The transformation that implements this gate and its unitary matrix are as
follows:
UIdentity j0〉 ! j0〉
UIdentity j1〉 ! j1〉
ji j0i j1i
1 0
j0i 1
0 ! UIdentity ¼ 0
1
j1i 0 1
5.6 Constructing Algorithms with Qubits 101
We will now consider the behavior of the Hadamard gate, H, which transforms a
one-qubit into a superposition of the elements of the basis {|0〉, |1〉}. The descrip-
tion and transformations implemented by the Hadamard gate are as follows:
1
U Hadamard j0〉 ! pffiffiffi ðj0〉 þ j1〉Þ
2
1
U Hadamard j1〉 ! pffiffiffi ðj0〉 j1〉Þ
2
ji j0i j1i
1 1 1 þ1 þ1
j0i þpffiffiffi þpffiffiffi
2 2 ! U ¼ p ffiffi
ffi
2 þ1 1
Hadamard
1 1
j1i þpffiffiffi pffiffiffi
2 2
1 þ1 þ1 1 1 þ1 1
UHadamard j0〉 ¼ pffiffiffi ¼ pffiffiffi ¼ pffiffiffi ðj0〉þj1〉Þ
2 þ1 1 0 2 þ1 2
1 þ1 þ1 0 1 þ1 1
UHadamard j1〉 ¼ pffiffiffi ¼ pffiffiffi ¼ pffiffiffi ðj0〉j1〉Þ
2 þ1 1 1 2 1 2
Other interesting gates are negation (N ), phase change (Z ) and negation with
phase change (Y ), expressed as follows:
0 1
N ! N j0〉 ¼j1〉; N j1〉 ¼j0〉 ! N ¼
1 0
1 0
Z ! Zj0〉 ¼j1〉; Z j1〉 ¼ j1〉 ! Z ¼
0 1
0 1
Y ! Y j0〉 ¼ j1〉; Y j1〉 ¼j0〉 ! Y ¼
1 0
102 5 Introducing Quantum Computing
The I and N matrices and the matrices associated with the transformations iY
and Z (the Pauli matrices referred to earlier in this chapter) are used to transport
quantum states and to build quantum corrector codes. In quantum algorithms the
most important transformations are H and N.
The following example illustrates how, using parametric quantum gates, to
obtain the transformation that results in a quantum gate on the elements of the
basis. Assume that
0 1
θ θ
B cos sin C
B 2 2 C
U ðθ Þ ¼ B C
@ θ θ A
sin cos
2 2
The behavior of this matrix regarding the elements of the basis {|0〉, |1〉} is as
follows:
0 1 0 1
θ θ θ
B cos 2 sin C B cos
B 2 C 1 B 2 C C
UðθÞj0i ¼ B C ¼B C
@ θ θ A 0 @ θ A
sin cos sin
2 2 2
θ θ
¼ cos j0〉 sin j1〉
2 2
0 1 0 1
θ θ θ
B cos 2 sin C B sin 2 C
B 2 C 0 B C
UðθÞj1i ¼ B C ¼B C
@ θ θ A 1 @ θ A
sin cos cos
2 2 2
θ θ
¼ sin j0〉 þ cos j1〉
2 2
Obviously, U(θ) can modify different states of qubits. It is therefore very useful
in the following transformation:
θ θ
U ðθÞ cos j0i sin j 1i
2 2
0 1 0 1
θ θ θ
B cos 2 sin C B cos C
¼B 2 C B 2 C
@ θ θ A @ θ A
sin cos sin
2 2 2
cos ðθÞ
¼ ¼ cos ðθÞj0〉 sin ðθÞj1〉
sin ðθÞ
0 1
θ θ
B cos sin
B 2 2 C
C
U{ ðθÞ ¼ B C
@ θ θ A
sin cos
2 2
The interesting issue here is that, for the construction of certain quantum circuits,
the following transformations by U{(θ) are very useful:
0 1
θ θ
B cos 2 sin
{ B 2 CC cos ðθÞ
U ðθÞð cos ðθÞj0〉 sin ðθÞj1〉Þ ¼ B C
@ θ θ A sin ðθÞ
sin cos
2 2
0 1
θ
B cos 2 C
B C
¼B C
@ θ A
sin
2
0 1 0 1
θ θ θ
B cos sin C B cos
θ θ B 2 2 C B 2 C C
U { ðθÞ cos j0〉 sin j1〉 ¼ B CB C
2 2 @ θ θ A @ θ A
sin cos sin
2 2 2
1
¼ ¼ j0〉
0
0 1
θ θ
B cos 2 sin
2 C
B C
Ry ðθÞ ¼ B C
@ θ θ A
sin cos
2 2
Before we turn to systems of two qubits, first recall that a two-qubit system |x, y〉 is
built from the tensor product |x〉 |y〉. Therefore, considering the vectors of the
basis |0〉 and |1〉, we have that
1 0
j0〉 ¼ ; j1〉 ¼
0 1
0 1
1
1 1 B0C
j0i j0i ¼ j00i ¼ ¼B @0A
C
0 0
0
0 1
0
1 0 B1C
j0i j1i ¼ j01i ¼ ¼@ C
B
0 1 0A
0
0 1
0
0 1 B0C
j1〉j0〉 ¼ j10〉 ¼ ¼B @1A
C
1 0
0
0 1
0
0 0 B0C
j1i j1i ¼ j11i ¼ ¼B @0A
C
1 1
1
It is not difficult to see that if we substitute the bits with qubits, the transforma-
tion of EX will take the following form:
U Ex j00〉 ! j00〉; U Ex j01〉 ! j10〉
U Ex j10〉 ! j01〉; U Ex j11〉 ! j11〉
EX 00 01 10 11
1 0 0 0
00 1 0 0 0
0 0 1 0
01 0 0 1 0 U EX
0 1 0 0
10 0 1 0 0
0 0 0 1
11 0 0 0 1
0 1 0 1 0 1
1 0 0 0 1 0 0 0 1 0 0 0
B0 0 1 0C B0 0 1 0C B0 1 0 0C
UEX UEX ¼B
@0
CB C¼B C ¼ UI
1 0 0A @0 1 0 0A @0 0 1 0A
0 0 0 1 0 0 0 1 0 0 0 1
U{EX ¼ UEX
5.6 Constructing Algorithms with Qubits 107
The two last conditions ensure the reversibility of this gate and also its coherence
with the postulates of quantum mechanics. Obviously
0 1 0 1 0 1
1 0 0 0 1 1
B0 0 1 0C B0C B0C
UEx j00i ¼ B C B C B C
@ 0 1 0 0 A @ 0 A ¼ @ 0 A ¼ j00i
0 0 0 1 0 0
0 1 0 1 0 1
1 0 0 0 0 0
B0 0 1 0C B1C B0C
UEx j01i ¼ B C B C B C
@ 0 1 0 0 A @ 0 A ¼ @ 1 A ¼ j10i
0 0 0 1 0 0
0 1 0 1 0 1
1 0 0 0 0 0
B0 0 1 0C B0C B1C
UEx j10i ¼ B C B C B C
@ 0 1 0 0 A @ 1 A ¼ @ 0 A ¼ j01i
0 0 0 1 0 0
0 1 0 1 0 1
1 0 0 0 0 0
B0 0 1 0C B0C B0C
UEx j11i ¼ B C B C B C
@ 0 1 0 0 A @ 0 A ¼ @ 0 A ¼ j11i
0 0 0 1 1 1
Another gate analyzed in the discussion about reversibility was the CN gate,
whose truth table is represented in Table 5.4.
We also said that that one can interpret |Bout〉 as the output of an XOR gate, with
inputs |Ain〉 and |Bin〉 in such a way that |Bout〉 ¼ XOR (|Ain〉, |Bin〉). . . However,
recall that the device is not the same, since the CN gate generates two outputs
instead of one. In quantum terms
U XOR jx, y〉 ! jx, x y〉
U XOR 00 01 10 11
1 0 0 0
00 1 0 0 0
0 1 0 0
01 0 1 0 0 U XOR
0 0 0 1
10 0 0 0 1
0 0 1 0
11 0 0 1 0
108 5 Introducing Quantum Computing
Table 5.4 Truth table for the |A〉 |B〉 |A0 〉 |B0 〉
CN operation
|0〉 |0〉 |0〉 |0〉
|0〉 |1〉 |0〉 |1〉
|1〉 |0〉 |1〉 |1〉
|1〉 |1〉 |1〉 |0〉
The CN gate is usually represented by one of the circuits illustrated in Fig. 5.4.
This gate can also act on a qubit formed from any linear combination of qubits.
The change in the second qubit is controlled by the first qubit, as is shown in the
following example:
5.6 Constructing Algorithms with Qubits 109
xor
| y> | x + y> | y> | x + y>
0 1
1 0 0 0
B0 1
B 0 0C
C 1 α
U XOR ðj0i ðαj0iþ βj1iÞÞ ¼B C
@0 0 0 1A 0 β
0 0 1 0
0 1 0 1 0 1
1 0 0 0 α α
B0 1 0 0C BβC BβC
C B C B
B C
¼B CB C¼B C
@0 0 0 1A @0A @0A
0 0 1 0 0 0
1 α
¼ ¼ j0i ðαj0iþ βj1iÞ
0 β
0 1
1 0 0 0
B0 1 0 0C 0 α
U XOR ðj1i ðαj0iþ βj1iÞÞ ¼ B
@0 0 0 1A
C
1 β
0 0 1 0
0 1 0 1 0 1
1 0 0 0 0 0
B0 1 0 0C B0C B0C
¼B C B C B C
@0 0 0 1A @αA ¼ @βA
0 0 1 0 β α
0 β
¼ ¼ j1i ðβj0iþ αj1iÞ
1 α
As can be verified from the results, if the first qubit is 0 the second qubit does not
change, but if the first qubit is 1 the second qubit exchanges its coefficients.
Constructing Quantum Circuits
We will now build a quantum circuit reflecting the architecture of the unitary
transformation of qubit exchange (EX). Three CN gates are needed, each of
which performs a quantum XOR. The corresponding circuit is illustrated in Fig. 5.5.
110 5 Introducing Quantum Computing
The steps to build the unitary 44 matrix that represents the exchange of two
qubits are as follows:
The first subcircuit performs the transformation
jx; yi ! jx; x yi
0 0 1 0
Since the second qubit is now the control qubit, the transformation that yields the
subcircuit and associated unitary matrix is as follows:
j00〉 ! j00〉; j01〉 ! j11〉; j 10〉 ! j10 〉; j11〉 ! j01〉
0 1
1 0 0 0
B0 0 0 1C
m2 ¼ B
@0 0 1 0A
C
0 1 0 0
The third subcircuit is similar to the first subcircuit and matrix m3 is equal to
matrix m1. The matrix UEX corresponding to the exchange circuit for two qubits is
therefore
5.6 Constructing Algorithms with Qubits 111
UEX ¼ ðm1 m2 Þ m3
20 1 0 13 0 1
1 0 0 0 1 0 0 0 1 0 0 0
6B 0 1 0 0 C B 0 0 0 1C 7 B 0C
6B
¼ 4@ C B C7 B 0 1 0 C
0 0 0 1A @0 0 1 0 A5 @ 0 0 0 1A
0 0 1 0 0 1 0 0 0 0 1 0
0 1
1 0 0 0
B0 0 1 0C
¼B@0 1 0 0A
C
0 0 0 1
This result is exactly the same as that obtained analytically for the transforma-
tion UEX.
To conclude this section, we will analyze the quantum behavior of the reversible
CCN (Toffoli) gate, already referred to in the discussion on reversible computation.
Recall the universal nature of this gate. The {AND, NOT} set of logic gates and the
NAND gate are universal because they allow us to implement any function of the
type
f : f0; 1gn ! f0; 1gm
With reversible gates of one or two lines, it is not possible to obtain a set of
universal gates for reversible functions of the form
f : f0; 1gn ! f0; 1gn
However, we can do so using the CCN gate, which operates on three lines as
follows:
ANDðx; yÞ ! x ^ y ) Toffoliðx; y; zÞ ! ðx; y; z ðx ^ yÞÞ
The universal character of the CCN gate, whose truth table is shown in Table 5.5,
is demonstrated below. Remember that this gate can act like an AND or NOT or
XOR or I gate.
Clearly
z ðx ^ yÞ ¼ x ^ y ; if z¼0
¼x z ; if y¼1
¼ Øz ; if x¼y¼1
¼z ; if x ¼ 0, y ¼ 1
112 5 Introducing Quantum Computing
The CCN gate can be viewed as a quantum circuit with its corresponding unitary
matrix:
0 1
1 0 0 0 0 0 0 0
B0 1 0 0 0 0 0 0C
B C
B0 0 1 0 0 0 0 0C
B C
B0 0 0 1 0 0 0 0C
UToffoli ¼ B
B0 0 0 0 1 0 0 0C
C
B C
B0 0 0 0 0 1 0 0C
B C
@0 0 0 0 0 0 0 1A
0 0 0 0 0 0 1 0
Step 0: The initial values of the kets |x〉, |y〉, |z〉 are |0〉, |0〉, |0〉, respectively,
with which we configure the initial quantum state
5.6 Constructing Algorithms with Qubits 113
Step 1: The first Ry gate acts on the ket |z〉 ¼ |0〉, as seen earlier:
0 π π 1 0 π 1
π cos sin cos
B C 1 B C
Ry j0i ¼ @ 8π 8π A ¼@ 8π A
4 sin cos 0 sin
8 8 8
π π
¼ cos j0i sin j 1i
8 8
Step 2: The first CN gate performs an XOR between the kets of the lines |y〉 ¼
|0〉, |z〉 ¼ cos (π/8) |0〉 sin (π/8) |1〉:
n π π o π π
jyi jzi ¼ j0i cos j0i sin j1i ¼ cos j0i sin j 1i
8 8 8 8
n π π o π π
j0i j0i cos j0i sin j1i ¼ cos j0; 0; 0i sin j0; 0; 1i
4 4 4 4
Step 4: The second CN gate performs an XOR between |x〉 and |z〉:
n π π o π π
jxi jzi ¼ j0i cos j0i sin j1i ¼ cos j0i sin j 1i
4 4 4 4
Step 5: The third Ry gate (the adjoint matrix Ry*) acts on |z〉 as follows:
0 π π 1 0 π 1
π n π π o cos sin cos
B C B C
R∗
y cos j0i sin j 1i ¼ @ π8 π8 A @ 4π A
4 4 4 sin cos sin
0 8π π8 π π4 1
cos cos þ sin sin
B C
¼ @ π8 π4 π8 π4 A
sin cos cos sin
8 4 8 4
0 π 1
cos π π
¼@ 8π A ¼ cos j0i sin j 1i
sin 8 8
8
Step 6: The third CN performs an XOR between |y〉 and |z〉 as follows:
n π π o π π
jyi jzi ¼ j0i cos j0i sin j1i ¼ cos j0i sin j 1i
8 8 8 8
Step 7: Finally, the fourth Ry gate (also the adjoint matrix of Ry) acts on |z〉 as
follows:
0 π π 1 0 π 1
π n π π o cos sin cos
B C B C
R∗
y cos j0i sin j 1i ¼ @ π8 π8 A @ 8π A
4 8 8 sin cos sin
0 8 π 8 π 81
cos 2
þ sin 2
B C
¼@ π π8 π8 π A
sin cos cos sin
8 8 8 8
1
¼ ¼ j 0i
0
According to this structure, for input |1, 0, 0〉, the intermediate results are as
follows:
Step 0: |1, 0, 0〉
Step 1: cos (π/8) |1, 0, 0〉 sin (π/8) |1, 0, 1〉
Step 2: cos (π/8) |1, 0, 0〉 sin (π/8) |1, 0, 1〉
Step 3: cos (π/4) |1, 0, 0〉 sin (π/4) |1, 0, 1〉
Step 4: sin (π/4) |1, 0, 0〉 + cos (π/4) |1, 0, 1〉
Step 5: sin (3π/8) |1, 0, 0〉 + cos (3π/8) |1, 0, 1〉
Step 6: sin (3π/8) |1, 0, 0〉 + cos (3π/8) |1, 0, 1〉
Step 7: |1, 0, 0〉
We have therefore been able to verify that
U Toffoli j100〉 ! j100〉
This case illustrates how the Toffoli gate changes the state of the third qubit:
Step 0: |1, 1, 1〉
Step 1: sin (π/8) |1, 1, 0〉 + cos (π/8) |1, 1, 1〉
Step 2: cos (π/8) |1, 1, 0〉 + sin (π/8) |1, 1, 1〉
Step 3: |1, 1, 0〉
Step 4: |1, 1, 1〉
Step 5: sin (π/8) |1, 1, 0〉 + cos (π/8) |1, 1, 1〉
Step 6: cos (π/8) |1, 1, 0〉 sin (π/8) |1, 1, 1〉
Step 7: |1, 1, 0〉
We have therefore been able to verify that
Terms
• Bloch sphere: a geometrical representation of the pure state space of a two-level
quantum mechanical system.
5.8 Glossary of Terms and Notation Used in This Chapter 117
Notation
αi Amplitude
|α0|2 + |α1|2 ¼ 1 Normalization for a single qubit
Bn Computational basis
U Unitary transformation
〈--|--〉 Inner product of two vectors
118 5 Introducing Quantum Computing
Tensor product
Exclusive-OR, EXOR, XOR
A* Complex conjugate of matrix A
AT Transpose of matrix A
A{ ¼ (AT)* Hermitian conjugate of matrix A
Chapter 6
Feynman’s Quantum Computer Machine
We are now ready to understand the design of quantum algorithms or, at least, to
analyze some of the more important quantum algorithms. But something is still
missing: we have a quantum computation model, but we do not have a computer
model on which to test our quantum algorithms. We will fill this gap by studying the
quantum computer model proposed by Feynman in the early 1980s.
Consider an ideal quantum system, for example, built from atoms. Using the
property of spin, the system can be in either of two states:
Up ð"Þ : Spin ¼ þ1=2
Down ð#Þ : Spin ¼ 1=2
We can build our computer from these atoms by connecting them in some
concrete form. Each set of atoms is in one of the two possible states, representing
a number that is the input to the quantum system. We now leave the system to
evolve during a certain period of time t. This evolution unfolds in accordance with
the laws of quantum mechanics. At a given moment we will have the set of atoms in
different states and representing the output of the system. With these ideas in mind,
Feynman proposed his quantum computer model, for which he used a special and
very simple kind of matrices.
Assume we have a line of computation A and a logic quantum gate that performs
a given unitary transformation, for example, identity or negation. We can thus
define the following matrices:
1 0 0 1 0 0 0 0
a1 ¼ , a2 ¼ , a3 ¼ , a4 ¼
0 0 0 0 0 1 1 0
We use the above products to build, for example, the unitary matrices of identity
I and negation N:
6.1 Playing with Matrices 121
1 0
I¼ ¼ a1 þ a3 ¼ ða2 a4 þ a4 a2 Þ ¼ 1
0 1
0 1
N¼ ¼ a2 þ a4
1 0
It is easy to verify that a1 and a3 do not change, whereas a2 and a4 are the
conjugate-transpose matrices of each other. As for what happens when we apply a2
and a4 to the states |0〉and |1〉 , the answer is
0 1 1 0 0 1 0 1
a 2 j 0i ¼ ¼ ¼ 0, a2 j1i ¼ ¼ ¼ j 0i
0 0 0 0 0 0 1 0
0 0 1 0 0 0 0 0
a 4 j 0i ¼ ¼ ¼ j1i, a4 j1i ¼ ¼ ¼0
1 0 0 1 1 0 1 0
Therefore, (aa) indicates that |A〉¼ |0〉and (aa) indicates that |A〉¼ |1〉
. We can
now use these criteria to represent the behavior of quantum gates—here the CN
gate—in terms of these matrices:
CN consists of two lines (A and B)
Line A is the control line (therefore |Ain〉¼ |Aout〉
)
If |A〉¼ |0〉then |Bout〉¼ |Bin〉
If |A〉¼ |1〉then |Bout〉¼ NOT |Bin〉
Then
UCN ¼ aa þ ðaaÞ ðb þ bÞ ¼ 1 aa þ ðaaÞ ðb þ bÞ
¼ 1 þ aa ðb þ b 1Þ
122 6 Feynman’s Quantum Computer Machine
The above expression can be interpreted as follows: if line A is in state 0 (aa), the
system does not execute any control action on line B, whereas if line A is in state
1 (aa), then the system inverts the state of line B (b + b). If we now interpret the +
and signs as somewhat equivalent to OR (disjunction) and AND (conjunction),
respectively, we can consider the above equation as follows:
• Line A is zero (aa)
• Or (+) line A is in state 1 (aa) and so () line B changes state (b + b)
We can now demonstrate the equivalence between the above expressions:
1 0
aa¼
0 0
0 0
aa¼
0 1
1 0 1 0 0 0
1aa¼ ¼ ¼ aa
0 1 0 0 0 1
Continuing with practical examples, in order to find the matrix expression for the
FO operator, we need to represent this gate as a CN circuit with two lines: A, which
is the control line, and B, whose input is always 0. Thus
Ainput ¼ Aoutput
Binput ¼ j0i
and in line B
bbj0i ¼ j0i; bbj1i ¼ j1i
Therefore
UFO ¼ ðaaÞ ðbbÞ þ ðaaÞ ðbbÞ ðb þ bÞ
¼ ð1 aaÞ ðbbÞ þ ðaaÞ ðbbÞ ðb þ bÞ
¼ ðbbÞ ðaaÞ ðbbÞ þ ðaaÞ ðbbÞ ðb þ bÞ
¼ ðbbÞ þ ðaaÞ ðbbÞ ðb þ b 1Þ
As for the EX and Fredkin reversible gates, we will leave the development of
their matrix expressions to the reader, pointing the way by suggesting possible
combinations of other reversible gates that lead to the solution.
EX can be obtained from the architecture combining three CN gates, as depicted
in Fig. 6.1. The evolution of the values in each line is represented in Table 6.1.
The Fredkin gate executes a controlled EX on the input lines, as illustrated in
Table 6.2.
Similar operations can be implemented to construct more complicated devices.
In the case of the half adder in Fig. 6.2, we need to consider the step-by-step
evolution of the states in each line, as depicted in Table 6.3.
As for the full adder, the solution requires following the steps indicated in
Fig. 6.3 to obtain the final result reflected in Table 6.4. The logic structure is as
follows:
B0 Bf
B1 B2
Table 6.1 Evolution of states for an EX architecture based on three CN reversible logic gates
|A0〉 |B0〉 |A1〉 |B1〉 |A2〉 |B2〉 |Af〉 |Bf〉
0 0 0 0 0 0 0 0
0 1 0 1 1 1 1 0
1 0 1 1 0 1 0 1
1 1 1 0 1 0 1 1
124 6 Feynman’s Quantum Computer Machine
Table 6.2 Evolution of states |A0〉 |B0〉 |C0〉 |Af〉 |Bf〉 |Cf〉
for a Fredkin gate
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 1 0
1 1 0 1 0 1
1 1 1 1 1 1
B0 B1 B2 Sf
C0 = 0 C1 C2 Kf
B1 B2 B3 B4 Bf
B0
C1 C2 C3 C4 Sf
C0
D0=0 D1 D2 D3 D4 Kf
6.2 Quantum Computer Design 125
hΣC ½A0 ; B0 ; C0 ; D0 ¼ 0i ¼ Af ; Bf ; Sf ; K f
We will go now to the heart of the matter: the design of an operator capable of
implementing computation in genuine quantum style. Note that, up to now, we only
have employed four atoms—a, b, c and d—to represent most of the operations of
interest to us. Each of these atoms could be a |0〉or |1〉bit. Let us now consider our
quantum system built with these four atoms, assuming that this quantum system is
in the state |a, b, c, d〉. If we denote by M the matrix of the logic structure that
generates the transformation of the initial quantum state, then
Mja; b; c; d i ¼ ja0 ; b0 ; c0 ; d0 i
jΨin i ¼ ja; b; c; d i
jΨout i ¼ ja0 ; b0 ; c0 ; d0 i
jΨout i ¼ MjΨin i
The operator M will obviously be ∑C, and (as can be verified from a truth table
for the full adder), the result will obviously be
jΨout i ¼ MjΨin i ¼ ΣC j1; 0; 1; 0〉 ¼j1; 0; 0; 1i
The general formulation of the problem is the following. Consider the following
generic set of matrices:
fA1 ; A2 ; A3 . . . Ak g
With this set we establish the sequence of operations required for a (given)
complex logic unit which can operate on n lines. The 2n2n matrix Mn that we need
can be built as follows:
Mn A k . . . A 3 A 2 A 1
Hence, the number of program positions in state |1〉is always the same. During
computation there can either be no occupied positions (when nothing happens), or
exactly one occupied position (when an elementary computation task is performed),
that is, it is not possible for two or more program positions to be occupied
simultaneously.
Let us try to understand what is happening with our quantum computer by
considering a quantum system in an initial state |Ψ0〉
:
1. When i ¼ 0 ! Pos ¼ 0 ! |Pos ¼ 0〉¼ |1〉 Pos(0)
2. We leave the system to evolve during an arbitrary time period
3. We observe that |Pos ¼ k〉¼ |1〉 Pos(k)
4. We observe that |Pos 6¼ k〉¼ |0〉
5. The register n is multiplied by the matrix
Mn ¼ A k . . . A 3 A 2 A 1
The example is explained as follows. Initially the system of three atoms is in the
state |Ψ0〉and counter position 0 is occupied. In these conditions, the term of H that
can operate is
a1 a0 A1
We now apply the matrix A1 to operate on the three atoms. Remember that a and
a move the position of the counter cursor.
The situation is
a0 : jPos ð0Þi ! j0i
a1 : jPos ð1Þi ! j1i
a1 a0 : Pos ð0Þ ! Pos ð1Þ
128 6 Feynman’s Quantum Computer Machine
According to what was stated above, a0 resets position 0 and a1 initiates position
1. Now it can be clearly seen that
i+1 ! |0〉
If ai+1 resets position i + 1, then |1〉 i+1
i ! |1〉
If ai initiates position i, then |0〉 i
First cycle
jPos0i ¼ j1; 0; 0 . . . 0i
jΨ 0 i ¼ jx1 ; x2 ; . . . xn i0 : xi ¼ 0, 1
a1 a0 A1
jΨ 1 i ¼ A1 jΨ 0 i
a1 a0 j1; 0; 0; . . . ; 0i ! j0; 1; 0; . . . ; 0i
jPosð0Þi ¼ j0i
Second cycle
jPos1i ¼ j0; 1; 0 . . . 0i
jΨ1 i ¼ jx1 ; x2 ; . . . xn i1 : xi ¼ 0, 1
a2 a1 A2
jΨ2 i ¼ A2 A1 jΨ0 i
a2 a1 j0; 1; 0; . . . ; 0i ! j0; 0; 1; . . . ; 0i
In this way the cursor continues to move and the primitive elementary operations
are applied in a suitable order so as to perform the complex operation M.
However, some restrictions have to be taken into account. For example, the
Hamiltonian H has to be Hermitian, so that the adjoint operations are present.
Furthermore, we can arrive at a position j from j 1 or from j + 1, but the result of
the computation has to be the same irrespective of the point of departure. Does
Feynman’s approach fulfil these restrictions?
Assume the computer is in |Pos (1)〉¼ |1〉and has already operated A2 A1|Register (n)〉 .
If the term that controls the process is a2 a1 , then the cursor moves to |Pos (2)〉¼ |1〉
and the evolution is |Ψ012〉¼ A3 A2 A1|Ψ0〉 . In contrast, if the term that controls the
process is a1 a2 , then the cursor moves to |Pos (0)〉¼ |1〉 , generating the new state
|Ψ010〉¼ A2* A2 A1|Ψ0〉 . But since we know that A2* A2 ¼ 1, then clearly
|Ψ010〉¼ A1|Ψ0〉 . The net result is that the state of the register n depends on the
position of the cursor.
More explicitly, we will assume a given number of atoms with information.
• Number of atoms: n ¼ 3
• Number of elementary operations: k ¼ 4
• Number of counter positions: k + 1 ¼ 5
• Possible states: Ψ0, Ψ1, Ψ2, Ψ3, Ψ4
• Matrices that perform operations: A1, A2, A3, A4
• Matrices that undo operations: A1*, A2*, A3*, A4*
• Position counter register:
Posð0Þ ¼ j10000i
Posð1Þ ¼ j01000i
Posð2Þ ¼ j00100i
Posð3Þ ¼ j00010i
Posð4Þ ¼ j00001i
Having our system in a given state Ψx then i ¼ x, and the state of the system can
evolve forwards ()) or backwards ((). We will use the following notation to
illustrate the process:
Ψx ! i ¼ x ! Ψx ) Ψxþ1 ðor Ψx ) Ψx1 Ψx1 ( Ψx Þ
The operation of this monstrosity, with its much longer chain of spins, is as
follows:
• Before computing (i < 0), and the computer waits:
jΨ i i ¼ jΨ Out i 8i > k
Terms
• Position counter: indicates where a computer is in its program sequence.
Notation
I, 1 Identity matrix
N Negation matrix
M, Mn A complex quantum operation
Ai An elementary operation
Ai* Adjoint of Ai
b H
H, Hamilton operator or Hamiltonian
Chapter 7
Some Quantum Algorithms
Deutsch’s algorithm goes as follows. Assume a black box with two inputs x and
y that take values in {0, 1}, and a function α of the type
α : f0; 1g ! f0; 1g
We will try to verify whether α is constant or balanced, taking into account that
α is constant if and only if α(x) ¼ α( y)
α is balanced if and only if α(x) 6¼ α( y)
From a classical point of view, four possible functions, as illustrated in Fig. 7.1,
satisfy the requirements of the problem:
α1: x ¼ 0, y ¼ 1 : α1 ðxÞ ¼ 0, α1 ðyÞ ¼ 0 ! α1 ðxÞ ¼ α1 ðyÞ ! α1 is constant
α2: x ¼ 0, y ¼ 1 : α2 ðxÞ ¼ 0, α2 ðyÞ ¼ 1 ! α2 ðxÞ 6¼ α2 ðyÞ ! α2 is balanced
α3: x ¼ 0, y ¼ 1 : α3 ðxÞ ¼ 1, α3 ðyÞ ¼ 0 ! α3 ðxÞ 6¼ α1 ðyÞ ! α3 is balanced
α4: x ¼ 0, y ¼ 1 : α4 ðxÞ ¼ 1, α4 ðyÞ ¼ 1 ! α4 ðxÞ ¼ α4 ðyÞ ! α4 is constant
and
M½αð0Þ; αð1Þ ¼ 0 $ αð0Þ 6¼ αð1Þ
and
M0 ½αð0Þ ¼ 0 $ αð0Þ 6¼ αð1Þ
However, this new Turing machine cannot be built following the classical
approach because α(1) is not an input of the system. So let us try to solve the
problem using the quantum computing paradigm.
According to the original Deutsch algorithm we assume that we have qubits |0i
and |1i to which we apply the Hadamard transform in order to superposition the
states
138 7 Some Quantum Algorithms
1 þ1 j0iþ j1i
H j0i ¼ pffiffiffi ¼ pffiffiffi
2 þ1 2
1 þ1 j0i j1i
H j1i ¼ pffiffiffi ¼ pffiffiffi
2 1 2
Now, given two arbitrary inputs |xi and |yi entering the quantum system by two
different lines, we define the unitary transformation of the Deutsch algorithm (UD)
as follows:
UD jx; yi ! jx; y αðxÞi
But first let us analyze what happens to this unitary transformation with a
simplified version of the Deutsch algorithm. We will ignore the normalization
factors and will configure the input taking into account that there are two lines,
which means that we have to perform the tensor product of the input values.
Ignoring the normalization factors means that
jxi ¼j0iþ j1i; jyi ¼j0i j1i
Note that we are not working in the canonical basis [|0i, |1i], but on the basis
[|0i+ |1i, |0i |1i], so that we can avoid using Hadamard gates.
Applying all the above restrictions,
φ
input ¼ jx; yi ¼ jxi jyi ¼ ððj0i þ j1iÞ ðj0i j1iÞÞ
3. |1, 0 α(1)i
a. α(1) ¼ 0 ! |1, 0 α(1)i¼ |1, 0 0i¼ |1, 0i¼ |1, α(1)i
b. α(1) ¼ 1 ! |1, 0 α(1)i¼ |1, 0 1i¼ |1, 1i¼ |1, α(1)i
4. |1, 1 α(1)i
a. α(1) ¼ 0 ! |1, 1 α(1)i¼ |1, 1 0i¼ |1, 1i¼ |1, NOT α(1)i
b. α(1) ¼ 1 ! |1, 1 α(1)i¼ |1, 1 1i¼ |1, 0i¼ |1, NOT α(1)i
In this way
φ
output ¼ U φinput ¼ Uðj0; 0i j0; 1i þ j1; 0i j1; 1iÞ
We apparently have not achieved much, as we still have to evaluate α(0) and
α(1). But recall that
• If α is constant ! α(0) ¼ α(1)
And
φ
output ¼ j0i ðjαð0Þi jNOTαð0ÞiÞ þ j1i ðjαð1Þi jNOTαð1ÞiÞ
We now only have to measure the first qubit to know whether α is constant or
balanced. In this simplified approach the corresponding measurement has to be
done in the non-canonical basis
fj0i þ j1i; j0i j1ig
If we obtain (|0i + |1i) after measuring the first qubit, then α is constant, and
conversely, if we obtain (|0i |1i), then α is balanced.
140 7 Some Quantum Algorithms
Deutsch designed the quantum circuit depicted in Fig. 7.2, where H represents
Hadamard gates, UD performs the unitary transformation of Deutsch, and the
speaker symbol indicates that the measurement is made on the corresponding line.
Hadamard gates are important for quantum algorithms in general, but especially
so for Deutsch’s algorithm, based as it is on the superposition of states. In order to
understand Deutsch’s algorithm, we need to remember that, as happens with
reversible gates in quantum circuits, sequentially applying Hadamard gates an
even number of times to a given initial state returns the initial state. This is because
H H ¼ H2 ¼ I, where I is the identity matrix. Application of two Hadamard gates
in parallel, however, as in our case, gives the tensor product of two states in
superposition. For example,
ðH H Þj1ij1i ¼ ðH j1iÞðH j1iÞ ¼ 1=√2 ðj0i j1iÞ 1=√2 ðj0i j1iÞ
H 3 ðj0ij0ij0iÞ
1 2X 1
n
1 þ1 j0i j1i
H j1i ¼ pffiffiffi ¼ pffiffiffi
2 1 2
Therefore
j φ2 i ¼ U D j φ1 i
1
¼ j0ijαð0Þi j0ijNOTα ð0Þi þ j1ijαð1Þi j1ijNOT αð1Þi
2
3. |φ3i¼ (H I) |φ2i
1
¼ pffiffiffi j0ifjαð0Þi jNOTαð0Þig
2
7.1 Deutsch’s Algorithm 143
1
¼ pffiffiffi j1ifjα ð0Þi jNOT α ð0Þig
2
We can now measure the first qubit (upper line), which will collapse to become a
conventional bit. If the result of the measurement is a bit 0, then α is constant, and
conversely, if the result of the measurement is a bit 1, then α is balanced.
Another Perspective on Deutsch’s Algorithm
There is yet another way to consider Deutsch’s algorithm, and interestingly, it
contains a term that helps explain the Deutsch-Jozsa algorithm. Given the ground-
work done above, we can progress rapidly from this point, but will explain the new
term in some detail.
We use the same quantum circuit analyzed above and the same first steps as
those previously described:
Input information: |φ0i¼ |0i |1i
j0iþj1i j0ij1i
Quantum superposition: jφ1 i ¼ H 2 j φ0 i ¼ pffiffi pffiffi
2 2
Assume that
j0iþ j1i j0i j1i
jxi ¼ pffiffiffi ; jyi ¼ pffiffiffi
2 2
If we do not make |xi explicit but do make |yi explicit, then the state |φ1i can be
written as follows:
j 0i j 1i
jφ1 i ¼ jxi pffiffiffi
2
The next step is to obtain |φ2i from |φ1i and UD such that
j0i j1i
jφ2 i ¼ U D jxi pffiffiffi
2
jxi j0 αðxÞi jxi j1 αðxÞi
¼ pffiffiffi
2
j0 αðxÞi j1 αðxÞi
¼ jxi p ffiffi
ffi
2
144 7 Some Quantum Algorithms
• If α(x) ¼ 1, then
j0 αðxÞi j1 αðxÞi j0i j1i j0i j1i
pffiffiffi ¼ pffiffiffi ¼ ð1Þαð1Þ pffiffiffi
2 2 2
j0iþ j1i
αð0Þ ¼ 1 and αð1Þ ¼ 1 ! pffiffiffi
2
j0i j1i
αð0Þ ¼ 0 and αð1Þ ¼ 1 ! þ pffiffiffi
2
7.2 The Deutsch-Jozsa Algorithm 145
j0i j1i
αð0Þ ¼ 1 and αð1Þ ¼ 0 ! pffiffiffi
2
2
1=√2 ðj0i j1iÞðj0i j1iÞ , αð0Þ 6¼ αð1Þ
It is now time to go through the last Hadamard gate, which operates in the upper
line of the quantum circuit proposed by Deutsch. The results are as follows:
1=√2 j0iðj0i j1iÞ , αð0Þ ¼ αð1Þ
1=√2 j1iðj0i j1iÞ , αð0Þ 6¼ αð1Þ
The last step consists of measuring the first qubit in such a way that if the result
of the measurement is a bit 0, then α(x) is constant, and if the result of the
measurement is a bit 1, then α(x) is balanced.
The novelty of this way of looking at Deutsch’s algorithm lies in the term (1)α(x),
which plays an important role in the Deutsch-Jozsa algorithm.
In the above expression, |xi is a string with a number n of zeros and ones. For
example, if n ¼ 5, then |xicould be |1, 1, 0, 0, 1i¼ |11001i |25i. The following
configuration is useful for evaluating α(x):
U DJ jxi j0i !jxi j0 αðxÞi ¼jxi jαðxÞi
The most important part of the process is to correctly select the initial input to the
state of quantum superposition. An initial state of n qubits in quantum superposition
is represented by means of the equation
1
pffiffiffiffinffiðj01 ; . . . ; 0n1 ; 0n i þ j01 ; . . . ; 0n1 ; 1n i þ j01 ; . . . ; 1n1 ; 0n i þ
2
þj11 ; . . . ; 1n1 ; 1n i Þ
1 2X 1
n
¼ pffiffiffiffinffi jxi
2 x¼0
Consequently,
!
1 2X 1
1 2X 1
1 2X 1
n n n
• If α(x) ¼ 1, then
j0 αðxÞi j1 αðxÞi j0i j1i αð1Þ j0i j1i
pffiffiffi ¼ pffiffiffi ¼ ð1Þ pffiffiffi
2 2 2
1 2X 1
n
n n
H j 0i ¼ pffiffiffiffinffi jxi
2 x¼0
Then
1 2X 1
1 2X 1
n n
j0i j1i αðxÞ j0i j1i
p
U DJ nffiffiffiffi
ffi jxi p ffiffi
ffi ¼ p ffiffiffiffi
ffi ð1Þ jxi p ffiffi
ffi
2 x¼0 2 2n x¼0 2
To study the general Deutsch-Jozsa algorithm we will use the quantum circuit
depicted in Fig. 7.3.
The algorithm begins with a state of n + 1 qubits of the type
j0in j1i
148 7 Some Quantum Algorithms
n
|0〉 H⊗n H⊗n
UDJ
|1〉 H
1 2X 1
n
1 2X 1
n
2X
n
1 X
φ2UpperLine ¼ p1ffiffiffiffiffi 1
ð1ÞαðxÞ jxi pffiffiffiffinffi ð1ÞαðxÞ jxi
n
2 x¼0 2 x2f0;1gn
Therefore
φ3UpperLine ¼ H n φ2UpperLine
"n #
1 2X 1 2X 1
1 2X 1 2X1
n n n
αðxÞ x z αðxÞ x z
jφ3UpperLine ¼ n ð1Þ ð1Þ jzi¼ n ð1Þ ð1Þ jzi
2 x¼0 z¼0
2 x¼0 z¼0
7.2 The Deutsch-Jozsa Algorithm 149
2 3
1 X X
jφ3UpperLine ¼ n 4 ð1ÞαðxÞx z 5 jzi
2 x2f0;1g n
z2f0;1g n
ð1ÞαðxÞx z
is related to the sign of each individual term in the equation. We can now
perform a measurement on the upper line in order to evaluate the probability
P(|0in).
Obviously
• If P(|0in) ¼ 1, then α is constant
• If P(|0in) ¼ 0, then α is balanced
We can also observe |zi after performing the measurement.
Thus
• If z ¼ (0, 0, . . ., 0), then α is constant
• If z 6¼ (0, 0, . . ., 0), then α is balanced
This may seem excessively abstract, so let us illustrate the whole procedure with
an example. First, consider the quantum circuit defined for the Deutsch-Jozsa
algorithm (Fig. 7.3). For the sake of clarity, we will assume n ¼ 2. Thus
150 7 Some Quantum Algorithms
In the above expression the first ket corresponds to the upper line, and the second
ket corresponds to the lower line. To put the upper line in a state of quantum
superposition we need two Hadamard gates:
0i ! H 2 0i ¼ Hj0iH j0i
2
¼ p1ffiffi f j00i þ j01i þ j10i þ j11ig
2
1 2X 1
n
1
pffiffiffiffiffi f j0i þ j1i þ j2i þ j3ig ¼ pffiffiffiffiffiffin jxi
22 2 x¼0
The next step is to build the input of the unitary transformation UDJ. Since the
second line is also in a state of quantum superposition, and since the two lines enter
in parallel into the transformation UDJ, we need to use the tensor product. First let us
recall the general approach:
1 2X 1
n
n j0i j1i
j φ1 i ¼ ð H HÞjφ0 i ¼ pffiffiffiffinffi jxi pffiffiffi
2 x¼0 2
And of course
j0i j1i j0i j1i
U D jxi pffiffiffi ¼ ð1ÞαðxÞ jxi pffiffiffi
2 2
7.2 The Deutsch-Jozsa Algorithm 151
Then
1 2X 1
n
j0i j1i
jφ2 i ¼ U DJ jφ1 i ¼ pffiffiffiffinffi ð1ÞαðxÞ jxi pffiffiffi
2 x¼0 2
We consequently have
H 2 jAi8 9
>
> αð0Þ j0iþ j1i j0iþ j1i αð1Þ j0iþ j1i j0i j1i >>
>
> ð 1 Þ p ffiffi
ffi p ffiffi
ffi þ ð 1 Þ p ffiffi
ffi p ffiffi
ffi >
>
1 < 2 2 2 2 =
¼ pffiffiffiffiffi
22 >
>
> αð2Þ j0i j1i j0iþ j1i j0i j1i j0i j1i >
>
>
>
: þð1Þ pffiffiffi pffiffiffi þ ð1Þαð3Þ pffiffiffi pffiffiffi > ;
2 2 2 2
Now to explain the change in signs. Following the previous equation, is easy to
see that, for n ¼ 2
fαð0Þ αð00Þg; fαð1Þ αð01Þg; fαð2Þ αð10Þg; fαð3Þ αð11Þg
1 X3 X 3
1 X
3 X 3
H 2 jAi ¼ 2
ð1Þx:zþαðxÞ jzi ¼ 2 ð1Þx:zþαðxÞ jzi
2 x¼0 z¼0 2 z¼0 x¼0
1 2X 1 2X 1
1 2X 1 2X 1
n n n n
x:zþαðxÞ
n
H jAi ¼ n ð1Þ j zi ¼ n ð1Þx:zþαðxÞ jzi
2 x¼0 z¼0 2 z¼0 x¼0
We can now build the output of the unitary transformation UDJ of the Deutsch-
Jozsa quantum circuit:
n 1 X2n 1 X2n 1 x:zþαðxÞ j0i j1i
jφ3 i ¼ ðH I Þjφ2 i ¼ n ð1Þ j zi pffiffiffi
2 z¼0 x¼0 2
Remember that the last step involves measurement of the first qubit:
1 2X 1 2X 1
n n
n ð1Þx:zþαðxÞ jzi
2 z¼0 x¼0
Thus, for n ¼ 2, if we make the part of the equation that represents the first qubit
explicit, then we have
154 7 Some Quantum Algorithms
Table 7.2 Results for the x z + α(0) x z + α(1) x z + α(2) x z + α(3) |zi
auxiliary ket A of the example
0 + α(0) 0 + α(1) 0 + α(2) 0 + α(3) |0i
0 + α(0) 1 + α(1) 0 + α(2) 1 + α(3) |1i
0 + α(0) 0 + α(1) 1 + α(2) 1 + α(3) |2i
0 + α(0) 1 + α(1) 1 + α(2) 0 + α(3) |3i
nh i
1
jAi ¼ ð1Þ0þαð0Þ þ ð1Þ0þαð1Þ þ ð1Þ0þαð2Þ þ ð1Þ0þαð3Þ j0i
4
h i
þ ð1Þ0þαð0Þ þ ð1Þ1þαð1Þ þ ð1Þ0þαð2Þ þ ð1Þ1þαð3Þ j1i
h i
þ ð1Þ0þαð0Þ þ ð1Þ0þαð1Þ þ ð1Þ1þαð2Þ þ ð1Þ1þαð3Þ j2i
h i o
þ ð1Þ0þαð0Þ þ ð1Þ1þαð1Þ þ ð1Þ1þαð2Þ þ ð1Þ0þαð3Þ j3i
Daniel Simon proposed a very interesting problem and a very clever solution. The
problem was to find patterns in functions by means of a procedure that combines
quantum and classical methods.
Let α be a given function such that
α : f0; 1gn ! f0; 1gn
In his quantum approach, Simon proposed the unitary transformation and algo-
rithm given below, along with the circuit depicted in Fig. 7.4. Note that the whole
process has to be repeated several times in order to take into account the probabi-
listic nature of the quantum approach.
• Unitary transformation: Us |xi|yi¼ |xi|y α(x)i
• Algorithm: (Hn I) Us (Hn I) |0i|0i
First step:
jφ0 i ¼ j0ij0i
Second step:
H⊗n H⊗n
|0〉
Us
|0〉
|ϕ0〉 |ϕ1〉 |ϕ2〉 |ϕ3〉
1 X 1 2X
n
1
jφ1 i ¼ pffiffiffiffinffi jxij0i ¼ pffiffiffiffinffi jxij0i
2 x2f0;1gn 2 x¼0
Third step:
1 X 1 2X
n
1
jφ2 i ¼ pffiffiffiffinffi jxijαðxÞi ¼ pffiffiffiffinffi jxijαðxÞi
2 x2f0;1gn 2 x¼0
Fourth step:
1 X X
j φ3 i ¼ ð1Þhz;xi jzijαðxÞi
2n x2f0;1gn z2f0;1gn
1 2X
12X
1
n n
¼ n ð1Þx:z jzijαðxÞi
2 x¼0 z¼0
In applying the algorithm, it can be seen that the operations with zeros and ones
could become a nightmare of confusion. We propose using decimal numbers to
avoid this problem. For example, for n ¼ 3, and following a similar approach to that
used earlier, we have
ð000Þ 0; ð001Þ 1; ð010Þ 2; ð011Þ 3
These numbers are presented in tabular form in Table 7.4. As with the Deutsch-
Jozsa algorithm, using such a table can help clarify the change in signs.
We now do the same with the values of α used in our example (Table 7.3).
jφ0 i ¼ j0ij0i
• Second step:
1 X 1 2X
n
1
jφ1 i ¼ pffiffiffiffinffi jxij0i ¼ pffiffiffiffinffi jxij0i
2 x2f0;1gn 2 x¼0
1
jφ1 i ¼ pffiffiffi fj0i þ j1i þ j2i þ j3i þ j4i þ j5i þ j6i þ j7igj0i
8
• Third step:
1 X 1 2X
n
1
jφ2 i ¼ pffiffiffiffinffi jxijαðxÞi ¼ pffiffiffiffinffi jxijαðxÞi
2 x2f0;1gn 2 x¼0
8 9
1 < j0i jαð0Þiþ j1i jαð1Þiþ j2i jαð2Þiþ j3i jαð3Þi =
jφ2 i ¼ pffiffiffi
8: þ j4i jαð4Þiþ j5i jαð5Þiþ j6i jαð6Þiþ j7i jαð7Þi ;
1
¼ pffiffiffifj0ij4i þ j1ij1i þ j2ij5i þ j3ij7i þ j4ij1i þ j5ij4i þ j6ij7i þ j7ij5ig
8
158 7 Some Quantum Algorithms
• Fourth step:
1 X X
j φ3 i ¼ ð1Þhz;xi jzijαðxÞi
2n x2f0;1gn z2f0;1gn
1 2X 12X
1
n n
1
jφ3 i ¼ fj0i þ j1i þ j2i þ j3i þ j4i þ j5i þ j6i þ j7ig j4i
8
1
þ fj0i j1i þ j2i j3i þ j4i j5i þ j6i j7ig j1i
8
1
þ fj0i þ j1i j2i j3i þ j4i þ j5i j6i j7ig j5i
8
1
þ fj0i þ j1i þ j2i þ j3i j4i j5i j6i j7ig j1i
8
1
þ fj0i þ j1i j2i j3i j4i j5i þ j6i þ j7ig j7i
8
1
þ fj0i j1i j2i þ j3i j4i þ j5i þ j6i j7ig j5i
8
Note how some elements disappear because of the change in sign. We can now
rewrite |φ3i as follows:
jφ3 i ¼
1 1
þ fj0i þ j2i þ j5i þ j7ig j4iþ fj0i þ j2i j5i j7ig j1i
8 8
1 1
þ fj0i þ j2i þ j5i þ j7ig j4iþ fj0i þ j2i j5i j7ig j1i
8 8
1 1
þ fj0i j2i þ j5i j7ig j5iþ fj0i j2i j5i þ j7ig j7i
8 8
1 1
þ fj0i j2i þ j5i j7ig j5iþ fj0i j2i j5i þ j7ig j7i
8 8
7.3 Simon’s Algorithm 159
We now perform several measurements that will yield different results. These
are the different possibilities:
• The measurement of the first qubit is 0 (000) ! h000, ci¼ 0
• The measurement of the first qubit is 2 (010) ! h010, ci¼ 0
• The measurement of the first qubit is 5 (101) ! h101, ci¼ 0
• The measurement of the first qubit is 7 (111) ! h111, ci¼ 0
We can now write c ¼ c1c2c3 and obtain a system of equations that can easily be
solved:
• If: h000, c1c2c3i¼ 0 ! (0 c1) (0 c2) (0 c3) ¼ 0 ! trivial solution
• If: h010, c1c2c3i¼ 0 ! (0 c1) (1 c2) (0 c3) ¼ 0 ! c2 ¼ 0
• If: h101, c1c2c3i¼ 0 ! (1 c1) (0 c2) (1 c3) ¼ 0 ! c1 c3 ¼ 0
In this case
c1 ¼ c3 ¼ 0 or c1 ¼ c3 ¼ 1
2n1 þ 1
β ¼ 1= 2 ½j00i þ j11i
Once Bad has stolen the message he contacts Badder by phone in order to
transmit just two conventional bits: {00} or {01} or {10} or {11}. Badder then
has to decode the message following the protocol described below.
If Badder receives {00}, then the following decoding clue has to be used:
þ1 0
0 þ1
If Badder receives {01}, then the following decoding clue has to be used:
0 þ1
þ1 0
If Badder receives {10}, then the following decoding clue has to be used:
þ1 0
0 1
If Badder receives {11}, then the following decoding clue has to be used:
0 þ1
1 0
Note that some of these matrices are Pauli matrices, already used above.
To establish a secure communication system, Bad and Badder design the hybrid
quantum-conventional circuit depicted in Fig. 7.5. Bad can access the two first
lines, and Badder can access the third line. Remember that measurement results in
conventional bits.
Bad steals the message |φi¼ a|0i+ b|1i, encodes it in parallel and inputs it into
the circuit. This is what happens:
7.4 Quantum Teleportation 161
β ·
D |ϕ〉
·
Input ¼ jφi β
pffiffiffi
The system evolves and finds a CN gate for the two upper lines that produces the
following result:
pffiffiffi
The Hadamard operation in the first line performs the following transformation:
8 9
2 < aðj0i þ j1iÞj0ij0i þ aðj0i þ j1iÞj1ij1i =
1
jφ2 i ¼ pffiffiffi
2 : þbðj0i j1iÞj1ij0i þ bðj0i j1iÞj0ij1i ;
8 9
< aj00ij0i þ aj10ij0i þ aj01ij1i þ aj11ij1i =
1
¼
2 : ;
þbj01ij0i bj11ij0i þ bj00ij1i bj10ij1i
8 9
< j00iðaj0i þ bj1iÞþ j01iðbj0i þ aj1iÞ =
1
¼
2 : ;
þ j10iðaj0i bj1iÞþ j11iðbj0i þ aj1iÞ
Badder receives the third qubit of the complete message |φ2i through the
quantum channel. However, solving Bad’s task requires us to use the classical
part of the circuit. Badder receives a phone call from Bad.
If the message is {00}, then the term associated with |00i is
ðaj0i þ bj1iÞ
and the decoder is the identity matrix. In this case the stolen message would be
þ1 0 þa
¼ a j0i þ b j1i
0 þ1 þb
162 7 Some Quantum Algorithms
and the decoder is the negation matrix. In this case the stolen message would be
0 þ1 þb
¼ a j0i þ b j1i
þ1 0 þa
and the decoder is the identity matrix with a phase change. In this case the stolen
message would be
þ1 0 þa
¼ a j0i þ b j1i
0 1 b
and the decoder is the negation matrix with a phase change. In this case the
stolen message would be
0 þ1 b
¼ a j0i þ b j1i
1 0 þa
Badder always receives the same message. Note that any attempt to intercept the
quantum communication would lead—by the mere fact of measurement—to the
irreversible collapse of message transmission by Bad.
Terms
• Black box: in science, computing and engineering, a device, system or object
that can be viewed only in terms of its inputs and outputs (or transfer character-
istics), but not in terms of its internal workings.
• Canonical basis: for a Euclidean space, the set of unit vectors pointing in the
directions of the axes of a Cartesian coordinate system. The standard basis for
the Euclidean plane is formed by vectors. Canonical bases can be defined for
other vector spaces, such as polynomials and matrices. In both these cases, the
standard basis consists of elements of the vector space such that all the coeffi-
cients but one are 0 and the non-zero coefficient is 1. For polynomials, the
canonical basis consists of monomials and is commonly called the monomial
basis. For matrices, the canonical basis consists of mn matrices with exactly
one non-zero entry, which is 1.
• Parallelism: a type of computation in which many calculations are carried out
simultaneously.
• Teleportation: a process by which quantum information (for instance, the exact
state of an atom or photon) is transmitted (theoretically intact) from one location
to another, by means of a classical communication system and quantum Entan-
glement between the sending and receiving locations. Because it depends on
classical communication (which cannot take place faster than the speed of light),
teleportation cannot be used for faster-than-light transmissions or for conven-
tional bits. Neither can it be used to make copies of a system, as this violates the
no-cloning theorem.
Notation
α A given function
M, M0 Turing machines
UD Deutsch transformation
UDJ Deutsch-Jozsa transformation
US Simon transformation
β Bell state
Chapter 8
Concluding Remarks
In this final chapter we discuss, from an academic point of view, the main charac-
teristics of several areas of computer science. We pay special attention to artificial
intelligence and quantum computing, in order to explore the possibility of mean-
ingful cooperation between them. In analyzing the basic principles that enable
researchers and engineers to make artificial intelligence and quantum computing
work together, we need to consider answers to several fundamental questions.
Below we briefly describe the behavior of the biological brain, focusing on the
singularities that enable it to perform so efficiently, especially energy consumption,
speed and parallelism. We illustrate the material presented here with examples and
conclude with a discussion regarding what we can expect from cooperation
between apparently unconnected fields of computer science.
In May 2013, Google, the National Aeronautics and Space Administration (NASA)
and the Universities Space Research Association (USRA) launched an initiative—
the Quantum Artificial Intelligence Lab (QAIL)—to investigate how technology
could drive artificial intelligence advances. The initiative is based on a synergy of
interests: Google believes that quantum computing could improve web search and
speech recognition technologies; university researchers aim to elaborate better and
more efficient computational models; and finally, NASA wants to model the
weather in space, simulate planetary atmospheres and analyze vast quantities
of data.
Until very recently, despite a sufficiently solid theoretical background, the
technology that would allow everything to be put together at the practical level
had not been developed. This situation was something similar to that of the
analytical engine defined by Charles Babbage and Ada Lovelace: the theory was
far in advance of the technology.
In 2011, as mentioned in Chap. 5, D-Wave Systems designed and implemented
what they claimed was the first system that applied quantum theory principles: the
128-qubit D-Wave One. In early 2013 this was updated to the 512-qubit D-Wave
Two. In January 2014, Google reported QAIL results comparing the performance of
D-Wave Two with classical computers; however, the results were ambiguous and
provoked heated discussion.
It is clear that not all the problems are of the same nature. On that basis, for
NASA, USRA and Google to achieve their goals, a very clear understanding is
necessary of the following:
Theoretical foundations
Advantages and disadvantages of the technology
Problems to be resolved
Limitations of both the theory and the technology.
We will illustrate our viewpoint with an example from biology. Our brains are
composed of highly interconnected neural systems. The neural systems need space
and the neurons in the system need energy. The human brain contains roughly
100 trillion nerve cells, 32 million kilometers of fibers (wires) and one million
trillion connections, occupies a volume of 1.5 l, weighs around 1.5 kg and consumes
around 10 W of energy. If we tried to build a similar artificial brain using silicon
chips, it would consume some 10 MW of energy and the heat it produced would
destroy it.
How is it possible for the biological brain to work so efficiently and economi-
cally? One of the aims of the artificial intelligence field is, obviously, to build
machines that are structurally and/or functionally similar to the brain, that is,
equally or more efficient. An analysis of how the brain works enables us to better
understand the potential of quantum computing in the artificial intelligence field.
8.3 Human Brains and Computers 167
Much of the efficiency of the biological brain is energy-related. In fact, the energy
cost of transmitting signals (that is, the communication capability between two
biological neurons) has probably been the most important single factor in the
biological evolution of the brain.
Approximately 50–80% of the total energy consumption of the brain is due to
conduction, that is, transmission of action potentials through fibers and communi-
cation between neurons in a process called synaptic transmission. Biological brains
are highly parallel networks and most neurons are connected directly to thousands
of other neurons. The fact that the brain is three-dimensional makes this possible.
In contrast, the two-dimensional nature of chips and circuits in silicon neurons
limits the establishment of connections, even among a small number of neurons,
which means that direct communication between silicon neurons is very restricted.
The high speeds allowed by conventional electronics are exploited in a different
way. The basic approach is to use processes that make it feasible for multiple
messages to be handled over the same wire. In this way computer engineers emulate
the connections of biological networks. There are, however, practically insur-
mountable energy implications. In fact, in their attempt to simulate the behavior
of biological systems, reducing energy consumption and increasing speed, some
computer engineers have adopted the strategy of using analog encoding rather than
digital encoding in classical bits (neuromorphic engineering); in other words,
information is encoded in the analog circuitry through continuously changing
voltage. This allows calculations to be done in fewer steps and also better exploits
the basic physics of silicon devices.
The human brain behaves as a massively parallel computing unit in which many
instructions are executed simultaneously. The basic underlying concept is that
complicated problems can be divided into simpler problems that are then solved
simultaneously (in parallel). The concept, which may seem trivial, certainly works
well in biological brains. The problem, however, is not so simple for our conven-
tional computers, for power consumption reasons. The power consumption of a
chip is given by the following equation:
P ¼ C V2 F
Likewise with chips; because smaller devices compute faster, increasingly small
microchips are being manufactured. However, their size cannot be infinitely
reduced. This is because nanometer-sized electrons escape from the channels
where they circulate in what is called the tunnel effect—a typically quantum
phenomenon. Electrons are quantum particles with wave-like behavior; hence,
there is a non-zero possibility that some such electrons will pass through the
walls behind which they are confined. Under such conditions, chips will not work
properly. By now, since we have already reached sizes of only a few tens of
nanometers, digital computing is clearly reaching its limits.
But where exactly is this limit? The answer may have much to do with the world
of the very small and it seems that we have no choice but to revert to certain
approaches and concepts of physics. Going back to basics, the first concept to
consider is the size of the atom. The size of current microprocessors is in the order
of nanometers. Various existing methods to estimate the size of the atomic radius
give values of between 0.5 and 5 Å, equivalent to 0.1 nm. Hence, we have only one
order of magnitude further to go before we have to design computers that take into
account the restrictions imposed by quantum mechanics!
We will answer this question using statistical mechanics, defining the concept of
entropy as follows: a measure of the disorder in a system, equal to the Boltzmann
constant multiplied by the natural logarithm of the number of microscopic states
corresponding to the thermodynamic state of the system. According to the above
definition:
S ¼ k ln ðN Þ
Ψ ¼ k ln ðN Þ
Perhaps k and N are not the same thing in both expressions, but the equations are
identical, suggesting that there is some link between entropy and the amount of
information in a system. If entropy is a measure of the disorder in a system, it is
clear that state 2 in our tank example is much messier than state 1. In other words,
there are far more possible microscopic states in state 2 than in state 1. The entropy
of state 1 is therefore much smaller than the entropy of state 2. If N (1) is the number
of microstates of state 1, and N (2) is the number of microstates of state 2, then
Sð1Þ ¼ k ln ½N ð1Þ; Sð2Þ ¼ k ln ½N ð2Þ
In physics, however, the concept of absolute entropy does not exist. The physical
meaning relates to increments in entropy. Thus
ΔS ¼ Sð2Þ Sð1Þ ¼ k ln ½N ð2Þ k ln ½N ð1Þ ¼ k ln ½N ð2Þ=N ð1Þ
We have already said that we can assume that our information in state 2 is zero.
To recap, starting from state 1 and letting the system evolve spontaneously to reach
the equilibrium state 2, entropy increases, but information is lost. According to our
previous formulation, we could say that the loss of information from allowing the
system to spontaneously evolve is equivalent to an increase in entropy in the
system. However, we will be more cautious and simply state that
½ΔΨ ¼ Ψð1Þα ΔS
ΔF ¼ TΔS
Consequently
ΔS ¼ k ln ð2Þ
However, do not forget that we only expend free energy if we do not know where
the particle is, because this is the only circumstance in which the phase space is
divided in two. Likewise, if we know the position of the particle beforehand we do
not expend energy on resetting. The conclusion is obvious: the information in the
message is in the known bits, and the elementary energy of a basic computation task
is defined only in the case of unknown bits. This obviously does not mean that we
can perform computations without energy. However, it does help us understand the
importance of energy when dealing with quantum operators and the reversibility of
quantum logic gates.
Quantum computing, based on the use of qubits rather than bits, gives rise to new
logic gates that enable new algorithms. The same task in classical computing and in
quantum computing may have different levels of complexity, which, promisingly,
means that certain intractable problems become tractable.
As explained earlier, in classical digital computing, a bit can take only 0 or 1.
However, in quantum computing, due to the laws of quantum mechanics, the
qubit can be in coherent superposition and can be either 0, or 1, or 0 and 1 simul-
taneously, meaning that several operations can be performed in parallel. The
number of qubits indicates the number of bits that can be in superposition. With
conventional bits, if we have three bits we have eight possible values and a given
system can only take one of these eight possible values. However, with a vector of
three qubits, through quantum superposition the particle can take eight different
values simultaneously, meaning that a vector of three qubits allows eight parallel
operations. The number of operations, in other words, is exponential with respect to
8.6 Some Things to Ponder on 173
the number of qubits. To get an idea of the great progress that this represents, a
quantum computer working with only 30 qubits is equivalent to a conventional
processor of 10 teraflops (1013 floating-point operations per second). At present,
computers are currently working in the order of gigaflops (a thousand million
floating-point operations per second).
Returning to artificial intelligence, an article published by X.E. Ying in 2010 in
Artificial Intelligence discusses potential applications of quantum computing in
artificial intelligence, among them
Quantum algorithms for learning
Quantum algorithms for decision making
Quantum search
Quantum game theory
Semantic analysis
Natural language
Quantum Bayesian networks
Quantum neural networks
Quantum genetic algorithms.
The best applications of quantum computing in artificial intelligence will be
found in the field of machine learning. Machine learning could definitely benefit
from quantum computing, because machine learning involves the design of pro-
cesses by means of which computers adapt to the environment and thereby learn to
perform tasks. In some cases, the computer does all the learning itself, without
human supervision, but in other cases, the system is supervised by a human who
makes the necessary adjustments. Quantum principles enable a computer to simul-
taneously use all the data relevant to a problem.
Google’s particular interest in quantum computing is in performing high-level
scientific computations, especially in the area of machine learning. “Machine learn-
ing is about building better models of the world to make more accurate predictions,”
wrote Hartmut Neven, Google’s Director of Engineering, in his blog. He goes on to
say “If we want to cure diseases, we need better models about how these diseases
develop, if we want to create effective environmental policies, we need better models
of what happens with our climate, and if we want to build a more useful search, we
need to know what’s on the Web in order to get the best response.”
The potential of quantum computing in artificial intelligence is evident, but we
still do not know how to translate that potential into reality. Undoubtedly, time will
put things in their place.
Some problems still need to be resolved. One such problem is the effect of
decoherence, which refers to information loss because of environmental interfer-
ence in the superposition of quantum states. Physical models therefore need to meet
certain requirements to be able to perform as authentic quantum computers. One of
these requirements is that the qubits have to be isolated to avoid decoherence.
Another is that systems have to permit controlled interaction with other qubits in
order to create states in quantum superposition and to be able to read results.
Although the errors caused by decoherence are a major problem for quantum
computation, scientists are developing quantum-based methods to correct these
errors. For instance, an article by Howard M. Wiseman published in Nature, titled
“Quantum physics: cruise control for a qubit,” describes an experimental imple-
mentation of a theoretical method for feedback control of quantum bits.
As for physical systems, several exist that theoretically fulfil the necessary
requirements to be quantum computers. However, they work with very few qubits
and we still cannot determine with any certainty which system might be the most
suitable. One problem of some prototypes is the lack of scalability to computers
with enough qubits to develop applications of practical interest, as these require
complex error detection methods.
In 1995, Juan Ignacio Cirac and Peter Zoller developed a basic schema for
quantum computers built using ions, thereby illustrating how what had previously
been a mere theoretical entelechy could be implemented. The quantum research
conducted by the joint recipients of the Nobel Prize in Physics 2012—Serge
Haroche and David Wineland—has direct implications for the future of quantum
computation and the physical implementation of qubits. As the Swedish Academy
noted, their innovative methods have laid the groundwork for the construction of a
new type of super-fast computer based on quantum physics. Both managed to
manipulate quantum systems formed by a single particle with no loss of quantum
properties, thereby achieving measurement: Wineland used photons to measure the
quantum state of atoms or ions in a trap, whereas Haroche—doing the opposite—
created a trap for photons and analyzed the quantum properties by means of atoms.
The novelty does not lie in the techniques to trap the individual quantum particles
but in the study and measurement of the quantum states of the trapped particles.
Recalling the paradox of Schr€odinger’s cat, this is rather similar to knowing
whether the cat is alive or dead without opening the box.
For the moment, however, current quantum computers continue to operate with a
very limited number of qubits and so are restricted in their capacity to resolve
problems of interest. However, there is no reason to think a priori that it will not be
possible to achieve these operations with many more qubits. Ongoing advances in
practical realizations of different theoretical models would suggest that the quan-
tum computer will be with us sooner than we may think, although, as yet, it is
difficult to say when. Juan Ignacio Cirac stated in a newspaper interview that we
may still have to wait several decades. However, in the words of Niels Bohr,
“Prediction is very difficult, especially if it’s about the future.”
176 8 Concluding Remarks
Terms
• Analytical engine: a mechanical general-purpose computer designed by English
mathematician and computer pioneer Charles Babbage in 1837 as the successor
to his difference engine (a design for a mechanical computer). The analytical
engine had an arithmetic logic unit, control flow in the form of conditional
branching and loops, and integrated memory. It was thus the first design for a
general-purpose computer that can be described in modern terms as Turing-
complete.
• Artificial intelligence: an academic field that studies how to create computers
and computer software capable of intelligent behavior.
• Bayesian network: a probabilistic graphical model (a type of statistical model)
that represents a set of random variables and their conditional dependencies via a
directed acyclic graph.
• Entropy: a measure of the number of specific ways in which a thermodynamic
system may be arranged, commonly understood as a measure of disorder.
According to the second law of thermodynamics the entropy of an isolated
system never decreases, as the system will spontaneously proceed towards
thermodynamic equilibrium as the configuration with maximum entropy. Sys-
tems that are not isolated may decrease in entropy, provided the entropy of their
environment increases by at least the same amount. Since entropy is a state
function, the change in the entropy of a system is the same for any process that
goes from a given initial state to a given final state, irrespective of whether the
process is reversible or irreversible. However, irreversible processes increase the
combined entropy of the system and its environment.
8.8 Glossary of Terms and Notation Used in This Chapter 177
• Genetic algorithm: a heuristic search that mimics the process of natural selec-
tion. This heuristic (also sometimes called a metaheuristic) is routinely used to
generate useful solutions to optimization and search problems. Genetic algo-
rithms belong to the larger class of evolutionary algorithms, which generate
solutions to optimization problems using techniques inspired by natural evolu-
tion, such as inheritance, mutation, selection and crossover.
• Machine learning: an artificial intelligence technique that explores the study and
construction of algorithms that can learn and make predictions from data. They
operate by building a model from example inputs in order to make data-driven
predictions or decisions, rather than by strictly following static program
instructions.
• Neural networks: a family of models inspired by biological neural networks (the
central nervous systems of animals, in particular the brain), which are used to
estimate or approximate functions that can depend on a large number of gener-
ally unknown inputs. Artificial neural networks are generally presented as
systems of interconnected neurons that exchange messages. The connections
have numerical weights that can be tuned based on experience, making neural
nets adaptive to inputs and capable of learning.
• Neuromorphic: a concept describing the use of very large-scale integration
systems containing electronic analog circuits that mimic neurobiological archi-
tectures present in the nervous system. In recent times the term has been used to
describe analog, digital and mixed-mode analog/digital systems that implement
models of neural systems (for perception, motor control or multisensory inte-
gration). The implementation of neuromorphic computing at the hardware level
can be realized by oxide-based memristors, threshold switches and transistors.
• Pattern matching: in computer science, pattern matching is the act of checking a
given sequence of tokens for the presence of the constituents of some pattern.
• Synergy: the creation of a whole that is greater than the simple sum of its parts.
• Transistor: a semiconductor device used to amplify or switch electronic signals
and electrical power. It is composed of semiconductor material with at least
three terminals for connection to an external circuit. A voltage or current applied
to one pair of the transistor’s terminals changes the current through another pair
of terminals. Because the controlled (output) power can be higher than the
controlling (input) power, a transistor can amplify a signal.
Notation
S Entropy
Ψ Information
α Proportional
F Free energy
W Energy in the form of work
Appendix A: Mathematical Background
In this appendix we are going to present some basic mathematical background that
has been used in the writing of this book. We are not going to work in any strictly
formal way as the idea is simply to provide a guide for quick consultation.
x2 þ 1 ¼ 0
Obviously
pffiffiffiffiffiffiffi
x2 ¼ 1 ! x ¼ 1
pffiffiffiffiffiffiffi
The number 1 is considered to be the imaginary unit, denoted by i. Therefore
pffiffiffiffiffiffiffi
i ¼ 1
Consider now the plane depicted in Fig. A.1 (called an Argand plane), in which
the x-axis represents real numbers and the y-axis represents imaginary numbers.
Let us call c the point (a, b) in Fig. A.1. This point c is called a complex number
because it has a real part and an imaginary part.
We can represent this complex number in several ways. For example,
c ¼ a þ bi ¼ ða; bÞ ¼ ðr; θÞ
where r is the length of the arrow in Fig. A.1 and θ is the angle between the arrow
and the x-axis.
r cos(θ)
z = x + iy
y
r
r sin(θ)
θ
Re
x
We will call the modulus of the complex number r and the argument of the
complex number θ. In this way
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
r ¼ j c j ¼ a2 þ b2
and
b ¼ r sin θ
then
b
1
θ ¼ tan
a
We can do many things with complex numbers, for example, sum or multiply
them. Thus if c1 and c2 are complex numbers such that
c 1 ¼ ð a1 ; b1 Þ ¼ a1 þ b1 i ¼ ð r 1 ; θ 1 Þ
and
c 2 ¼ ð a2 ; b2 Þ ¼ a2 þ b2 i ¼ ð r 2 ; θ 2 Þ
then
c1 þ c2 ¼ ð a1 þ a2 ; b1 þ b2 Þ ¼ ða1 þ a2 Þ þ ðb1 þ b2 Þi
and
Appendix A: Mathematical Background 181
c 1 c 2 ¼ ð a1 a2 b1 b2 ; a1 b2 þ a2 b1 Þ
¼ ðr 1 r 2 ; θ 1 þ θ 2 Þ
To represent the above operations, we have used the most convenient and
clearest notation.
A very interesting property of complex numbers is conjugation, which consists
of maintaining the real part as it is and at the same time changing the sign of the
imaginary part. Thus, if we have the complex number
c ¼ a þ bi
c∗ ¼ a bi
Then
c∗ ¼ a bi
We can do many other things with complex numbers, but given the scope of this
Appendix, this is enough to understand the book.
182 Appendix A: Mathematical Background
A.2. Vectors
Let us now talk about vectors, which have an interesting analogy with complex
numbers. We will start with Fig. A.2, which is similar to Fig. A.1 except that it
depicts a vector in the plane.
We can denote by V the vector (arrow) in Fig. A.2 and can represent it as
follows:
V ¼ Vx ; Vy
where Vx and Vy are scalar numbers. We can also do many things with vectors. For
example, we can add two vectors. Assume
V ¼ Vx ; Vy
and
W ¼ Wx ; Wy
Then
V þ W ¼ Vx ; Vy þ Wx ; Wy ¼ Vx þ Wx ; Vy þ Wy
and
1 Vy
θV ¼ tan
Vx
θ
x
Appendix A: Mathematical Background 183
It should be noted that when we multiply a vector by a scalar number the angle of
the vector does not change. Thus, if V is a vector and Z is a scalar number, then
Z V ¼ Z Vx ; Z Vy
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
2
jZ V j ¼ ðZ Vx Þ2 þ Z Vy
1 Vy
θZV ¼ tan
Vx
Assume now that all the scalar numbers are complex scalar numbers. For
example,
α þ βi
c ¼ a þ bi and V ¼
γ þ δi
In this case
c ðα þ βiÞ
cV¼
c ðγ þ δiÞ
In this way, together with some other properties which will not be discussed here
for the sake of brevity, complex vector spaces are defined. An interesting question
regarding such complex vector spaces derives from the possibility of their matrix
representation. Briefly, we can define the following concepts.
Assume a vector V belonging to a complex vector space such that
V ¼ ½ða þ biÞ; ðc þ diÞ
184 Appendix A: Mathematical Background
It holds that
a þ bi
• Matrix V:
c þ di
a bi
• Conjugate V ¼ V*:
c di
• Transpose V ¼ VT: (a + bi c + di)
• Adjoint V ¼ (V*)T ¼ V{: ð a bi c di Þ
Now we can define the inner product as follows:
If we are working with real numbers in Rn, then, given two vectors V1 and V2,
hV1 ; V2 i ¼ V1T V2 2 Rn
If we are working with complex numbers in Cn, then, given two vectors V1 and V2,
hV1 ; V2 i ¼ V{1 V2 2 Cn
On the subject of matrices, to conclude this Appendix, let us define two special
kinds of matrices: Hermitian and Unitary.
A given matrix M is Hermitian if the matrix is equal to its adjoint: M ¼ M{. For
example,
a b þ ci ∗ a b ci
M¼ !M ¼
b ci d b þ ci d
{ a b þ ci
!M ¼
b ci d
Sy ¼ S{y
Then
0 i 0 i 1 0
Sy S{y ¼ ¼
i 0 i 0 0 1
Bearing in mind the above mathematical concepts, we are ready to define the
Hilbert space.
A Hilbert space is a complex vector space with an inner product that is also
complete.
It is beyond the scope of this book to discuss the condition of completeness of
Hilbert spaces.
Appendix B: Glossary of Terms Used in the Book
• Absolute zero point: the point at which the fundamental particles of nature have
minimal vibrational motion, retaining only quantum mechanical, zero-point-
energy-induced particle motion.
• Alpha particle: positively charged particle consisting of two protons and two
neutrons, emitted in radioactive decay or nuclear fission. Also the nucleus of a
helium atom.
• Analytical engine: a mechanical general-purpose computer designed by English
mathematician and computer pioneer Charles Babbage in 1837 as the successor
to his difference engine (a design for a mechanical computer). The analytical
engine had an arithmetic logic unit, control flow in the form of conditional
branching and loops and integrated memory. It was thus the first design for a
general-purpose computer that could be described in modern terms as Turing-
complete.
• Artificial intelligence: an academic field that studies how to create computers
and computer software capable of intelligent behavior.
• Average value: a quantity intermediate to a set of quantities.
• Axiom: a proposition that is assumed without proof for the sake of studying its
consequences.
• Backward reasoning: proving a goal by recursively breaking it down into
sub-goals and trying to prove these until facts are derived. Facts are goals with
no sub-goals and are therefore always true.
• Bayesian network: a probabilistic graphical model (a type of statistical model)
that represents a set of random variables and their conditional dependencies via a
directed acyclic graph.
• Binary logic: classical propositional two-valued logic, often called Boolean
logic in engineering.
• Black body: a hypothetical body that absorbs but does not reflect electromag-
netic radiation incident on its surface.
• Full adder: an adder of binary numbers that accounts for values carried in as well
as out. A one-bit full adder adds three one-bit numbers, often written as A, B and
Cin; A and B are the operands, and Cin is a bit carried in from the previous less
significant stage. The full adder is usually a component in a cascade of adders
that sum binary numbers (8-, 16-, 32-bit etc.). The circuit produces a two-bit
output: output carry and sum.
• General relativity: a generalization of special relativity and Newton’s law of
universal gravitation that provides a unified description of gravity as a geometric
property of space and time (or space-time). The curvature of space-time is
directly related to the energy and momentum of the matter and radiation that
are present.
• Genetic algorithm: a heuristic search that mimics the process of natural selec-
tion. This heuristic (also sometimes called a metaheuristic) is routinely used to
generate useful solutions to optimization and search problems. Genetic algo-
rithms belong to the larger class of evolutionary algorithms, which generate
solutions to optimization problems using techniques inspired by natural evolu-
tion, such as inheritance, mutation, selection and crossover.
• Half adder: a combinational arithmetic circuit that adds two numbers, producing
a sum bit (S) and a carry bit (C) as output.
• Hamiltonian: the operator (in most cases) corresponding to the total energy of
the system.
• Heisenberg’s uncertainty principle: in quantum mechanics, any of a variety of
mathematical inequalities asserting a fundamental limit to the precision with
which certain pairs of physical properties of a particle (complementary vari-
ables), such as position x and momentum p, can be known simultaneously.
• Hermitian: in mathematics, a self-adjoint matrix or square matrix with complex
entries that is equal to its own conjugate transpose. Thus, the element in the i-th
row and j-th column is equal to the complex conjugate of the element in the j-th
row and i-th column, for all indices i and j. In mathematical analysis, a Hermitian
function is a complex function with the property that its complex conjugate is
equal to the original function with the variable changed in sign.
• Hilbert space: an abstract vector space possessing the structure of an inner
product that allows length and angle to be measured.
• Inner product space: in linear algebra, a vector space with an additional structure
called an inner product that associates each pair of vectors in the space with a
scalar quantity known as the inner product of the vectors. Inner products allow
the rigorous introduction of intuitive geometrical notions such as vector length
and the angle between two vectors and also provide the means of defining
orthogonality between vectors (zero inner product).
• Joint probability: given at least two random variables x, y, . . . defined in a
probability space, the joint probability distribution for x, y, . . . gives the prob-
ability that each of x, y, . . . falls within a particular range or discrete set of values
specified for that variable.
• Linear momentum: the product of the mass and velocity of an object.
190 Appendix B: Glossary of Terms Used in the Book
• Logarithm: the exponent of the power to which a base number must be raised to
equal a given number.
• Machine learning: an artificial intelligence technique that explores the study and
construction of algorithms that can learn and make predictions from data. They
operate by building a model from example inputs in order to make data-driven
predictions or decisions, rather than by strictly following static program
instructions.
• Matrix: in mathematics, a rectangular array of numbers, symbols or expressions,
arranged in rows and columns.
• Maxwell’s demon: a thought experiment by the physicist James Clerk Maxwell
that suggested how the second law of thermodynamics could hypothetically be
violated.
• Neural networks: a family of models inspired by biological neural networks (the
central nervous systems of animals, in particular the brain) that are used to
estimate or approximate functions that can depend on a large number of gener-
ally unknown inputs. Artificial neural networks are generally presented as
systems of interconnected neurons that exchange messages. The connections
have numerical weights that can be tuned based on experience, making neural
nets adaptive to inputs and capable of learning.
• Neuromorphic: a concept describing the use of very large-scale integration
systems containing electronic analog circuits that mimic neurobiological archi-
tectures present in the nervous system. In recent times the term has been used to
describe analog, digital and mixed-mode analog/digital systems that implement
models of neural systems (for perception, motor control or multisensory inte-
gration). The implementation of neuromorphic computing at the hardware level
can be realized by oxide-based memristors, threshold switches and transistors.
• Operator: a mapping from one vector space or module to another. Operators are
of critical importance in both linear algebra and functional analysis, and have
applications in many other pure and applied mathematics fields. For example, in
classical mechanics, the derivative is used ubiquitously, and in quantum
mechanics, observables are represented by Hermitian operators. Important prop-
erties of operators include linearity, continuity and boundedness.
• Orthonormal basis: for an inner product space V with finite dimension, a basis
for V whose vectors are orthonormal, that is, all are unit vectors that are
orthogonal to each other.
• Parallelism: a type of computation in which many calculations are carried out
simultaneously.
• Pattern matching: in computer science, pattern matching is the act of checking a
given sequence of tokens for the presence of the constituents of some pattern.
• Photoelectric effect: the observation that light shone on many metals produces
electrons called photoelectrons. The effect is commonly studied in electronic
physics and in chemistry disciplines such as quantum chemistry and
electrochemistry.
• Photon: a particle representing a quantum of light or other electromagnetic
radiation.
Appendix B: Glossary of Terms Used in the Book 191
• Planck’s constant: a physical constant that is the quantum of action and central to
quantum mechanics.
• Position counter: indicates where a computer is in its program sequence.
• Probability density: a function that describes the relative likelihood of a random
variable taking on a given value.
• Quantum circuit: a model for quantum computation whereby computation is a
sequence of quantum gates that are reversible transformations of a quantum
mechanical analog of an n-bit register, referred to as an n-qubit register.
• Quantum computation: a kind of computation that makes direct use of quantum
mechanical phenomena, such as superposition and entanglement, to perform
operations on data. Quantum computers are different from our digital electronic
computers based on transistors. Whereas digital computers require data to be
encoded in binary digits (always in one of two states, 0 or 1), quantum compu-
tation uses quantum bits, which can be in a superposition of states.
• Quantum decoherence: the loss of coherence or ordering of the phase angles
between system components in quantum superposition.
• Quantum entanglement: a physical phenomenon that occurs when pairs or
groups of particles are generated or interact in such a way that the quantum
state of each particle cannot be described independently.
• Quantum parallelism: a method whereby a quantum computer is able to perform
computations simultaneously.
• Quantum superposition: a fundamental principle of quantum mechanics that
states that, much like waves in classical physics, any two (or more) quantum
states can be added together (superposed) and the result will be another valid
quantum state, and conversely, that every quantum state can be represented as a
sum of two or more other distinct states.
• Remainder: the portion of the dividend that is not evenly divisible by the divisor.
• Reversible computing: a model of computing where the computational process
is to some extent reversible (in time). In a computational model that uses
transitions from one state of the abstract machine to another, a necessary
condition for reversibility is one-to-one mapping from states to their successors.
• Rule base: a set of rules that apply to a given inferential process. Each rule has an
IF-part (the condition), a THEN-part (the conclusion) and, optionally, an ELSE-
part.
• Spin: in quantum mechanics and particle physics, an intrinsic form of angular
momentum carried by elementary particles, composite particles (hadrons) and
atomic nuclei.
• Symbol: a letter, figure, or other character or mark or combination thereof used
to designate something.
• Synergy: the creation of a whole that is greater than the simple sum of its parts.
• Teleportation: a process by which quantum information (for instance, the exact
state of an atom or photon) is transmitted (theoretically intact) from one location
to another, by means of a classical communication system and quantum entan-
glement between the sending and receiving locations. Because it depends on
classical communication (which cannot take place faster than the speed of light),
192 Appendix B: Glossary of Terms Used in the Book
Barenco, A., Bennett, C.H., Cleve, R., DiVincenzo, D.P., Margolus, N., Shor, P., Sleator, T.,
Smolin, J., Weinfurter, H.: Elementary gates for quantum computation. Phys. Rev. A. 52(5),
3457–3467 (1995)
Benioff, P.: Quantum mechanical Hamiltonian models of Turing machines. J. Stat. Phys. 29,
515–546 (1982)
Bennett, C.H.: Logical reversibility of computation. IBM J. Res. Dev. 17, 525–532 (1973)
Bennett, C.H.: The thermodynamics of computation: a review. Int. J. Theoret. Phys. 21(12),
905–940 (1982)
Bennett, C.H., DiVincenzo, D.P.: Quantum information and computation. Nature. 404, 247–255
(2000)
Bennett, C.H., Landauer, R.: The fundamental physical limits of computation. Sci. Am. 253,
48–56 (1985)
Bennett, C.H., Shor, P.W.: Quantum information theory. IEEE Trans. Inf. Theory. 44(6),
2724–2742 (1998)
Brain Basics: Know your brain. Http://www.ninds.nih.gov/disorders/brain_basics/know_your_
brain.htm. Accessed Mar 2014
Brandom, R.: A first look inside Google’s futuristic quantum lab. http://www.theverge.com/2013/
10/10/4824026/a-first-look-inside-googles-secretive-quantum-lab. Accessed Mar 2014
Cirac, J.I., Zoller, P.: A scalable quantum computer with ions in an array of microtraps. Nature.
404, 579–581 (2000)
Cirac, J.I., Zoller, P.: Quantum teleportation between light and matter. Nature. 443, 557–560
(2006)
Desurvire, E.: Classical and Quantum Information Theory. Cambridge University Press, Cam-
bridge (2009)
Deutsch, D.: Quantum theory, the Church-Turing principle and the universal quantum computer.
Proc. R. Soc. A400, 97–117 (1985)
Deutsch, D., Jozsa, R.: Rapid solution of problems by quantum computation. Proc. R. Soc. A439,
553–558 (1992)
Diccionario de Computación: McGraw-Hill/Interamericana. ISBN: 970-10-0018-8 (1991)
Dieks, D.: Communication by EPR devices. Phys. Lett. A. 92(6), 271–272 (1982)
D-Wave, disentangled: Google explains the present and future of Quantum Computing. Http://
www.extremetech.com/extreme/177316-d-wave-disentangled-google-explains-the-present-
and-future-of-quantum-computing. Accessed Mar 2014
Feynman, R.P.: Simulating physics with computers. Int. J. Theor. Phys. 21, 467–488 (1982)
Feynman, R.P.: Lectures on Computation, Critical Eds (2003)
Feynman, R.P., Pines, D., Hey, A., Hey, J.G., Tollen, W.: Feynman Lectures on Computation.
Westview Press, Boulder (1996)
Fredkin, E., Toffoli, T.: Conservative logic. Int. J. Theor. Phys. 21, 219–253 (1982)
Gardner, H.: Multiple Intelligences: The Theory in Practice. Basic Books, New York (1993)
Gisin, N.: Nonlocality criteria for quantum teleportation. Phys. Rev. Lett. A. 210(3), 157–159
(1996)
Group of Quantum Computation: Department of Applied Mathematics and Computing,
Universidad Politécnica de Madrid, Introduction to the Quantum Model of Computation,
Technical Report Number 19, 2003
Grover, L.K.: A fast quantum mechanical algorithm for database search. The Alamos Physics
Preprint File. http://xxx.lanl.gov/abs/quant-ph/9605043 (1996)
Landauer, R.: Irreversibility and heat generation in the computing process. IBM J. Res. Dev. 5(3),
183–191 (1961)
Levine, I.N.: Quantum Chemistry. AC Eds. (1977)
Levine, I.N.: Quantum Chemistry, 7th edn. Pearson Education, London (2013)
Meglicki, Z.: Quantum Computing Without Magic: Devices. The MIT Press, Cambridge (2008)
Moret-Bonillo, V.: Can artificial intelligence benefit from quantum computing? Prog. Artif. Intell.
3(2), 89–105 (2015)
Neven, H.: Launching the Quantum Artificial Intelligence Lab. http://research.googleblog.com/
2013/05/launching-quantum-artificial.html. Accessed Mar 2014
Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge
University Press, Cambridge (2000)
Poon, C.-S., Zhou, K.: Neuromorphic silicon neurons and large-scale neural networks: challenges
and opportunities. Front. Neurosci. (2011). doi:10.3389/Fnins.2011.00108
Quantum Artificial Intelligence Lab: http://en.wikipedia.org/wiki/Quantum_Artificial_Intelli
gence_Lab. Accessed Mar 2014
Shor, P.W.: Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a
Quantum Computer, The Alamos Physics Preprint File. http://xxx.lanl.gov/abs/quantph/
9508027 (1994)
Shor, P.W.: Why haven’t more quantum algorithms been found? J. ACM. 50(1), 87–90 (2003)
Sicart, T., Elkin, M.: Some Introductory Elements About the Quantum Computation. Department
of Basic Sciences. University EAFIT. Medellı́n, Colombia, June 1999
The Babbage Engine. http://www.computerhistory.org/babbage/. Accessed Mar 2014
Toffoli, T.: Reversible computing. MIT Technical Report MIT/LCS/TM-151 (1980)
Toffoli, T., Margolus, N.: Cellular Automata Machines: A New Environment for Modeling. The
MIT Press, Cambridge (1987)
Vance, A.: Intel says Adios to Knit and Jayhawk chips. Http://www.theregister.co.uk/2004/05/07/
intel_kills_tejas/ (From Inter- net March 2014)
Wichert, A.: Principles of Quantum Artificial Intelligence. World Scientific, New York (2013)
Wootters, W.K., Zurek, W.H.: A single quantum cannot be cloned. Nature. 299, 802–803 (1982)
Yanofsky, N.S., Mannucci, M.A.: Quantum Computing for Computer Scientists. Cambridge
University Press, Cambridge (2008)
Ying, M.: Quantum computation, quantum theory and AI. Artif. Intell. 174(2), 162–176 (2010)
Index
A Bra-ket notation, 12
Absolute zero point, 72 Bra notation, 70
Adjoint, 98
Algebra, 68, 73
Alpha particle, 72 C
Analytical engine, 176 Canonical basis, 93, 138, 163
AND operator, 16 Cartesian coordinates, 67
Angular momentum, 74 Cartesian product, 81
Artificial intelligence, 3, 165, 168, 176 CCN gate, 112, 122
Average value, 69, 72 Church-Turing principle, 76
Axiom, 25 Cirac, J.I., 175
Circuit, 11, 153
Cleve, R., 174
B Commutator, 68
Babbage, C., 166, 176 Complex number, 72
Backward reasoning, 3, 25 Compton scattering, 22, 66
Bayesian network, 176 Compton, A., 22
Bell state, 88 Controlled-controlled-NOT (CCN), 29
Benioff, P., 75, 174 Control register, 48
Bennett, C.H., 28, 50, 174 Corpuscular character of light, 54
Billiard balls, 35 Cryptography, 117
Binary decision, 2
Binary disjunction, 14, 15
Binary equality, 14 D
Binary logic, 1, 13–19, 25 Data-driven, 177
Binary negation, 14 Data-driven reasoning, 3, 25
Binary representation, 89 de Broglie, L., 54, 61, 66
Black body, 66, 72 de Broglie’s equation, 61
Black box, 163 Decoherence, 78, 175
Bloch sphere, 84, 116, 174 Density matrix, 117
Bohr, N., 58, 66, 175 Deutsch, D., 76, 135, 174
Boltzmann constant, 170 Deutsch-Jozsa algorithm, 145–154
Boole, G., 13 Deutsch’s algorithm, 136–143
Born, M., 63, 66 Differential equation, 72
Diffraction, 59, 72 I
Dirac, P., 12, 66, 70 Implication, 17
Information, 2, 6, 12, 27, 47, 49, 53, 79, 81, 85,
168–174
E Inner product space, 70, 73, 152
Eigenfunctions, 67, 72, 84
Eigenstates, 67, 72
Eigenvalue, 73 J
Einstein, A., 54, 66 Joint probability, 25
Ekert, A., 174 Jordan, P., 66
Electron, 12, 54, 56, 82 Jozsa, R., 135
Energy, 28, 39, 49, 53, 54, 56, 72, 166, 171
Entanglement, 50, 80, 174
Entropy, 171, 176 K
Euclidean space, 163 Ket notation, 12, 70
Exchange (EX), 27, 105 Knowledge, 168
F L
Fanout (FO), 27 Landauer, R., 53, 169
Feynman, R., 75, 81, 174 Learning, 22, 168, 177
Fly, M., 174 Lecerf, Y., 50
Fredkin, E., 22, 28 Levine, I., 64
Fredkin gate, 31–33, 124 Linear momentum, 73
Free energy, 37 Linear operator, 98
Full adder, 21, 37, 46, 47 Logarithm, 25
Logic gates, 19, 77, 81, 172
Logic operator, 28
G Lovelace, A., 166
General relativity, 73
Genetic algorithms, 173, 177
Gigaflops, 78, 173 M
Grover, L., 76 Macchiavello, C., 174
Grover’s algorithm, 76 Machine learning, 168, 177
Matrix, 73
Maxwell, J.C., 54, 117
H Maxwell’s demon, 80, 117
Hadamard gates, 101, 141, 150 Measurement, 56, 66, 82, 90, 92, 162, 175, 176
Hadamard operation, 161 Momentum, 55, 58
Hadamard transformation, 140
Half adder, 20–22, 37
Hamiltonian operator, 66, 73, 126 N
Haroche, S., 175 NAND gate, 32
Heisenberg, W., 56, 66 NAND operator, 17
Heisenberg’s uncertainty principle, 56–60, 72, Neural networks, 177
73, 79, 82 Neuromorphic, 177
Hermitian, 73 Neurons, 20, 166, 177
conjugate, 103, 118 Newton’s second law of motion, 60
operator, 67 No-cloning theorem, 80, 98
Hilbert space, 72, 73, 81 NOR operator, 16
Index 197
P S
Parallelism, 78, 80, 89, 163, 165 Scalability, 79
Pattern matching, 177 Schoelkopf, R., 77
Pauli matrices, 83, 160 Schr€odinger, E., 60, 66
Pauli, W., 66 Schr€odinger’s equation, 60–63
Photoelectric effect, 54, 66, 73 Schumacher, B., 79
Photon, 73 Schumacher compression, 79
Planck, M., 54 Self-adjoint, 73
Planck’s constant, 54, 73 Shannon, C., 5
Position, 56 Shannon’s formula, 170
Position counter, 133 Shor’s algorithm, 76
Postulates, 72 Simon, D., 76, 154
Postulates of quantum mechanics, 66, 67 Simon’s algorithm, 154–159
Probability, 2, 6, 83, 87, 91, 149 Simon’s problem, 155
Probability density, 63, 74 Sinusoidal solution, 62
Spin, 12, 74, 82
Spin pin, 53
Q Stern, O., 56
Quantum algorithms, 76, 80, 135–152, Stickers, 10–12
154–163 Superposition, 50, 77, 79, 83, 101, 141
Quantum circuit, 80, 117 Symbol, 25
Quantum computing, 50, 65, 71, 75–118, Synergy, 177
165, 174
Quantum cryptography, 76, 79
Quantum decoherence, 117 T
Quantum entanglement, 117 Teleportation, 163, 174
Quantum information, 78 Tensor product, 86, 95, 117, 141, 150
Quantum mechanical, 71 Thermodynamics, 176
Quantum mechanical postulates, 91 Toffoli gate, 29–31, 116, 122
Quantum mechanics, 53, 54, 56–74, 79, 81, 86 Toffoli, T., 22
Quantum parallelism, 117 Transistor, 177
Quantum superposition, 117 Transpose, 118
Quantum teleportation, 76, 89, 160–162 Trigonometric (circular) function, 61, 74
Quantum Turing machine, 81 Trigonometric relations, 103
Qubit, 76, 82, 93 Tunnel effect, 75, 117, 169
Turing machines, 51, 75, 77, 137
R
Registers, 90, 98 U
Remainder, 25 Unit of measure, 2
Reversibility, 27, 29, 39, 49, 99, 172 Unit vectors, 163
Reversible AND, 44, 45 Unitary matrix, 80, 99, 112, 117
198 Index
W
Wave, 54, 58, 75 Z
Wave function, 74 Zoller, P., 175