ArticlePDF Available

Abstract and Figures

Quantum Computing is a new and exciting field at the intersection of mathematics, computer science and physics. It concerns a utilization of quantum mechanics to improve the efficiency of computation. Here we present a gentle introduction to some of the ideas in quantum computing. The paper begins by motivating the central ideas of quantum mechanics and quantum computation with simple toy models. From there we move on to a formal presentation of the small fraction of (finite dimensional) quantum mechanics that we will need for basic quantum computation. Central notions of quantum architecture (qubits and quantum gates) are described. The paper ends with a presentation of one of the simplest quantum algorithms: Deutsch's algorithm. Our presentation demands neither advanced mathematics nor advanced physics.
Content may be subject to copyright.
AN INTRODUCTION TO QUANTUM COMPUTING
NOSON S. YANOFSKY
Abstract. Quantum Computing is a new and exciting field at the intersec-
tion of mathematics, computer science and physics. It concerns a utilization of
quantum mechanics to improve the efficiency of computation. Here we present
a gentle introduction to some of the ideas in quantum computing. The paper
begins by motivating the central ideas of quantum mechanics and quantum
computation with simple toy models. From there we move on to a formal
presentation of the small fraction of (finite dimensional) quantum mechanics
that we will need for basic quantum computation. Central notions of quan-
tum architecture (qubits and quantum gates) are described. The paper ends
with a presentation of one of the simplest quantum algorithms: Deutsch’s algo-
rithm. Our presentation demands neither advanced mathematics nor advanced
physics.
Contents
1. Intuition 1
1.1. Classical Deterministic Systems 2
1.2. Classical Probabilistic Systems 5
1.3. Quantum Systems 9
1.4. Combining Systems 15
2. Basic Quantum Theory 18
2.1. States 18
2.2. Dynamics 20
2.3. Observables 20
3. Architecture 21
3.1. Bits and Qubits 21
3.2. Classical Gates 25
3.3. Quantum Gates 27
4. Deutsch’s Algorithm 28
4.1. First Attempt 30
4.2. Second Attempt 31
4.3. Deutsch’s Algorithm 32
1. Intuition
Quantum Computing is a fascinating new field at the intersection of computer
science, mathematics and physics. This field studies how to harness some of the
strange aspects of quantum physics for use in computer science. Many of the texts
to this field require knowledge of a large corpus of advanced mathematics or physics.
We try to remedy this situation by presenting the basic ideas of quantum computing
1
arXiv:0708.0261v1 [quant-ph] 2 Aug 2007
2 NOSON S. YANOFSKY
understandable to anyone who has had a course in pre-calculus or discrete struc-
tures. (A good course in linear algebra would help, but, the reader is reminded of
many definitions in the footnotes.)
The reason why we are able to ignore the higher mathematics and physics is that
we do not aim to teach the reader all of quantum mechanics and all of quantum
computing. Rather, we lower our aim to simply present that part necessary to
offer a taste of what quantum computing is all about. What makes this possible
is that we only need finite dimensional quantum mechanics, i.e., the vector spaces
that represent the states of the system will only be of finite dimension. Such vector
spaces consist of finite vectors with complex entries. These vectors will change by
being multiplied by operators or matrices. These matrices will be finite and have
complex entries. We do not do any more quantum computing than what is needed
for our final goal: Deutsch’s algorithm. We stress that the reader does not need
more than the ability to do matrix multiplication in order to understand this paper.
To motivate our use of vectors to describe states and matrices as ways of describ-
ing dynamics, we show that it is understandable if one looks at a basic toy models.
Our models deal with childrens’ marbles moving along the edges of a graph. Every
computer scientist and logician who has taken a class in discrete structures knows
how to represent a (weighted) graph as an adjacency matrix. We shall take this
basic idea and generalize it in several straightforward ways. While doing this, we
shall present many concepts that are at the very core of quantum mechanics.
We begin with graphs that are without weights and progress to graphs that are
weighted with real numbers, and finally to graphs that are weighted with complex
numbers. With this in hand, we present a graph theoretic version of the double-slit
experiment. This is the most important experiment in quantum mechanics. We
conclude with a discussion of ways of combining systems to yield larger systems.
Throughout this chapter, we shall present an idea in a toy model, then generalize
it to an abstract point and lastly discuss the connection with quantum mechanics
before moving on to the next idea.
This paper is based on a forthcoming text Quantum Computing for Computer
Scientists coauthored with Mirco Mannucci. The text was accepted for publication
by Cambridge University Press and should see the light of day in the beginning
of 2008. In the text we take the reader through the same material and go much
further. The reader who appreciates this paper, will definitely gain from the text.
Acknowledgement. I am grateful to Dr. Mirco Mannucci for many helpful dis-
cussions and cheery editing sessions.
1.1. Classical Deterministic Systems. We begin with a simple system described
by a graph along with some children’s marbles. Imagine the marbles as being on
the vertices of the graph. The state of a system is described by how many marbles
are on each vertex. For example, say that there are six vertices in the graph and a
total of 27 marbles.
AN INTRODUCTION TO QUANTUM COMPUTING 3
We might place six marbles on vertex 0, two marbles on vertex 1 and the rest
as described by this picture.
06 1 22 1
35 4 35 10
We shall denote this state as X= [6,2,1,5,3,10]T. The states of such a system
will simply be a collum vector of size 6.
We are not only interested in states of the system, but also in the way that the
states change or the “dynamics” of the system. This can be represented by
a graph with directed edges. The dynamics might be described by the following
directed graph:
0
++
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W
W1//2
wwppppppppppppp
3
4//5
OO
The idea is that if there exists an arrow from vertex ito vertex j, then in one time
click, all the marbles on vertex iwill move to vertex j. We place the following
restriction on the types of graphs we shall be concerned with: graphs with exactly
one outgoing edge from each vertex. This will correspond to the notion of a classical
determinstic system. At each time click the marbles will have exactly one place to
go.
This graph is equivalent to the matrix, M(for “marbles”):
M=
012345
0 000000
1 000000
2 010001
3 000100
4 001000
5 100010
where M[i, j] = 1 if and only if there is an arrow from vertex jto vertex i.1Our
restricted class of graphs are related to the restricted class of boolean matrices that
have exactly one 1 in each column.
1Although most texts might have M[i,j ] = 1 if and only if there is an arrow from vertex ito
vertex j, we shall need it to be the other way for reasons which will become apparent later. The
difference is trivial.
4 NOSON S. YANOFSKY
Let us say we multiply Mby a state of the system X= [6,2,1,5,3,10]T. Then
we have
MX =
000000
000000
010001
000100
001000
100010
6
2
1
5
3
10
=
0
0
12
5
1
9
=Y
What does this correspond to? If Xdescribes the state of the system at time t,
then Yis the state at time t+ 1 , i.e., after one time click. We can see this clearly
by looking at the formula for matrix multiplication:
Y[i]=(M ? X)[i] =
5
X
k=0
M[i, k]X[k].
In plain English, this states that the number of marbles that will reach vertex iafter
one time step is the sum of all the marbles that are on vertices with edges connecting
to vertex i. Notice that the top two entries of Yare zero. This corresponds to the
fact that there are no arrows going to vertex 0 or 1.
In general if X= [x0, x1, . . . , xn1]Tis a column vector corresponding to having
ximarbles on vertex i,Mis a nby nBoolean matrix, and if MX =Ywhere
Y= [y0, y1, . . . , yn1]T, then there are yjmarbles on vertex jin one time click. M
is thus a way of describing how the state of the marbles can change from time tto
time t+ 1.
As we shall soon see, (finite dimensional) quantum mechanics works in the same
way. States of a system are represented by column vectors and the way in which
the system changes in one time click is represented by matrices. Multiplying a
matrix with a column vector yields a new state of the system. Quantum mechanics
explores the way states of similar systems evolve over time.
Returning to our marbles, let’s multiply Mby itself. M M =M2. However, since
our entries are Boolean, we shall multiply the matrices as Boolean, i.e., 1 + 1 =
11 = 1.
000000
000000
010001
000100
001000
100010
000000
000000
010001
000100
001000
100010
=
000000
000000
100010
000100
010001
001000
AN INTRODUCTION TO QUANTUM COMPUTING 5
Looking at the formula for Boolean matrix multiplication
M2[i, j] =
n1
_
k=0
M[i, k]M[k, j ]
we can see that this formula really shows us how to go from vertex jto vertex iin
two time clicks.
And so we have that
M2[i, j] = 1 if and only if there is a path of length 2 from vertex jto vertex i.
For an arbitrary kwe have
Mk[i, j] = 1 if and only if there is a path of length kfrom vertex jto vertex i.
In general, multiplying an nby nmatrix by itself several times will corre-
spond to the whether there is a path after several time clicks. Consider X=
[x0, x1, . . . , xn1]Tto be the state where one has x0marbles on vertex 0, x1mar-
bles on vertex 1, . . . , xn1marbles on vertex n1. Then, after ksteps, the state
of the marbles is Ywhere Y= [y0, y1, . . . , yn1]T=MkX. In other words, yjis
the number of marbles on vertex jafter ksteps.
In quantum mechanics, if there are two or more matrices or operators that
manipulate states, then the action of one followed by another is described by their
matrix product. We shall take different states of systems and multiply the states
by various matrices (of the appropriate type) to obtain other states. These other
states will again be multiplied by other matrices until we attain the desired state.
1.2. Classical Probabilistic Systems. In quantum mechanics, neither the state
of a system nor the dynamics of a system are deterministic. There is an indetermi-
nacy in our knowledge of a state. Furthermore, the states change with probabilistic
laws as opposed to deterministic laws. That means that states do not change in set
ways. Rather, the laws are given by stating that states will change from one state
to another state with a certain likelihood.
In order to capture these probabilistic scenarios, let us generalize what we did in
the last subsection. Instead of dealing with a bunch of marbles moving around, we
shall deal with a single marble. The state of the system will tell us the probabilities
of the single marble being on each vertex. For a three-vertex graph, a typical state
might look like this X= [1
5,3
10,1
2]T. This will correspond to the fact that there
is a one-fifth2chance that the marble is on vertex 0; a three-tenth chance that the
marble is on vertex 1; and a half chance that the marble is on vertex 2. Since the
marble must be somewhere on the graph, the sum of the probabilities is 1.
We must generalize the dynamics as well. Rather than exactly one arrow leaving
each vertex, we will have several arrows leaving each vertex with non-negative real
numbers between 0 and 1 as weights. These weights will describe the probability
of the single marble going from one vertex to another in one time click. We shall
restrict our attention to weighted graphs that satisfy the following two conditions:
a) the sum of all the weights leaving a vertex is 1 and b) the sum of all the weights
entering a vertex is 1. This will correspond to the fact that a marble must go
someplace (there might be loops) and a marble must come from someplace. An
example of such a graph is
2Although the theory works with any r[0,1], we shall deal only with fractions.
6 NOSON S. YANOFSKY
0
1
3--
2
3
1
1
3
yy
1
6
mm
1
2
2.
5
6
ZZ1
6
99
The matrix for this graph is
M=
01
65
6
1
31
21
6
2
31
30
The adjacency matrices for our graphs will have non-negative real entries where the
sums of the rows and the sums of the columns are all 1. Such matrices are called
“doubly stochastic matrices.”
Let us see how the states interact with the dynamics. Suppose we have a state
X=h1
6,1
6,2
3iT
. We will calculate how a state changes: MX =Y
01
65
6
1
31
21
6
2
31
30
1
6
1
6
2
3
=
21
36
9
36
6
36
Notice that the sum of the entries of Yis 1. If we have Xexpressing the probability
of the position of a marble, and Mexpressing the probability of the way the marble
moves around, then MX =Y=h21
36,9
36,6
36iT
is to be interpreted as expressing
the probability of the marble’s location after moving. In other words, if Xis the
probability of the marble at time t, then MX is the probability of the marble at
time t+ 1.
If Mis an nby ndoubly stochastic matrix and Xis an nby 1 column vec-
tor whose entries sum to 1, then MkX=Ycan be interpreted as expressing
the probability of the position of a marble after ktime clicks. That is, if X=
[x0, x1, . . . , xn1]Tmeans that there is an xichance that a marble is on vertex i,
then MkX=Y= [y0, y1, . . . , yn1]Tmeans that after ktime clicks, there is a yj
chance that the marble is on vertex j.
We are not constrained to multiply Mby itself. We may also multiply Mby
another doubly stochastic matrix. Let Mand Nbe two nby ndoubly stochastic
matrices. M ? N will then describe a probability transition of going from time tto
t+ 1 to t+ 2.
In quantum computers, quantum systems are generally in a probabilistic state.
Manipulating the system will correspond to multiplying the state by matrices. Each
time click will correspond to one matrix multiplication. At the end of the compu-
tation, the resulting vector will describe the state of the system.
AN INTRODUCTION TO QUANTUM COMPUTING 7
Before moving on to the next section, we shall examine an interesting example.
This shall be known as the “probabilistic double slit experiment.” Consider the
following picture of a shooting gun.
Figure 1. Double slit experiment with bullets.
There are two slits in the wall. The shooter is a good enough shot to always get
the bullets through one of the two slits. There is a 50-50 chance of which slit the
bullet will go through. Once a bullet is through a slit, there are three targets to the
right of each slit that the bullet can hit with equal probability. The middle target
can get hit in one of two ways: from the top slit going down, or from the bottom
slit going up. It is assumed that it takes the bullet one time click to go from the
gun to the wall and one time click to go from the wall to the targets. The picture
8 NOSON S. YANOFSKY
correspond to the following weighted graph.
3
1
1
1
3
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}1
3//
1
3
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A4
1
0
1
2
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
1
2
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A5
1
2
1
3
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}1
3//
1
3
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A6
1
7
1
Notice that the vertex marked 5 can receive bullets from either of the two slits.
Corresponding to this graph is the matrix B(for “bullets”)
B=
0 0 0 0 0 0 0 0
1
20 000000
1
20 000000
01
3010000
01
3001000
01
31
300100
0 0 1
300010
0 0 1
300001
In words, Bdescribes the way a bullet will move after one time click.3
3The matrix Bis not a doubly stochastic matrix. The sum of the weights entering vertex 0
is not 1. The sum of weights leaving vertices 3, 4, 5, 6, and 7 are more than 1. This fact should
not bother you. We are interested in demonstrating the way probabilities behave with respect to
these matrices.
AN INTRODUCTION TO QUANTUM COMPUTING 9
Let us calculate the probabilities for the bullet’s position after two time clicks.
B ? B =B2=
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1
61
3010000
1
61
3001000
1
31
31
300100
1
601
300010
1
601
300001
So B2indicates the probabilities of the bullet’s position after two time clicks.
If we are sure that we start with the bullet in position 0, i.e., X= [1,0,0,0,0,0,0,0]T,
then, after two time clicks, the state of the bullets will be
B2X= [0,0,0,1
6,1
6,1
3,1
6,1
6]T
The key idea is to notice that B2[5,0] = 1
6+1
6=1
3because the bullets start from
position 0, then there are two possible ways of the bullet getting to position 5. The
possibilities sum to 1
3. This is what we would expect. We shall revisit this example
in the next subsection where strange things start happening!
1.3. Quantum Systems. We are now ready to leave the world of classical proba-
bilities and enter the world of the quantum. One of the central facts about quantum
mechanics is that complex numbers play a major role in the calculations. Proba-
bilities of states and transitions are not given as a real numbers pbetween 0 and
1. Rather, they are given is a complex numbers csuch that |c|2is a real number4
between 0 and 1.
What is the difference how the probabilities are given? What does it matter if
a probability is given as a real number between 0 and 1, or as a complex number
whose modulus squared is a real number between 0 and 1? The difference is and
this is the core of quantum theory that real number probabilities can be added
to obtain larger real numbers. In contrast, complex numbers can cancel each other
and lower their probability. In detail, if p1and p2are two real numbers between
0 and 1, then (p1+p2)p1and (p1+p2)p2. Now let’s look at the complex
case. Let c1and c2be two complex numbers with their squares of modulus |c1|2
and |c2|2.|c1+c2|2need not be bigger then |c1|2and it also does not need to be
bigger than |c2|2.
For example5, if c1= 5 + 3iand c2=32i, then |c1|2= 34 and |c2|2= 13
but |c1+c2|2=|2 + i|2= 5. 5 is less than 34 and 5 is less than 13.
4We remind the reader that if c=a+bi is a complex number, then its modulus is |c|=a2+b2
and |c|2=a2+b2.
5The important point here is that the modulus squared is positive. For simplicity of calcula-
tions, we have chosen easy complex numbers.
10 NOSON S. YANOFSKY
This possibility of canceling out complex numbers corresponds to something
called “interference” in quantum mechanics. One complex number might interfere
with another. It is one of the most important ideas in quantum theory.
Let us generalize our states and graphs from the previous subsection. Rather
than insisting that the sum of the entries in the column vector is 1, we insist that
the sum of the modulus squared of the entries is 1. This makes sense since we are
considering the probability as the modulus squared.
For dynamics, rather than talking about graphs with real number weights, we
shall talk about graphs with complex number weights. Instead of insisting that the
adjacency matrix of such a graph be a doubly stochastic matrix, we ask instead
that the adjacency matrix be unitary.6
For example, consider the graph
0
1
2
i
2
--1
1
2
mm
i
2
ss
2.
i
The corresponding unitary adjacency matrix is
U=
1
2
1
20
i
2
i
20
0 0 i
.
Unitary matrices are related to doubly stochastic matrices as follows. The mod-
ulus squared of the all the complex entries in Uforms a doubly stochastic matrix.
The i, jth element in Uis denoted U[i, j], and its modulus squared is denoted
|U[i, j]|2. By abuse of notation, we shall denote the entire matrix of modulus
squares as |U[i, j]|2:
|U[i, j]|2=
1
21
20
1
21
20
0 0 1
.
It is easy to see that this is a doubly stochastic matrix.
6Let us just remember: a matrix Uis unitary if U ? U=I=U? U. The adjoint of U,
denoted as U, is defined as U= (U)T= (UT) or U[j, k] = U[k, j ].
AN INTRODUCTION TO QUANTUM COMPUTING 11
From this graph-theoretic point of view, it is easy to see what unitary means:
the conjugate transpose of the Umatrix is
U=
1
2
i
20
1
2i
20
0 0 i
.
This matrix corresponds to the graph
0
1
2
1
2
--1
i
2
mm
i
2
2.
i
If Uis the matrix that takes a state from time tto time t+ 1, then Uis the matrix
that takes a state from time tto time t1. If we multiply Uand U, we get the
identity matrix I3which corresponds to the graph
0
1
1
1
2.
1
This means that if we perform some operation and then “undo” the operation, we
will find ourselves in the same state as we began with probability 1. It is important
to note that unitary does not only mean invertible. It means invertible in a very
easy way, i.e., the inverse is the dagger of the matrix. This “invertibility” is again
an important issue in quantum mechanics. Most of the dynamics will be invertible
(except measurements).
In order to see the interference phenomenon and the related “superposition”
phenomenon, we will revisit the double-slit experiment from the last subsection.
Rather than looking at bullets, which are relatively large objects and hence adhere
to the laws of classical physics, we shall look at microscopic objects such as photons
that follow the laws of quantum physics. Rather than having a gun, we shall have
a laser shoot photons through two slits as in figure 2.
Again we shall make the assumption that a photon will pass through one of the
two slits. Each slit has a 50% chance of the photon going through it. To the left
of each slit there are three measuring devices. It is assumed that it takes one time
click to go from the laser to the slits and one time click to go from the slits to the
targets. We are not interested in how large the slits are or how far the measuring
positions are from the slits. Physicists are very adapt at calculating many different
aspects of this experiment. We are only interested in the set-up.
12 NOSON S. YANOFSKY
Figure 2. Double slit experiment with photons.
Consider the following weighted graph that describes the set-up of the experi-
ment:
3
1
1
1 + i
6
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}1i
6//
1i
6
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A4
1
0
1
2
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
1
2
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A5
1
2
1 + i
6
>>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}1i
6//
1i
6
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A6
1
7.
1
AN INTRODUCTION TO QUANTUM COMPUTING 13
The modulus squared of 1
2is 1
2, which corresponds to the fact that there is a 50-50
chance of the photon going through either slit. ±1±i
6
2
=1
3which corresponds
to the fact that whichever slit the photon goes through, there is a 1
3of a chance of
its hitting any of the three measuring positions to the right of that slit. 7
The adjacency matrix for this graph is P(for “photons”)8
P=
0 0 0 0 0 0 0 0
1
20 0 00000
1
20 0 00000
01 + i
60 10000
01i
60 01000
01i
61 + i
600100
0 0 1i
600010
0 0 1i
600001
.
The modulus squared of the Pmatrix is exactly the same as the bullets matrix
i.e., |P[i, j]|2=B. Let us see what happens if we calculate the transitions
7The actual complex number weights are not our interest here. If we wanted to calculate the
actual numbers, we would have to measure the width of the slits, the distance between the slits,
the distance from the slits to the measuring devices etc. However, our goal here is to clearly
demonstrate the interference phenomenon. And so we chose the above complex numbers simply
because the modulus squared are exactly the same as the bullets case.
8This matrix is not a unitary matrix. Looking carefully at row 0, one can immediately see that
Pis not unitary. In our graph, there is nothing entering vertex 0. The reason why this matrix
fails to be unitary is because we have not put in all the arrows in our graph. There are many more
possible ways the photon can travel in a real-life physical situation. In particular, the photon
might go from the right to the left. The diagram and matrix would become too complicated if we
put in all the transitions. We are simply trying to demonstrate the interference phenomenon and
we can accomplish that even with a matrix that is not quite unitary.
14 NOSON S. YANOFSKY
matrix after two time clicks.
P2=
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1 + i
12 1 + i
60 10000
1i
12 1i
60 01000
01 + i
6
1i
600100
1i
12 01i
600010
1 + i
12 01i
600001
.
How do we interpret this in terms of probability? Let us look at the modulus
squared of each of the entries.
|P2[i, j]|2=
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
1
61
3010000
1
61
3001000
01
31
300100
1
601
300010
1
601
300001
.
This matrix is almost exactly the same as B2but with one glaring difference.
B2[5,0] = 1
3because of the two ways of starting at position 0 and ending at position
5. We added the nonnegative probabilities 1
6+1
6=1
3. However with a photon
that follows the laws of quantum mechanics, the complex numbers are added as
opposed to their probabilities.
1
21 + i
6+1
21i
6=1 + i
12 +1i
12 =0
12 = 0.
Thus giving us |P2[5,0]|2= 0. In other words, although there are two ways of a
photon going from vertex 0 to vertex 5, there will be no photon at vertex 5.
How is one to understand this phenomenon? Physicists have a simple explanation
for interference: waves. A familiar observation such as a pebble thrown into a
pool of water will easily convince us that waves interfere, sometimes reinforcing
each other, sometimes cancelling each other. In our experiment, photons are going
through both slits at one time and they are canceling each other out at the middle
measuring device. Thus, the double-slit experiment points to the wave-like nature
of light.
AN INTRODUCTION TO QUANTUM COMPUTING 15
The experiment can be done with only one photon shot out from vertex 0. This
ensures that there will not be another wave for it to cancel out with. And yet, when
only one photon goes through a slit, there is still an interference phenomenon. What
is going on here?
The naive probabilistic interpretation of the position of the photon following the
bullet metaphor of the previous subsection is thus not entirely adequate. Let the
state of the system be given by X= [c0, c1, . . . , cn1]TCn. It is incorrect to say
that the probability of the photon being in position kis |ck|2. Rather, a system in
state Xmeans that the particle is in all positions simultaneously. It is only after
we measure the photon that the chances of it being found in position kis |ck|2.
The photon (or its associated wave) goes through the top slit and the bottom slit
simultaneously. And when the photon exits both slits, it can cancel itself out. A
photon is not in asinge position, rather it is in many positions or a “superposition”.
This might cause some justifiable disbelief. After all, we do not see things in
a superposition of states. Our everyday experience tells us that things are in one
position or (exclusive or!) another position. How can this be? The reason why we
see particles in exactly one position is because we have performed a measurement.
When we measure something at the quantum level, the quantum object that we
have measured is no longer in a superposition of states, rather it collapses to a
single classical state. So we have to redefine what a state of a quantum system
means: A system in state Xmeans that after measuring the photon it will be in
position kwith probability |ck|2.
What are we to make of these strange ideas? Are we really to believe them?
Richard Feynman in discussing the double-slit experiment [?] (Vol. III, Page 1-1)
waxes lyrical:
We choose to examine a phenomenon which is impossible, absolutely
impossible, to explain in any classical way, and which has in it
the heart of quantum mechanics. In reality, it contains the only
mystery. We can not make the mystery go away by “explaining”
how it works. We will just tell you how it works.
It is exactly this superposition of states that is the real power behind quantum
computing. Classical computers are in one state at every moment. Quantum
computers can be put in a superposition of states. Imagine putting a computer in
many different classical states at one time and then processing with all the states.
This is the ultimate in parallel processing! Such a computer can only be conceived
in the quantum world.
1.4. Combining Systems. Quantum mechanics can also deal with systems that
have more than one part. In this subsection we learn how to combine several
systems into one. We shall talk about combining classical probabilistic systems.
However, whatever is stated about classical probabilistic systems is also true for
quantum systems.
16 NOSON S. YANOFSKY
Consider two different marbles. Imagine that a red marble follows the probabil-
ities of the graph whose corresponding adjacency matrix is
M=
01
65
6
1
31
21
6
2
31
30
.
Consider also a blue marble that follows the transitions given by the graph
GN=a
1
3
2
3,,b
1
3
2
3
ll
i.e., the matrix
N=
1
32
3
2
31
3
.
What does a state for a two marble system look like? Since the red marble can
be on one of three vertices and the blue marble can be on one of two vertices, there
are 3 ×2 = 6 possible states of the combined system. This is the tensor product of
a 3 by 1 vector with a 2 by 1 vector. A typical state might look like:
X=
0a1
18
0b0
1a2
18
1b1
3
2a0
2b1
2
,
which would correspond to the fact that there is a
1
18 chance of the red marble being on vertex 1 and the blue marble
being on vertex a,
0 chance of the red marble being on vertex 1 and the blue marble
being on vertex b,
.
.
.
1
2chance of the red marble being on vertex 3 and the blue marble
being on vertex b.
Now we may ask, how does a system with these two marbles change? What
is its dynamics? Imagine that the red marble is on vertex 1 and the blue marble
is on vertex a. We may write this as “1a.” What is the probability of the state
going from state 1ato state 2b? Obviously, the red marble must go from vertex
1 to vertex 2 and (multiply) the blue marble must go from vertex ato vertex b.
The probability is 1
3×2
3=2
9. In general, for a system to go from state ij to a
AN INTRODUCTION TO QUANTUM COMPUTING 17
state i0j0we must multiply the probability of going from state ito state i0with the
probability of going from state jto state j0.
ij M[i0,i]×N[j0,j]//i0j0.
For the changes of all the states, we have to do this for all the entries. We are really
giving the tensor product of two matrices9:
MN=
012
0 0
1
32
3
2
31
3
1
6
1
32
3
2
31
3
5
6
1
32
3
2
31
3
11
3
1
32
3
2
31
3
1
2
1
32
3
2
31
3
1
6
1
32
3
2
31
3
22
3
1
32
3
2
31
3
1
3
1
32
3
2
31
3
0
1
32
3
2
31
3
.
=
0a0b1a1b2a2b
0a0 0 1
18 2
18 5
18 10
18
0b0 0 2
18 1
18 10
18 5
18
1a1
92
91
62
61
18 2
18
1b2
91
92
61
62
18 1
18
2a2
94
91
92
90 0
2b4
92
92
91
90 0
The graph that corresponds to this matrix, GM×GNis called the Cartesian prod-
uct of two weighted graphs. In quantum theory, the states of two systems are
combined using the tensor product of two vectors and the dynamics of two systems
are combined by using the tensor product of two matrices. The tensor product of
the matrices will then act on the tensor product of the vectors.
In general, the Cartesian product of an n-vertex graph with an n0-vertex graph
is an (n×n0)-vertex graph. If we have an n-vertex graph Gand we are interested
in mdifferent marbles moving in this system, we would need to look at the graph
Gm=G×G× · ·· × G
| {z }
mtimes
9Formally, the tensor product of matrices is a function
:Cm×m×Cn×n Cm×mCn×n=Cmn×mn
and it is defined as
(AB)[j, k] = A[j/n, k /m]×B[jMOD n, k MOD m].
18 NOSON S. YANOFSKY
which will have nmvertices. If MGis the associated adjacency matrix, then we will
be interested in
Mm
G=MGMG · ·· MG
| {z }
mtimes
which will be a nmby nmmatrix.
One might think of a bit as a two vertex graph with a marble on the 0 vertex or
a marble on the 1 vertex. If one were then interested in mbits, one would need a
2mvertex graph or equivalently a 2mby 2mmatrix. So there is exponential growth
of the resources needed for the amount of bits discussed.
This exponential growth for a system is actually one of the main reasons why
Richard Feynman started thinking about quantum computing. He realized that
because of this exponential growth, it would be hard for a classical computer to
simulate such a system. He asked whether a quantum computer with its ability to
do massive parallel processing, might be able to simulate such a system.
2. Basic Quantum Theory
Armed with the intuition, we tackle the formal statement of quantum theory.
A disclaimer is in order: We are only presenting a small part of finite dimensional
quantum physics. There is no way that we can give more than a minute fraction of
this magnificent subject in these few pages. It is a sincere hope that this will inspire
the reader to go on and study more. For a mathematician, the best book to start
reading about quantum mechanics is, of course, Dirac’s classic text [?]. However,
there are many other primers available, e.g., [?,?,?] and [?]. The more advanced
mathematician might want to look at [?].
2.1. States. An ndimensional quantum system is a system that can be observed
in one of npossible states. Examples of such systems are
a particle can be in one of npositions;
a system might have one of nenergy levels;
a photon might have one of npolarization directions.
For clarity, lets talk of the first example. Lets say we have a particle that can be
in one of npositions.
The states of such a system shall be represented by collum vectors of ncomplex
numbers. We shall denote these vectors with the “ket” | i 10 notation:
|ϕi= [c0, c1, . . . , cj, . . . , cn1]T.
How is one to interpret these kets? Let us look at simple cases. The state
|ψi= [0,1,...,0,...,0]T
is to be thought of as saying that our particle will be found in position 1. The state
|ψ0i= [0,0,...,1,...,0]T
is to be interpreted that the particle is in position j. These two states are examples
of what are called “pure states”.
How is one to interpret an arbitrary
|ϕi= [c0, c1, . . . , cj, . . . , cn1]T?
10“Ket” is the second half of “bracket”. However we shall not use the “bra” part in our
exposition.
AN INTRODUCTION TO QUANTUM COMPUTING 19
Let Sbe the sum of the squares of modulus of the cj, i.e.,
S=|c0|2+|c1|2+. . . +|cn1|2.
This is the length of the vector |ϕi. Then |ϕiis to be interpreted that if one
was to measure the state described by |ϕiwe would find the particle in position 0
with probability |c0|2/S, in position 1 with probability |c1|2/S, in position 2 with
probability |c2|2/S,. . ., in position n1 with probability |cn1|2/S Such states are
called “superpositions”. They say that the particle is in more than one “position”
at a time. It is important to stress that |ϕimeans that the particle is in all positions
simultaneously. It does not mean that the particle is in some single position and
the cjare giving us probabilities of which position.
These superpositions can be added: if
|ϕi= [c0, c1, . . . , cj, . . . , cn1]T
and
|ϕ0i= [c0
0, c0
1, . . . , c0
j, . . . , c0
n1]T,
then
|ϕi+|ϕ0i= [c0+c0
0, c1+c0
1, . . . , cj+c0
j, . . . , cn1+c0
n1]T.
Also, if there is a complex number cC, we can multiply a ket by this c:
c|ϕi= [c×c0, c ×c1, . . . , c ×cj, . . . ,c ×cn1]T
These operation satisfy all the properties of being a complex vector space. So the
states of an ndimensional quantum system are represented by the complex vector
space Cn.
Let us add a superposition to itself.
|ϕi+|ϕi= 2|ϕi= [c0+c0, c1+c1, . . . , cj+cj, . . . , cn1+cn1]T
= [2c0,2c1,...,2cj,...,2cn1]T.
The sum of the modulus squared is
S0=|2c0|2+|2c1|2+. . .+|2cn1|2= 22|c0|2+22|c1|2+. . .+22|cn1|2= 22(|c0|2+|c1|2+. . .+|cn1|2).
The chances of a particle being found in position jis
|2cj|2
S0=22|cj|2
22(|c0|2+|c1|2+. . . +|cn1|2)=|cj|2
|c0|2+|c1|2+. . . +|cn1|2.
In other words, the ket 2|ϕidescribes the same physical system as |ϕi.This makes
sense, after all when we add two of the same superpositions, we do not expect any
interference. We expect that they should reinforce each other. A similar analysis
shows that for an arbitrary cCwe have that the ket |ϕiand the ket c|ϕi
describe the same physical state. Geometrically, we can say that the vector |ϕi
and the extension c|ϕidescribe the same physical state. So the only thing that is
important is the direction of |ϕinot the length of |ϕi. We might as well work with
a “normalized” |ϕi, i.e.,
|ϕi
||ϕi|
which has length 1. In fact, in section 1, we only worked with normalized vectors.
Given an ndimensional quantum system represented by Cnand an mdimen-
sional quantum system represented byCm, we can combine these two systems to
20 NOSON S. YANOFSKY
form one system. This one system is to represented by the tensor product of the
two vector spaces:
CnCm
=Cn×m.
If |ϕiis in the first system and |ϕ0iis in the second system, then we represent the
combined system as
|ϕi⊗|ϕ0i=|ϕ, ϕ0i=|ϕϕ0i.
It is important to realize that, in general, there are more elements in the tensor
product of the two systems than in the union of each of the two systems. States in
CnCmthat cannot be represented simply as an element in Cnand an element in
Cmare said to be “entangled”.
2.2. Dynamics. Quantum systems are not static. The states of the system are
constantly changing. Changes, or “operators”, on an ndimensional quantum sys-
tem are represented by nby nunitary matrices. Given a state |ϕithat represents
a system at time t, then the system will be in state U|ϕiat time t+ 1.
What does unitary really mean? If U|ϕi=|ϕ0ithen we can easily form Uand
multiply both sides of the equation by Uto get UU|ϕi=U|ϕ0ior |ϕi=U|ϕ0i.
In other words, because Uis unitary, there is a related matrix that can “undo” the
action that Udoes. Utakes the result of U’s action and gets the original vector
back. In the quantum world, most actions actions are “undoable” or “reversible”
in such a manner.
If Uoperates on Cnand U0operates on Cm, then UU0will operate on CnCm
in the following way:
(UU0)(|ϕi⊗|ϕ0i) = U|ϕi U0|ϕ0i.
2.3. Observables. There are other types of operations that one can do to a n
dimensional quantum system: one can observe, or “measure”, the system. When
we measure a system, it is no longer in a superposition. The superposition is said
to “collapse” to a pure state.
|ϕi= [c0, c1, . . . , cj, . . . , cn1]T |ϕ0i= [0,0,...,1,...,0].T
The question is which of the npure states will the state collapse to? The answer
is that it is random. Let Sbe the sum of all the squares of the modulus, i.e.,
S=|c0|2+|c1|2+· ·· +|cj|2+· ·· +|cn1|2.
There is a |c0|2/S of a chance of the superposition collapsing to the 0th pure state.
There is a |c1|2/S of a chance of the superposition collapsing to the 1th pure state.
etc. There is no known mathematical way to decide which pure state the system
will, in-fact, collapse to.
An observable, or “measurement” on an ndimensional system is represented
by an nby nhermitian matrix. We remind the reader that a nby nmatrix
Ais hermitian, or “self-adjoint” if A=A. In other words, A[j, k] = A[k, j ].
Equivalently Ais hermitian if and only if AT=A. For example, the matrix
5 4 + 5i616i
45i13 7
6 + 16i72.1
is hermitian.
AN INTRODUCTION TO QUANTUM COMPUTING 21
For a matrix Ain Cn×n, if there is a number cin Cand a vector |ψiin Cnsuch
that
A|ψi=c|ψi
then cis called an “eigenvalue” of Aand |ψiis called an “eigenvector” of Aassoci-
ated to c. The eigenvalues of a hermitian matrix are all real numbers. Furthermore,
distinct eigenvectors which have distinct eigenvalues of any hermitian matrix are
orthogonal. The hermitian matrices that represent observables for an ndimen-
sional system have the further property that there are ndistinct eigenvalues and n
distinct eigenvectors. That means that the set of eigenvectors form a basis for the
entire complex vector space that represents the quantum system we are interested
in. Hence if we have an observable Aand |ϕian eigenvalue of Athen A|ϕi=c|ϕi
for some cC.c|ϕirepresents the same state as |ϕias we said before. So if the
system is in an eigenvector of the basis, then the system will not change.
3. Architecture
In this section we are going to show how the ideas of quantum mechanics are
going to influence our construction of quantum computers. In this paper we do not
dwell on actual hardware implementations. Rather we shall look at the quantum
generalizations of bits and logical gates. In section 3.1 we go from bits to qubits.
We also discuss the notation that is needed for this. In section 3.2 we show how
to look at classical computing as matrix manipulations. From the view afforded by
this perspective, we easily generalize the notion of logical gate to quantum gate.
There are many quantum gates, but we shall only look at a few that will be needed
in the next section.
3.1. Bits and Qubits. What is a bit? A bit is an atom of information that
represents one of two disjoint situations. An example of a bit is electricity going
through a circuit or electricity not going through a circuit; a switch turned on or a
switch turned off; a way of saying true or false. All these examples are saying the
same thing: a bit is a way of describing a system whose set of states is of size two.
A bit can be represented by two 2 by 1 matrices. We shall represent 0—or better
the state |0ias
|0i=
0 1
1 0
We shall represent a 1, or state |1ias:
|1i=
0 0
1 1
Since these are two different representations, we have an honest-to-goodness bit.
A bit is either in state |0ior in state |1i. That was sufficient for the classical
world. But that is not sufficient for the quantum world. In that world we have
situations where we are in one state and in the other state simultaneously. In the
quantum world we have systems where a switch is in a superposition of states on
and off. So we define a “quantum bit” or a “qubit” as a way of describing a
22 NOSON S. YANOFSKY
quantum system of dimension two. We shall represent any such qubit as a two by
one matrix with complex numbers:
0c0
1c1
where |c0|2+|c1|2= 1. Notice that a classical bit is a special type of qubit. |c0|2is
to be interpreted as the probability that after measuring the qubit, it will be found
in state |0i.|c1|2is to be interpreted as the probability that after measuring the
qubit it will be found in state |1i. Whenever we measure a qubit, it automatically
becomes a bit. So we shall never “see” a general qubit. Nevertheless, they do exist
and they are the core of our tale. The power of quantum computers is due to the
fact that a system can be in many states at the same time.
Following the normalization procedure that we learned in the last section, any
element of C2can be converted into a qubit. For example, the vector
V=
5+3i
6i
has norm
|V|=phV, V i=v
u
u
u
t[5 3i, 6i]
5+3i
6i
=34 + 36 = 70.
So Vdescribes the same physical state as the qubit
V
70 =
5+3i
70
6i
70
.
After measuring the qubit V
70, the probability of being in state |0iis 34
70, and the
probability of being in state |1iis 36
70.
It is easy to see that the bits |0iand |1iare the canonical basis of C2. So any
qubit can be written as
c0
c1
=c0·
1
0
+c1·
0
1
=c0|0i+c1|1i.
Let us look at several ways of writing different qubits. 1
2
1
1
can be written
as
1
2
1
2
=1
2|0i+1
2|1i=|0i+|1i
2.
AN INTRODUCTION TO QUANTUM COMPUTING 23
Similarly 1
2
1
1
can be written as
1
2
1
2
=1
2|0i 1
2|1i=|0i−|1i
2.
It is important to realize that
|0i+|1i
2=|1i+|0i
2.
These are both ways of writing
1
2
1
2
. In contrast,
|0i−|1i
26=|1i−|0i
2
The first state is
1
2
1
2
and the second one is
1
2
1
2
. However the two
states are related: |0i−|1i
2= (1)|1i−|0i
2.
How are qubits to be implemented? While this is not our focus, some examples
of qubit implementations are given:
An electron might be in one of two different orbits around a nucleus of an
atom. (Ground state and excited state.)
A photon might be in one of two different polarized states.
A subatomic particle might be in spinning in one of two different directions.
There will be enough quantum indeterminacy and quantum superposition effects
within all these systems to represent a qubit.
Computers with only one bit of storage are not very interesting. Similarly, we
will need quantum devices with more then one qubit. Consider a byte, or eight
bits. A typical byte might look like
01101011.
We might also write it as
1
0
,
0
1
,
0
1
,
1
0
,
0
1
,
1
0
,
0
1
,
0
1
.
Previously, we learned that in order to combine systems one should use the tensor
product. We can describe the above byte as
|0i⊗|1i⊗|1i⊗|0i⊗|1i⊗|0i⊗|1i⊗|1i.
24 NOSON S. YANOFSKY
As a qubit, this is an element of
C2C2C2C2C2C2C2C2.
This vector space can be written as (C2)8. This is a complex vector space of
dimension 28= 256. Since there is only one complex vector space (up to isomor-
phism) of this dimension, this space is isomorphic to C256.
Our byte can be described as in yet another way: As a 28= 256 row vector
00000000 0
00000001 0
.
.
..
.
.
01101010 0
01101011 1
01101100 0
.
.
..
.
.
11111110 0
11111111 0
.
This is fine for the classical world. However, for the quantum world, a general
qubit can be written as
00000000 c0
00000001 c1
.
.
..
.
.
01101010 c106
01101011 c107
01101100 c108
.
.
..
.
.
11111110 c254
11111111 c255
where P255
i=0 |ci|2= 1.
In the classical world, you need to write the state of each of the eight bits. This
amounts to writing eight bits. In the quantum world, a state of eight qubits is
given by writing 256 complex numbers. This exponential growth was one of the
reasons why researchers started thinking about quantum computing. If you wanted
to emulate a quantum computer with a 64 qubit register, you would need to store
264 = 18,446,744,073,709,551,616 complex numbers. This is beyond our current
ability.
AN INTRODUCTION TO QUANTUM COMPUTING 25
Let us practice writing two qubits in ket notation. The qubits
00 0
01 1
10 0
11 0
can be written as
|0i⊗|1i.
Since the tensor product is understood, we might also write these qubits as |0,1i
or |01i. The qubit corresponding to
1
3
1
0
1
1
can be written as
1
3|00i 1
3|10i+1
3|11i=|00i−|10i+|11i
3.
The tensor product of two states is not commutative.
|0i⊗|1i=|0,1i=|01i 6=|10i=|1,0i=|1i⊗|0i.
The first ket says that the first qubit is in state 0 and the second qubit is in state
1. The second ket says that first qubit is in state 1 and the second state is in state
0.
3.2. Classical Gates. Classical logical gates are ways of manipulating bits. Bits
go into logical gates and bits come out. We represent ninput bits as a 2nby 1
matrix and moutput bits as a 2mby 1 matrix. How should we represent our logical
gates? A 2mby 2nmatrix takes a 2nby 1 matrix and outputs a 2mby 1 matrix.
In symbols:
(2m×2n)(2n×1) = (2m×1).
So bits will be represented by column vectors and logic gates will be represented
by matrices.
Let us do a simple example. Consider the NOT gate. NOT takes as input one
bit, or a 2 by 1 matrix, and outputs one bit, or a 2 by 1 matrix. NOT of |0iequals
|1iand NOT of |1iequals |0i. The matrix
NOT =
0 1
1 0
.
This matrix satisfies
0 1
1 0
1
0
=
0
1
0 1
1 0
0
1
=
1
0
,
which is exactly what we want.
26 NOSON S. YANOFSKY
What about the other gates? The other gates will be given by the following
matrices:
AND N AN D OR NOR
1110
0001
0001
1110
1000
0111
0111
1000
When we perform a computation, often we have to carry out one operation
followed by another.
A B
We shall call this performing “sequential” operations. If matrix Acorresponds
to performing an operation and matrix Bcorresponds to performing another opera-
tion, then the multiplication matrix B ? A corresponds to performing the operation
sequentially.
Besides sequential operations, there are “parallel” operations:
A
B
Here we are doing Ato some bits and Bto other bits. This will be represented by
AB, the tensor product of two matrices.
Combination of sequential and parallel operations gates/matrices will be circuits.
A starting point is the realization that the circuit
A B
A0B0
AN INTRODUCTION TO QUANTUM COMPUTING 27
can be realized as
(B ? A)(B0? A0)=(BB0)?(AA0).
We will of course have some really complicated matrices, but they will all be de-
composable into the sequential and parallel composition of simple gates.
3.3. Quantum Gates. A quantum gate is simply any unitary matrix that manip-
ulates qubits. There are some simple gates that are quantum gates.
The “Hadamard matrix”
H=1
2
1 1
11
=
1
2
1
2
1
21
2
.
The Hadamard matrix is also its own inverse. As it turns out, the Hadamard matrix
is one of the most important matrices in quantum computing.
Consider the following “controlled-not” gate.
|xi|xi
|yi |(xy)i
This gate has two inputs and has two outputs. The top input is the control bit.
It controls what the output will be. If |xi=|0i, then the output of |yiwill be the
same as the input. If |xi=|1ithen the output of |yiwill be the opposite. If we
write the top qubit first and then the bottom qubit, then the controlled-not gate
takes |x, yito |x, x yiwhere is the binary exclusive or operation.
The matrix that corresponds to this reversible gate is
00 01 10 11
00 1 0 0 0
01 0 1 0 0
10 0 0 0 1
11 0 0 1 0
.
One last piece of notation: we shall denote an observation (measurement) by the
following “meter”:
FE
28 NOSON S. YANOFSKY
There are many other quantum gates, but we shall not need them for our work
in the next section.
4. Deutsch’s Algorithm
The simplest quantum algorithm is Deutsch’s algorithm which is a nice short
algorithm that solves a slightly contrived problem. This algorithm is concerned
with functions from the set {0,1}to the set {0,1}. There are four such functions
which we might visualize as
0//0 0//0 0
B
B
B
B
B
B
B
B0 0
B
B
B
B
B
B
B
B0
1<
>>
|
|
|
|
|
|
|
|1 1//1 1<
>>
|
|
|
|
|
|
|
|1 1//1
Call a function f:{0,1} {0,1}, “balanced” if f(0) 6=f(1)). In contrast, call
a function “constant” if f(0) = f(1). Of the four functions, two are balanced and
two are constant.
Deutsch’s algorithm solves the following problem: Given a function f:{0,1}
{0,1}as a black-box, where one can evaluate an input, but cannot “look inside”
and “see” how the function is defined, tell if the function is balanced or constant.
With a classical computer, one would have to first evaluate fon an input, then
evaluate fon the second input and then compare the outputs. The point is that
with a classical computer, fmust be evaluated twice. Can we do better?
A quantum computer can be in two states at one time. We shall use this super-
position of states to evaluate both inputs at one time.
In classical computing, evaluating a given function fwould correspond to per-
forming the following operation
xf
f(x)
Such a function could be thought of as a matrix. The function
0//0
1<
>>
|
|
|
|
|
|
|
|1
is equivalent to the matrix
0 1
0 1 1
1 0 0 .
Multiplying either state |0ior state |1ion the right of this matrix would result in
state |0i. The column name is to be thought of as the input and the row name is
to be thought of as the output.
AN INTRODUCTION TO QUANTUM COMPUTING 29
However, this will not be good for a quantum system. For a quantum system
we need a little something extra. A quantum system must be unitary (reversible).
Given the output, we must be able to find the input. If fis the name of the
function, then the following black-box Ufsystem will be the quantum gate that we
shall employ to evaluate input:
|xi
Uf
|xi
|yi |yf(x)i
The top input, |xi, will be the qubit value that one wishes to evaluate and the
bottom input, |yi, controls the output. The top output will be the same as the
input qubit |xiand the bottom output will be the qubit |yf(x)iwhere is XOR,
the exclusive or operation. We are going to write from left to right the top qubit
first and then the bottom. So we say that this function takes the state |x, yito the
state |x, y f(x)i. If y= 0 this simplifies: |x, 0ito |x, 0f(x)i=|x, f(x)i.This
gate is reversible by simply looking at the following system
|xi
Uf
|xi
Uf
|xi
|yi |yf(x)i |yi
State |x, yigoes to |x, y f(x)iwhich further goes to
|x, (yf(x)) f(x)i=|x, y (f(x)f(x))i=|x, y 0i=|x, yi.
In quantum systems, evaluating fis equivalent to multiplying a state of the
input by a unitary matrix Uf. For the function
0
B
B
B
B
B
B
B
B0
1<
>>
|
|
|
|
|
|
|
|1
30 NOSON S. YANOFSKY
the corresponding unitary matrix is
00 01 10 11
00 0 1 0 0
01 1 0 0 0
10 0 0 1 0
11 0 0 0 1
.
Remember that the top column name correspond to the input |x, yiand the
left-hand row name corresponds to the outputs |x, y f(x)i. A 1 in the xy column
and the x0y0row means for input |x, yithe output will be |x0, y0i.
So we are given such a matrix that expresses a function but we cannot “look
inside” the matrix to “see” how it is defined. We are asked to determine if the
function is balanced or constant.
4.1. First Attempt. Let us take a first stab at a quantum algorithm to solve this
problem. Rather than evaluating ftwice, let us try our trick of superposition of
states. Instead of having the top input to be either in state |0ior in state |1i, we
shall put the top input in state
|0i+|1i
2
which is “half-way” |0iand “half-way” |1i. The Hadamard matrix can place a qubit
in such a state.
H|0i=
1
2
1
2
1
21
2
1
0
=
1
2
1
2
=|0i+|1i
2.
The obvious (and not necessarily correct) state to put the bottom input is as state
|0i. And so we have:
|0iH
Uf
FE
|0i
|ϕ0i |ϕ1i |ϕ2i
In terms of matrices this corresponds to
Uf(HI)(|0i⊗|0i).
AN INTRODUCTION TO QUANTUM COMPUTING 31
We shall carefully examine the states of the system at every point. The system
starts in
|ϕ0i= (|0i⊗|0i) = |0,0i.
We then apply the Hadamard matrix only to the top input leaving the bottom
input alone to get
|ϕ1i=|0i+|1i
2|0i=|0,0i+|1,0i
2.
After multiplying with Ufwe have
|ϕ2i=|0, f (0)i+|1, f(1)i
2
For the function 0 7→ 1 and 1 7→ 0 the state |ϕ2iwould be
|ϕ2i=
00 01 10 11
00 0 1 0 0
01 1 0 0 0
10 0 0 1 0
11 0 0 0 1
00 1
2
01 0
10 1
2
11 0
=
00 0
01 1
2
10 1
2
11 0
=|0,1i+|1,0i
2
If we measure the top qubit, there will be a 50-50 chance of finding it in state |0i
and a 50-50 chance of finding it in state |1i. Similarly there is no real information
to be gotten by measuring the bottom qubit. So the obvious algorithm does not
work. We need another trick.
4.2. Second Attempt. Let us take another stab at solving our problem. Rather
then leaving the bottom qubit in state |0i, let us put it in the superposition state:
|0i−|1i
2=
1
2
1
2
.
Notice the minus sign. Even though there is a negation, this state is also “half-way”
in state |0iand “half-way” in state |1i. The change of phase will help us get our
desired results. We can get to this superposition of states by multiplying state |1i
with the Hadamard matrix. We shall leave the top qubit as an ambiguous |xi.
32 NOSON S. YANOFSKY
|xi
Uf
FE
|1iH
|ϕ0i |ϕ1i |ϕ2i
In terms of matrices, this becomes:
Uf(IH)|x, 1i.
Let us look carefully at how the states of the qubits change.
|ϕ0i=|x, 1i.
After the Hadamard matrix, we have
|ϕ1i=|xi|0i−|1i
2=|x, 0i−|x, 1i
2.
Applying Ufwe get
|ϕ2i=|xi|0f(x)i−|1f(x)i
2=|xi"|f(x)i−|f(x)i
2#
where f(x) means the opposite of f(x). And so we have
|ϕ2i=
|xi|0i−|1i
2if f(x)=0
|xi|1i−|0i
2if f(x)=1
.
Remembering that ab= (1)(ba) we might write this as
|ϕ2i= (1)f(x)|xi|0i−|1i
2.
What would happen if we evaluate either the top or the bottom state? Again,
this does not really help us. We do not gain any information. The top qubit will
be in state |xiand the bottom qubit will with equal probability be either in
state |0ior in state |1i. We need something more.
4.3. Deutsch’s Algorithm. Now let us combine both of these attempts to actu-
ally give Deutsch’s algorithm. Deutsch’s algorithm works by putting both the top
and bottom qubits into a superposition. We will also put the results of the top
qubit through a Hadamard matrix.
AN INTRODUCTION TO QUANTUM COMPUTING 33
|0iH
Uf
HFE
|1iH
|ϕ0i |ϕ1i |ϕ2i |ϕ3i
In terms of matrices this becomes:
(IH)Uf(HH)|0,1i
At each point of the algorithm the states are as follows.
|ϕ0i=|0,1i.
|ϕ1i=|0i+|1i
2|0i−|1i
2=+|0,0i−|0,1i+|1,0i−|1,1i
2=
00 +1
2
01 1
2
10 +1
2
11 1
2
.
We saw from our last attempt at solving this problem, that when we put the
bottom qubit into a superposition and then multiply by Ufwe will be in a super-
position
(1)f(x)|xi|0i−|1i
2.
Now with |xiin a superposition, we have
|ϕ2i="(1)f(0)|0i+ (1)f(1) |1i
2#|0i−|1i
2.
Let us carefully look at
(1)f(0)|0i+ (1)f(1)|1i.
If fis constant this becomes either
+1(|0i+|1i) or 1(|0i+|1i)
(depending on being constantly 0 or constantly 1.) If fis balanced it becomes
either
+1(|0i−|1i) or 1(|0i−|1i)
34 NOSON S. YANOFSKY
(depending on which way it is balanced.) Summing up, we have that
|ϕ2i=
(±1) |0i+|1i
2|0i−|1i
2if fis constant
(±1) |0i−|1i
2|0i−|1i
2if fis balanced
Remembering that the Hadamard matrix is its own inverse and takes |0i+|1i
2
to |0iand takes |0i−|1i
2to |1i, we apply the Hadamard matrix to the top qubit
to get
|ϕ3i=
(±1)|0i|0i−|1i
2if fis constant
(±1)|1i|0i−|1i
2if fis balanced
Now we simply measure the top qubit. If it is in state |0i, then we know that fis
a constant function, otherwise it is a balanced function. And we did this all with
only one evaluation as opposed to the two evaluations that a classical algorithm
demands.
Notice that although the ±1 tells us even more information, namely which of the
two balanced functions or which of the two constant functions, we are not privy to
this information. Upon measuring, if the function is balanced, we will measure |1i
regardless if the state was (1)|1ior (+1)|1i.
In conclusion, we have solved a problem that a classical computer would require
two function evaluations. Deutsch’s quantum algorithm solved the same problem
with one function evaluation. Other quantum algorithms are built-up with similar
ideas to the ones presented here.
Department of Computer and Information Science,
Brooklyn College, CUNY,
Brooklyn, N.Y. 11210.
and
Computer Science Department,
The Graduate Center, CUNY,
New York, N.Y. 10016.
e-mail: noson@sci.brooklyn.cuny.edu
... By introducing the concept of quantum superposition states, the shortcomings of compartmental models can be addressed effectively. Quantum superposition allows a system to exist simultaneously in multiple states, collapsing into a specific state only upon observation 21,22 . This feature is particularly useful for modeling uncertainties and individual heterogeneity, which are often overlooked in classical models 19 . ...
... In this section, we constructed the Quantum Healthy-Infected Model (QHIM) based on the concept of quantum superposition in quantum mechanics. Quantum superposition is a basic concept in quantum mechanics that describes the phenomenon where a quantum system can exist in multiple different states simultaneously 21 . Unlike the deterministic states in classical physics, the state of a quantum system is described probabilistically and can exist as a superposition of several possible states. ...
Article
Full-text available
Traditional infectious disease models often use fixed compartments to represent different states of individuals. However, these models can be limited in accurately reflecting real-world conditions of individuals. In this study, we integrate quantum mechanics into infectious disease modeling, developing a quantum mechanics-based model that effectively addresses the limitations of traditional compartmental models and introduces a novel approach to understanding disease dynamics. Firstly, we examined the individual infection process and the model’s evolutionary dynamics, deriving both the disease-free equilibrium point and the model's basic reproduction number. Secondly, the proposed model is simulated on a quantum circuit. The simulation results are utilized to analyze the model’s parameter sensitivity and verify its rationality. The results indicate that the model’s predictions align with the general patterns of viral transmission and are capable of replicating the structural attributes of compartmental models. Finally, we apply the model to simulate the spread of COVID-19. The observed similarity between the simulated results and actual infection trends demonstrates the model's effectiveness in accurately capturing viral transmission dynamics. Comparative experiments show that the proposed model significantly improves accuracy over traditional models. By leveraging quantum mechanics, our method offers a fresh perspective in infectious disease modeling, broadening the application of quantum mechanics methodologies in understanding information propagation within the macroscopic world.
... In contrast, a qubit is a two-state quantum system with two basis qubit states, or computational basis states, |0⟩ and |1⟩, existing in a 2-dimensional Hilbert vector space and spanned by orthonormal basis states |0⟩ and |1⟩. All qubits can be expressed as vectors [11]. ...
Thesis
Full-text available
Quantum computing has potential applications in a seemingly never-ending list of fields, including finance, mathematics, drug development, weather prediction, cryptography, and national security, to name a few. Individuals, academics, businesses, and governments continue to invest in and research quantum com- puting developments. Given this growing level of interest, malicious actors may target quantum computers through fault injection attacks to erode user trust in Quantum-as-a-Service providers, gain competitive advantages, or steal sensitive data. In this work, we introduce quantum computing terminology and Noisy Intermediate-Scale Quantum (NISQ) era characteristics to establish an understanding of quantum computing theory and its current state in practice. We then define a threat model to classify attackers at low, medium, and high levels of capability. We simulate fault injection attacks at each level considering a range of entangled quantum circuits, and algorithms such as Grover’s algorithm, the Deutsch-Jozsa algorithm, and the Quantum Fourier Transform. We analyze these results based on the threat model, accounting for the risks and impacts of these attacks. Finally, we propose defense and mitigation strategies to combat fault injection attacks in quantum computers, to protect the confidentiality, integrity, and availability of quantum systems and users in the NISQ era.
... Today, knot theory is very active and flourishing branch of mathematics, having immediate connections not only to other branches of mathematics, such as quantum group representation theory [1,2,3,4] and the theory of quantum computation [5,6,7], but also to theoretical physics, where its functional integral counterpart -the Chern-Simons theory [8] -is currently at the border between known and unknown: the more-or-less completely well-understood 2D conformal field theories [9] and still relatively mysterious real-world 4D quantum field theories [10]. ...
Preprint
We prove that normalized colored Alexander polynomial (the A1A \rightarrow 1 limit of colored HOMFLY-PT polynomial) evaluated for one-hook (L-shape) representation R possesses scaling property: it is equal to the fundamental Alexander polynomial with the substitution qqRq \rightarrow q^{|R|}. The proof is simple and direct use of Reshetikhin-Turaev formalism to get all required R-matrices.
... (5) The H operator, also known as the Hadamard operator, transforms a qubit in the collapsed state ( �0⟩ or �1⟩ ) into a superposition of both states with equal amplitude. The H operator coincides with its adjunct operator [28]. (6) The P operator performs a phase shift dependent on the informed angle . ...
Article
Full-text available
This work presents a novel approach to quantum computing by proposing a customizable hardware design of a dedicated processor that emulates the execution of quantum algorithms. Unlike software-based quantum computation simulators, which run on standard general-purpose computers and suffer from reduced performance, this hardware design, which is based on classical concepts of bits, registers and memories, aims to leverage pure parallelism and pipelined execution for efficient quantum computations via emulation. The architecture includes several key components: memories, computation unit, measurement unit and control unit. The quantum state memory stores the individual and group states of qubits. This memory is crucial for maintaining the quantum information required for quantum operations. Basic operators are stored in dedicated operator memory. Additionally, a scratch memory allows for larger operators to be dynamically built at runtime. The computation unit is responsible for performing complex number multiplications, which form the basis of tensor and matrix products necessary for executing quantum operations. A measurement unit enables quantum state sampling, which is an essential aspect of quantum computation. Furthermore, a control unit is incorporated to ensure the correct operation of the quantum processor’s data path. It utilizes a microprogram to manage and coordinate the functional units. All the functional units communicate with each other through dedicated and shared data buses, depending on the frequency of information exchange. This enables efficient data transfer and coordination among the components. The proposed hardware design has been simulated and proved to be effective in executing quantum operations. By exploiting parallelism and employing a pipelined execution, this architecture overcomes the limitations of software-based simulators, delivering improved performance for emulating quantum algorithms. We use Grover’s search algorithm as a benchmark to evaluate the performance of the proposed hardware design and compare it to software-based simulation and to hardware-based algorithm-dedicated emulation.
... With the advent of quantum computing, the second quantum revolution has been ushered in [1]. Quantum memory [2], quantum information processing [3], etc., are rapidly becoming modernized to improvise the performance of computing in this era. ...
Article
Full-text available
An atom confined in an optical dipole trap is a promising candidate for a qubit. Analyzing the temporal response of such trapped atoms enables us to estimate the speed at which quantum computers operate. The present work models an atom in an optical dipole trap formed using crossed laser beams and further examines the photoionization time delay from such confined atoms. We study noble gas atoms, such as Ne (Z = 10), Ar (Z = 18), Kr (Z = 36), and Xe (Z = 54). The atoms are considered to be confined in an optical dipole trap using X-ray Free Electron Lasers (XFEL). The present work shows that the photoionization time delay of the trapped atoms is different compared with that of the free atoms. This analysis alerts us that while talking about the speed of quantum computing, the temporal response of the atoms in the trapped environment must also be accounted for.
Chapter
The use of quantum-mechanical phenomena to solve problems that traditional computers cannot solve is known as quantum computing. Every day, we reap the benefits of traditional computing. How-ever, there are some issues that classical computers cannot handle, and we lack the processing capability to address them. This calls for the development of quantum computing, which might drive the emergence of breakthroughs in numerous disciplines to tackle previously unsolved challenges. Certain computational problems, such as integer factorization (which forms the basis of RSA encryption), are thought to be solved significantly faster on quantum computers than on classical computers, because quantum computers harness the power of quantum mechanics to deliver massive leaps forward in processing power. The accuracy of the Approximation Ratio after the steps were found to be 89.8%, which was better than some of the existing algorithms.
Chapter
Quantum computing has emerged as a revolutionary field with the potential to revolutionize computation and solve complex problems that are beyond the capabilities of classical computers. This literature review paper presents a comprehensive examination of the tools, libraries, and algorithms developed in the realm of quantum computing. The review aims to provide an extensive analysis of the current state of the field and explore the advancements made in harnessing quantum phenomena for computational purposes. The literature review begins by delving into the fundamental principles of quantum computing, including the concept of qubits, superposition, entanglement, and quantum parallelism. It then navigates through the developments made by companies like D-Wave, IBM and Google in the field of quantum computing and the libraries developed such as Qbsolv, Qiskit, and Cirq, exploring their features, functionalities, and applications. Additionally, an in-depth exploration of prominent quantum algorithms, including Grover's algorithm, Shor's algorithm, Quantum Bayesian networks, and Quantum Support Vector Machines (SVM), is presented alongside their classical counterparts for comparative analysis. By critically evaluating the existing literature, this review aims to identify the strengths, limitations, and potential applications of these tools and algorithms. Additionally, it sheds light on the significance of utilizing quantum computing in celestial object identification, showcasing the comparative analysis between classical and quantum algorithms for improved risk assessment in space exploration.
Book
Quantum Theory is the most revolutionary discovery in physics since Newton. Quantum Theory: A Very Short Introduction gives a lucid, exciting, and accessible account of the surprising and counterintuitive ideas that shape our understanding of the sub-atomic world. It does not disguise the problems of interpretation that still remain unsettled 75 years after the initial discoveries. The main text makes no use of equations, but there is a Mathematical Appendix for those desiring stronger fare. Uncertainty, probabilistic physics, complementarity, the problematic character of measurement, and decoherence are among the many topics discussed.
Article
The book's purpose is to fuse the mathematical machinery of quantum mechanics with the philosophical world view embedded in it so that the mathematics appears to grow organically out of the philosophy. In his classic work, Principles of Quantum Mechanics, P. A. M. Dirac invented a special notation to spotlight the physics within the mathematics. Dirac notation embodies the quantum mechanical way of thinking about nature. Primer is entirely in the language of Dirac notation.
The Principles of Quantum Mechanics (The International Series of Monographs on Physics)
  • P A M Dirac
Basic Quantum Mechanics (McGraw-Hill physical and Quantum Electronics Series)
  • R L White
  • R. L. White
Basic Quantum Mechanics (Oxford Physics Series)
  • J L Martin