The Temple of Quantum Computing

by Riley T. Perry
Version 1.1 - April 29, 2006
Contents
Acknowledgements vii
The Website and Contact Details viii
1 Introduction 1
1.1 What is Quantum Computing? . . . . . . . . . . . . . . . . . . . . 1
1.2 Why Another Quantum Computing Tutorial? . . . . . . . . . . . . 2
1.2.1 The Bible of Quantum Computing . . . . . . . . . . . . . . 2
2 Computer Science 3
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1 Binary Numbers and Formal Languages . . . . . . . . . . 6
2.3.2 Turing Machines in Action . . . . . . . . . . . . . . . . . . 10
2.3.3 The Universal Turing Machine . . . . . . . . . . . . . . . . 11
2.3.4 The Halting Problem . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.1 Common Gates . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4.2 Combinations of Gates . . . . . . . . . . . . . . . . . . . . . 17
2.4.3 Relevant Properties . . . . . . . . . . . . . . . . . . . . . . . 18
2.4.4 Universality . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Computational Resources and Efficiency . . . . . . . . . . . . . . . 18
2.5.1 Quantifying Computational Resources . . . . . . . . . . . 20
2.5.2 Standard Complexity Classes . . . . . . . . . . . . . . . . . 22
2.5.3 The Strong Church-Turing Thesis . . . . . . . . . . . . . . . 23
2.5.4 Quantum Turing Machines . . . . . . . . . . . . . . . . . . 25
2.6 Energy and Computation . . . . . . . . . . . . . . . . . . . . . . . 26
i
ii CONTENTS
2.6.1 Reversibility . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.2 Irreversibility . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.3 Landauer’s Principle . . . . . . . . . . . . . . . . . . . . . . 26
2.6.4 Maxwell’s Demon . . . . . . . . . . . . . . . . . . . . . . . 27
2.6.5 Reversible Computation . . . . . . . . . . . . . . . . . . . . 28
2.6.6 Reversible Gates . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6.7 Reversible Circuits . . . . . . . . . . . . . . . . . . . . . . . 31
2.7 Artificial Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.1 The Chinese Room . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.2 Quantum Computers and Intelligence . . . . . . . . . . . . 33
3 Mathematics for Quantum Computing 35
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Logical Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4 Trigonometry Review . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4.1 Right Angled Triangles . . . . . . . . . . . . . . . . . . . . 37
3.4.2 Converting Between Degrees and Radians . . . . . . . . . 38
3.4.3 Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4.4 Angles in Other Quadrants . . . . . . . . . . . . . . . . . . 38
3.4.5 Visualisations and Identities . . . . . . . . . . . . . . . . . . 39
3.5 Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.6 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.6.1 Polar Coordinates and Complex Conjugates . . . . . . . . 42
3.6.2 Rationalising and Dividing . . . . . . . . . . . . . . . . . . 44
3.6.3 Exponential Form . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.7.1 Matrix Operations . . . . . . . . . . . . . . . . . . . . . . . 47
3.8 Vectors and Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . 51
3.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.8.2 Column Notation . . . . . . . . . . . . . . . . . . . . . . . . 54
3.8.3 The Zero Vector . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.8.4 Properties of Vectors in C
n
. . . . . . . . . . . . . . . . . . . 55
3.8.5 The Dual Vector . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.8.6 Linear Combinations . . . . . . . . . . . . . . . . . . . . . . 56
3.8.7 Linear Independence . . . . . . . . . . . . . . . . . . . . . . 57
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
CONTENTS iii
3.8.8 Spanning Set . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.8.9 Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.8.10 Probability Amplitudes . . . . . . . . . . . . . . . . . . . . 58
3.8.11 The Inner Product . . . . . . . . . . . . . . . . . . . . . . . 59
3.8.12 Orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.8.13 The Unit Vector . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.8.14 Bases for C
n
. . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.8.15 The Gram Schmidt Method . . . . . . . . . . . . . . . . . . 64
3.8.16 Linear Operators . . . . . . . . . . . . . . . . . . . . . . . . 64
3.8.17 Outer Products and Projectors . . . . . . . . . . . . . . . . 65
3.8.18 The Adjoint . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.8.19 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . 70
3.8.20 Trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.8.21 Normal Operators . . . . . . . . . . . . . . . . . . . . . . . 73
3.8.22 Unitary Operators . . . . . . . . . . . . . . . . . . . . . . . 73
3.8.23 Hermitian and Positive Operators . . . . . . . . . . . . . . 76
3.8.24 Diagonalisable Matrix . . . . . . . . . . . . . . . . . . . . . 76
3.8.25 The Commutator and Anti-Commutator . . . . . . . . . . 77
3.8.26 Polar Decomposition . . . . . . . . . . . . . . . . . . . . . . 78
3.8.27 Spectral Decomposition . . . . . . . . . . . . . . . . . . . . 79
3.8.28 Tensor Products . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.9 Fourier Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.9.1 The Fourier Series . . . . . . . . . . . . . . . . . . . . . . . 82
3.9.2 The Discrete Fourier Transform . . . . . . . . . . . . . . . . 85
4 Quantum Mechanics 89
4.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4.1.1 Classical Physics . . . . . . . . . . . . . . . . . . . . . . . . 90
4.1.2 Important Concepts . . . . . . . . . . . . . . . . . . . . . . 91
4.1.3 Statistical Mechanics . . . . . . . . . . . . . . . . . . . . . . 93
4.1.4 Important Experiments . . . . . . . . . . . . . . . . . . . . 94
4.1.5 The Photoelectric Effect . . . . . . . . . . . . . . . . . . . . 96
4.1.6 Bright Line Spectra . . . . . . . . . . . . . . . . . . . . . . . 97
4.1.7 Proto Quantum Mechanics . . . . . . . . . . . . . . . . . . 98
4.1.8 The New Theory of Quantum Mechanics . . . . . . . . . . 103
4.2 Important Principles for Quantum Computing . . . . . . . . . . . 106
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
iv CONTENTS
4.2.1 Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.2.2 Superposition . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.2.3 Dirac Notation . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.2.4 Representing Information . . . . . . . . . . . . . . . . . . . 110
4.2.5 Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
4.2.6 Entanglement . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.2.7 The Four Postulates of Quantum Mechanics . . . . . . . . 112
5 Quantum Computing 113
5.1 Elements of Quantum Computing . . . . . . . . . . . . . . . . . . 113
5.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.1.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.1.3 Bits and Qubits . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.1.4 Entangled States . . . . . . . . . . . . . . . . . . . . . . . . 127
5.1.5 Quantum Circuits . . . . . . . . . . . . . . . . . . . . . . . . 129
5.2 Important Properties of Quantum Circuits . . . . . . . . . . . . . . 142
5.2.1 Common Circuits . . . . . . . . . . . . . . . . . . . . . . . . 142
5.3 The Reality of Building Circuits . . . . . . . . . . . . . . . . . . . . 148
5.3.1 Building a Programmable Quantum Computer . . . . . . . 148
5.4 The Four Postulates of Quantum Mechanics . . . . . . . . . . . . . 149
5.4.1 Postulate One . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.4.2 Postulate Two . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.4.3 Postulate Three . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.4.4 Postulate Four . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6 Information Theory 155
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.3 Shannon’s Communication Model . . . . . . . . . . . . . . . . . . 156
6.3.1 Channel Capacity . . . . . . . . . . . . . . . . . . . . . . . . 157
6.4 Classical Information Sources . . . . . . . . . . . . . . . . . . . . . 158
6.4.1 Independent Information Sources . . . . . . . . . . . . . . 158
6.5 Classical Redundancy and Compression . . . . . . . . . . . . . . . 160
6.5.1 Shannon’s Noiseless Coding Theorem . . . . . . . . . . . . 161
6.5.2 Quantum Information Sources . . . . . . . . . . . . . . . . 163
6.5.3 Pure and Mixed States . . . . . . . . . . . . . . . . . . . . . 163
6.5.4 Schumacher’s Quantum Noiseless Coding Theorem . . . . 164
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
CONTENTS v
6.6 Noise and Error Correction . . . . . . . . . . . . . . . . . . . . . . 171
6.6.1 Quantum Noise . . . . . . . . . . . . . . . . . . . . . . . . . 172
6.6.2 Quantum Error Correction . . . . . . . . . . . . . . . . . . 173
6.7 Bell States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
6.7.1 Same Measurement Direction . . . . . . . . . . . . . . . . . 179
6.7.2 Different Measurement Directions . . . . . . . . . . . . . . 180
6.7.3 Bell’s Inequality . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.8 Cryptology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
6.8.1 Classical Cryptography . . . . . . . . . . . . . . . . . . . . 186
6.8.2 Quantum Cryptography . . . . . . . . . . . . . . . . . . . . 187
6.8.3 Are we Essentially Information? . . . . . . . . . . . . . . . 191
6.9 Alternative Models of Computation . . . . . . . . . . . . . . . . . 191
7 Quantum Algorithms 193
7.0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
7.1 Deutsch’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 194
7.1.1 The Problem Defined . . . . . . . . . . . . . . . . . . . . . . 194
7.1.2 The Classical Solution . . . . . . . . . . . . . . . . . . . . . 194
7.1.3 The Quantum Solution . . . . . . . . . . . . . . . . . . . . . 195
7.1.4 Physical Implementations . . . . . . . . . . . . . . . . . . . 197
7.2 The Deutsch-Josza Algorithm . . . . . . . . . . . . . . . . . . . . . 198
7.2.1 The Problem Defined . . . . . . . . . . . . . . . . . . . . . . 198
7.2.2 The Quantum Solution . . . . . . . . . . . . . . . . . . . . . 199
7.3 Shor’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
7.3.1 The Quantum Fourier Transform . . . . . . . . . . . . . . . 200
7.3.2 Fast Factorisation . . . . . . . . . . . . . . . . . . . . . . . . 205
7.3.3 Order Finding . . . . . . . . . . . . . . . . . . . . . . . . . . 206
7.4 Grover’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.4.1 The Travelling Salesman Problem . . . . . . . . . . . . . . 212
7.4.2 Quantum Searching . . . . . . . . . . . . . . . . . . . . . . 212
8 Using Quantum Mechanical Devices 217
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
8.2 Physical Realisation . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
8.2.1 Implementation Technologies . . . . . . . . . . . . . . . . . 219
8.3 Quantum Computer Languages . . . . . . . . . . . . . . . . . . . . 220
8.4 Encryption Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
vi CONTENTS
A Complexity Classes 223
A.1 Classical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
A.2 Quantum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Bibliography 227
Index 235
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Acknowledgements
I would like to thank the following people:
Brian Lederer, my supervisor, who always provided detailed answers to my
questions. Brian is directly responsible for some parts of this text. He wrote the
section on Bell states, some parts of the chapter on quantum mechanics, and
a substantial amount of the other chapters. Without his help this work would
never have been completed.
Waranyoo Pulsawat, my dear girlfriend. Waranyoo has been a constant source
of support, companionship, and inspiration.
Most of the credit for the corrections and improved content in version 1.1 goes
to Andreas Gunnarsson. Andreas’ attention to detail is astonishing. Simply put,
this version would not have been possible without him. So a big thanks to An-
dreas, to whom this version is dedicated.
A special thanks to Xerxes R˚ anby. Xerxes had some valuable comments about
version 1.0 and found a number of errors. I’ve also had great fun discussing a
variety of different eclectic topics with him via email.
Carlos Gon¸ calves who has kindly offered to translate version 1.1 into Portuguese.
All the members of the QC4Dummies Yahoo group (http://groups.yahoo.
com/group/QC4dummies/) and administrators David Morris and David Rick-
man.
Sean Kaye and Micheal Nielson for mentioning version 1.0 in their blogs.
The people at Slashdot (http://slashdot.org/) and QubitNews (http://
quantum.fis.ucm.es/) for posting version 1.0 for review.
James Hari, and Slashdotters AC, Birdie 1013, and s/nemesis.
Also, thanks to all of the readers. Let the proofreading continue!
The Website and Contact Details
The Temple of Quantum Computing (TOQC) Website is available at:
http://www.toqc.com/ .
You can check the site for any updates, TOQC news, my current contact de-
tails, and a bunch of useful links.
Finally, a shameless plug for the company I work for.
Distributed Development specialises in .Net development, B2B and A2A in-
tegration, and Visual Studio Team System. Visit our site at:
http://www.disdev.com/ .
Chapter 1
Introduction
1.1 What is Quantum Computing?
In quantum computers we exploit quantum effects to compute in ways that are
faster or more efficient than, or even impossible, on conventional computers.
Quantumcomputers use a specific physical implementation to gain a computa-
tional advantage over conventional computers. Properties called superposition
and entanglement may, in some cases, allow an exponential amount of paral-
lelism. Also, special purpose machines like quantum cryptographic devices
use entanglement and other peculiarities like quantum uncertainty.
Quantum computing combines quantum mechanics, information theory, and
aspects of computer science [Nielsen, M. A. & Chuang, I. L. 2000]. The field
is a relatively new one that promises secure data transfer, dramatic computing
speed increases, and may take component miniaturisation to its fundamental
limit.
This text describes some of the introductory aspects of quantum computing.
We’ll examine some basic quantum mechanics, elementary quantum comput-
ing topics like qubits, quantum algorithms, physical realisations of those algo-
rithms, basic concepts from computer science (like complexity theory, Turing
machines, and linear algebra), information theory, and more.
1
2 Why Another Quantum Computing Tutorial?
1.2 Why Another Quantum Computing Tutorial?
Most of the books or papers on quantum computing require (or assume) prior
knowledge of certain areas like linear algebra or physics. The majority of the
literature that is currently available is hard to understand for the average com-
puter enthusiast, or interested layman. This text attempts to teach basic quan-
tum computing from the ground up in an easily readable way. It contains a lot
of the background in math, physics, and computer science that you will need,
although it is assumed that you know a little about computer programming.
At certain places in this document, topics that could make interesting research
topics have been identified. These topics are presented in the following format:
Question The topic is presented in bold-italics.
1.2.1 The Bible of Quantum Computing
Every Temple needs a Bible right? Well there is one book out there that is by far
the most complete book available for quantum computing, Quantum Computa-
tion and QuantumInformation by Michael A. Nielsen and Isaac L. Chuang, which
we’ll abbreviate to QCQI. The main references for this work are QCQI and a
great set of lecture notes, also written by Nielsen. Nielsen’s lecture notes are
currently available at http://www.qinfo.org/people/nielsen/qicss.
html. An honourable mention goes out to Vadim V. Bulitko who has man-
aged to condense a large part of QCQI into 14 pages! His paper, entitled On
Quantum Computing and AI (Notes for a Graduate Class) is available at www.cs.
ualberta.ca/

bulitko/qc/schedule/qcss-notes.pdf.
QCQI may be a little hard to get into at first, particularly for those without
a strong background in math. So the Temple of Quantum Computing is, in
part, a collection of worked examples from various web sites, sets of lecture
notes, journal entries, papers, and books which may aid in understanding of
some of the concepts in QCQI.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 2
Computer Science
2.1 Introduction
The special properties of quantum computers force us to rethink some of the
most fundamental aspects of computer science. In this chapter we’ll see how
quantum effects can give us a new kind of Turing machine, new kinds of cir-
cuits, and new kinds of complexity classes. This is important as it was thought
that these things were not affected by what the computer was built from, but it
turns out that they are.
A distinction has been made between computer science and information the-
ory. Although information theory can be seen as a part of computer science it
is treated separately in this text with its own dedicated chapter. This is because
The quantum aspects of information theory require some of the concepts intro-
duced in the chapters that follow this one.
There’s also a little math and notation used in this chapter which is presented
in the first few sections of chapter 3 and some basic C and javascript code for
which you may need an external reference.
2.2 History
The origins of computer science can at least be traced back to the invention of
algorithms like Euclid’s Algorithm (c. 300 BC) for finding the greatest com-
mon divisor of two numbers. There are also much older sources like early
3
4 History
Figure 2.1: Charles Babbage and Ada Byron.
Babylonian cuneiform tablets (c. 2000 - 1700 BC) that contain clear evidence of
algorithmic processes [Gilleland M. ? 2000]. But up until the 19th century it’s
difficult to separate computer science fromother sciences like mathematics and
engineering. So we might say that computer science began in the 19th century.
In the early to mid 19th century Charles Babbage, 1791 - 1871 (figure 2.1) de-
signed and partially built several programmable computing machines (see fig-
ure 2.4 for the difference engine built in 1822) that had many of the features of
modern computers. One of these machines called the analytical engine had re-
movable programs on punch cards based on those used in the Jacquard loom,
which was invented by Joseph Marie Jacquard (1752 - 1834) in 1804 [Smithso-
nian NMAH1999]. Babbage’s friend, Ada Augusta King, Countess of Lovelace,
1815 - 1852 (figure 2.1) and the daughter of Lord Byron is considered by some
as the first programmer for her writings on the Analytical engine. Sadly, Bab-
bage’s work was largely forgotten until the 1930s and the advent of modern
computer science. Modern computer science can be said to have started in
1936 when logician Alan Turing, 1912 - 1954 (figure 2.2) wrote a paper which
contained the notion of a universal computer.
The first electronic computers were developed in the 1940’s and led Jon Von
Neumann, 1903 - 1957 (figure 2.3) to develop a generic architecture on which
modern computers are loosely based. Von Neumann architecture specifies an
Arithmetic Logic Unit (ALU), control unit, memory, input/output (IO), a bus,
and a computing process. The architecture originated in 1945 in the first draft
of a report on EDVAC [Cabrera, B. J. ? 2000].
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 5
Figure 2.2: Alan Turing and Alonzo Church.
Figure 2.3: Jon Von Neumann.
Computers increased in power and versatility rapidly over the next sixty years,
partly due to the development of the transistor in 1947, integrated circuits
in 1959, and increasingly intuitive user interfaces. Gordon Moore proposed
Moore’s law in 1965, the current version of which states that processor com-
plexity will double every eighteen months with respect to cost (in reality it’s
more like two years) [wikipedia.org 2006]. This law still holds but is starting
to falter, and components are getting smaller. Soon they will be so small, being
made up of a few atoms [Benjamin, S. & Ekert, A. ? 2000] that quantum effects
will become unavoidable, possibly ending Moore’s law.
There are ways in which we can use quantum effects to our advantage in a
classical sense, but by fully utilising those effects we can achieve much more.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
6 Turing Machines
This approach is the basis for quantum computing.
2.3 Turing Machines
In 1928 David Hilbert, 1862 - 1943 (figure 2.5) asked if there was a universal
algorithmic process to decide whether any mathematical proposition was true.
His intuition suggested ”yes”, then, in 1930 he went as far as claiming that
there were no unsolvable problems in mathematics [Natural Theology 2004].
This was promptly refuted by Kurt G¨ odel, 1908 - 1976 (figure 2.5) in 1931 by
way of his incompleteness theorem which can be roughly summed up as follows:
You might be able to prove every conceivable statement about num-
bers within a system by going outside the system in order to come
up with new rules and axioms, but by doing so you’ll only create a
larger systemwith its own unprovable statements. [Jones, J. Wilson,
W. 1995, p. ?]
Then, in 1936 Alan Turing and Alonzo Church, 1903 - 1995 (figure 2.2) indepen-
dently came up with models of computation, aimed at resolving whether or
not mathematics contained problems that were ”uncomputable”. These were
problems for which there were no algorithmic solutions (an algorithm is a pro-
cedure for solving a mathematical problem that is guaranteed to end after a
number of steps). Turing’s model, now called a called a Turing Machine (TM) is
depicted in figure 2.6. It turned out that the models of Turing and Church were
equivalent in power. The thesis that any algorithm capable of being devised
can be run on a Turing machine, as Turing’s model was subsequently called,
was given the names of both these pioneers, the Church-Turing thesis [Nielsen,
M. A. 2002].
2.3.1 Binary Numbers and Formal Languages
Before defining a Turing machine we need to say something about binary num-
bers, since this is usually (although not confined to) the format in which data is
presented to a Turing machine (see the tape is figure 2.6).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Turing Machines 7
Figure 2.4: Babbage’s difference engine.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
8 Turing Machines
Figure 2.5: David Hilbert and Kurt G¨ odel.
Binary Representation
Computers represent numbers in binary form, as a series of zeros and ones,
because this is easy to implement in hardware (compared with other forms,
e.g. decimal). Any information can be converted to and from zeros and ones
and we call this representation a binary representation.
Example Here are some binary numbers and their decimal equivalents:
The binary number, 1110 in decimal is 14.
The decimal 212 when converted to binary becomes 11010100.
The binary numbers (on the left hand side) that represent the decimals
0-4 are as follows:
0 = 0
1 = 1
10 = 2
11 = 3
100 = 4
A binary number has the form b
n−1
. . . b
2
b
1
b
0
where n is the number of binary
digits (or bits, with each digit being a 0 or a 1) and b
0
is the least significant digit.
We can convert the binary string to a decimal number D using the following
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Turing Machines 9
formula:
D = 2
n−1
(b
n−1
) +. . . + 2
2
(b
1
) + 2
1
(b
1
) + 2
0
(b
0
). (2.1)
Here is another example:
Example Converting the binary number 11010100 to decimal:
D = 2
7
(1) + 2
6
(1) + 2
5
(0) + 2
4
(1) + 2
3
(0) + 2
2
(1) + 2
1
(0) + 2
0
(0)
= 128 + 64 + 16 + 4
= 212
We call the binary numbers a base 2 number system because it is based on
just two symbols 0 and 1. By contrast, in decimal which is base 10, we have
0, 1, 2, 3, . . . , 9.
All data in modern computers is stored in binary format; even machine instruc-
tions are in binary format. This allows both data and instructions to be stored
in computer memory and it allows all of the fundamental logical operations of
the machine to be represented as binary operations.
Formal Languages
Turing machines and other computer science models of computation use formal
languages to represent their inputs and outputs. We say a language L has an al-
phabet

. The language is a subset of the set


of all finite strings of symbols
from

.
Example If

= ¦0, 1¦ then the set of all even binary numbers
¦0, 10, 100, 110, ...¦ is a langauge over

.
It turns out that the ”power” of a computational model (or automaton) i.e. the
class of algorithm that the model can implement, can be determined by consid-
ering a related question:
What type of ”language” can the automaton recognise?
A formal language in this setting is just a set of binary strings. In simple lan-
guages the strings all follow an obvious pattern, e.g. with the language:
¦01, 001, 0001, . . .¦
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
10 Turing Machines
Figure 2.6: A Turing machine.
the pattern is that we have one or more zeroes followed by a 1. If an automa-
ton, when presented with any string from the language can read each symbol
and then halt after the last symbol we say it recognises the language (provid-
ing it doesn’t do this for strings not in the language). Then the power of the
automaton is gauged by the complexity of the patterns for the languages it can
recognise.
2.3.2 Turing Machines in Action
A Turing machine (which we’ll sometimes abbreviate to TM) has the following
components [Copeland, J. 2000]:
1. A tape - made up of cells containing 0, 1, or blank. Note that this gives us a
alphabet of

= ¦0, 1, blank¦.
2. A read/write head - reads, or overwrites the current symbol on each step and
moves one square to the left or right.
3. A controller - controls the elements of the machine to do the following:
1. read the current symbol
2. write a symbol by overwriting what’s already there
4. move the tape left or right one square
5. change state
6. halt.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Turing Machines 11
4. The controller’s behaviour - the way the TM switches states depending on the
symbol it’s reading, represented by a finite state automata (FSA).
The operation of a TM is best described by a simple example:
Example Inversion inverts each input bit, for example:
001 → 110
The behaviour of the machine can be represented by a two state FSA. The
FSA is represented below in table form (where the states are labelled 1 and
2: 1 for the start state, and 2 for the halt state).
State Value New State New Value Direction
1 0 1 1 Move Right
1 1 1 0 Move Right
1 blank 2 - HALT blank Move Right
2 - HALT N/A N/A N/A N/A
2.3.3 The Universal Turing Machine
A Universal Turning Machine (UTM) is a TM (with an in built mechanism de-
scribed by a FSA) that is capable of reading, from a tape, a program describing
the behaviour of another TM. The UTM simulates the ordinary TM performing
the behaviour generated when the ordinary TM acts upon its data. When the
UTM halts its tape contains the result that would have been produced by the
ordinary TM (the one that describes the workings of the UTM).
The great thing about the UTM is that it shows that all algorithms (Turing ma-
chines) can be reduced to a single algorithm. As stated above, Church, G¨ odel,
and a number of other great thinkers did find alternative ways to represent al-
gorithms, but it was only Turing who found a way of reducing all algorithms
to a single one. This reduction in algorithms is a bit like what we have in infor-
mation theory where all messages can be reduced to zeroes and ones.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
12 Turing Machines
2.3.4 The Halting Problem
This is a famous problem in computer science. Having discovered the simple,
but powerful model of computation (essentially the stored program computer)
Turing then looked at its limitations by devising a problem that it could not
solve.
The UTM can run any algorithm. What, asked Turing, if we have another UTM
that, rather than running a given algorithm, looks to see whether that algorithm
acting on it’s data, will actually halt (in a finite number of steps rather than
looping forever or crashing). Turing called this hypothetical new TM called H
(for halting machine). Like a UTM, Hcan receive a description of the algorithm
in question (its program) and the algorithm’s data. Then H works on this in-
formation and produces a result. When given a number, say 1 or 0 it decides
whether or not the given algorithm would then halt. Is such a machine possi-
ble (so asked Turing)? The answer he found was ”no” (look below). The very
concept of H involves a contradiction! He demonstrated this by taking, as the
algorithm description (program) and data that H should work on, a variant of
H itself!! The clue to this ingenious way of thinking came from the liar’s para-
dox - the question of whether or not the sentence:
This sentence is false.
can be assigned a truth value. Just as a ”universal truth machine” fails in as-
signing this funny sentence a truth value (try it), so to does H fail to assign a
halting number 1 or 0 to the variant (the design of the latter involving the same
ingredients, self-reference and negation - that made the sentence problematic).
This proof by contradiction only applies to Turing machines, and machines
that are computationally equivalent. It still remains unproven that the halting
problem cannot be solved in all computational models.
The next section contains a detailed explanation of the halting problem by
means of an example. This can be skipped it you’ve had enough of Turing
machines for now.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Turing Machines 13
The Halting Problem - Proof by Contradiction
The halting problem in Javascript [Marshall, J. 2001].
The proof is by contradiction, say we could have a program that could de-
termine whether or not another program will halt.
function Halt(program, data) {
if ( ...Code to check if program can halt... ) {
return true;
} else {
return false;
}
}
Given two programs, one that halts and one that does not:
function Halter(input) {
alert(’finished’);
}
function Looper(input) {
while (1==1) {;}
}
In our example Halt() would return the following:
Halt("function Halter(1){alert(’finished’);}", 1)
\\ returns true
Halt("function Looper(1)while (1==1) {;}}", 1)
\\ returns false
So it would be possible given these special cases, but is it possible for all al-
gorithms to be covered in the ...Code to check if program can halt...
section? No - here is the proof, given a new program:
function Contradiction(program) {
if (Halt(program, program) == true) {
while (1 == 1) {;}
} else {
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
14 Circuits
alert(’finished’);
}
}
If Contradiction() is given an arbitrary program as an input then:
• If Halt() returns true then Contradiction() goes into an infinite loop.
• If Halt() returns false then Contradiction() halts.
If Contradiction() is given itself as input then:
• Contradiction() loops infinitely if Contradiction() halts (given itself
as input).
• Contradiction() halts if Contradiction() goes into an infinite loop
(given itself as input).
Contradiction() here does not loop or halt, we can’t decide algorithmically
what the behaviour of Contradiction() will be.
2.4 Circuits
Although modern computers are no more powerful than TM’s (in terms of the
languages they can recognise) they are a lot more efficient (for more on effi-
ciency see section 2.5). However, what a modern or conventional computer
gives in efficiency it loses in transparency (compared with a TM). It is for this
reason that a TM is still of value in theoretical discussions, e.g. in comparing
the ”hardness” of various classes of problems.
We won’t go fully into the architecture of a conventional computer. However
some of the concepts needed for quantum computing are related, e.g. circuits,
registers, and gates. For this reason we’ll examine conventional (classical) cir-
cuits.
Classical circuits are made up of the following:
1. Gates - which perform logical operations on inputs. Given input(s) with
values of 0 or 1 they produce an output of 0 or 1 (see below). These oper-
ations can be represented by truth tables which specify all of the different
combinations of the outputs with respect to the inputs.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Circuits 15
2. Wires - carry signals between gates and registers.
3. Registers - made up of cells containing 0 or 1, i.e. bits.
2.4.1 Common Gates
The commonly used gates are listed below with their respective truth tables.
NOT inverts the input.
NOT
a x
0 1
1 0
OR returns a 1 if either of the inputs is 1.
OR
a b x
0 0 0
1 0 1
0 1 1
1 1 1
AND only returns a 1 if both of the inputs are 1.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
16 Circuits
AND
a b x
0 0 0
1 0 0
0 1 0
1 1 1
NOR is an OR and a NOT gate combined.
NOR
a b x
0 0 1
1 0 0
0 1 0
1 1 0
NAND is an AND and a NOT gate combined.
NAND
a b x
0 0 1
1 0 1
0 1 1
1 1 0
XOR returns a 1 if only one of its inputs is 1.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Circuits 17
XOR
a b x
0 0 0
1 0 1
0 1 1
1 1 0
2.4.2 Combinations of Gates
Shown below, a circuit also has a truth table.
The circuit shown above has the following truth table:
a b c f
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
18 Computational Resources and Efficiency
Figure 2.7: FANOUT.
This circuit has an expression associated with it, which is as follows:
f = OR(AND(a, b), AND(NOT(b), c)).
2.4.3 Relevant Properties
These circuits are capable of FANOUT, FANIN, and CROSSOVER (unlike quan-
tum circuits) where FANOUT means that many wires (i.e. many inputs) can be
tied to one output (figure 2.7), FANIN means that many outputs can be tied
together with an OR, and CROSSOVER means that the value of two bits are in-
terchanged.
2.4.4 Universality
Combinations of NAND gates can be used to emulate any other gate (see figure
2.8). For this reason the NAND gate is considered a universal gate. So, this means
that any circuit, no matter how complicated can be expressed as a combination
of NAND gates. The quantum analogue of this is called the CNOT gate.
2.5 Computational Resources and Efficiency
Computational time complexity is a measure of how fast and with how many
resources a computational problem can be solved. In terms of algorithms, we
can compare algorithms that perform the same task and measure whether one
is more efficient than the other. Conversely, if the same algorithm is imple-
mented on different architectures then the time complexities should not differ
by more than a constant, this is called the principle of invariance.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Computational Resources and Efficiency 19
Figure 2.8: The universal NAND gate.
A simple example of differing time complexities is with sorting algorithms,
i.e. algorithms used to sort a list of numbers. The following example uses the
bubble sort and quick sort algorithms. Some code for bubble sort is given be-
low, but the code for quick sort is not given explicitly. We’ll also use the code
for the bubble sort algorithm in an example on page 22.
Bubble sort:
for(i = 1;i < = n - 1;i ++)
for(j = n;j > = i + 1;j --)
{
if (list[j]<list[j - 1])
{
Swap(list[j],list[j - 1]);
}
}
}
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
20 Computational Resources and Efficiency
Example Quick sort vs. bubble sort.
Bubble Sort:
Each item in a list is compared with the item next to it, they are swapped
if required. This process is repeated until all of the numbers are checked
without any swaps.
Quick Sort:
The quick sort has the following four steps:
1. Finish if there are no more elements to be sorted (i.e. 1 or less elements).
2. Select a pivot point.
3. The list is split into two lists - with numbers smaller than the pivot value
in one list and numbers larger than the pivot value in the other list.
4. Repeat steps 1 to 3 for each list generated in step 3.
On average the bubble sort is much slower than the quick sort, regardless of
the architecture it is running on.
2.5.1 Quantifying Computational Resources
Let’s say we’ve gone through an algorithmsystematically and worked out, line
by line (see the end of this section for an example) how fast it is going to run
given a particular variable n which describes the ”size” of the input. E.g. the
number of elements in a list to be sorted. Suppose we can quantify the compu-
tational work involved as function of n, consider the following expression:
3n + 2 log n + 12.
The important part of this function is 3n as it grows more quickly than the other
terms, i.e. n grows faster than log n and the constant. We say that the algorithm
that generated this result has,
O(n)
time complexity (i.e. we ignore the 3). The important parts of the function are
shown here:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Computational Resources and Efficiency 21
0
10
20
30
40
50
0 10 20 30 40 50
3n + 2 log n + 12
3n
2 log n
12
¡¡
So we’ve split the function 3n + 2 log n + 12 into its parts : 3n, 2 log n, and 12.
More formally Big O notation allows us to set an upper bound on the behaviour
of the algorithm. So, at worst this algorithm will take approximately n cycles
to complete (plus a vanishingly small unimportant figure). Note that this is the
worst case, i.e. it gives us no notion of the average complexity of an algorithm.
The class of O(n) contains all functions that are quicker than O(n). for example,
3n ≤ 3n
2
so 3n is bounded by the class O(3n
2
) (∀ positive n).
For a lower bound we use big Ω notation (Big Omega).
Example 2
n
is in Ω(n
2
) as n
2
≤ 2
n
(∀ sufficiently large n).
Finally, big Θ is used to show that a function is asymptotically equivalent in both
lower and upper bounds. formally:
f(n) = Θ(g(n)) ⇐⇒ O(g(n)) = Ω(g(n)). (2.2)
Example 4n
2
−40n + 2 = Θ(n
2
) ,= Θ(n
3
) ,= Θ(n).
As promised, here is a more in-depth example of the average complexity of
an algorithm.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
22 Computational Resources and Efficiency
Example Time Complexity: Quick sort vs. bubble sort [Nielsen, M. A. &
Chuang, I. L. 2000].
Here our n is the number of elements in a list, the number of swap
operations is:
(n −1) + (n −2) +... + 1 =
n(n −1)
2
The most important factor here is n
2
. The average and worst case time
complexities are O(n
2
), so we say it is generally O(n
2
).
If we do the same to the quick sort algorithm, the average time com-
plexity is just O(nlog n). So now we have a precise mathematical notion for
the speed of an algorithm.
2.5.2 Standard Complexity Classes
Computational complexity is the study of how hard a problem is to compute.
Or put another way, what is the least amount of resources required by the best
known algorithm for solving the problem. There are many types of resources
(e.g. time and space); but we are interested in time complexity for now. The
main distinction between hard and easy problems is the rate at which they
grow. If the problem can be solved in polynomial time, that is it is bounded
by a polynomial in n, then it is easy. Hard problems grow faster than any
polynomial in n, for example:
n
2
is polynomial, and easy, whereas,
2
n
is exponential and hard. What we mean by hard is that as we make n large the
time taken to solve the problemgoes up as 2
n
, i.e. exponentially. So we say that
O(2
n
) is hard or intractable.
The complexity classes of most interest to us are P (Polynomial) and NP (Non-
Deterministic Polynomial).
P means that the problem can be solved in polynomial time, NP means that
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Computational Resources and Efficiency 23
it probably can’t, and NP complete means it almost definitely can’t. More for-
mally:
The class P consists of all those decision problems that can be solved
on a deterministic sequential machine in an amount of time that
is polynomial in the size of the input; the class NP consists of all
those decision problems whose positive solutions can be verified in
polynomial time given the right information, or equivalently, whose
solution can be found in polynomial time on a non-deterministic
machine [wikipedia.org 2004].
Where:
• Adecision problemis a function that takes an arbitrary value or values as input
and returns a yes or a no. Most problems can be represented as decision
problems.
• Witnesses are solutions to decision problems that can be checked in polyno-
mial time. For example, checking if 7747 has a factor less than 70 is a
decision problem. 61 is a factor (61 127 = 7747) which is easily checked.
So we have a witness to a yes instance of the problem. Now, if we ask if
7747 has a factor less than 60 there is no easily checkable witnesses for the
no instance [Nielsen, M. A. 2002].
• Non deterministic Turing machines (NTMs) differ from normal deterministic
Turing machines in that at each step of the computation the Turing ma-
chine can ”spawn” copies, or new Turing machines that work in parallel
with the original. It’s a common mistake to call a quantum computer an
NTM, as we shall see later we can only use quantum parallelism indi-
rectly.
• It is not proven that P ,= NP it is just very unlikely as this would mean that
all problems in NP can be solved in polynomial time.
See appendix A.1 for a list of common complexity classes.
2.5.3 The Strong Church-Turing Thesis
Originally, the strong Church-Turing thesis went something like this:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
24 Computational Resources and Efficiency
Any algorithmic process can be simulated with no loss of efficiency
using a Turing machine [Banerjee, S. ? 2004].
We are saying a TM is as powerful as any other model of computation in terms
of the class of problems it can solve; any efficiency gain due to using a particu-
lar model, is at most polynomial.
This was challenged in 1977 by Robert Solovay and Volker Strassen, who intro-
duced truly randomised algorithms, which do give a computational advantage
based on the machine’s architecture [Nielsen, M. A. & Chuang, I. L. 2000]. So,
this led to a revision of the strong Church-Turing thesis, which now relates to a
probabilistic Turing machine (PTM).
A probabilistic Turing machine can be described as:
A deterministic Turing machine having an additional write instruc-
tion where the value of the write is uniformly distributed in the Tur-
ing machine’s alphabet (generally, an equal likelihood of writing a
1 or a 0 on to the tape) [TheFreeDictionary.com 2004].
This means that algorithms given the same inputs can have different run times,
and results if necessary. An example, of an algorithm that can benefit from a
PTMis quicksort. Although on average quicksort runs in O(nlog n) it still has a
worst case running time of O(n
2
) if say the list is already sorted. Randomising
the list before hand ensures the algorithm runs more often in O(nlog n). The
PTMhas its own set of complexity classes, some of which are listed in appendix
A.1.
Can we efficiently simulate any non-probabilistic algorithm on a probabilistic
Turing machine without exponential slowdown? The answer is ”yes” accord-
ing to the new strong Church-Turing thesis:
Any model of computation can be simulated on a probabilistic Tur-
ing machine with at most a polynomial increase in the number of
elementary operations [Bettelli, S. 2000, p.2].
A new challenge came from another quarter when in the early eighties Richard
Feynman, 1918 - 1988 (figure 2.9) suggested that it would be possible to sim-
ulate quantum systems using quantum mechanics - this alluded to a kind of
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Computational Resources and Efficiency 25
Figure 2.9: Richard Feynman.
proto-quantum computer. He then went on to ask if it was possible to simulate
quantum systems on conventional (i.e. classical) Turing machines. It is hard
(time-wise) to simulate quantum systems effectively, in fact it gets exponen-
tially harder the more components you have [Nielsen, M. A. 2002]. Intuitively,
the TM simulation can’t keep up with the evolution of the physical system it-
self: it falls further and further behind, exponentially so. Then, reasoned Feyn-
man, if the simulator was ”built of quantum components” perhaps it wouldn’t
fall behind. So such a ”quantum computer” would seem to be more efficient
than a TM. The strong Church-Turing thesis would seem to have been violated
(as the two models are not polynomially equivalent).
The idea really took shape in 1985 when, based on Feynman’s ideas, David
Deutsch proposed another revision to the strong Church Turing thesis. He pro-
posed a newarchitecture based on quantummechanics, on the assumption that
all physics is derived from quantum mechanics (this is the Deutsch - Church -
Turing principle [Nielsen, M. A. 2002]). He then demonstrated a simple quan-
tumalgorithmwhich seemed to prove the newrevision. More algorithms were
developed that seemed to work better on a quantum Turing machine (see below)
rather than a classical one (notably Shor’s factorisation and Grover’s search
algorithms - see chapter 7).
2.5.4 Quantum Turing Machines
A quantum Turing machine (QTM) is a normal Turing machine with quantum
parallelism. The head and tape of a QTM exist in quantum states, and each
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
26 Energy and Computation
cell of the tape holds a quantum bit (qubit) which can contain what’s called a
superposition of the values 0 and 1. Don’t worry too much about that now as
it’ll be explained in detail later; what’s important is that a QTM can perform
calculations on a number of values simultaneously by using quantum effects.
Unlike classical parallelism which requires a separate processor for each value
operated on in parallel, in quantum parallelism a single processor operates on
all the values simultaneously.
There are a number of complexity classes for QTMs, see appendix A.2 for a
list of some of them and the relationships between them.
Question The architecture itself can change the time complexity of algorithms.
Could there be other revisions? If physics itself is not purely based on quantum
mechanics and combinations of discrete particles have emergent properties for
example, there could be further revisions.
2.6 Energy and Computation
2.6.1 Reversibility
When an isolated quantum system evolves it always does so reversibly. This
implies that if a quantum computer has components, similar to gates, that per-
form logical operations then these components, if behaving according to quan-
tum mechanics, will have to implement all the logical operations reversibly.
2.6.2 Irreversibility
Most classical circuits are not reversible. This means that they lose information
in the process of generating outputs from inputs, i.e. they are not invertible. An
example of this is the NAND gate (figure 2.10). It is not possible in general, to
invert the output. E.g. knowing the output is 1 does not allowone to determine
the input: it could be 00, 10, or 01.
2.6.3 Landauer’s Principle
In 1961, IBM physicist Rolf Landauer, 1927 - 1999 showed that, when infor-
mation is lost in an irreversible circuit that information is dissipated as heat
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Energy and Computation 27
Figure 2.10: An irreversible NAND gate.
[Nielsen, M. A. 2002]. This result was obtained for circuits based on classical
physics.
Theoretically, if we were to build a classical computer with reversible compo-
nents then work could be done with no heat loss, and no use of energy! Prac-
tically though we still need to waste some energy for correcting any physical
errors that occur during the computation. A good example of the link between
reversibility and information is Maxwell’s demon, which is described next.
2.6.4 Maxwell’s Demon
Maxwell’s demon is a thought experiment comprised of (see figure 2.11) a box
filled with gas separated into two halves by a wall. The wall has a little door
that can be opened and closed by a demon. The second law of thermodynam-
ics (see chapter 4) says that the amount of entropy in a closed system never
decreases. Entropy is the amount of disorder in a system or in this case the
amount of energy. The demon can, in theory, open and close the door in a cer-
tain way to actually decrease the amount of entropy in the system.
Here are a list of steps to understanding the problem:
1. We have a box filled with particles with different velocities (shown by the
arrows).
2. A demon opens and closes a door in the centre of the box that allows parti-
cles to travel through it.
3. The demon only opens the door when fast particles come from the right and
slow ones from the left.
4. The fast particles end up on the left hand side, the slow particles on the
right. The demon makes a temperature difference without doing any
work (which violates the second law of thermodynamics).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
28 Energy and Computation
Figure 2.11: Maxwell’s Demon.
5. Rolf Landauer and R.W. Keyes resolved the paradox when they examined
the thermodynamic costs of information processing. The demon’s mind
gets ”hotter” as his memory stores the results, the operations are reversible
until his memory is cleared.
6. Almost anything can be done in a reversible manner (with no entropy cost).
2.6.5 Reversible Computation
In 1973 Charles Bennett expanded on Landauer’s work and asked whether it
was possible, in general, to do computational tasks without dissipating heat.
The loss of heat is not important to quantum circuits, but because quantum
mechanics is reversible we must build quantumcomputers with reversible gates.
We can simulate any classical gate with reversible gates. For example, a re-
versible NAND gate can be made from a reversible gate called a Toffoli gate.
Reversible gates use control lines which in reversible circuits can be fed from
ancilla bits (which are work bits). Bits in reversible circuits may then go on to
become garbage bits that are only there to ensure reversibility. Control lines en-
sure we have enough bits to recover the inputs from the outputs. The reason
they are called control lines is that they control (as in an if statement) whether
or not a logic operation is applied to the non-control bit(s). E.g. in CNOT below,
the NOT operation is applied to bit b if the control bit is on (=1).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Energy and Computation 29
2.6.6 Reversible Gates
Listed below are some of the common reversible gates and their truth tables.
Note: the reversible gate diagrams, and quantum circuit diagrams were built
with a L
A
T
E
X macro package called Q-Circuit which is available at http://
info.phys.unm.edu/Qcircuit/.
Controlled NOT
Like a NOT gate (on b) but with a control line, a. b

can also be expressed as a
XOR b.
a •
a

b
· ¸¸_¸
b

CNOT
a b a

b

0 0 0 0
0 1 0 1
1 0 1 1
1 1 1 0
Properties of the CNOT gate, CNOT(a, b):
CNOT(x, 0) : b

= a

= a = FANOUT. (2.3)
Toffoli Gate
If the two control lines are set it flips the third bit (i.e. applies NOT). The Toffoli
gate is also called a controlled-controlled NOT.
a •
a

b

b

c
· ¸¸_¸
c

The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
30 Energy and Computation
Toffoli
a b c a

b

c

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 0 1
1 1 0 1 1 1
1 1 1 1 1 0
Properties of the Toffoli Gate, T
F
(a, b, c):
T
F
(a, b, c) = (a, b, c XOR(a AND b)). (2.4)
T
F
(1, 1, x) : c

= NOT x. (2.5)
T
F
(x, y, 1) : c

= x NAND y. (2.6)
T
F
(x, y, 0) : c

= x AND y. (2.7)
T
F
(x, 1, 0) : c

= a = a

= FANOUT. (2.8)
A combination of Toffoli gates can simulate a Fredkin gate.
Fredkin Gate
If the control line is set it flips the second and third bits.
a •
a

b

b

c
c

The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Energy and Computation 31
Figure 2.12: A conventional reversible circuit.
Fredkin
a b c a

b

c

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
Properties of the Fredkin Gate, F
R
(a, b, c):
F
R
(x, 0, y) : b

= x AND y. (2.9)
F
R
(1, x, y) : b

= c and c

= b, which is CROSSOVER. (2.10)
F
R
(x, 1, 0) : c

= a

= c = FANOUT, with b

= NOT x. (2.11)
A combination of Fredkin gates can simulate a Toffoli gate.
2.6.7 Reversible Circuits
Reversible circuits have been implemented in a classical sense, an example of
a reversible circuit built with conventional technology is shown in figure 2.12.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
32 Artificial Intelligence
Quantum computers use reversible circuits to implement quantum algorithms.
Chapters 6 and 7 contain many examples of these algorithms and their associ-
ated circuits.
2.7 Artificial Intelligence
Can an algorithmthink? that’s really what we are asking when we ask if a com-
puter can think, because a modern computer’s architecture is arbitrary. This is
the kind of intelligence that is tested with the Turing test which simply asks if
responses from a hidden source can be determined to be human, or artificial.
Turing said that if one can’t distinguish between the two then the source can
be considered to be intelligent. This is called strong AI, but a more realistic ap-
proach in which the modelling of mental processes is used in the study of real
mental processes is called weak AI.
2.7.1 The Chinese Room
John Searle has a good example of howthe Turing test does not achieve its goal.
Consider a language you don’t understand. In my case, I do not un-
derstand Chinese. To me Chinese writing looks like so many mean-
ingless squiggles. Now suppose I am placed in a room containing
baskets full of Chinese symbols. Suppose also that I am given a rule
book in English for matching Chinese symbols with other Chinese
Symbols. The rules identify the symbols entirely by their shapes and
do not require that I understand any of them. Imagine that people
outside the roomwho understand Chinese hand in small bunches of
symbols and that in response to the rule book and hand back more
small bunches of symbols [Searle, J. R. 1990, p. 20].
This system could pass the Turing test - in programming terms one could al-
most consider a case statement to be intelligent. Clearly, the Turing test has
problems. Intelligence is intimately tied up with the ”stuff” that goes to make
up a brain.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Artificial Intelligence 33
2.7.2 Quantum Computers and Intelligence
The idea that consciousness and quantum mechanics are related is a core part
of the original theory of quantum mechanics [Hameroff, S. ? 2003]. There are
two main explanations of what consciousness is. The Socratic, in which con-
scious thoughts are products of the cerebrum and the Democritan in which con-
sciousness is a fundamental feature of reality accessed by brain. Currently the
modern Socratic view prevails, that is that consciousness is an emergent prop-
erty and proponents of the emergent theory point to many emergent phenom-
ena (Jupiter’s red spot, whirlpools, etc.). Contrasting this, modern Democri-
tans believe consciousness to be irreducible, and fundamental. For example,
Whiteheads (1920) theory of panexperientielism suggests that quantum state re-
ductions (measurements) in a universal proto-conscious field [Arizona.edu 1999]
cause individual conscious events. There are many other theories of conscious-
ness that relate to quantum effects like electron tunnelling, quantum indeter-
minacy, quantum superposition/interference, and more.
Question Given the newquantumarchitecture can quantumcomputers think?
because of their fundamental nature do they give newhope to strong AI? Or are
they just another example of an algorithmic architecture which isn’t made of
the ”right stuff”?
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 3
Mathematics for Quantum
Computing
3.1 Introduction
In conventional computers we have logical operators (gates) such as NOT that
acts on bits. The quantum analogue of this is a matrix operator operating on a
qubit state vector. The math we need to handle this includes:
• Vectors to represent the quantum state.
• Matrices to represent gates acting on the values.
• Complex numbers, because the components of the quantumstate vector are,
in general complex.
• Trig functions for the polar representation of complex numbers and the
fourier series.
• Projectors to handle quantum measurements.
• Probability theory for computing the probability of measurement outcomes.
As well as there being material here that you may not be familiar with (com-
plex vector spaces for example), chances are that you’ll know at least some of
the math. The sections you knowmight be useful for revision, or as a reference.
This is especially true for the sections on polynomials, trigonometry, and logs
which are very succinct.
35
36 Polynomials
So what’s not in here? There’s obviously some elementary math that is not
covered. This includes topics like fractions, percentages, basic algebra, powers,
radicals, summations, limits, factorisation, and simple geometry. If you’re not
comfortable with these topics then you may need to study them before contin-
uing on with this chapter.
3.2 Polynomials
A polynomial is an expression in the form:
c
0
+c
1
x +c
2
x
2
+... +c
n
x
n
(3.1)
where c
0
, c
1
, c
2
, ..., c
n
are constant coefficients with c
n
,= 0.
We say that the above is a polynomial in x of degree n.
Example Different types of polynomials.
3v
2
+ 4v + 7 is a polynomial in v of degree 2, i.e. a quadratic.
4t
3
−5 is a polynomial in t of degree 3, i.e. a cubic.
6x
2
+ 2x
−1
is not a polynomial as it contains a negative power for x.
3.3 Logical Symbols
A number of logical symbols are used in this text to compress formulae; they
are explained below:
∀ means for all.
Example ∀ n > 5, f(n) = 4 means that for all values of n greater than 5 f(n)
will return 4.
∃ means there exists.
Example ∃ n such that f(n) = 4 means there is a value of n that will make
f(n) return 4. Say if f(n) = (n−1)
2
+4, then the n value in question is n = 1.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Trigonometry Review 37
iff means if and only if.
Example f(n) = 4 iff n = 8 means f(n) will return 4 if n = 8 but for no
other values of n.
3.4 Trigonometry Review
3.4.1 Right Angled Triangles
Given the triangle,
&
&
&
&
&
&
&
&
&
&
&
&
b
a
c
θ
A
θ
B
θ
C
we can say the following:
a
2
+b
2
= c
2
, Pythagorean theorem (3.2)
and for the opposite side, adjacent side, and hypotenuse:
sin =
opp
hyp
, cos =
adj
hyp
, tan =
opp
adj
, (3.3)
sin θ
A
=
a
c
, sin θ
B
=
b
c
, (3.4)
tan θ
A
=
a
b
, tan θ
B
=
b
a
, (3.5)
cos θ
A
= sin θ
B
=
b
c
, cos θ
B
= sin θ
A
=
a
c
. (3.6)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
38 Trigonometry Review
3.4.2 Converting Between Degrees and Radians
Angles in trigonometry can be represented in radians and degrees. For con-
verting degrees to radians:
rads =
n

π
180
. (3.7)
For converting radians to degrees we have:
n

=
180 rads
π
. (3.8)
Some common angle conversions are:
360

= 0

= 2π rads.
1

=
π
180
rads.
45

=
π
4
rads.
90

=
π
2
rads.
180

= π rads.
270

=

2
rads.
1 rad = 57

.
3.4.3 Inverses
Here are some inverses for obtaining θ from sin θ, cos θ, and tan θ:
sin
−1
= arcsin = θ from sin θ. (3.9)
cos
−1
= arccos = θ from cos θ. (3.10)
tan
−1
= arctan = θ from tan θ. (3.11)
3.4.4 Angles in Other Quadrants
The angles for right angled triangles are in quadrant 1 (i.e. from 0

to 90

). If
we want to measure larger angles like 247

we must determine which quadrant
the angle is in (here we don’t consider angles larger than 360

). The following
diagram has the rules for doing so:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Trigonometry Review 39
0

≤ θ ≤ 90

90

≤ θ ≤ 180

180

≤ θ ≤ 270

270

≤ θ ≤ 360

(0

)
No change
Make cos and tan negative
Change θ to 180

−θ
Make sin and cos negative
Change θ to θ −180

Make sin and tan negative
Change θ to 360

−θ
Example Using the diagram above we can say that sin(315

) = −sin(45

)
and cos(315

) = cos(45

).
3.4.5 Visualisations and Identities
The functions y = sin(x) and y = cos(x) are shown graphically below, where x
is in radians.
−1.5
−1
−0.5
0
0.5
1
1.5
-10 -5 0 5 10
sin(x)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
40 Logs
−1.5
−1
−0.5
0
0.5
1
1.5
-10 -5 0 5 10
cos(x)
Finally, here are some important identities:
sin
2
θ + cos
2
θ = 1. (3.12)
sin(−θ) = −sin θ. (3.13)
cos(−θ) = cos θ. (3.14)
tan(−θ) = −tan θ. (3.15)
3.5 Logs
The logarithm of a number (say x) to base b is the power of b that gives back the
number, i.e. b
log
b
x
= x. E.g. The log of x = 100 to base b = 10 is the power (2) of
10 that gives back 100, i.e. 10
2
= 100. So log
10
100 = 2.
Put another way, the answer to a logarithm is the power y put to a base b given
an answer x, with:
y = log
b
x (3.16)
and,
x = b
y
(3.17)
where x >= 0, b >= 0, and b ,= 1.
Example log
2
16 = 4 is equivalent to 2
4
= 16.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Complex Numbers 41
E
T
c
' Z
Z
Z
Z

a
b
z
r
θ
3
3
Figure 3.1: Representing z = a+ib in the complex plane with coordinates a = 3
and b = 3.
3.6 Complex Numbers
A complex number, z is a number in the form:
z = a +ib (3.18)
where a, b ∈ R (the real numbers) where i stands for

−1. The complex num-
ber z is said to be in C (the complex numbers). z is called complex because it is
made of two parts, a and b. Sometimes we write z = (a, b) to express this.
Except for the rules regarding i, the operations of addition, subtraction, and
multiplication of complex numbers follow the normal rules of arithmetic. Di-
vision requires using a complex conjugate, which is introduced in the next sec-
tion. With these operations defined via the examples in the box below.
The systemof complex numbers is closed in that, except for division by 0, sums,
products, and ratios of complex numbers give back a complex number: i.e. we
stay within the system. Here are examples of i itself:
i
−3
= i, i
−2
= −1, i
−1
= −i, i =

−1, i
2
= −1, i
3
= −i, i
4
= 1, i
5
= i, i
6
= −1.
So the pattern (−i, 1, i, −1) repeats indefinitely.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
42 Complex Numbers
Example Basic complex numbers.
Addition:
(5 + 2i) + (−4 + 7i) = 1 + 9i
Multiplication:
(5 + 2i)(−4 + 3i) = 5(−4) + 5(3)i + 2(−4)i + (2)(3)i
2
= −20 + 15i −8i −6
= −26 + 7i.
Finding Roots:
(−5i)
2
= 5i
2
= 5
2
i
2
= 25(−1)
= −25.
−25 has roots 5i and −5i.
3.6.1 Polar Coordinates and Complex Conjugates
Complex numbers can be represented in polar form, (r, θ):
(r, θ) = ([z[, θ) = [z[(cos θ +i sin θ) (3.19)
where θ, r ∈ R and [z[ is the norm (also called the modulus) of z:
[z[ =

a
2
+b
2
(3.20)
or,
[z[ =

z

z (3.21)
where z

is the complex conjugate of z:
z

= a −ib. (3.22)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Complex Numbers 43
E
T
c
' Z
Z
Z
Z

`
`
`
`

`
`
`
`
``
Z
Z
Z
Z

−z

z
z

−z
Figure 3.2: z, z

, −z

, and −z.
Polar Coordinates
For polar coordinates (figure 3.1) we can say that θ is the angle between a line
drawn between a point (a, b) of length r on the complex plane and the x axis
with the coordinates being taken for the complex number as x = a and y = b.
The horizontal axis is called the real axis and the vertical axis is called the imag-
inary axis. It’s also helpful to look at the relationships between z, z

, −z

and -z
graphically. These are shown in figure 3.2.
So for converting from polar to cartesian coordinates:
(r, θ) = a +bi (3.23)
where a = r cos θ and b = r sin θ. Conversely, converting cartesian to polar form
is a little more complicated:
a +bi = (r, θ) (3.24)
where r = [z[ =

a
2
+b
2
and θ is the solution to tan θ =
b
a
which lies in the
following quadrant:
1. If a > 0 and b > 0
2. If a < 0 and b > 0
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
44 Complex Numbers
3. If a < 0 and b < 0
4. If a > 0 and b < 0.
Example Convert (3, 40

) to a +bi.
a = r cos θ = 3 cos 40

= 3(0.77)
= 2.3
b = r sin θ = 3 cos 40

= 3(0.64)
= 1.9
z = 2.3 + 1.9i .
Example Convert −1 + 2i to (r, θ). This gives us a = −1 and b = 2.
r =
_
(−1)
2
+ 2
2
=

5
= 2.2
tan θ =
b
a
=
2
−1
= −2 .
Since a < 0 and b > 0 we use quadrant 2 which gives us θ = 116.6

and the
solution is:
−1 + 2i = (2.2, 116.6

) .
3.6.2 Rationalising and Dividing
1
a+bi
is rationalised by multiplying the numerator and denominator by a −bi.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Complex Numbers 45
Example Rationalisation.
1
5 + 2i
=
1
5 + 2i
(5 −2i)
(5 −2i)
=
5
29

2
29
i .
Division of complex numbers is done by rationalising in terms of the denomi-
nator.
Example Division of complex numbers.
3 + 2i
2i
=
3 + 2i
2i
(−2i)
(−2i)
=
−6i −4i
2
−4i
2
=
−6i + 4
4
= 1 −
3
2
i .
3.6.3 Exponential Form
Complex numbers can also be represented in exponential form:
z = re

. (3.25)
The derivation of which is:
z = [z[(cos θ +i sin θ)
= r(cos θ +i sin θ)
= re

.
This is because:
e

= cos θ +i sin θ, (3.26)
e
−iθ
= cos θ −i sin θ. (3.27)
which can be rewritten as:
cos θ =
e

+e
−iθ
2
, (3.28)
sin θ =
e

−e
−iθ
2i
. (3.29)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
46 Complex Numbers
To prove (3.26) we use a power series exponent (which is an infinite polyno-
mial):
e
x
= 1 +x +
x
2
2!
+
x
3
3!
+. . . , (3.30)
e

= 1 +iθ −

2
2!


3
3!
+
θ
4
4!
−. . . (3.31)
= 1 −
θ
2
2!
+
θ
4
4!
+i(θ −

3
3!
+. . .) (3.32)
= cos θ +i sin θ. (3.33)
Example Convert 3 +3i to exponential form. This requires two main steps,
which are:
1. Find the modulus.
r = [z[ =

3
2
+ 3
2
=

18.
2. To find θ, we can use the a and b components of z as opposite and adjacent
sides of a right angled triangle in quadrant one which means need to
apply arctan. So given tan
−1 3
3
=
π
4
then z in exponential form looks
like:

18e
πi/4
.
Example Convert e
πi3/4
to the form: a +bi (also called rectangular form).
e
πi3/4
= e
i(3π/4)
= cos

4
+i sin

4
= cos 135

+i sin 135

=
−1

2
+
i

2
=
−1 +i

2
.
Properties:
z

= re
−iθ
. (3.34)
e
−i2π
= 1. (3.35)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Matrices 47
3.7 Matrices
Matrices will be needed in quantum computing to represent gates, operators,
and vectors. So even if you know this material it’ll be useful to revise as they
are used so often.
A matrix is an array of numbers, the numbers in the matrix are called entries,
for example:
_
¸
_
17 24 1 8
23 5 7 14
4 6 13 20
_
¸
_
.
3.7.1 Matrix Operations
Just as we could define arithmetic operators - addition and multiplication for
complex numbers, we can do the same for matrices.
Given the following 3 matrices:
M
A
=
_
2 1
3 4
_
,
M
B
=
_
2 1
3 5
_
,
M
C
=
_
2 1 0
3 4 0
_
.
Addition
Addition can only be done when the matrices are of the same dimensions (the
same number of columns and rows), e.g:
M
A
+M
B
=
_
4 2
6 9
_
.
Scalar Multiplication
The product of multiplying a scalar (i.e. a number) by a matrix is a new matrix
that is found by multiplying each entry in the given matrix. Given a scalar
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
48 Matrices
α = 2 :
αM
A
=
_
4 2
6 8
_
.
Matrix Multiplication
The product of multiplying matrices M and N with dimensions M = mr and
N = rn is a matrix Owith dimension O = mn. The resulting matrix is found
by O
ij
=

r
k=1
M
i
rN
r
j where i and j denote row and column respectively. The
matrices M and N must also satisfy the condition that the number of columns
in M is the same as the number of rows in N.
M
B
M
C
=
_
(2 2) + (1 3) (2 1) + (1 4) (2 0) + (1 0)
(3 2) + (5 3) (3 1) + (5 4) (3 0) + (5 0)
_
=
_
7 6 0
21 23 0
_
.
Basic Matrix Arithmetic
Suppose M, N, and O are matrices and α and β are scalars:
M +N = N +M. Commutative law for addition (3.36)
M + (N +O) = (M +N) +O. Associative law for addition (3.37)
M(NO) = (MN)O. Associative law for multiplication (3.38)
M(N +O) = MN +MO. Distributive law (3.39)
(N +O)M = NM +OM. Distributive law (3.40)
M(N −O) = MN −MO. (3.41)
(N −O)M = NM −OM. (3.42)
α(N +O) = αN +αO. (3.43)
α(N −O) = αN −αO. (3.44)
(α +β)O = αO +βO. (3.45)
(α −β)O = αO −βO. (3.46)
(αβ)O = α(βO). (3.47)
α(NO) = (αN)O = N(αO). (3.48)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Matrices 49
You may have noticed that there is no commutative law for multiplication. It is
not always the case that MN = NM. This is important in quantum mechanics,
which follows the same non-commutative multiplication law.
Zero Matrix
The special case of a matrix filled with zeroes.
0 =
_
0 0
0 0
_
. (3.49)
Identity Matrix
A matrix multiplied by the identity matrix (corresponding to unity in the ordi-
nary numbers) will not change.
I =
_
1 0
0 1
_
, (3.50)
M
A
I =
_
2 1
3 4
_
.
Inverse Matrix
A number a has an inverse a
−1
where aa
−1
= a
−1
a = 1. Equivalently a matrix
A has an inverse:
A
−1
where AA
−1
= A
−1
A = I. (3.51)
Even with a simple 22 matrix it is not a trivial matter to determine its inverses
(if it has any at all). An example of an inverse is below, for a full explanation of
how to calculate an inverse you’ll need to consult an external reference.
M
−1
A
=
_
4
5
−1
5
−3
5
2
5
_
.
Note A
−1
only exists iff A has full rank (see Determinants and Rank below).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
50 Matrices
Transpose Matrix
A
T
is the transpose of matrix A if:
A
T
ji
= A
ij
. (3.52)
Here’s an example:
M
T
C
=
_
¸
_
2 3
1 4
0 0
_
¸
_
.
For a square matrix like M
A
you get the transpose by reflecting about the diag-
onal (i.e. flipping the values).
Determinants and Rank
Rank is the number of rows (or columns) which are not linear combinations (see
section 3.8.6) of other rows.
In the case of a square matrix A (i.e., m = n), then A is invertible iff A has
rank n (we say that A has full rank). A matrix has full rank when the rank is the
number of rows or columns, whichever is smaller. A non-zero determinant (see
below) determines that the matrix has full rank. So a non-zero determinant im-
plies the matrix has an inverse and vice-versa, if the determinant is 0 the matrix
is singular (i.e. doesn’t have an inverse).
The determinant of a simple 2 2 matrix is defined as:
det
¸
¸
¸
¸
¸
_
a b
c d

¸
¸
¸
¸
= ad −bc. (3.53)
So now for an example of rank, given the matrix below,
M
D
=
_
2 4
3 6
_
.
We can say it has rank 1 because row 2 is a multiple (by
3
2
) of row 1. It’s deter-
minant, 2 6 −3 4 is 0.
Determinants of larger matrices can be found by decomposing theminto smaller
2 2 matrices, for example:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 51
det
¸
¸
¸
¸
¸
¸
¸
_
¸
_
a b c
d e f
g h i
_
¸
_
¸
¸
¸
¸
¸
¸
¸
= a det
¸
¸
¸
¸
¸
_
e f
h i

¸
¸
¸
¸
−b det
¸
¸
¸
¸
¸
_
d f
g i

¸
¸
¸
¸
+c det
¸
¸
¸
¸
¸
_
d e
g h

¸
¸
¸
¸
.
(3.54)
Determinants, like inverses are not trivial to calculate. Again, for a full expla-
nation you’ll need to consult an external reference.
3.8 Vectors and Vector Spaces
3.8.1 Introduction
Vectors are line segments that have both magnitude and direction. Vectors
for quantum computing are in complex vector space C
n
called n dimensional
Hilbert space. But it’s helpful to look at simpler vectors in real space (i.e. ordi-
nary 2D space) first.
Vectors in R
A vector in R (the real numbers) can be represented by a point on the cartesian
plane (x, y) if the tail of the vector starts at the origin (see figure 3.3). The x
and y coordinates that relate to the x and y axes are called the components of the
vector.
The tail does not have to start at the origin and the vector can move anywhere
in the cartesian plane as long as it keeps the same direction and length. When
vectors do not start at the origin they are made up of two points, the initial point
and the terminal point. For simplicity’s sake our vectors in R all have an initial
point at the origin and our coordinates just refer to the terminal point.
The collection of all the vectors corresponding to all the different points in the
plane make up the space (R
2
). We can make a vector 3D by using another axis
(the z axis) and extending into 3 space (R
3
) (see figure 3.7). This can be further
extended to more dimensions using n space (R
n
).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
52 Vectors and Vector Spaces
E
T
c
' Z
Z
Z
Z

`

-
-
-
-
-

(3, 3)
(−1, −1)
(−3, 1)
Figure 3.3: Vectors in R
2
(i.e. ordinary 2D space like a table top).
E
T
¡
¡
¡
¡
¡
¡
¡
Z
Z
Z

/
/
/
/
`
`
`
`
`
`
`
`
x
y
z
u
x
u
y
u
z
u = (u
x
, u
y
, u
z
)
Figure 3.4: A 3D vector with components u
x
, u
y
, u
z
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 53
E
T
c
'
`
`
`
`

`
`
`
`

`
`
`
`


`
`
``
a
b
c
d
e
Figure 3.5: Vector examples.
Example A point in 5 dimensional space is represented by the ordered 5
tuple (4, 7, 8, 17, 20).
We can think of some vectors as having local coordinate systems that are offset
fromthe origin. In computer graphics the distinction is that coordinate systems
are measured in world coordinates and vectors are terminal points that are lo-
cal to that coordinate system (see figure 3.6).
Example Example vectors in R in figure 3.5.
a = b = c,
d ,= e ,= a.
Two Interesting Properties of Vectors in R
3
Vectors in R
3
are represented here by a bolded letter. Let u = (u
x
, u
y
, u
z
) and
v = (v
x
, v
y
, v
z
) (two vectors). An important operation is the dot product (used
below to get the angle between two vectors):
u v = u
x
v
x
+u
y
v
y
+u
z
v
z
. (3.55)
The dot () here means the inner, or dot product. This operation takes two vec-
tors and returns a number (not a vector).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
54 Vectors and Vector Spaces
Knowing the components we can calculate the magnitude (the length of the vec-
tor) using Pythagoras’ theorem as follows:
|u| =
_
u
x
u
x
+u
y
u
y
+u
z
u
z
. (3.56)
Example if u = (1, 1, 1) then |u| =

3.
Example if u = (1, 1, 1) and v = (2, 1, 3) then:
cos θ =
2 + 1 + 3

3

14
=
_
6
7
.
Vectors in C
V = C
n
is a complex vector space with dimension n, this is the set containing all
column vectors with n complex numbers laid out vertically (the above exam-
ples were rowvectors with components laid out horizontally). We also define a
vector subspace as a non empty set of vectors which satisfy the same conditions
as the parent’s vector space.
3.8.2 Column Notation
In C
2
for example, the quantum mechanical notation for a ket can be used to
represent a vector.
[u) =
_
u
1
u
2
_
(3.57)
where u
1
= a
1
+b
1
i and u
2
= a
2
+b
2
i.
[u)
can also be represented in row form:
[u) = (u
1
, u
2
) (3.58)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 55
Example Column Notation.
[0) =
_
1
0
_
and, [1) =
_
0
1
_
.
Example Here’s a more complex example:
[u) = (1 +i)[0) + (2 −3i)[1)
=
_
1 +i
2 −3i
_
.
3.8.3 The Zero Vector
The 0 vector is the vector where all entries are 0.
3.8.4 Properties of Vectors in C
n
Given scalars (α, β) ∈ C and vectors ([u), [v), [w)) ∈ C
n
.
Scalar Multiplication and Addition
Listed here are some basic properties of complex scalar multiplication and ad-
dition.
α[u) =
_
¸
¸
_
αu
1
.
.
.
αu
n
_
¸
¸
_
. (3.59)
α(β[u)) = αβ[u). (3.60)
α([u) +[v)) = α[u) +α[v). Associative law for scalar multiplication (3.61)
(α +β)[u) = α[u) +β[u). Distributive law for scalar addition (3.62)
α([u) +[v)) = α[u) +α[v). (3.63)
Vector Addition
A sum of vectors can be represented by:
[u) +[v) =
_
¸
¸
_
u
1
+v
1
.
.
.
u
n
+v
n
_
¸
¸
_
. (3.64)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
56 Vectors and Vector Spaces
This sum has the following properties:
[u) +[v) = [v) +[u). Commutative (3.65)
([u) +[v)) +[w) = [u) + ([v) +[w)). Associative (3.66)
[u) + 0 = [u). (3.67)
For every [u) ∈ C
n
there is a corresponding unique vector −[u) such that:
[u) + (−[u)) = 0. (3.68)
3.8.5 The Dual Vector
The dual vector ¸u[ corresponding to a ket vector [u) is obtained by transpos-
ing the corresponding column vector and conjugating its components. This is
called, in quantum mechanics, a bra and we have:
¸u[ = [u)

= [u

1
, u

2
, . . . , u

n
]. (3.69)
The dagger symbol, † is called the adjoint and is introduced in section 3.8.18.
Example The dual of [0).
¸0[ = [0)

= [1

, 0

].
Example Given the vector [u) where:
[u) =
_
1 −i
1 +i
_
.
The dual of [u) is:
¸u[ = [(1 −i)

, (1 +i)

]
= [(1 +i), (1 −i)]
3.8.6 Linear Combinations
A vector [u) is a linear combination of vectors [v
1
), [v
2
), . . . , [v
n
) if [u) can be ex-
pressed by:
[u) = α
1
[v
1
) +α
2
[v
2
) +. . . +α
n
[v
n
) (3.70)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 57
where scalars α
1
, α
2
, . . . , α
n
are complex numbers.
We can represent a linear combination as:
[u) =
n

i=1
α
i
[v
i
). (3.71)
3.8.7 Linear Independence
A set of non-zero vectors [υ
1
), ..., [υ
n
) is linearly independent if:
n

i=1
a
i

i
) = 0 iff a
1
= ... = a
n
= 0. (3.72)
Example Linear dependence. The row vectors (bras) [1, −1], [1, 2], and [2, 2]
are linearly dependent because:
[1, −1] + [1, 2] −[2, 1] = [0, 0]
i.e there is a linear combination with a
1
= 1, a
2
= 1, a
3
= −1 (other than the
zero condition above) that evaluates to 0; So they are not linearly indepen-
dent.
3.8.8 Spanning Set
A spanning set is a set of vectors [υ
1
), ..., [υ
n
) for V in terms of which every vec-
tor in V can be written as a linear combination.
Example Vectors u = [1, 0, 0], v = [0, 1, 0], and w = [0, 0, 1] span R
3
because
all vectors [x, y, z] in R
3
can be written as a linear combination of u, v, and w
like the following:
[x, y, z] = xu +yv +zw.
3.8.9 Basis
Abasis is any set of vectors that are a spanning set and are linearly independent.
Most of the time with quantum computing we’ll use a standard basis, called
the computational basis. This is also called an orthonormal basis (see section
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
58 Vectors and Vector Spaces
3.8.14). In C
2
we can use [0) and [1) for the basis. In C
4
we can use [00),[01),[10),
and [11) for a basis (the tensor product is needed to understand this - see section
3.8.28).
3.8.10 Probability Amplitudes
We can write a vector as a combination of basis vectors. In quantum me-
chanics we use a state vector [Ψ). The state vector in C
2
is often written as
[Ψ) = α[0) +β[1).
The scalars (e.g. α and β in α[0) + β[1)) associated with our basis vectors are
called probability amplitudes. Because in quantummechanics they give the prob-
abilities of projecting the state into a basis state, [0) or a [1), when the appropri-
ate measurement is performed (see chapter 4).
To fit with the probability interpretation the square of the absolute values of
the probability amplitudes must sum to 1:
[α[
2
+[β[
2
= 1. (3.73)
Example Determine the probabilities of measuring a [0) or a [1) for
_
1
3
[0) +
_
2
3
[1).
First, check if the probabilities sum to 1.
_
1
3
[0) +
_
2
3
[1) =
¸
¸
¸
¸
¸
_
1
3
¸
¸
¸
¸
¸
2
+
¸
¸
¸
¸
¸
_
2
3
¸
¸
¸
¸
¸
2
=
1
3
+
2
3
= 1.
They do sum to 1 so convert to percentages.
1
3
(100) = 33.
˙
3 and
2
3
(100) = 66.
˙
6 .
So this give us a 33.
˙
3% chance of measuring a [0) and a 66.
˙
6% chance of
measuring a [1).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 59
E
T
c
' .
.
.
.
.
.

Z
Z
Z
Z

θ
Figure 3.6: The dot product.
3.8.11 The Inner Product
We’ve already met the inner (or dot) product in R
2
in section 3.7.1. The inner
product in quantum computing is defined in terms of C
n
, but it’s helpful to
think of what the inner product gives us in R
2
, which is the angle between two
vectors. The dot product in R
2
is shown here (also see figure 3.6):
u v = |u||v| cos θ (3.74)
and rearranging we get:
θ = cos
−1
_
u v
|u||v|
_
. (3.75)
Now we’ll look at the inner product in C
n
, which is defined in terms of a dual.
An inner product in C
n
combines two vectors and produces a complex number.
So given,
[u) =
_
¸
¸
_
α
1
.
.
.
α
n
_
¸
¸
_
and,
[v) =
_
¸
¸
_
β
1
.
.
.
β
n
_
¸
¸
_
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
60 Vectors and Vector Spaces
we can calculate the inner product:


1
, ..., α

n
]
_
¸
¸
_
β
1
.
.
.
β
n
_
¸
¸
_
= ¸u[ [v) (3.76)
= ¸u[v). (3.77)
An inner product can also be represented in the following format:
([u), [v)) = ¸u[v). (3.78)
So for C
2
the following are equivalent:
__
u
1
u
2
_
,
_
v
1
v
2
__
= ([u), [v)) = ¸u[ [v) = ¸u[v) = [u

1
, u

2
]
_
v
1
v
2
_
= u

1
v
1
+u

2
v
2
.
Example Using the inner product notation from above we can extract a
probability amplitude if we use one of the basis vectors as the original vec-
tor’s dual:
¸0[(α[0) +β[1)) = [1

, 0

]
_
α
β
_
= α
or using dot product notation,
¸0[(α[0) +β[1)) =
_
1
0
_

_
α
β
_
= α.
This is called bra-ket notation. Hilbert space is the vector space for complex
inner products.
Properties:
¸u[v) = ¸v[u)

. (3.79)
¸u[αv) = ¸α

u[v) = α¸u[v). (3.80)
¸u[v +w) = ¸u[v) = ¸u[w). (3.81)
∀ [u)[R ÷ ¸u[u) ≥ 0]. (3.82)
If ¸u[u) = 0 then [u) = 0. (3.83)
[¸u[v)[
2
≤ ¸u[u)¸v[v). The Cauchy-Schwartz inequality (3.84)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 61
3.8.12 Orthogonality
Orthogonal vectors can be thought of as being ”perpendicular to each other”;
two vectors are orthogonal iff:
[u) ,= 0, [v) ,= 0, and ¸u[v) = 0. (3.85)
Example The vectors:
[u) =
_
1
0
_
and [v) =
_
0
1
_
are orthogonal because:
[1

, 0

]
_
0
1
_
= 0.
Example The vectors:
[u) =
_
1
1
_
and [v) =
_
1
−1
_
are orthogonal because:
¸u[v) = ((1, 1), (1, −1))
= 1 1 + 1 (−1)
= 0.
Example The vectors:
[u) =
_
1 +i
2 −2i
_
and [v) =
_
−i
1
2
_
are orthogonal because:
[1 −i, 2 + 2i]
_
−i
1
2
_
= 0.
3.8.13 The Unit Vector
A vector’s norm is:
|[u)| =
_
¸u[u) . (3.86)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
62 Vectors and Vector Spaces
A unit vector is a vector where its norm is equal to 1.
|[u)| = 1. (3.87)
If we want to make an arbitrary vector a unit vector, which here is represented
by theˆ(hat) symbol. We must normalise it by dividing by the norm:
[ˆ u) =
[u)
|[u)|
. (3.88)
Example Normalise [u) =
_
1
1
_
(= [0) +[1)).
First we find the norm:
|[u)| =
¸
¸
¸
_
[1

, 1

]
_
1
1
_
=

2 .
Now we normalise |[u)| to get:
[ˆ u) =
_
1
1
_

2
=
1

2
_
1
1
_
=
_
1

2
1

2
_
=
1

2
[0) +
1

2
[1).
3.8.14 Bases for C
n
C
n
has a standard basis (see 3.7.9) which is:
_
¸
¸
¸
¸
_
1
0
. . .
0
_
¸
¸
¸
¸
_
,
_
¸
¸
¸
¸
_
0
1
. . .
0
_
¸
¸
¸
¸
_
, . . . ,
_
¸
¸
¸
¸
_
0
0
. . .
1
_
¸
¸
¸
¸
_
. (3.89)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 63
E
T
¡
¡
¡
¡
¡
¡
¡
E
T
¡
¡
x
y
z
Figure 3.7: A local coordinate system.
This is written as [0), [1), . . . , [n − 1). Any other vector in the same space can
be expanded in terms of [0), [1), ..., [n − 1). The basis is called orthonormal be-
cause the vectors are of unit length and mutually orthogonal. There are other
orthonormal bases in C
n
and, in quantum computing, it is sometimes conve-
nient to switch between bases.
Example Orthonormal bases [0), [1) and
1

2
([0) +[1)),
1

2
([0) −[1)) are often
used for quantum computing.
It’s useful at this point to consider what an orthonormal basis is in R
3
. The
”ortho” part of orthonormal stands for orthogonal, which means the vectors
are perpendicular to each other, for example the 3D axes (x, y, z) are orthog-
onal. The ”normal” part refers to normalised (unit) vectors. We can use an
orthonormal basis in R
3
to separate world coordinates from a local coordinate
system in 3D computer graphics. In this system we define the position of the
local coordinate system in world coordinates and then we can define the po-
sitions of individual objects in terms of the local coordinate system. In this
way we can transform the local coordinates system, together with everything
in it while leaving the world coordinates system intact. In figure 3.7 the local
coordinate system forms an orthonormal basis.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
64 Vectors and Vector Spaces
3.8.15 The Gram Schmidt Method
Suppose [u
1
), . . . , [u
n
) is a basis (any basis will do) for vector space V that has
an inner product. Suppose this basis is not orthonormal.
The Gram Schmidt method can be used to produce an orthonormal basis set
[v
1
), . . . , [v
n
) for V by,
[v
1
) =
[u
1
)
|[u
1
)|
(3.90)
and given [v
k+1
) for 1 ≤ k < n −1:
[v
k+1
) =
[u
k+1
) −

k
i=1
¸v
i
[u
k+1
)[v
i
)
|[u
k+1
) −

k
i=1
¸v
i
[u
k+1
)[v
i
)|
. (3.91)
Example Given the following vectors in C
3
: [u
1
) = (i, i, i), [u
2
) = (0, i, i),
and [u
3
) = (0, 0, i) find an orthonormal basis [v
1
), [v
2
), [v
3
).
[v
1
) =
[u
1
)
|[u
1
)|
=
(i, i, i)

3
=
_
i

3
,
i

3
,
i

3
_
[v
2
) =
[u
2
) −¸v
1
[u
2
)[v
1
)
|[u
2
) −¸v
1
[u
2
)[v
1
)|
=
_

2i

6
,
i

6
,
i

6
_
[v
3
) =
[u
3
) −¸v
1
[u
3
)[v
1
) −¸v
2
[u
3
)[v
2
)
|[u
3
) −¸v
1
[u
3
)[v
1
) −¸v
2
[u
3
)[v
2
)|
=
_
0, −
i
2
,
i
2
_
.
3.8.16 Linear Operators
A linear operator A : V → W where V and W are complex vector spaces is
defined as:
A(α[u) +β[v)) = α(A([u)) +β(A[v))). (3.92)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 65
With dimensions n for V and m for W the linear operator can be represented
by an mn matrix.
Example Given a linear operator A, apply it to
_
1
3
[0) +
_
2
3
[1):
A =
_
0 1
1 0
_
.
A
_
_
1
3
[0) +
_
2
3
[1)
_
=
_
0 1
1 0
__
_
1
3
[0) +
_
2
3
[1)
_
=
_
0 1
1 0
_
_
_
_
1
3
_
2
3
_
_
=
_
_
_
2
3
_
1
3
_
_
=
_
2
3
[0) +
_
1
3
[1).
Properties:
¸u[A[v) is the inner product of ¸u[ and A[v). (3.93)
3.8.17 Outer Products and Projectors
We define an outer product, [u)¸v[ as a linear operator A which does the follow-
ing:
([u)¸v[)([w)) = [u)¸v[w) = ¸v[w)[u). (3.94)
This can be read as,
1. The result of the linear operator [u)¸v[ acting on [w)
or,
2. The result of multiplying [u) by ¸v[w).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
66 Vectors and Vector Spaces
In terms of matrices, [u)¸v[ can be represented by:
_
¸
¸
_
u
1
u
2
.
.
.
_
¸
¸
_
_
v

1
v

2
. . .
_
=
_
¸
¸
¸
¸
_
u
1
v

1
u
1
v

2
. . . u
1
v

n
u
2
v

1
u
2
v

2
. . . u
2
v

n
.
.
.
.
.
.
u
n
v

1
u
n
v

2
. . . u
n
v

n
_
¸
¸
¸
¸
_
. (3.95)
Example Take [Ψ) = α[0) +β[1) for [w) then:
[1)¸1[Ψ) = [1)¸1[(α[0) +β[1))
= [1)β
= β[1),
[0)¸1[Ψ) = [0)¸1[(α[0) +β[1))
= [0)β
= β[0),
[1)¸0[Ψ) = [1)¸0[(α[0) +β[1))
= [1)α
= α[1),
[0)¸0[Ψ) = [0)¸0[(α[0) +β[1))
= [0)α
= α[0).
In the chapters ahead we will use projectors to deal with quantum measure-
ments. Say we have a vector space V = ¦[00), [01), [10), [11)¦. A projector P on
to the subspace V
s
= ¦[00), [01)¦ behaves as follows:
P(α
00
[00) +α
01
[01) +α
10
[10) +α
11
[11)) = α
00
[00) +α
01
[01).
P projects any vector in V onto V
s
(components not in V
s
are discarded). We
can represent projectors with outer product notation. Given a subspace which
is spanned by orthonormal vectors, ¦[u
1
), [u
2
) . . . , [u
n
)¦. A projection on to this
subspace can be represented by a summation of outer products:
P =
n

i=1
[u
i
)¸u
i
[ (3.96)
= [u
1
)¸u
1
[ +[u
2
)¸u
2
[ +. . . +[u
n
)¸u
n
[. (3.97)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 67
So, we can replace the projector notation P with the explicit outer product no-
tation:
([00)¸00[ +[01)¸01[)(α
00
[00) +α
01
[01) +α
10
[10) +α
11
[11)) = α
00
[00) +α
01
[01).
We can also represent a matrix (an operator for example) using outer product
notation, as shown in the next example.
Example Representing operators X and Z. These two matrices are defined
below, but it turns out they are quite handy for quantum computing. We’ll
be using them frequently in the chapters ahead:
[0)¸1[ =
_
1
0
_
_
0

1

_
=
_
0 1
0 0
_
,
[1)¸1[ =
_
0
1
_
_
0

1

_
=
_
0 0
0 1
_
,
[0)¸0[ =
_
1
0
_
_
1

0

_
=
_
1 0
0 0
_
,
[1)¸0[ =
_
0
1
_
_
1

0

_
=
_
0 0
1 0
_
.
X =
_
0 1
1 0
_
= [0)¸1[ +[1)¸0[,
Z =
_
1 0
0 −1
_
= [0)¸0[ −[1)¸1[.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
68 Vectors and Vector Spaces
Properties:

i
[i)¸i[ = I for any orthonormal basis ¦[i)¦. The completeness relation
(3.98)
Given a subspace V
s
= [1) , . . . , [k)
then V = [1) , . . . , [k) [k + 1) , . . . , [d) . (3.99)
Each component [u) ¸u[ of P is hermitian
and P itself is hermitian (see 3.8.23). (3.100)
P

= P. (3.101)
P
2
= P. (3.102)
Q = I −P is called the orthogonal complement
and is a projector onto [k + 1) , . . . , [d) in 3.98. (3.103)
Notice how we have slightly changed the notation here for

. By saying

i
[i)¸i[ we actually mean ”for each element n in the set ¦[i)¦ then add [n)¸n[
to the total”.
Later we’ll look at quantum measurements, and we’ll use Mm to represent
a measurement. If we use a projector (i.e. Mm = P ) for measurement then the
probability of measuring m is:
pr(m) = ¸Ψ[ M

m
M
m
[Ψ) .
By 3.100 and 3.101 we can say that this is equivalent to:
pr(m) = ¸Ψ[ M
m
[Ψ) .
3.8.18 The Adjoint
The adjoint A

is the matrix obtained from A by conjugating all the elements of
A (to get A

) and then forming the transpose:
A

= (A

)
T
. (3.104)
Example An adjoint.
_
1 +i 1 −i
−1 1
_

=
_
1 −i −1
1 +i 1
_
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 69
Properties:
A[u) = ¸u[A

. (3.105)
¸u[Av) = ¸A

u[v). (3.106)
(AB)

= B

A

. (3.107)
(A

)

= A. (3.108)
([u))

= ¸u[. (3.109)
(A[u))

= ¸u[A

but not A[u) = ¸u[A

. (3.110)
(αA +βB)

= α

A



B

. (3.111)
Example Example of ¸u[Av) = ¸A

u[v). Given,
[u) =
_
1
i
_
, [v) =
_
1
1
_
and A =
_
1 +i 1 −i
−1 1
_
.
A[v) =
_
1 +i 1 −i
−1 1
__
1
1
_
=
_
2
0
_
,
¸u[Av) = 2,
A

[u) =
_
1 −i −1
1 +i 1
__
1
i
_
=
_
1 −2i
1 + 2i
_
,
¸A

u[v) =
_
1 + 2i 1 −2i
_
_
1
1
_
= 2.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
70 Vectors and Vector Spaces
3.8.19 Eigenvalues and Eigenvectors
The complex number λ is an eigenvalue of a linear operator A if there exists
vector [u) such that:
A[u) = λ[u) (3.112)
where [u) is called an eigenvector of A.
Eigenvalues of A can be found by using the following equation, called the char-
acteristic equation of A:
c(λ) = det(A −λI) = 0. (3.113)
This comes from noting that:
A[u) = λ[u) ⇔ (A −λI)[u) = 0 ⇔ A −λI is singular ⇔ det(A −λI) = 0.
Solving the characteristic equation gives us the characteristic polynomial of A.
We can then solve the characteristic polynomial to find all the eigenvalues for
A. If A is an n n matrix, there will be n eigenvalues (but some may be the
same as others).
Properties:
A’s i
th
eigenvalue λ
i
has eigenvector [u
i
) iff A[u
i
) = λ
i
[u
i
). (3.114)
An eigenspace for λ
i
is the set of eigenvectors that satisfies
A[u
j
) = λ
i
[u
j
), here j is the index for eigenvectors of λ
i
. (3.115)
An eigenspace is degenerate when it has dimension > 1
i.e. more than one eigenvector. (3.116)
Note: The eigenvectors that match different eigenvalues are linearly indepen-
dent, which means we can have an orthonormal set of eigenvectors for an op-
erator A.
An example is on the next page.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 71
Example Eigenvalues and eigenvectors of X.
X =
_
0 1
1 0
_
.
det(X −λI) =
_
−λ 1
1 −λ
_
= λ
2
−1.
This is the characteristic polynomial. The two solutions to λ
2
− 1 = 0 are
λ = −1 and λ = +1. If we use the eigenvalue of λ = −1 to determine the
corresponding eigenvector [λ
−1
) of X we get:
X[λ
−1
) = −1[λ
−1
)
_
0 1
1 0
__
α
β
_
=
_
−α
−β
_
_
β
α
_
=
_
−α
−β
_
.
We get α = −β, so after normalisation our eigenvector is:

−1
) =
1

2
[0) −
1

2
[1).
Notice that we’ve used the eigenvalue λ = −1 to label the eigenvector [λ
−1
).
3.8.20 Trace
The trace of A is the sum of its eigenvalues, or:
tr(A) =
n

i=1
a
ii
(3.117)
i.e. the sum of its diagonal entries.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
72 Vectors and Vector Spaces
Example Trace of X and I
X =
_
0 1
1 0
_
.
I =
_
1 0
0 1
_
.
tr(X) = 0 + 0 = 0 or the sum of the eigenvalues 1 + (−1) = 0. For I we have
tr(I) = 2.
Properties:
tr(A +B) = tr(A) + tr(B). (3.118)
tr(α(A +B)) = αtr(A) +αtr(B). (3.119)
tr(AB) = tr(BA). (3.120)
tr([u)¸v[) = ¸u[v). (3.121)
tr(αA) = αtr(A). (3.122)
tr(UAU

) = tr(A). Similarity transform for U (3.123)
tr(U

AU) = tr(A). (3.124)
tr(A[u)¸u[) = ¸u[A[u) if [u) is unitary. (3.125)
For unit norm[u):
tr([u)¸u[) = tr([u)¸u[[u)¸u[) (3.126)
= ¸u[[u)¸u[[u) (3.127)
= ¸u[u)¸u[u) (3.128)
= [[u)[
4
(3.129)
= 1. (3.130)
As stated, the trace of A is the sum of its eigenvalues. We can also say that:
U

AU =
_
¸
¸
_
λ
1
.
.
.
λ
n
_
¸
¸
_
.
which also has a trace which is the sum the eigenvalues of A as tr(U

AU) =
tr(A) (see section 3.8.24 below).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 73
Figure 3.8: Relationships between operators.
3.8.21 Normal Operators
A normal operator satisfies the following condition:
AA

= A

A. (3.131)
The class of normal operators has a number of subsets. In the following sections
we’ll look at some of the important normal operators. These include unitary,
hermitian, and positive operators. The relationships between these operators is
shown in figure 3.8.
3.8.22 Unitary Operators
Matrix U is unitary (unitary operators are usually represented by U) if:
U
−1
= U

(3.132)
or,
UU

= U

U = I. (3.133)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
74 Vectors and Vector Spaces
Eigenvectors of unitary matrices have a modulus of 1:
|U[u)| = |[u)| ∀ [u). (3.134)
Unitary operators have the property that they preserve norm, and are invert-
ible. There are some particularly important operators called the Pauli operators.
We’ve seen some of them already, they are referred to by the letters I, X, Y,
and Z. In some texts X, Y, and Z are referred to by another notation, where
σ
1
= σ
X
= X, σ
2
= σ
Y
= Y, and σ
3
= σ
Z
= Z. The Pauli operators are defined
as:
I =
_
1 0
0 1
_
, (3.135)
X =
_
0 1
1 0
_
, (3.136)
Y =
_
0 −i
i 0
_
, (3.137)
Z =
_
1 0
0 −1
_
. (3.138)
Example I, X, Y, and Z are unitary because:
II

= I
2
=
_
1 0
0 1
__
1 0
0 1
_
=
_
1 0
0 1
_
.
XX

= X
2
=
_
0 1
1 0
__
0 1
1 0
_
=
_
1 0
0 1
_
.
Y Y

= Y
2
=
_
0 −i
i 0
__
0 −i
i 0
_
=
_
1 0
0 1
_
.
ZZ

= Z
2
=
_
1 0
0 −1
__
1 0
0 −1
_
=
_
1 0
0 1
_
.
Note: I = I

, X = X

, Y = Y

, and Z = Z

.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 75
Properties (of unitary operators):
U =

j
[j)¸j[. (3.139)
(U[u), U[v)) = ¸u[U

U[v) = ¸u[v). (3.140)
Unitary matrices are also normal. (3.141)
Unitary matrices allow for spectral decomposition,
(see section 3.8.27). (3.142)
Unitary matrices allow for reversal, i.e. U

(U[u)) = I[u) = [u). (3.143)
Unitary matrices preserve inner product
(U[u), U[v)) = ([u), [v)) = ¸u[v). (3.144)
Unitary matrices preserve norm|U[u)| = |u)|. (3.145)
Given an orthonormal basis set ¦[u
i
)¦, ¦U[u
i
)¦ = ¦v
i
¦
is also an orthonormal basis with U =

i
[v
i
)¸u
i
[. (3.146)
Unitary matrices have eigenvalues of modulus 1. (3.147)
If([u), A[u)) > 0 ∀[u) in V (all positive eigenvalues). (3.148)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
76 Vectors and Vector Spaces
3.8.23 Hermitian and Positive Operators
A hermitian matrix A has the property:
A = A

. (3.149)
The eigenvalues of a hermitian matrix are real numbers and hermitian matrices
are also normal (although not all normal matrices need real eigenvalues).
Example The matrix X is Hermitian because:
X =
_
0 1
1 0
_
=, X

=
_
0 1
1 0
_
.
Properties:
A = B +iC can represent any operator if B and C are hermitian
with C = 0 if A itself is hermitian. (3.150)
If A is hermitian then for [u), ¸u[A[u) ∈ R. (3.151)
If A is hermitian then A is a positive operator iff for [u), ¸u[Au) ∈ R
and ¸u[Au) ≥ 0. (3.152)
If A is positive it has no negative eigenvalues. (3.153)
3.8.24 Diagonalisable Matrix
An operator A is diagonalisable if:
A =

i
λ
i
[u
i
)¸u
i
[. (3.154)
The vectors [u
i
) form an orthonormal set of eigenvectors for A, with eigenval-
ues of λ
i
. This is the same as saying that A can be transformed to:
_
¸
¸
_
λ
1
.
.
.
λ
n
_
¸
¸
_
. (3.155)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 77
Example Representing operator X:
X =
_
0 1
1 0
_
.
The two normalised eigenvectors for X are:
1

2
[0) −
1

2
[1) and
1

2
[0) +
1

2
[1).
The two vectors are orthogonal (with eigenvalues −1 and +1),
_
1

2
¸0[ −
1

2
¸1[
_ _
1

2
[0) +
1

2
[1)
_
=
1
2
[¸0[0) −¸0[1) +¸1[0) −¸1[1)]
=
1
2
[1 −0 + 0 −1]
= 0.
So X is diagonalisable and is given by:
X =
1
2
[[0) +[1)][¸0[ +¸1[] −
1
2
[[0) −[1)][¸0[ −¸1[].
Which expanded is:
1
2
([¸0[0) +¸0[1) +¸1[0) +¸1[1)]) −
1
2
([¸0[0) −¸0[1) −¸1[0) +¸1[1)]).
3.8.25 The Commutator and Anti-Commutator
Here is a set of properties for the Commutator and Anti-Commutator which relate
to commutative relationships between two operators A and B.
Commutator:
[A, B] = AB −BA, A and B commute (AB = BA) if [A, B] = 0. (3.156)
Anti-commutator:
¦A, B¦ = AB +BA, we say A and B anti-commute if ¦A, B¦ = 0. (3.157)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
78 Vectors and Vector Spaces
Example We test X and Z against the commutator.
[X, Z] =
_
0 1
1 0
__
1 0
0 −1
_

_
1 0
0 −1
__
0 1
1 0
_
=
_
0 −2
2 0
_
,= 0.
So X and Z do not commute.
The simultaneous diagonalisation theorem says that if H
A
and H
B
are hermitian,
[H
A
, H
B
] = 0 if ∃ a set of orthonormal eigenvectors for both H
A
, H
B
so:
H
A
=

i
λ

i
[i)¸i[ and H
B
=

i
λ

i
[i)¸i[. (3.158)
i.e. they are both diagonal in a common basis.
Properties:
AB =
[A, B] +¦A, B¦
2
. (3.159)
[A, B]

= [A

, B

]. (3.160)
[A, B] = −[B, A]. (3.161)
[H
A
, H
B
] is hermitian if H
A
, H
B
are hermitian. (3.162)
3.8.26 Polar Decomposition
Polar decomposition says that any linear operator A can be represented as A =
U

A

A (called the left polar decomposition) =

AA

U (called the right polar
decomposition) where U is a unitary operator.
Single value decomposition says that if a linear operator A that is a square ma-
trix (i.e. the same input and output dimension) then there exist unitaries U
A
and U
B
, and D a diagonal matrix with non-negative elements in R such that
A = U
A
DU
B
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Vectors and Vector Spaces 79
3.8.27 Spectral Decomposition
A linear operator is normal (A

A = AA

) iff it has orthogonal eigenvectors and
the normalised (orthonormal) versions ¦u
i
¦ of the eigenvectors can diagonalise
the operator:
A =

i
λ
i
[u
i
)¸u
i
[. (3.163)
Example Spectral decomposition of X and Z.
Z =
_
1 0
0 −1
_
= [0)¸0[ −[1)¸1[.
X =
_
0 1
1 0
_
= [+)¸+[ −[−)¸−[.
X has eigenvectors [+) =
1

2
[0) +[1), and [−) =
1

2
[0) −[1) and eigenvalues
of +1, and −1 Then, if we expand, we get back X:
[+)¸+[ −[−)¸−[ =
1
2
_
1
1
_
[11] −
1
2
_
1
−1
_
[1 −1]
=
1
2
_
1 1
1 1
_

1
2
_
1 −1
−1 1
_
=
_
0 1
1 0
_
.
Properties:
A = UDU

where U is a unitary and D is a diagonal operator. (3.164)
If A is normal then it has a spectral decomposition of

a
[a)¸a[. (3.165)
3.8.28 Tensor Products
In a tensor product we have a combination of two smaller vector spaces to form
a larger one. The elements of the smaller vector spaces are combined whilst
preserving scalar multiplication and linearity, formally:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
80 Vectors and Vector Spaces
If ¦[u)¦ and ¦[v)¦ are bases for V and W respectively then ¦[u) ⊗ [v)¦ form a
basis for V ⊗W. We can write this in the following way:
[u) ⊗[v) = [u)[v) = [u, v) = [uv). (3.166)
Example A simple tensor product.
[1) ⊗[0) = [1)[0) = [1, 0) = [10).
The Kronecker product is defined as:
A ⊗B =
_
a b
c d
_

_
x y
v w
_
(3.167)
=
_
a B b B
c B d B
_
(3.168)
=
_
¸
¸
¸
¸
_
ax ay bx by
av aw bv bw
cx cy dx dy
cv cw dv dw
_
¸
¸
¸
¸
_
. (3.169)
where A and B are linear operators.
Example A Kronecker product on Pauli matrices X. and Y
X =
_
0 1
1 0
_
and Y =
_
0 −i
i 0
_
.
X ⊗Y =
_
0 Y 1 Y
1 Y 0 Y
_
=
_
0 1
1 0
__
0 −i
i 0
_
=
_
¸
¸
¸
¸
_
0 0 0 −i
0 0 1 0
0 −i 0 0
i 0 0 0
_
¸
¸
¸
¸
_
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Fourier Transforms 81
Properties:
Tensor products are related to the inner product:
([uv), [u

v

)) = ([u), [u

))([v), [v

)) (3.170)
= ¸u[u

)¸v[v

). (3.171)
[u)
⊗k
= ([u) ⊗. . . ⊗[u))
k
k times. (3.172)
(A ⊗B)

= A

⊗B

. (3.173)
(A ⊗B)
T
= A
T
⊗B
T
. (3.174)
(A ⊗B)

= A

⊗B

. (3.175)
[ab)

= ¸ab[. (3.176)
α([u, v)) = [αu, v) = [u, αv). (3.177)
[u
1
+u
2
, v) = [u
1
, v) +[u
2
, v). (3.178)
[u, v
1
+v
2
) = [u, v
1
) +[u, v
2
). (3.179)
[uv) ,= [vu). (3.180)
For linear operators A and B, A ⊗B([uv)) = A[u) ⊗A[v). (3.181)
For normal operators N
A
and N
B
, N
A
⊗N
B
will be normal. (3.182)
For hermitian operators H
A
and H
B
, H
A
⊗H
B
will be hermitian. (3.183)
For unitary operators U
A
and U
B
, U
A
⊗U
B
will be unitary. (3.184)
For positive operators P
A
and P
B
, P
A
⊗P
B
will be positive. (3.185)
3.9 Fourier Transforms
The Fourier transform, which is named after Jean Baptiste Joseph Fourier, 1768
- 1830 (figure 3.9), maps data from the time domain to the frequency domain. The
discrete Fourier transform (DFT) is a version of the Fourier transform which, un-
like the basic Fourier transform, does not involve calculus and can be directly
implemented on computers but is limited to periodic functions. The Fourier
transform itself is not limited to periodic functions.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
82 Fourier Transforms
Figure 3.9: Jean Baptiste Joseph Fourier.
3.9.1 The Fourier Series
Representing a periodic function as a linear combination of sines and cosines is
called a Fourier series expansion of the function. We can represent any periodic,
continuous function as a linear combination of sines and cosines. In fact, like [0)
and [1) forms an orthonormal basis for quantum computing, sin and cos form
an orthonormal basis for the time domain based representation of a waveform.
One way to describe an orthonormal basis is:
That which you measure against.
The fourier series has the form:
f(t) =
a
0
2
+

n=1
a
n
sin(nt) +

n=1
b
n
cos(nt). (3.186)
So if we have a waveform we want to model we only need to find the coeffi-
cients a
0
, a
1
, . . . , a
n
and b
0
, b
1
, . . . , b
n
and the number of sines and cosines. We
won’t go into the derivation of these coefficients (or how to find the number of
sines and cosines) here. The definition will be enough, as this is only meant to
be a brief introduction to the Fourier series. For example, suppose we’ve found
a
1
= 0.5, a
4
= 2 and b
2
= 4 and all the rest are 0; then the Fourier series is:
f(t) = 0.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt)
which is represented by the following graph:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Fourier Transforms 83
−8
−6
−4
−2
0
2
4
6
8
0 1 2 3 4 5
0.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt)
The function f(t) is made up of the following waveforms, 0.5 sin(πt), 2 sin(4πt),
and 4 cos(2πt). Again, it’s helpful to look at them graphically:
−6
−4
−2
0
2
4
6
0 1 2 3 4 5
0.5 sin(πt)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
84 Fourier Transforms
−6
−4
−2
0
2
4
6
0 1 2 3 4 5
2 sin(4πt)
−6
−4
−2
0
2
4
6
0 1 2 3 4 5
4 cos(2πt)
If we analyse the frequencies and amplitudes of the components of f(t) we get
the following results [Shatkay, H. 1995]:
Waveform Sine Amplitude Cosine Amplitude Frequency
0.5 sin(πt)
1
2
0 2
2 sin(4πt) 2 0
1
2
4 cos(2πt) 0 4 1
We can also rewrite the sinusoids above as a sum of numbers in complex, ex-
ponential form.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Fourier Transforms 85
3.9.2 The Discrete Fourier Transform
The DFT maps from a discrete, periodic sequence t
k
to a set of coefficients rep-
resenting the frequencies of the discrete sequence. The DFT takes as input and
outputs an array of complex numbers. The number of elements in the array is
governed by the sampling rate and the length of the waveform. Formally, The
N complex numbers t
0
, ..., t
N−1
are transformed into the N complex numbers
f
0
, ..., f
N
−1 according to the formula:
f
j
=
N−1

k=0
t
k
e

2πi
N
jk
j = 0, . . . , N −1. (3.187)
The DFT is a linear operator with an invertible matrix representation, so we can
take the conversion back to its original form using:
t
k
=
1
N
N−1

j=0
f
j
e
2πi
N
kj
k = 0, . . . , N −1. (3.188)
We have chosen to represent our periodic functions as a sequence of sines and
cosines. To use the above formulas they need to be converted to complex, expo-
nential form. Because the sequence we are after is discrete we need to sample
various points along the sequence. The sample rate N determines the accuracy
of our transformation. With the lower bound on the sampling rate being found
by applying Nyquist’s theorem (which is beyond the scope of this paper).
Let’s look at doing a DFT on f(t) = 0.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) and
adjust the sampling rate until we get an acceptable waveform in the frequency
domain:
The graph below is just f(t) = 0.5 sin(πt) +2 sin(4πt) +4 cos(2πt) with sampling
points at the whole numbers (1, 2, . . . , N) as you can see if we only sample at
this point we get no notion of a wave at all.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
86 Fourier Transforms
−6
−4
−2
0
2
4
6
0 2 4 6 8 10 12
0.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt)
Instead of adjusting the sample rate to be fractional, we just have to adjust the
function slightly, which just makes the x-axis longer but retains our wave. The
function now looks like this:
f(t) = 0.5 sin
_
π
t
2
_
+ 2 sin
_

t
2
_
+ 4 cos
_

t
2
_
.
So we are effectively sampling at twice the rate.
−6
−4
−2
0
2
4
6
0 2 4 6 8 10 12
0.5 sin(π
t
2
) + 2 sin(4π
t
2
) + 4 cos(2π
t
2
)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Fourier Transforms 87
Below we show a sampling rate of 50 times the original rate and our waveform
looks good, the function now looks like this:
f(t) = 0.5 sin
_
π
t
50
_
+ 2 sin
_

t
50
_
+ 4 cos
_

t
50
_
.
−8
−6
−4
−2
0
2
4
6
8
0 50 100 150 200 250
0.5 sin(π
t
50
) + 2 sin(4π
t
50
) + 4 cos(2π
t
50
)
Finally, here is f(t) = 0.5 sin(π
t
50
)+2 sin(4π
t
50
)+4 cos(2π
t
50
) after it has been put
through the DFT, it is now in the frequency domain:
0
10
20
30
40
50
0 20 40 60 80 100 120
DFT(0.5 sin(π
t
50
) + 2 sin(4π
t
50
) + 4 cos(2π
t
50
))
Later, in chapter 7, we’ll see how the quantum analogue of the DFT (called the
quantum fourier transform) can be used for quantum computing.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 4
Quantum Mechanics
Quantummechanics is generally about the novel behaviour of very small things.
At this scale matter becomes quantised, this means that it can be subdivided no
more. Quantum mechanics has never been wrong, it explains why the stars
shine, how matter is structured, the periodic table, and countless other phe-
nomena. One day scientists hope to use quantum mechanics to explain every-
thing, but at present the theory remains incomplete as it has not been success-
fully combined with classical theories of gravity.
Some strange effects happen at the quantum scale. The following effects are
important for quantum computing:
• Superposition and interference
• Uncertainty
• Entanglement
This chapter is broken into two parts. In the first part we’ll look briefly at the
history of quantum mechanics. Then, in the second part we will examine some
important concepts (like the ones above) of quantum mechanics and how they
relate to quantum computing.
The main references used for this chapter are, Introducing Quantum Theory by
J.P. McEvoy and Oscar Zarate, and Quantum Physics, Illusion or Reality by Alas-
tair Rae. Both of these are very accessible introductory books.
89
90 History
Figure 4.1: James Clerk Maxwell and Isaac Newton.
Figure 4.2: Nicolaus Copernicus and Galileo Galilei.
4.1 History
4.1.1 Classical Physics
Classical physics roughly means pre-20
th
century physics, or pre-quantumphysics.
Two of the most important classical theories are electromagnetism, by James
Clerk Maxwell, 1831 - 1879 (figure 4.1) and Isaac Newton’s mechanics. Isaac
Newton, 1642 - 1727 (figure 4.1) is arguably the most important scientist of all
time due to the large body of work he produced that is still relevant today. Prior
to this, Nicolaus Copernicus, 1473 - 1543 and Galileo Galilei, 1564 - 1642 (fig-
ure 4.2) created the modern scientific method (we might also include Leonardo
Davinci, 1452 - 1519) by testing theories with observation and experimentation.
Classical physics has a number of fundamental assumptions, they are:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 91
• The universe is a giant machine.
• Cause and effect, i.e. all non-uniform motion and action is caused by some-
thing (uniform motion doesn’t need a cause, this is Galileo’s principle of
inertia).
• Determinism, if a state of motion is known now then because the universe is
predictable, we can say exactly what it has been and what it will be at any
time.
• Light is a wave that is completely described by Maxwell’s wave equations.
These are four equations that describe all electric and magnetic phenom-
ena.
• Particles and waves exist, but they are distinct.
• We can measure any system to an arbitrary accuracy and correct for any er-
rors caused by the measuring tool.
It’s all proven, or is it? No, the above assumptions do not hold for quantum
mechanics.
4.1.2 Important Concepts
In the lead up to quantum mechanics there are some important concepts from
classical physics that we should look at. These are the concepts of atoms, ther-
modynamics, and statistical analysis.
Atoms
Atoms are defined as indivisible parts of matter first postulated by Democritus,
460 - 370 BC(figure 4.3). The idea was dismissed as a waste of time by Aristotle,
(384 - 322 BC) but two thousand years later the idea started gaining acceptance.
The first major breakthrough was in 1806 when John Dalton, 1766 - 1844 (figure
4.3) predicted properties of elements and compounds using the atomic concept.
Thermodynamics
Thermodynamics is the theory of heat energy. Heat is understood to be disor-
dered energy; e.g. the heat energy in a gas is the kinetic energies of all the
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
92 History
Figure 4.3: Democritus and John Dalton.
Figure 4.4: Hermann von Helmholtz and Rudolf Clausius.
molecules. The temperature is a measure of how fast the molecules are trav-
elling (if a gas or liquid; if solid, how fast they are vibrating about their fixed
positions in the solid).
Thermodynamics is made up of two laws:
• The first law of thermodynamics
In a closed system, whenever a certain amount of energy dis-
appears in one place an equivalent amount must appear else-
where in the system is some form.
This law of conservation of energy was originally stated by Herman Von
Helmholtz, 1824 - 1894 (figure 4.4).
• The second law of thermodynamics
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 93
Figure 4.5: Maxwell distribution.
Rudolf Clausius, 1822 - 1888 (figure 4.4) called the previous law the first
of two laws. He introduced a new concept, entropy which in terms of heat
transfer is:
The total entropy of a system increases when heat flows from
a hot body to a cold one. Heat always flows from hot to cold
[Rae, A. 1996, p.18].
So this implies that an isolated system’s entropy is always increasing until
the system reaches thermal equilibrium (i.e. all parts of the system are at
the same temperature).
4.1.3 Statistical Mechanics
In 1859, J.C. Maxwell, using the atomic model, came up with a way of statisti-
cally averaging the velocities of randomly chosen molecules of a gas in a closed
system like a box (because it was impossible to track each one). The graph is
shown in figure 4.5, remember hotter molecules tend to go faster, the graph’s n
axis denotes the number of molecules (this particular graph shows CO
2
). The v
axis denotes velocity. The letters a, b, and c represent molecules at 100

K, 400

K,
and 1600

K respectively.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
94 History
Figure 4.6: Ludwig Boltzmann and Niels Bohr.
In the 1870s Ludwig Boltzmann, 1844 - 1906 (figure 4.6) generalised the the-
ory to any collection of entities that interact randomly, are independent, and
are free to move. He rewrote the second law of thermodynamics to say:
As the energy in a system degrades the system’s atoms become
more disordered and there is an increase in entropy. to measure this
disorder we consider the number of configurations or states that the
collection of atoms can be in.
If this number is W then the entropy S is defined as:
S = k log W (4.1)
where k is Boltzmann’s constant k = 1.38 10
−23
J/K.
So the behaviour of ”large things” could now be predicted by the average sta-
tistical behaviour of the their smaller parts, which is important for quantum
mechanics. There also remains the probability that a fluctuation can occur, a
statistical improbability that may seem nonsensical but nonetheless the theory
must cater for it. For example, if we have a box containing a gas a fluctuation
could be all particles of the gas randomly clumping together in one corner of
the box.
4.1.4 Important Experiments
There are two major periods in the development of quantum theory, the first
culminating in 1913 with the Niels Bohr, 1885 - 1962 (figure 4.6) model of the
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 95
atom and ending in about 1924. This is called old quantum theory. The new
quantum theory began in 1925. The old quantum theory was developed in some
part to explain the results of three experiments which could not be explained
by classical physics, they are:
• Black body radiation, and the ultraviolet catastrophe.
• The Photoelectric effect.
• Bright Line Spectra.
These experiments, and their subsequent explanations are described in the next
three sections.
Black Body Radiation
A black body absorbs all electromagnetic radiation (light) that falls on it and
would appear black to an observer because it reflects no light. To determine
the temperature of a black body we have to observe the radiation emitted from
it.
Associates of Max Planck, 1858 - 1947, (figure 4.8) measured the distribution
of radiation and energy over frequency in a cavity, a kind of oven with a little
hole for a small amount of heat (light, radiation) to escape for observation. Be-
cause the radiation is confined in the cavity it settles down to an equilibrium
distribution of the molecules in a gas. They found the frequency distributions
to be similar to Maxwell’s velocity distributions. The colour of the light emit-
ted is dependent on the temperature. E.g. the element of your electric stove
goes from red hot to white hot as the temperature increases. It didn’t take
long for physicists to apply a Maxwell style statistical analysis to the waves of
electromagnetic energy present in the cavity. The difference being is that classi-
cal physics saw waves as continuous which means that more and more waves
could be packed into a ”box” as the wavelengths get smaller, i.e. the frequency
gets higher. This means that as the temperature was raised the radiation should
keep getting stronger and stronger indefinitely. This was called the ultraviolet
catastrophe. If nature did indeed behave in this way you would get singed sit-
ting in front of a fire by all the ultraviolet light coming out of it. fortunately this
doesn’t occur so the catastrophe is not in nature but in classical physics which
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
96 History
Figure 4.7: Albert Einstein and Johann Jakob Balmer.
predicted something that doesn’t happen.
The results of several experiments had given the correct frequency distribu-
tions and it was Max Planck who found a formula that matched the results. He
couldn’t find a classical solution, so grudgingly he used Boltzmann’s version
of the second law of thermodynamics. Planck imagined that the waves emit-
ted from the black body were produced by a finite number of tiny oscillators
(a kind of precursor to modern atoms). Eventually he had to divide the en-
ergy into finite chunks of a certain size to fit his own radiation formula. Which
finally gives us the first important formula for quantum mechanics:
E = hf (4.2)
where E is energy, f is frequency and h is Planck’s constant which is:
h = 0.000000000000000000000000006626. (4.3)
4.1.5 The Photoelectric Effect
If a light is shone onto certain kinds of material (e.g. some metals or semi con-
ductors) then electrons are released. When this effect was examined it was
found that the results of the experiments did not agree with classical elec-
tromagnetic theory which predicted that the energy of the released electron
should depend on the intensity of the incident light wave. However it was
found that the energy released was dependent not on intensity (an electron
would come out no matter how low the intensity was) but on the frequency of
the light.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 97
Albert Einstein, 1879 - 1955 (figure 4.7) showed that if we look at the light as a
collection of particles carrying energy proportional to the frequency (as given
by Planck’s law E = hf) and if those particles can transfer energy to electrons
in a target metal then the experimental results could be explained. Put simply
a light particle hits the metal’s surface and its energy is transferred to an elec-
tron and becomes kinetic energy; so the electron is ejected fromthe metal. With
different kinds of metals it can be easier or harder for electrons to escape.
4.1.6 Bright Line Spectra
When a solid is heated and emits white light then, if that light is concentrated
and broken up into the separate colours by a prism, we get a rainbowlike spec-
trum (continuous spectrum) like the following:
If we do the same thing with a hot gas emitting light then the spectrum con-
sists of a number of bright lines that have the colours of the rainbow above,
with dark regions in between. The spectrum for this, which is called an emis-
sion spectrum is shown below.
If a cold gas is placed between a hot solid emitting white light and the prism
we get the inverse of the above. This is called an absorbtion spectrum, shown
below.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
98 History
Figure 4.8: Max Planck and Joseph J. Thomson.
The hot gas is emitting light at certain frequencies and example three shows
us that the cold gas is absorbing light at the same frequencies. These lines are
different for each element, and they allow us to determine the composition of
a gas even at astronomical distances, by observing its spectrum.
In 1885 Johann Jakob Balmer, 1825 - 1898 (figure 4.7) derived a formula for
the spectral lines of Hydrogen. Which is:
f = R
_
1
n
2
f

1
n
2
i
_
(4.4)
where R is the Rydberg constant of 3.29163 10
1
5 cycles/second and n
f
and
n
i
are whole numbers. The trouble was that no one knew how to explain the
formula. The explanation came in 1913 with Niels Bohr’s atomic model.
4.1.7 Proto Quantum Mechanics
During the last part of the 19th century it was discovered that a number of
”rays” were actually particles. One of these particles was the electron, discov-
ered by Joseph J. Thomson, 1856 - 1940 (figure 4.8). In a study of cathode ray
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 99
Figure 4.9: Ernest Rutherford and Arnold Sommerfeld.
Figure 4.10: Thomson’s atomic model.
Figure 4.11: Rutherford’s atomic model.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
100 History
tubes Thompson showed that electrically charged particles (electrons) are emit-
ted when a wire is heated. Thomson went on to help develop the first model
of the atom which had his (negatively charged) electrons contained within a
positively charged sphere (figure 4.10).
This first atomic model was called the Christmas pudding model. Then, in 1907,
Ernest Rutherford, 1871 - 1937 (figure 4.9), developed a new model, which was
found by firing alpha particles (Helium ions) at gold foil and observing that,
very occasionally, one would bounce back. This model had a tiny but massive
nucleus surrounded by electrons (figure 4.11).
The new model was like a mini solar system with electrons orbiting the nu-
cleus, but the atomic model was thought to still follow the rules of classical
physics. However, according to classical electromagnetic theory an orbiting
electron, subject to centripetal acceleration (the electron is attracted by the pos-
itively charged nucleus) would radiate energy and so rapidly spiral in towards
the nucleus. But this did not happen: atoms were stable, and all the atoms
of an element emitted the same line spectrum. To explain this Bohr assumed
that the atom could exist in only certain stationary states - stationary because,
even if the electron was orbiting in such a state (and, later, this was questioned
by Heisenberg) it would not radiate, despite what electromagnetic theory said.
However, if the electron jumped from a stationary state to one of lower energy
then the transmission was accompanied by the emission of a photon; vice versa
there was absorption of light in going from a lower to a higher energy.
In this scheme there was a lowest stationary state, called the ground state be-
low which the electron could not jump; so this restored stability to the atom.
The frequency of the light emitted as a jump was given by Einstein’s formula:
f =
E
h
(4.5)
where E is the difference in the energies of the stationary states involved. These
energies of the stationary states could be calculated fromclassical physics if one
additional assumption was introduced: that the orbital angular momentum
was an integer multiple of Planck’s constant. Then the calculated frequencies
were found to agree with those observed.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 101
Figure 4.12: Bohr’s first atomic model.
So Bohr developed a model based on stable orbital shells which only gave a
certain number of shells to each atom. Bohr quantised electron orbits in units
of Planck’s constant. He gave us the first of several quantum numbers which are
useful in quantum computing, the shell number, n (see figure 4.12).
Of particular interest are the ground state at n = 1 and the excited state at n > 1
of an atom. Bohr developed a formula for the radius of the electron orbits in a
hydrogen atom:
r =
_
h
2

2
mq
2
_
n
2
(4.6)
where r is the radius of the orbital, h is Planck’s constant, and m and q are the
mass and charge of the electron. In real terms the value of r is 5.3 nanometres
for n = 1.
Bohr went on with this model to derive the Balmer’s formula for hydrogen
by two postulates:
1. Quantum angular momentum:
L = n
_
h

_
. (4.7)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
102 History
Figure 4.13: Wolfgang Pauli and Louis de Broglie.
2. A jump between orbitals will emit or absorb radiation by:
hf = E
i
−E
f
(4.8)
where E
i
is the initial energy of the electron and E
f
is the final energy of
the electron.
Although very close, it didn’t quite match up to the spectral line data. Arnold
Sommerfeld, 1868 - 1951 (figure 4.9) then proposed a new model with elliptical
orbits and a new quantum number was added, k to deal with the shape of the
orbit, Bohr then introduced quantum number m to explain the Zeeman effect
which produced extra spectral lines when a magnetic field was applied to the
atom (i.e. the direction the field was pointing).
It was soon discovered that m could not account for all the spectral lines pro-
duced by magnetic fields. Wolfgang Pauli, 1900 - 1958 (figure 4.13) hypoth-
esised another quantum number to account for this. It was thought, but not
accepted by Pauli that the electron was ”spinning around” and it turns out that
Pauli was right but the name stuck, so we still use spin up and spin down to de-
scribe this property of an electron. Pauli then described why electrons fill the
higher energy levels and don’t just occupy the ground state which we now call
the Pauli exclusion principle. Niels Bohr went on to explain the periodic table
in terms of orbital shells with the outer most shell being the valence shell that
allows binding and the formation of molecules.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 103
Figure 4.14: Werner Heisenberg and Erwin Schr¨ odinger.
4.1.8 The New Theory of Quantum Mechanics
In 1909, a few years after demonstrating the photoelectric effect, Einstein used
his photon hypothesis to obtain a simple derivation of Planck’s black body dis-
tribution. Planck himself had not gone as far as Einstein: he had indeed as-
sumed that the transfer of energy between matter (the oscillators in the walls
of the cavity) and radiation was quantised (i.e. the energy transferred to/from
an oscillator occurred in ”grains” less than h times the frequency of the oscil-
lator). But Planck had assumed the energy in the electromagnetic field, in the
cavity, was continuously distributed, as in classical theory. By contrast, it was
Einstein’s hypothesis that the energy in the field itself was quantised: that for
certain purposes, the field behaved like an ideal gas, not of molecules, but of
photons, each with energy h times frequency, with the number of photons be-
ing proportional to the intensity. The clue to this was Einstein’s observation
that the high frequency part of Planck’s distribution for black body radiation
(described by Wien’s law) could be derived by assuming a gas of photons and
applying statistical mechanics to it. This was in contrast to the low frequency
part (described by the Rayleigh-Jeans law) which could be successfully obtained
using classical electromagnetic theory, i.e. assuming waves. So you had both
particles and waves playing a part. Furthermore, Einstein looked at fluctua-
tions of the energy about its average value, and observed that the formula ob-
tained had two forms, one which you would get if light was made up of waves
and the other if it was made up of particles. Hence we have wave-particle du-
ality. In 1924, Louis de Broglie, 1892 - 1987 (figure 4.13) extended the particle
duality for light to all matter. He stated:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
104 History
The motion of a particle of any sort is associated with the propaga-
tion of a wave.
This is the idea of a pilot wave which guides a free particle’s motion. de Broglie
then suggested the idea of electron waves be extended to bound particles in
atoms, meaning electrons move around the nucleus guided by pilot waves. So,
again a duality, de Broglie waves and Bohr’s particles. de Broglie was able to
show that Bohr’s orbital radii could be obtained by fitting a whole number of
waves around the nucleus. This gave an explanation of Bohr’s angular mo-
mentum quantum condition (see above).
The new quantum theory was developed between June 1925 and June 1926.
Werner Heisenberg, 1901 - 1976 (figure 4.14), using a totally different and more
simple atomic model (one that did not use orbits) worked out a code to con-
nect quantum numbers and spectra. He also discovered that quantum me-
chanics does not follow the commutative law of multiplication i.e pq ,= qp. When
Max Born, 1882 - 1970 (figure 4.15) saw this he suggested that Heisenberg use
matrices. This became matrix mechanics, eventually all the spectral lines and
quantum numbers were deduced for hydrogen. The first complete version of
quantum mechanics was born. It’s interesting to note that it was not observa-
tion, or visualisation that was used to deduce to theory - but pure mathematics.
Later we will see matrices cropping up in quantum computing.
At around the same time Erwin Schr¨ odinger, 1887 - 1961 (figure 4.14) built on
de Broglie’s work on matter waves. He developed a wave equation (for which
Ψ is the solution) for the core of bound electrons, as in the Hydrogen atom. It
turns out that the results derived fromthis equation agree with the Bohr model.
He then showed that Heisenberg’s matrix mechanics and his wave mechanics
were equivalent.
Max Born proposed that Ψ, the solution to Schr¨ odinger’s equation can be in-
terpreted as a probability amplitude, not a real, physical value. The prob-
ability amplitude is a function of the electron’s position (x, y, z) and, when
squared, gives the probability of finding the electron in a unit volume at the
point (x, y, z). This gives us a new, probabilistic atomic model, in which there
is a high probability that the electron will be found in a particular orbital shell.
A representation of the ground state of hydrogen is shown in figure 4.16 and
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
History 105
at the places where the density of points is high there is a high probability of
finding the particle. The linear nature of the wave equation means that if Ψ
1
and Ψ
2
are two solutions then so is Ψ
1
+ Ψ
2
, a superposition state (we’ll look
at superposition soon). This probabilistic interpretation of quantum mechanics
implies the system is in both states until measured.
Schr¨ odinger was unhappy with the probabilistic interpretation (superposition)
and created a scenario that would show it was false. This is called Schr¨ odinger’s
cat, a paradox, which simply put refers to the situation of a cat being in both
states of dead Ψ
1
and alive Ψ
2
until it is observed.
Paul Dirac, 1902 - 1984 (figure 4.15) developed a new approach and the bra-ket
notation we use for quantum computing. His approach expanded to a quan-
tum field theory, he expanded Schr¨ odinger’s equation, incorporated spin, and
Einstein’s relativity, and predicted antimatter.
In 1927 Heisenberg made his second major discovery, the Heisenberg uncertainty
principle which relates to the position and momentumof a particle. It states that
the more accurate our knowledge of a particle’s position, the more inaccurate
our knowledge of its momentum will be and vice versa. The uncertainty is due
to the uncontrollable effect on the particle of any attempt to observe it (because
of the quantum interaction; see 4.25). This signalled the breakdown of deter-
minism.
Now back to Niels Bohr. In 1927 Niels Bohr described the concept of comple-
mentarity: it depends on what type of measurement operations you are using
to look at the system as to whether it behaves like a particle or a wave. He
then put together various aspects of the work by Heisenberg, Schr¨ odinger, and
Born and concluded that the properties of a system (such as position and mo-
mentum) are undefined having only potential values with certain probabilities
of being measured. This became know as the Copenhagen interpretation of quan-
tum mechanics.
Einstein did not like the Copenhagen interpretation and, for a good deal of
time, Einstein kept trying to refute it by thought experiment, but Bohr always
had an answer. But in 1935 Einstein raised an issue that was to later have pro-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
106 Important Principles for Quantum Computing
Figure 4.15: Max Born and Paul Dirac.
Figure 4.16: Born’s atomic model.
found implications for quantum computation and lead to the phenomenon we
now call entanglement, a concept we’ll look at in a few pages.
4.2 Important Principles for Quantum Computing
The main parts of quantum mechanics that are important for quantum com-
puting are:
• Linear algebra.
• Superposition.
• Dirac notation.
• Representing information.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Principles for Quantum Computing 107
• Uncertainty.
• Entanglement.
• The 4 postulates of quantum mechanics.
4.2.1 Linear Algebra
Quantum mechanics leans heavily on linear algebra. Some of the concepts of
quantum mechanics come from the mathematical formalism, not thought ex-
periments - that’s what can give rise to counter intuitive conclusions.
4.2.2 Superposition
Superposition means a systemcan be in two or more of its states simultaneously.
For example a single particle can be travelling along two different paths at once.
This implies that the particle has wave-like properties, which can mean that the
waves from the different paths can interfere with each other. Interference can
cause the particle to act in ways that are impossible to explain without these
wave-like properties.
The ability for the particle to be in a superposition is where we get the parallel
nature of quantum computing: If each of the states corresponds to a different
value then, if we have a superposition of such states and act on the system, we
effectively act on all the states simultaneously.
An Example With Silvered Mirrors
Superposition can be explained by way of a simple example using silvered and
half silvered mirrors [Barenco, A. Ekert, A. Sanpera, A. &Machiavello, C. 1996].
Ahalf silvered mirror reflects half of the light that hits it and transmits the other
half of the light through it (figure 4.17). If we send a single photon through this
system then this gives us a 50% chance of the light hitting detector 1 and a
50% chance of hitting detector 2. It is tempting to think that the light takes
one or the other path, but in fact it takes both! It’s just that the photo detector
that measures the photon first breaks the superposition, so it’s the detectors that
cause the randomness, not the half silvered mirror. This can be demonstrated
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
108 Important Principles for Quantum Computing
Figure 4.17: Uncertainty.
by adding in some fully silvered mirrors and bouncing both parts of the super-
posed photon (which is at this point is in two places at once) so that they meet
and interfere with each other at their meeting point. If another half silvered
mirror (figure 4.18) is placed at this meeting point and if light was just particle-
like we would expect that the light would behave as before (going either way
with 50% probability), but the interference (like wave interference when two
stones are thrown into a pond near each other simultaneously) causes the pho-
ton to always be detected by detector 1. A third example (figure 4.19) shows
clearly that the photons travel both paths because blocking one path will break
the superposition and stop the interference.
4.2.3 Dirac Notation
As described in the previous chapter Dirac notation is used for quantum com-
puting. We can represent the states of a quantum system as kets. For example,
an electron’s spin can be represented as [0) = spin up and [1) as spin down.
The electron can be thought of as a little magnet, the effect of a charged particle
spinning on its axis. When we pass a horizontally travelling electron through
an inhomogeneous magnetic field, in say, the vertical direction, the electron ei-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Principles for Quantum Computing 109
Figure 4.18: Superposition 1.
Figure 4.19: Superposition 2.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
110 Important Principles for Quantum Computing
ther goes up or down. If we then repeat this with the up electron it goes up,
with the down electron it goes down. We say the up electron after the first mea-
surement is in the state [0) and the down electron is in state [1). But, if we take
the up electron and pass it through a horizontal field it comes out on one side
50%of the time and on the other side 50%of the time. If we represent these two
states as [+) and [−) we can say that the up spin electron was in a superposition
of the two states [+) and [−):
[0) =
1

2
[+) +
1

2
[−)
such that, when we make a measurement with the field horizontal we project
the electron into one or the other of the two states, with equal probabilities
1
2
(given by the square of the amplitudes).
4.2.4 Representing Information
Quantum mechanical information can be physically realised in many ways. To
have something analogous to a classical bit we need a quantum mechanical
system with two states only, when measured. We have just seen two examples:
electron spin and photon direction. Two more methods for representing binary
information in a way that is capable of exhibiting quantum effects (e.g. entan-
glement and superposition) are: polarisation of photons and nuclear spins.
We examine various physical implementations of these ”quantumbits” (qubits)
in chapter 8.
4.2.5 Uncertainty
The quantum world is irreducibly small so it’s impossible to measure a quan-
tumsystemwithout having an effect on that systemas our measurement device
is also quantum mechanical. As a result there is no way of accurately predict-
ing all of the properties of a particle. There is a trade off - the properties occur
in complementary pairs (like position and momentum, or vertical spin and
horizontal spin) and if we know one property with a high degree of certainty
then we must know almost nothing about the other property. That unknown
property’s behaviour is essentially random. An example of this is a particle’s
position and velocity: if we know exactly where it is then we know nothing
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Principles for Quantum Computing 111
about how fast it is going. This indeterminacy is exploited in quantum cryp-
tography (see chapter 7).
It has been postulated (and currently accepted) that particles in fact DO NOT
have defined values for unknown properties until they are measured. This is
like saying that something does not exist until it is looked at.
4.2.6 Entanglement
In 1935 Einstein (along with colleagues Podolski and Rosen) demonstrated a
paradox (named EPR after them) in an attempt to refute the undefined na-
ture of quantum systems. The results of their experiment seemed to show that
quantum systems were defined, having local state BEFORE measurement. Al-
though the original hypothesis was later proven wrong (i.e. it was proven that
quantum systems do not have local state before measurement). The effect they
demonstrated was still important, and later became known as entanglement.
Entanglement is the ability for pairs of particles to interact over any distance
instantaneously. Particles don’t exactly communicate, but there is a statisti-
cal correlation between results of measurements on each particle that is hard to
understand using classical physics. To become entangled, two particles are al-
lowed to interact; they then separate and, on measuring say, the velocity of one
of them (regardless of the distance between them), we can be sure of the value
of velocity of the other one (before it is measured). The reason we say that
they communicate instantaneously is because they store no local state [Rae, A.
1996] and only have well defined state once they are measured. Because of this
limitation particles can’t be used to transmit classical messages faster than the
speed of light as we only know the states upon measurement. Entanglement
has applications in a wide variety of quantumalgorithms and machinery, some
of which we’ll look at later.
As stated before, it has been proven that entangled particles have no local state;
this is explained in section 6.7.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
112 Important Principles for Quantum Computing
4.2.7 The Four Postulates of Quantum Mechanics
The theory of quantum mechanics has four main postulates. These are intro-
duced here as simple sentences. Later, in section 5.4, they will be explained in
more detail in terms of quantum computing.
1. In a closed quantum system we need a way of describing the state of all the
particles within it. The first postulate gives us a way to do this by using
a single state vector to represent the entire system. Say the state is to be a
vector in C
n
, this would be C
2
for a spin system.
2. The evolution of a closed system is a unitary transform. Say that, while the
system is evolving under its own steam - no measurement - the state at
some stage [Ψ

) is related to the state at some previous stage (or time)
[Ψ) by a unitary transform [Ψ

) = U[Ψ). This means that we can totally
describe the behaviour of a system by using unitary matrices.
3. The third postulate relates to making measurements on a closed quantum
system, and the affect those measurements have on that system.
4. Postulate four relates to combining or separating different closed quantum
systems using tensor products.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 5
Quantum Computing
5.1 Elements of Quantum Computing
5.1.1 Introduction
Generally we’ll think of a quantum computer as a classical computer with a
quantum circuit attached to it with some kind of interface between conven-
tional and quantum logic. Since there are only a few things a quantum com-
puter does better than a classical computer it makes sense to do the bulk of the
processing on the classical machine.
This section borrows heavily from [Nielsen, M. A. & Chuang, I. L. 2000] and
[Dawar, A. 2004] so the use of individual citations for these references has been
dropped.
5.1.2 History
In 1982 Richard Feynman theorised that classic computation could be dramat-
ically improved by quantum effects, building on this, David Deutsch devel-
oped the basis for quantum computing between 1984 and 1985. The next major
breakthrough came in 1994 when Peter Shor described a method to factor large
numbers in quantum poly-time (which breaks RSA encryption). This became
known as Shor’s algorithm. At around the same time the quantum complex-
ity classes were developed and the quantum Turing machine was described.
Then in 1996 Lov Grover developed a fast database search algorithm (known
as Grover’s algorithm). The first prototypes of quantum computers were also
113
114 Elements of Quantum Computing
built in 1996. In 1997 quantum error correction techniques were developed at
Bell labs and IBM. Physical implementations of quantum computers improved
with a three qubit machine in 1999 and a seven qubit machine in 2000.
5.1.3 Bits and Qubits
This section is about the ”nuts and bolts” of quantum computing. It describes
qubits, gates, and circuits.
Quantumcomputers performoperations on qubits which are analogous to con-
ventional bits (see below) but they have an additional property in that they can
be in a superposition. A quantum register with 3 qubits can store 8 numbers
in superposition simultaneously [Barenco, A. Ekert, A. Sanpera, A. & Machi-
avello, C. 1996] and a 250 qubit register holds more numbers (superposed) than
there are atoms in the universe! [Deutsch, D. & Ekert, A. 1998].
The amount of information stored during the ”computational phase” is essen-
tially infinite - its just that we can’t get at it. The inaccessibility of the infor-
mation is related to quantum measurement: When we attempt to readout a
superposition state holding many values the state collapses and we get only
one value (the rest get lost). This is tantalising but, in some cases, can be made
to work to our computational advantage.
Single Qubits
Classical computers use two discrete states (e.g. states of charging of a capac-
itor) to represent a unit of information, this state is called a binary digit (or bit
for short). A bit has the following two values:
0 and 1.
There is no intermediate state between them, i.e. the value of the bit cannot
be in a superposition.
Quantum bits, or qubits, can on the other hand be in a state ”between” 0 and
1, but only during the computational phase of a quantum operation. When
measured, a qubit can become either:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 115
[0) or [1)
i.e. we readout 0 or 1. This is the same as saying a spin particle can be in a
superposition state but, when measured, it shows only one value (see chapter
4).
The [) symbolic notation is part of the Dirac notation (see chapters 3 and 4).
In terms of the above it essentially means the same thing as 0 and 1 (this is
explained a little further on), just like a classical bit. Generally, a qubit’s state
during the computational phase is represented by a linear combination of states
otherwise called a superposition state.
α[0) +β[1).
Here α and β are the probability amplitudes. They can be used to calculate the
probabilities of the system jumping into [0) or [1) following a measurement or
readout operation. There may be, say a 25% chance a 0 is measured and a 75%
chance a 1 is measured. The percentages must add to 100%. In terms of their
representation qubits must satisfy:
[α[
2
+[β[
2
= 1. (5.1)
This the same thing as saying the probabilities add to 100%.
Once the qubit is measured it will remain in that state if the same measure-
ment is repeated provided the system remains closed between measurements
(see chapter 4). The probability that the qubit’s state, when in a superposition,
will collapse to states [0) or [1) is
[α[
2
for [0)
and
[β[
2
for [1).
[0) and [1) are actually vectors, they are called the computational basis states
that form an orthonormal basis for the vector space C
2
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
116 Elements of Quantum Computing
The state vector [Ψ) of a quantum system describes the state at any point in
time of the entire system. Our state vector in the case of one qubit is:
[Ψ) = α[0) +β[1). (5.2)
The α and β might vary with time as the state evolves during the computation
but the sum of the squares of α and β must always must be equal to 1.
Quantum computing also commonly uses
1

2
([0) + [1)) and
1

2
([0) − [1)) as a
basis for C
2
, which is often shortened to just [+), and [−). These bases are some-
times represented with arrows which are described below, and are referred to
as rectilinear and diagonal which can say refer to the polarisation of a photon.
You may find these notational conventions being used:
[0) = [ →). (5.3)
[1) = [ ↑). (5.4)
1

2
([0) +[1)) = [+) = [ ¸). (5.5)
1

2
([0) −[1)) = [−) = [ ¸). (5.6)
Some examples of measurement probabilities are on the next page.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 117
Example Measurement probabilities.
[Ψ) =
1

2
[0) +
1

2
[1).
The probability of measuring a [0) is:

¸
¸
1

2
¸
¸
¸
_
2
=
1
2
.
The probability of measuring a [1) is:

¸
¸
1

2
¸
¸
¸
_
2
=
1
2
.
So 50% of the time we’ll measure a [0) and 50% of the time we’ll measure a
[1).
Example More measurement probabilities.
[Ψ) =

3
2
[0) −
1
2
[1).
The probability of measuring a [0) is:

¸
¸

3
2
¸
¸
¸
_
2
=
3
4
.
The probability of measuring a [1) is:

¸
¸
1
2
¸
¸
¸
_
2
=
1
4
.
So 75% of the time we’ll measure a [0) and 25% of the time we’ll measure a
[1).
The sign in the middle of the two values can change, which affects the internal
evolution of the qubit, not the outcome of a measurement. When measuring in
the basis ¦[0), [1)¦ the sign is actually the relative phase of the qubit. So,
α[0) +β[1)
and
α[0) −β[1)
have the same output values and probabilities but behave differently during
the computational phase. Formally we say they differ by a relative phase fac-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
118 Elements of Quantum Computing
tor. So in the case of the qubits above they differ by a phase factor of -1. It is
called a phase factor because it always has magnitude 1 and so its value, as a
complex number, is determined entirely by the phase.
The other type of phase is called global phase. Two states can differ by a global
phase factor and still be considered the same, as the global phase factor is not
observable. One reason for this is that the probabilities for the outcomes [α[ and
[β[ are unaffected if α and β are each multiplied by the same complex number
of magnitude 1. Likewise the relative phase (which figures in interference ef-
fects) is unaffected if α and β are multiplied by a common phase factor. What
this means is that if we have a state on n qubits we can put a complex factor in
front of the entire state to make it more readable. This is best described by an
example (below).
Example Global phase.
[Ψ) =
−i

2
[0) +
1

2
[1).
can be rewritten as:
[Ψ) = −i
_
1

2
[0) −
i

2
[1)
_
.
Remembering that −i −i = +1 we say the factor at the front of our
state vector (−i) is a global phase factor. We can also say here that because
−i = e
−i
π
2
we have a phase of −
π
2
.
Example More global phase.
[Ψ) =
1
2
(−[00) +[01) −[10) +[11)).
can be rewritten as:
[Ψ) = (−1)
1
2
([00) −[01) +[10) +[11)).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 119
E
T
c
' Z
Z
Z
Z

`
`
`
`

a
b
[1)
[0)
−[1)
Figure 5.1: 2D qubit representations.
The Ket [)
Part of Dirac’s notation is the ket ([)). The ket is just a notation for a vector. The
state of a single qubit is a unit vector in C
2
. So,
_
α
β
_
is a vector, and is written as:
α[0) +β[1)
with
[0) =
_
1
0
_
(5.7)
and
[1) =
_
0
1
_
. (5.8)
Two Dimensional Qubit Visualisation
Single qubits can be represented in value and relative phase in two dimensions
by the diagram in figure 5.1 which is similar to the way we represent polar co-
ordinates for complex numbers. The graph shows the general form of 2D qubit
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
120 Elements of Quantum Computing
representation where a =
1

2
[0) +
1

2
[1) and b =
1

2
[0) −
1

2
[1).
This diagram is ok for real numbered values of α and β but cannot accurately
depict all the possible states of a qubit. For this we need three dimensions.
Three Dimensional Qubit Visualisation - The Bloch Sphere
The Bloch sphere is a tool with which the state of single qubit can be viewed in
three dimensions and is useful for visualising all single qubit operations. We
can say that the state of a single qubit can be written as:
[Ψ) = e

(cos
θ
2
[0) +e

sin
θ
2
[1)). (5.9)
We can ignore the global phase factor in front so [Ψ) becomes:
[Ψ) = cos
θ
2
[0) +e

sin
θ
2
[1). (5.10)
So, in terms of the angle θ and ϕ the Bloch sphere looks like this:
Note: An applet written by Jose Castro was used to generate the images of the
Bloch sphere. This applet is available at http://pegasus.cc.ucf.edu/

jcastro/java/BlochSphere.html.
What’s probably more helpful at this stage is to see where all of the potential
states of a qubit lie on the Bloch sphere. This is shown below with the points
ˆ x, ˆ y, and ˆ z labelling each positive axis:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 121
As stated in chapter 4, individual qubits can be physically realised using vari-
ous quantum two state systems, here are a few ways this can be done:
• Polarisations of a photon.
• Nuclear spins.
• Ground and excited states of an atom (i.e. the energy level, or orbital).
We now look at the equivalent of a register: i.e. a composite system of qubits,
e.g. Ions in a trap (see chapter 8).
Multiple Qubits
The potential amount of information available during the computational phase
grows exponentially with the size of the system, i.e. the number of qubits.
This is because if we have n qubits the number of basis states is 2
n
. E.g. if
we have two qubits, forming a quantum register then there are four (= 2
2
)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
122 Elements of Quantum Computing
computational basis states: forming,
[00), [01), [10), and [11). (5.11)
Here [01) means that qubit 1 is in state [0) and qubit 2 is in state [1), etc. We
actually have [01) = [0) ⊗[1), where ⊗ is the tensor product (see below).
Like a single qubit, the two qubit register can exist in a superposition of the four
states (below we change the notation for the complex coefficients, i.e. probabil-
ity amplitudes):
[Ψ) = α
0
[00) +α
1
[01) +α
2
[10) +α
3
[11). (5.12)
Again all of the probabilities must sum to 1, formally for the general case of n
qubits this is can be written as:
2
n
−1

i=0

i
[
2
= 1. (5.13)
Example n = 5 (5 qubits). We can have up to 32 (= 2
5
) basis states in a
superposition.
Ψ = α
0
[00000) +α
1
[00001) +... +α
2
n
−1
[11111).
We don’t have to represent values with 0s and 1s. A qudit has the following
format in C
N
:
Ψ = α
0
[0) +α
1
[1) +α
2
[2) +. . . +α
n−1
[N −1) =
_
¸
¸
¸
¸
¸
¸
¸
_
α
0
α
1
α
2
.
.
.
α
N
−1
_
¸
¸
¸
¸
¸
¸
¸
_
. (5.14)
If N = 2
n
we require an n qubit register.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 123
Tensor Products
A decomposition into single qubits of a multi-qubit system can be represented
by a tensor product, ⊗.
Example Decomposition using a tensor product.
1
2
([00) +[01) +[10) +[11)) =
1

2
([0) +[1)) ⊗
1

2
([0) +[1)).
A tensor product can also be used to combine different qubits.

0
[0) +α
1
[1)) ⊗(β
0
[0) +β
1
[1)) = α
0
β
0
[00) +α
0
β
1
[01) +α
1
β
0
[10) +α
1
β
1
[11).
(5.15)
Partial Measurement
We can measure a subset of an n-qubit system. i.e. we don’t have to get read
outs on all the qubits (some can be left unmeasured). We’ll first consider non-
entangled states. The simplest way to measure a subset of states is shown in
the following example with two qubits.
An example is presented on the next page.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
124 Elements of Quantum Computing
Example measuring the first bit in a two qubit system.
1. We prepare a quantum system in the following state, the qubit we are
going to measure is bolded, a non-entangled state would mean that all
the probability amplitudes are non-zero:
Ψ = α
0
[00) +α
1
[01) +α
2
[10) +α
3
[11).
2. We now measure, so the probability of it being 0 is:
pr(0) = [α
0
[
2
+[α
1
[
2
and, the probability of it being 1 is:
pr(1) = [α
2
[
2
+[α
3
[
2
.
3. If we measured a [0) the post measurement state is:
[0) ⊗
α
0
[0) +α
1
[1)
_

0
[
2
+[α
1
[
2
(i.e. we project on to the ¦[00), [01)¦ subspace and the α
2
and α
3
terms
drop out). Similarly, if we measured a [1) measured the post measure-
ment state is:
[1) ⊗
α
2
[0) +α
3
[1)
_

2
[
2
+[α
3
[
2
.
We can do the same for qubit two, the probability of qubit two being a [0) is:
pr(0) = [α
0
[
2
+[α
2
[
2
and its post measurement state would be:
α
0
[0) +α
2
[1)
_

0
[
2
+[α
2
[
2
⊗[0).
This logic can be extended to n qubits.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 125
Quantummeasurement can be described as a set ¦M
m
¦ of linear operators with
1 ≤ m ≤ n where n is the number of possible outcomes. For a single qubit
with an orhtonormal basis of [0) and [1) we can define measurement operators
M
0
= [0) ¸0[ and M
1
= [1) ¸1[ (which are also both projectors).
If we have a system in state [Ψ) then outcome m has a probability of:
pr(m) = ¸Ψ[M

m
M
m
[Ψ). (5.16)
If the outcome is m then the state collapses to:
M
m
[Ψ)
_
¸Ψ[M

m
M
m
[Ψ)
. (5.17)
Example Another way of looking at measuring the first bit in a two qubit
system.
[Ψ) =
1

30
[00) +
2

30
[01) +
3

30
[10) +
4

30
[11)
When we measure qubit one the resulting states would look like this (unnor-
malised):
[Ψ) = [0) ⊗
_
1

30
[0) +
2

30
[1)
_
for measuring a [0) and for measuring a [1):
[Ψ) = [1) ⊗
_
3

30
[0) +
4

30
[1)
_
.
Nowwe must make sure that the second qubit is normalised, so we multiply
it by a factor:
[Ψ) =

5

30
[0) ⊗
_
1

5
[0) +
2

5
[1)
_
+
5

30
[1) ⊗
_
3
5
[0) +
4
5
[1).
_
This gives us
¸
¸
¸

5

30
¸
¸
¸
2
=
1
6
probability of measuring a [0) and a
¸
¸
¸
5

30
¸
¸
¸
2
=
5
6
prob-
ability of measuring a [1). So if we measure a [0) then our post measurement
state is:
[Ψ) = [0) ⊗
_
1

5
[0) +
2

5
[1)
_
and if we measure a [1) then our post measurement state is:
[Ψ) = [1) ⊗
_
3
5
[0) +
4
5
[1)
_
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
126 Elements of Quantum Computing
Example Measurement of qubit one in a two qubit system using a simple
projector.
[Ψ) =
1

30
[00) +
2

30
[01) +
3

30
[10) +
4

30
[11).
We find the probability of measuring a [0) by using a projector [00)¸00[ +
[01)¸01[:
([00)¸00[ +[01)¸01[)
_
1

30
[00) +
2

30
[01) +
3

30
[10) +
4

30
[11)
_
= ([00)¸00[ +[01)¸01[) [Ψ)
=
1

30
[00) +
2

30
[01).
Say we change our measurement basis to ¦[0) , [1)¦ then we can represent pro-
jectors P
0
and P
1
as [0) ¸0[ and [1) ¸1[ respectively. We measure the probabil-
ity of the first qubit being 0 by using P
0
on qubit one and I on qubit two, i.e.
P
0
⊗I. If we wanted to measure the probability of the first qubit being 1 then
we would use P
1
⊗I.
pr(0) = ¸Ψ[P
0
⊗I[Ψ)
= ¸Ψ[ [0) ¸0[ ⊗I[Ψ)
= ¸Ψ[
1

30
[00) +
2

30
[01)
=
1
6
and this gives us a post-measurement state of:

) =
P
0
⊗I[Ψ)
_
¸Ψ[P
0
⊗I[Ψ)
=
1

30
[00) +
2

30
[01)
_
1
6
= [0) ⊗
_
_
1

30
[0) +
2

30
[1)
_
1
6
_
_
= [0) ⊗
_
1

5
[0) +
2

5
[1)
_
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 127
Properties:
All probabilities sum to 1,
m

i=1
pr(i) =
m

i=1
¸Ψ[M

i
M
i
[Ψ) = 1 this is
the result of the completeness equation, i.e.
m

i=1
M

i
M
i
= I. (5.18)
Note: our basis needs to be orthogonal, otherwise we can’t reliably distinguish
between two basis states [u) and [v), i.e. ¸u[v) ,= 0 means [u) and [v) are not
orthogonal.
Projective Measurements
Projective measurements are a means by which we can accomplish two tasks,
they are:
1. Apply a unitary transform to [Ψ).
2. Measure [Ψ).
So we need a unitary transform U and [Ψ) to perform a measurement. The uni-
tary transform is called the observable, which is denoted here by O
M
.
First we need to find the spectral decomposition of O
M
(Z for example), for
O
M
we have:
O
M
=

m
mP
m
(5.19)
where m is each eigenvalue and P
m
is a projector made up of P
m
= [m)¸m[.
5.1.4 Entangled States
Subatomic particles can be entangled, this means that they are connected, re-
gardless of distance. Their effect on each other upon measurement is instanta-
neous. This can be useful for computational purposes.
Consider the following state (which is not entangled):
1

2
([00) +[01))
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
128 Elements of Quantum Computing
it can be expanded to:
1

2
[00) +
1

2
[01) + 0[10) + 0[11).
Upon measuring the first qubit (a partial measurement) we get 0 100% of the
time and the state of the second qubit becomes:
1

2
[0) +
1

2
[1)
giving us equal probability for a 0 or a 1.
If we try this on an entangled state (in this case an EPR pair or Bell state, see
section 6.7) we find that the results for the qubits are correlated.
Example Consider:
1

2
([00) +[11)) .
When expanded this is:
1

2
[00) + 0[01) + 0[10) +
1

2
[11).
Measuring the first qubit gives us [00) 50% of the time and [11) 50% of the
time. So the second qubit is always the same as the first, i.e. we get two qubit
values for the price of one measurement.
This type of correlation can be used in a variety of ways in application to the
first or second qubit to give us correlations that are strongly statistically con-
nected. This is a distinct advantage over classical computation. Measuring
entangled states accounts for the correlations between them. The next example
show the measurement of a partially entangled state.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 129
Example The following state vector represents an entangled system.
[Ψ) =
2
3
[01) +
i2
3
[10) +
1
3
[00).
If we separate out the qubits (tensor decomposition) The state looks like this
(unnormalised):
[Ψ) = [0) ⊗
_
2
3
[1) +
1
3
[0)
_
+[1) ⊗
i2
3
[0).
Nowwe must make sure that the second qubit is normalised, so we multiply
it by a factor:
[Ψ) =

5
3
[0) ⊗
_
2

5
[0) +
1

5
[1)
_
+
i2
3
[1) ⊗[0).
Now say we measure qubit 1. Upon measurement of [0) the state collapses
to:

) = [0) ⊗
_
2

5
[0) +
1

5
[1)
_
.
Upon measuring a [1) the state collapses to:

) = [1) ⊗[0).
5.1.5 Quantum Circuits
If we take a quantum state, representing one or more qubits, and apply a se-
quence of unitary operators (quantum gates) the result is a quantum circuit.
We now take a register and let gates act on qubits, in analogy to a conventional
circuit.
U
1
U
2
Input states
U
3

This gives us a simple form of quantum circuit (above) which is a series of
operations and measurements on the state of n-qubits. Each operation is uni-
tary and can be described by an 2
n
2
n
matrix.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
130 Elements of Quantum Computing
Each of the lines is an abstract wire, the boxes containing U
n
are quantum logic
gates (or a series of gates) and the meter symbol is a measurement. Together, the
gates, wires, input, and output mechanisms implement quantum algorithms.
Unlike classical circuits which can contain loops, quantum circuits are ”one
shot circuits” that just run once from left to right (and are special purpose: i.e.
we have a different circuit for each algorithm).
It should be noted that it is always possible to rearrange quantum circuits so
that all the measurements are done at the end of the circuit.
Single Qubit Gates
Just as a single qubit can be represented by a column vector, a gate acting on
the qubit can be represented by a 2 2 matrix. The quantum equivalent of a
NOT gate, for example, has the following form:
_
0 1
1 0
_
.
The only constraint these gates have to satisfy (as required by quantum me-
chanics) is that they have to be unitary, where a unitary matrix is one that sat-
isfies the condition underneath. This allows for a lot of potential gates.
U

U = I.
The matrix acts as a quantum operator on a qubit. The operator’s matrix must
be unitary because the resultant values must satisfy the normalisation condi-
tion. Unitarity implies that the probability amplitudes must still sum to 1. If
(before the gate is applied)
[α[
2
+[β[
2
= 1
then, after the gate is applied:

[
2
+[β

[
2
= 1 (5.20)
where α

and β

are the values for the probability amplitudes for the qubit after
the operation has been applied.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 131
Here are some examples:
Pauli I Gate
This is the identity gate.
σ
0
= I =
_
1 0
0 1
_
(5.21)
which gives us the following:
[0) → I → [0), (5.22)
[1) → I → [1), (5.23)
α[0) +β[1) → I → α[0) +β[1). (5.24)
Pauli X Gate
The Pauli X gate is a quantum NOT gate.
X
σ
1
= σ
X
= X =
_
0 1
1 0
_
(5.25)
which gives us the following:
[0) → X → [1), (5.26)
[1) → X → [0), (5.27)
α[0) +β[1) → X → β[0) +α[1). (5.28)
The operation of the Pauli X gate can be visualised on the Bloch sphere as
follows:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
132 Elements of Quantum Computing
Here (and in subsequent images) the blue (dark) point is the original state vec-
tor and the green (light) point is the state vector after the transformation.
Pauli Y Gate
Y
σ
2
= σ
Y
= Y =
_
0 −i
i 0
_
(5.29)
which gives us the following:
[0) → Y → i[1), (5.30)
[1) → Y → −i[0), (5.31)
α[0) +β[1) → Y → −βi[0) +αi[1). (5.32)
Pauli Z Gate
This gate flips a qubit’s sign, i.e. changes the relative phase by a factor of -1.
Z
σ
3
= σ
Y
= Z =
_
1 0
0 −1
_
(5.33)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 133
which gives us the following:
[0) → Z → [0), (5.34)
[1) → Z → −[1), (5.35)
α[0) +β[1) → Z → α[0) −β[1). (5.36)
Phase Gate
S
S =
_
1 0
0 i
_
(5.37)
which gives us the following:
[0) → S → [0), (5.38)
[1) → S → i[1), (5.39)
α[0) +β[1) → S → α[0) +βi[1). (5.40)
Note, the Phase gate can be expressed in terms of the T gate (see below):
S = T
2
(5.41)
π
8
Gate (T Gate)
T
T =
_
1 0
0 e
i
π
4
_
(5.42)
which gives us the following:
[0) → T → [0), (5.43)
[1) → T → e
i
π
4
[1), (5.44)
α[0) +β[1) → T → α[0) +e
i
π
4
β[1). (5.45)
If we apply T again we get the same as applying S once.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
134 Elements of Quantum Computing
Hadamard Gate
Sometimes called the square root of NOT gate, it turns a [0) or a [1) into a su-
perposition (note the different sign). This gate is one of the most important in
quantum computing. We’ll use this gate later for a demonstration of a simple
algorithm.
H
H =
_
1 1
1 −1
_
(5.46)
which gives us the following:
[0) → H →
1

2
([0) +[1)), (5.47)
[1) → H →
1

2
([0) −[1)), (5.48)
α[0) +β[1) → H → α
_
[0) +[1)

2
_

_
[0) −[1)

2
_
. (5.49)
Example Using H and Z gates and measuring in the ¦[+), [−)¦ basis.
(1) We can put [0) into state [+) by using an H gate:
[0) → H →
1

2
([0) +[1)).
(2) We can put [0) into state [−) by using an H gate followed by a Z gate :
[0) → H →
1

2
([0) +[1)) → Z →
1

2
([0) −[1)).
The operation of the H gate can be visualised on the Bloch sphere as follows:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 135
Outer Product Notation
A handy way to represent gates is with outer product notation, for example a
Pauli X gate can be represented by:
[1)¸0[ +[0)¸1[.
When applied to α[0) +β[1). we get:
X(α[0) +β[1)) = ([1)¸0[ +[0)¸1[)(α[0) +β[1))
= [1)¸0[(α[0) +β[1)) +[0)¸1[(α[0) +β[1))
= α[1)1 +β[1)0 +α[0)0 +β[0)1
= β[0) +α[1).
For the above it’s useful to remember the following:
¸0[0) = 1,
¸0[1) = 0,
¸1[0) = 0,
¸1[1) = 1.
Instead of doing all that math, just think of it this way. For each component of
the sequence, take the bra part, ¸u[ from [v)¸u[, and the new qubit’s coefficient
will be the old qubit’s coefficient for the ket part [v).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
136 Elements of Quantum Computing
Example Say we use this method on the Pauli Y outer product representa-
tion,
i[1)¸0[ −i[0)¸1[.
When applied to [Ψ) = α[0) +β[1)) we’ll see what we get:
The first part of the outer product notation is i[1)¸0[ so this means we
take the α[0) part of [Ψ) and convert it to iα[1) so our partially built state
now looks like:
[Ψ) = . . . +iα[1).
Now we take the second part, −i[0)¸1[ and β[1) becomes −iβ[0) and finally
we get:
[Ψ) = −iβ[0) +iα[1).
Finally, the coefficients of outer product representations are the same as the
matrix entries, so for the matrix:
_
α
00
α
01
α
10
α
11
_
.
The outer product representation looks like:
α
00
[0)¸0[ +α
01
[0)¸1[ +α
10
[1)¸0[ +α
11
[1)¸1[.
Further Properties of the Pauli Gates
Next we’ll look at the eigenvectors, eigenvalues, spectral decomposition, and
outer product representation of the Pauli gates.
I has eigenvectors [0), and [1) with eigenvalues of 1 and 1 respectively. Us-
ing the spectral decomposition theorem:
I = 1 [0)¸0[ + 1 [1)¸1[
= [0)¸0[ +[1)¸1[. (5.50)
X has eigenvectors
1

2
([0) +[1)), and
1

2
([0) −[1)) with eigenvalues of 1 and -1
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 137
respectively.
X = 1
1

2
([0) +[1))
1

2
(¸0[ +¸1[) + (−1)
1

2
([0) −[1))
1

2
(¸0[ −¸1[)
= [1)¸0[ +[0)¸1[. (5.51)
Y has eigenvectors
1

2
(−i[0) +[1)), and
1

2
([0) −i[1)) with eigenvalues of 1 and
-1 respectively.
Y = 1
1

2
(−i[0) +[1))
1

2
(i¸0[ +¸1[) + (−1)
1

2
([0) −i[1))
1

2
(¸0[ +i¸1[)
= i[1)¸0[ −i[0)¸1[. (5.52)
Z has eigenvectors [0), and [1) with eigenvalues of 1 and -1 respectively.
Z = 1 [0)¸0[ + (−1) [1)¸1[
= [0)¸0[ −[1)¸1[. (5.53)
The Pauli matrices are:
Unitary (σ
k
)

= I ∀ k. (5.54)
Hermitian (σ
k
)

= σ
k
∀ k. (5.55)
Rotation Operators
There are three useful operators that work well with the Bloch sphere. These
are the rotation operators R
X
, R
Y
, and R
Z
.
R
X
=
_
cos
θ
2
−i sin
θ
2
−i sin
θ
2
cos
θ
2
_
(5.56)
= e
−iθX/2
, (5.57)
R
Y
=
_
cos
θ
2
−sin
θ
2
sin
θ
2
cos
θ
2
_
(5.58)
= e
−iθY/2
, (5.59)
R
Z
=
_
e
−iθ/2
0
0 e
−iθ/2
_
(5.60)
= e
−iθZ/2
. (5.61)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
138 Elements of Quantum Computing
The rotation operators can be rewritten as
cos
θ
2
I −i sin
θ
2
P
σ
(5.62)
where P
σ
means a Pauli operator identified by σ = X, Y, or Z.
In fact if we assume different angles for θ then all single qubit gates can be
represented by the product of R
Y
and R
Z
.
Example We can represent R
Y
(90

) by the following matrix:
1

2
_
1 −1
1 1
_
=
_
1

2

1

2
1

2
1

2
_
.
So if we apply the gate to state [Ψ) = [1) we get the following:
_
1

2

1

2
1

2
1

2
__
0
1
_
=
_

1

2
1

2
_
= −
1

2
[0) +
1

2
[1)
=
1

2
[0) −
1

2
[1).
At that last step we multiplied the entire state by a global phase factor of −1.
Multi Qubit Gates
Atrue quantumgate must be reversible, this requires that multi qubit gates use
a control line, where the control line is unaffected by the unitary transforma-
tion. We’ll look again at the reversible gates that were introduced in chapter 2,
this time with emphasis on quantum computing.
[a) • [a)
[b)
· ¸¸_¸
[b ⊕a)
In the case of the CNOT gate, the ⊕ is a classical XOR with the input on the b
line and the control line a. Because it is a two qubit gate it is represented by a
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 139
4 4 matrix:
_
¸
¸
¸
¸
_
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
_
¸
¸
¸
¸
_
(5.63)
which gives the following:
[00) → CNOT → [00), (5.64)
[01) → CNOT → [01), (5.65)
[10) → CNOT → [11), (5.66)
[11) → CNOT → [10), (5.67)
(α[0) +β[1))[1) → CNOT → α[01) +β[10), (5.68)
[0)(α[0) +β[1)) → CNOT → α[00) +β[01), (5.69)
[1)(α[0) +β[1)) → CNOT → α[11) +β[10). (5.70)
Example Evaluating (α[0) +β[1))[0) →CNOT → α[00) +β[11).
(α[0) +β[1))[0) expanded is α[00) +β[10), so in matrix form we have:
_
¸
¸
¸
¸
_
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
_
¸
¸
¸
¸
_
_
¸
¸
¸
¸
_
α
0
β
0
_
¸
¸
¸
¸
_
=
_
¸
¸
¸
¸
_
α
0
0
β
_
¸
¸
¸
¸
_
= α[00) +β[11).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
140 Elements of Quantum Computing
Qubit Two NOT Gate
As distinct from the CNOT gate we have a NOT
2
gate, which just does NOT on
qubit two and has the following matrix representation:
_
¸
¸
¸
¸
_
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0
_
¸
¸
¸
¸
_
(5.71)
which gives the following:
[00) → NOT
2
→ [01), (5.72)
[01) → NOT
2
→ [00), (5.73)
[10) → NOT
2
→ [11), (5.74)
[11) → NOT
2
→ [10). (5.75)
Although it’s not a commonly used gate it’s interesting to note that the gate
can be represented as a Kronecker product of I and X as follows [Knill, E.
Laflamme, R. Barnum, H. Dalvit, D. Dziarmaga, J. Gubernatis, J. Gurvits, L.
Ortiz, G. Viola, L. & Zurek, W.H. 2002]:
NOT
2
= I ⊗X =
_
1 0
0 1
_

_
0 1
1 0
_
(5.76)
=
_
_
_
_
_
_
1
_
0 1
1 0
_
0
_
0 1
1 0
_
0
_
0 1
1 0
_
1
_
0 1
1 0
_
_
_
_
_
_
_
. (5.77)
So, as well as using the NOT
2
notation we can use the tensor product of Pauli
gates on qubits one and two, shown below:
[00) → I ⊗X → [01), (5.78)
[01) → I ⊗X → [00), (5.79)
[10) → I ⊗X → [11), (5.80)
[11) → I ⊗X → [10). (5.81)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Elements of Quantum Computing 141
Toffoli Gate
The Toffoli gate was first introduced in chapter 2. Here we’ll look at some prop-
erties that relate to quantum computing. The most important property being
that any classical circuit can be emulated by using Toffoli gates.
[a) • [a

)
[b) • [b

)
[c)
· ¸¸_¸
[c

)
The Toffoli gate can simulate NAND gates and it can perform FANOUT, which
is classical bit copying (but we can’t copy superposed probability amplitudes).
FANOUT is easy in classical computing, but impossible in quantum computing
because of the no cloning theorem (see chapter 6).
A Toffoli gate can be simulated using a number of H, T, and S gates.
Fredkin Gate Also introduced in chapter 2, the Fredkin gate is another three
qubit gate. This gate can simulate AND, NOT, CROSSOVER, and FANOUT, it also
has the interesting property that it conserves 1’s.
[a) • [a

)
[b) [b

)
[c) [c

)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
142 Important Properties of Quantum Circuits
Classical circuit
Quantum circuit
x f(x)
x f(x)
ancilla bits
garbage bits
Figure 5.2: Garbage and ancilla bits.
5.2 Important Properties of Quantum Circuits
Quantum circuit diagrams have the following constraints which make them
different from classical diagrams.
1. They are acyclic (no loops).
2. No FANIN, as FANIN implies that the circuit is NOT reversible, and therefore
not unitary.
3. No FANOUT, as we can’t copy a qubit’s state during the computational phase
because of the no-cloning theorem (explained in chapter 6).
All of the above can be simulated with the use of ancilla and garbage bits if
we assume that no qubits will be in a superposition (figure 5.2). As stated
in chapter 2, Garbage bits are useless qubits left over after computation and
ancilla bits are extra qubits needed for temporary calculations.
5.2.1 Common Circuits
Controlled U Gate
Let U be a unitary matrix, which uses an arbitrary number of qubits. A con-
trolled U gate is a U gate with a control line, i.e. if the control qubit is [1) then
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Properties of Quantum Circuits 143
U acts on its data qubits, otherwise they are left alone.

U
Bit Swap Circuit
This circuit swaps the values of qubits between lines.
[a) •
· ¸¸_¸
• [b)
[b)
· ¸¸_¸

· ¸¸_¸
[a)
The circuit can be simplified to:
[a) [b)
[b) [a)
Here are some examples:
[0) [1)
[1) [0)
[1) [0)
[0) [1)
Copying Circuit
If we have no superposition then we can copy bits in a classical sense with a
CNOT.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
144 Important Properties of Quantum Circuits
[a) • [a)
[0)
· ¸¸_¸
[a)
[0) • [0)
[0)
· ¸¸_¸
[0)
[1) • [1)
[0)
· ¸¸_¸
[1)
But when we use a superposition as input:
α[0) +β [1) •
[0)
· ¸¸_¸
The combined state becomes:
(α[0) +β[1))[0) = α[00) +β[10),
α[00) +β[10) → CNOT → α[00) +β[11).
Which is not a copy of the original state because:
(α[0) +β[1))(α[0) +β[1)) ,= α[00) +β[11).
A qubit in an unknown state (as an input) cannot be copied, when it is copied
it must first be measured to be copied. The information held in the probability
amplitudes α and β is lost.
Bell State Circuit
This circuit produces Bell states that are entangled. We’ll represent a Bell state
circuit by β, and the individual Bell states as [β
00
), [β
01
), [β
10
), and [β
11
).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Properties of Quantum Circuits 145
[a)
H


xx
)
[b)
· ¸¸_¸
[00) → β →
1

2
([00) +[11)) = [β
00
),
[01) → β →
1

2
([01) +[10)) = [β
01
),
[10) → β →
1

2
([00) −[11)) = [β
10
),
[11) → β →
1

2
([01) −[10)) = [β
11
).
Superdense Coding
It’s possible, by using entangled pairs, to communicate two bits of information
by transmitting one qubit. Here’s how:
1. Initially Alice and Bob each take one half of an EPR pair, say we start with
β
00
. This means that Alice has the bolded qubit in
1

2
([00) + [11)) and
Bob has the bolded qubit in
1

2
([00) − [11)). They then move apart to an
arbitrary distance.
2. Depending on which value Alice wants to send to Bob, she applies a gate
(or gates) to her qubit. This is described below and the combined state is
shown after the gate’s operation with Alice’s qubit shown bolded:
[00) → I →
1

2
([00) +[11)),
[10) → X(X[0) = [1), X[1) = [0)) →
1

2
([10) +[01)),
[01) → Z(Z[0) = [0), Z[1) = −[1)) →
1

2
([00) −[11)),
[11) → XZ →
1

2
([01) −[10)).
3. Alice now sends her qubit to Bob via a classical channel.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
146 Important Properties of Quantum Circuits
4. Bob now uses a CNOT which allows him to ”factor out the second qubit”
while the first one stays in a superposition.
1

2
(α[00) +β[11)) → CNOT →
1

2
(α[00) +β[10)) =
1

2
(α[0) +β[1))[0),
1

2
(α[10) +β[01)) → CNOT →
1

2
(α[01) +β[11)) =
1

2
(α[0) +β[1))[1),
1

2
(α[00) −β[11)) → CNOT →
1

2
(α[00) −β[10)) =
1

2
(α[0) −β[1))[0),
1

2
(α[01) −β[10)) → CNOT →
1

2
(α[01) −β[11)) =
1

2
(α[0) −β[1))[1).
5. Now Bob applies an H gate to the first bit to collapse the superposition.
1

2
(α[0) −β[1)) → H → [1),
1

2
(α[0) +β[1)) → H → [0).
So Bob gets the following:
1

2
(α[0) +β[1))[0) → (H ⊗I) → [00),
1

2
(α[0) +β[1))[1) → (H ⊗I) → [01),
1

2
(α[0) −β[1))[0) → (H ⊗I) → [10),
1

2
(α[0) −β[1))[1) → (H ⊗I) → [11).
Bob can now measure the two qubits in the computational basis and the result
will be the value that Alice wanted to send.
Teleportation Circuit
Teleportation is basically the opposite of superdense coding, i.e. superdense
coding takes a quantum state to two classical bits. Teleportation takes two clas-
sical bits to one quantum state.
Alice’s circuit
[Ψ) •
H

β
00
· ¸¸_¸

The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Important Properties of Quantum Circuits 147
Bob chooses one of the following four circuits
β
00 I
[Ψ)
β
00 X
[Ψ)
β
00 Z
[Ψ)
β
00 X Z
[Ψ)
1. Like superdense coding, initially Alice and Bob each take one half of an EPR
pair, say we start with β
00
. This means that Alice has the bolded qubit in
1

2
([00) −[11)) and Bob has the bolded qubit in
1

2
([00) −[11)). They then
move apart to an arbitrary distance.
2. Alice has a qubit in an unknown state:
[Ψ) = α[0) +β[1).
Which she combines with her entangled qubit:
(α[0) +β[1))
_
1

2
([00) +[11))
_
.
This gives the following combined state (Alice’s qubits are bolded):
[Ψ) =
1

2
(α[000) +α[011) +β[100) +β[111)).
3. Alice then applies a CNOT. Note - This is like using (CNOT⊗I) on the combined
three qubit system, i.e. including Bob’s qubit.
1

2
(α[000) +α[011) +β[110) +β[101)).
4. Alice then applies an H gate to her first qubit, the qubit we want to teleport
(or H ⊗I ⊗I for the combined system):
1
2
(α([000) +[100) +[011) +[111)) +β([010) −[110) +[001) −[101))).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
148 The Reality of Building Circuits
Now we rearrange the state to move amplitudes α and β so that we can
read the first two bits leaving the third in a superposition.
=
1
2
([00)α[0) +[10)α[0) +[01)α[1) +[11)α[1) +[01)β[0) −[11)β[0)
+[00)β[1) −[10)β[1)),
=
1
2
([00)(α[0) +β[1)) +[01)(α[1) +β[0)) +[10)(α[0) −β[1))
+[11)(α[1) −β[0))).
5. Alice now performs measurements on her state to determine which of the
above bolded states her qubits are in. She then communicates via a clas-
sical channel what she measured (i.e. a [00), [01), [10), or a [11)) to Bob.
6. Bob now may use X and/or Z gate(s) to fix up the phase and order of the
probability amplitudes, (he selects gates based on what Alice tells him)
so that the result restores the original qubit. Summarised below are the
gates he must use:
Case 00 = α[0) +β[1) → I → α[0) +β[1),
Case 01 = α[1) +β[0) → X → α[0) +β[1),
Case 10 = α[0) −β[1) → Z → α[0) +β[1),
Case 11 = α[1) −β[0) → XZ → α[0) +β[1).
5.3 The Reality of Building Circuits
There is a general theorem: Any unitary operation on n qubits can be imple-
mented using a set of two qubit operations. This can include CNOTs and other
single bit operations. This result resembles the classical result that any boolean
function can be implemented with NAND gates. This is helpful because some-
times we are limited in what we can use to build a quantum circuit.
5.3.1 Building a Programmable Quantum Computer
Is it Possible to Build a Programmable Quantum Computer
Can we build a programmable quantum computer? This means a quantum
computer that has an architecture similar to Von Neumann (or Harvard) archi-
tecture? No! This is because:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
The Four Postulates of Quantum Mechanics 149
Distinct unitary operators U
0
...U
n
require orthogonal programs [U
0
), ...[U
n
)
[Nielsen, M. A. 2002]
This is called the no programming theorem.
If we were to have a programmable quantum computer our ”program” would
consist of one or more unitary operators. Since there are an infinite number of
these unitary operators the program register would have to be infinite in size
(that is our input to the quantumcomputer that contains the program) [Nielsen,
M. A. 2002].
5.4 The Four Postulates of Quantum Mechanics
Now we can look at the four postulates in a bit more detail than in chapter 4,
in terms of quantum computing.
5.4.1 Postulate One
An isolated system has an associated complex vector space called a state space.
We will use a state space called a Hilbert space.
The state of the quantum system can be described by a unit vector in this space
called a state vector.
Example The simplest system we are interested in is a qubit which is in C
2
.
Aqubit is a unit vector [Ψ) in C. Most of the time we’ll attach an orthonormal
basis (like ¦[0), [1)¦). Our qubit can be described by:
[Ψ) = α[0) +β[1) =
_
α
β
_
here α and β are known as probability amplitudes and we say the qubit is in
a quantum superposition of states [0) and [1).
5.4.2 Postulate Two
Simple form
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
150 The Four Postulates of Quantum Mechanics
An isolated (closed) system’s evolution can be described by a unitary trans-
form.

) = U[Ψ). (5.82)
Form including time
If we include time (as quantum interactions happen in continuous time):
[Ψ(t
2
)) = U(t
1
, t
2
)[Ψ(t
1
)) (5.83)
here t
1
and t
2
are points in time and U(t
1
, t
2
) is a unitary operator than can vary
with time.
We can also say that the process is reversible, because:
U

U[Ψ) = [Ψ). (5.84)
The history of the quantumsystemdoes not matter as it is completely described
by the current state (this is know as a Markov process).
Note: We can rewrite the above in terms of Schr¨ odinger’s equation, but that
is beyond the scope of this paper.
5.4.3 Postulate Three
Simple form
This deals with what happens if [Ψ) is measured in an orthonormal basis:
¦[O
1
), [O
1
), . . . , [O
n
)¦.
We’ll measure a particular outcome j with probability:
pr(j) = [¸O
j
[Ψ)[
2
. (5.85)
Example If we measure in the computational basis we have:
pr(0) = [¸0[Ψ)[
2
= [¸0[(α[0) +β [1))[
2
= [α[
2
and pr(1) = [β[
2
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
The Four Postulates of Quantum Mechanics 151
After the measurement the system is in state [O
j
). This is because measure-
ment disturbs the system.
If [u
1
) and [u
2
) are not orthogonal (i.e. ¸u
1
[u
2
) ,= 0) then we can’t reliably dis-
tinguish between them on measurement.
Projectors
Suppose we have a larger quantum system which is a combination of smaller
systems, i.e. we have an orthonormal basis A = ¦[e
1
), . . . , [e
n
)¦ where n is the
dimension of A. Then we have a larger quantum system B such that A ⊂ B.
If we measure A what is the effect on B?
We can say that [O
1
), . . . , [O
n
) is part of or comprised of one or many of the
orthogonal subspaces V
1
, V
2
, . . . , V
m
which are connected in the following way:
V = V
1
⊕V
2
⊕. . . ⊕V
m
. (5.86)
Example The state vector:
[Ψ) = (α[O
1
) +β[O
2
)) +γ[O
3
)
can be rewritten as:
V ([O
1
), [O
2
), [O
3
)) = V
1
([e
1
), [e
2
)) ⊕V
2
([e
3
)).
We can use projectors (P
1
, . . . , P
m
) to filter out everything other than the sub-
space we are looking for (i.e. everything orthogonal to our subspace V ).
Example From the last example, projector P
1
on V
1
([e
1
), [e
2
)) gives us:
P
1
(α[e
1
) +β[e
2
) +γ[e
3
)) = α[e
1
) +β[e
2
).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
152 The Four Postulates of Quantum Mechanics
Formally, if P
1
, . . . , P
m
is a set of projectors which covers all the orthogonal
subspaces of the state space, upon measuring [Ψ) we have,
pr(j) = ¸Ψ[P
j
[Ψ) (5.87)
leaving the system in the post measurement state:
P
j
[Ψ)
_
¸Ψ[P
j
[Ψ)
. (5.88)
Example Given a qutrit [Ψ) = α[0) +β[1) +γ[2)).
P
1
on V
1
([0), [1)) and P
2
on V
2
([2)) gives us:
pr(1) = ¸Ψ[P
1
[Ψ)
= [α

β

γ

]
_
¸
_
α
β
0
_
¸
_
= [α[
2
+[β[
2
,
pr(2) = ¸Ψ[P
2
[Ψ)
= [α

β

γ

]
_
¸
_
0
0
γ
_
¸
_
= [γ[
2
.
So our separated look like this:

1
) =
P
1
[Ψ)
_
¸Ψ[P
1
[Ψ)
=
α[0) +β[1)
_
[α[
2
+[β[
2
,

2
) =
P
2
[Ψ)
_
¸Ψ[P
2
[Ψ)
=
γ[2)
_
[γ[
2
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
The Four Postulates of Quantum Mechanics 153
More importantly we can look at partial measurement of a group of qubits, the
following example uses the tensor product which is also part of postulate 4. If
the system to be measured in the basis ¦[O
1
), [O
2
)¦ then we use the projector
with a tensor product with I on the qubit we don’t want to measure. e.g. for
[O
2
) of qubit two we use (I ⊗P
2
).
Example If [Ψ) = α
00
[00) +α
01
[01) +α
10
[10) +α
11
[11):
For measuring qubit one in the computational basis we get [0) with
probability:
pr(0) = ¸Ψ[P
0
⊗I[Ψ)
= (α
00
[00) +α
01
[01) +α
10
[10) +α
11
[11)) • (α
00
[00) +α
01
[01))
= [α
00
[
2
+[α
01
[
2
.
There is another type of measurement called a POVM (Positive Operator Val-
ued Measure) of which projectors are a certain type. POVMs are beyond the
scope of this text.
5.4.4 Postulate Four
A tensor product of the components of a composite physical system, describes
the system. So the state spaces of the individual systems are combined so:
C
n
⊗C
n
= C
n
2
. (5.89)
An example is on the next page.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
154 The Four Postulates of Quantum Mechanics
Example C
4
⊗C
4
= C
16
can look like:
([Ψ
A
) = [1) +[2) +[3) +[4)) ⊗([Ψ
B
) = [a) +[b) +[c) +[d))
and can be written as:

AB
) = [1a) +[1b) +[1c) +. . . +[4d).
Example If Alice has [Ψ
A
) = [u) and Bob has [Ψ
B
) = [v), if their systems
are combined the joint state is:

AB
) = [u) ⊗[v).
If Bob applies gate U to this system it means I ⊗ U is applied to the joint
system.
Example Given the following:
[Ψ) =

0.1[00) +

0.2[01) +

0.3[10) +

0.4[11)
then,
[Ψ) → (I ⊗X) → [Ψ) =

0.1[01) +

0.2[00) +

0.3[11) +

0.4[10),
[Ψ) → (X ⊗I) → [Ψ) =

0.1[10) +

0.2[11) +

0.3[00) +

0.4[01).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 6
Information Theory
6.1 Introduction
Information theory examines the ways information can be represented and
transformed efficiently [Steane, A. M. 1998]. This information can be repre-
sented in many different ways to express the same meaning. E.g. ”How are
you?” and ”Comment allez vous?” express the same meaning. All known
ways of representing this information must have a physical medium like mag-
netic storage or ink on paper. The Information stored on a particular physical
medium is not ”tied” to that medium and can be converted from one form to
another. If we consider information in these terms then it becomes a property
like energy that can be transferred from one physical system to another.
We are interested in quantum information, which has many parallels in con-
ventional information theory. Conventional information theory relies heavily
on the classical theorems of Claude E. Shannon, 1916 - 2001 (figure 6.1). There
are a number of quantum equivalents for the various parts of his classical the-
orems. In this chapter we’ll look at these and other related topics like quantum
error correction, and quantum cryptology. Also, as promised, there is a fairly
in-depth section on Bell states and the chapter ends with some open questions
on the nature of information and alternate methods of computation.
As with chapter 5 individual references to QCQI have been dropped as they
would appear too frequently.
155
156 History
Figure 6.1: Claude E. Shannon and George Boole.
6.2 History
The history of information theory can be said to have started with the invention
of boolean algebra in 1847 by George Boole, 1815 - 1864 (figure 6.1). Boolean alge-
bra introduced the concept of using logical operations (like AND, OR, and NOT)
on the binary number system. The next milestone was in 1948 when Shannon
wrote ”the mathematical theory of communication” in which he outlined the
concepts of Shannon entropy (see section 6.5.1) [Shannon C. E. 1948]. Earlier
Shannon had shown that boolean algebra could be used to represent relays,
switches, and other components in electronic circuits. Shannon also defined
the most basic unit of information theory - the bit (binary digit).
6.3 Shannon’s Communication Model
To formally describe the process of transmitting information from a source to a
destination we can use Shannon’s communication model, which is shown in figure
6.2. The components of this are described as follows:
Source - The origin of the message, which itself has a formal definition (see
section 6.4). The message is sent from the source in its raw form.
Transmitter - The transmitter encodes and may compress the message at which
point the message becomes a signal which is transported fromtransmitter
to receiver.
Source of Noise - The noise source can introduce random noise into the sig-
nal, potentially scrambling it.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shannon’s Communication Model 157
Figure 6.2: Shannon’s communication model.
Receiver - The receiver may decode and decompress the signal back into the
original message.
Destination - The destination of the raw message.
6.3.1 Channel Capacity
A message is chosen from a set of all possible messages and then transmitted.
Each symbol transferred takes a certain amount of time (which is called the
channel capacity).
Shannon’s name for channel capacity on a binary channel is ”one bit per time
period” e.g. 56, 000 bits per second. His expression for capacity is:
C = lim
T→∞
log
2
N
T
(6.1)
where N is the number of possible messages of length T.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
158 Classical Information Sources
Example For binary we have:
2 bits = 4 different messages in 2 time periods.
3 bits = 8 different messages in 3 time periods.
so,
N(T) = 2
T
and,
C =
log
2
N
T
= 1 bit per time period.
Example Another example is morse code, where dashes take longer to
transmit than dots. If dashes are represented by 1110 and a dot is 10 for
this we have:
C = 0.34 bit per time period.
6.4 Classical Information Sources
A source of information produces a discrete set of symbols from a specific al-
phabet. The alphabet that is most commonly used is binary (1 and 0), but it
could in principle be any series of symbols.
The way an information source can be modelled is via a probability that cer-
tain letters or combinations of letters (words) will be produced by the source.
An example for this probability distribution would be, given an unknown book -
one could, in advance, predict to a certain degree of accuracy the frequency of
words and letters within the book [Nielsen, M. A. 2002].
6.4.1 Independent Information Sources
An independent and identically Distributed (IID) information source is an infor-
mation source in which each output has no dependency on other outputs from
the source, and furthermore each output has the same probability of occurring
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Information Sources 159
each time it is produced [Nielsen, M. A. 2002].
An IID is an information source with an alphabet (i.e a set of symbols or out-
puts a
i
):
A = ¦a
1
, . . . , a
n
¦ (6.2)
with probabilities pr(a
1
),pr(a
2
), . . . ,pr(a
n
) such that:
n

i=1
pr(a
i
) = 1 where 0 ≤ pr(a
i
) ≤ 1 ∀ i. (6.3)
This source will produce a letter with probability pr(a
i
) with no dependency
on the previous symbols. Independent information sources are also called zero
memory information sources (i.e. they correspond to a Markov process).
Example [Nielsen, M. A. 2002] A biased coin is a good example of an IID.
The biased coin has a probability p of heads and a probability of 1−p of tails.
Given a language

= ¦heads, tails¦:
pr(heads) = 0.3,
pr(tails) = 0.7 .
Our coin will come up tails 70% of the time.
Strictly speaking, Shannon’s results only hold for a subset of information sources
that conform to the following:
1. Symbols must be chosen with fixed probabilities, one by one with no depen-
dency on current symbols and preceding choices.
2. An information source must be an ergodic source. This means that there
should be no statistical variation (with a probability of 1) between possi-
ble sources. I.e. all systems should have the same probabilities for letters
to appear in their alphabets.
Not many sources are perfect like the above. The reason is that, for example
a book has correlations between syllables, words, etc. (not just letters) like
”he” and ”wh” [Nielsen, M. A. 2002]. We can measure certain qualities and
the source becomes more like an IID (like JUST letter frequency). Shannon
suggested that most information sources can be approximated.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
160 Classical Redundancy and Compression
6.5 Classical Redundancy and Compression
Compression of data means using less information to represent a message and
reconstructing it after it has been transmitted. When we talk about compression
in this section we mean simple algorithmic compression that can be applied to
all information sources. This is distinct from say, changing the text in a sen-
tence to convey the same meaning or using special techniques to only work
on a subset of messages or information sources (like using a simple formula to
exactly represent a picture of a sphere).
We often talk about using a coding K to represent our message. Formally, a
coding is a function that takes a source alphabet A to a coding alphabet B, i.e.
K : A → B. For every symbol a in the language A, K(a) is a word with letters
from B.
A word, w = a
1
a
2
. . . a
n
in A is found by:
K(w) = K(a
1
)K(a
2
) . . . K(a
n
). (6.4)
Example A simple coding.
A = ¦A, B, C, D¦,
B = ¦0, 1¦.
Possible encodings are:
A → 0001,
B → 0101,
C → 1001,
D → 1111.
So we encode the word ABBA as:
K(ABBA) = 0001 0101 0101 0001.
Length of Codes
We define the size of an alphabet A as [A[ and the length of a word w can be
shown with [w[.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Redundancy and Compression 161
Example [A[ and [w[.
A = ¦a, b, c, d, e, f¦,
B = ¦0, 1, 2¦.
Possible encodings are:
a → 0,
b → 1,
c → 20,
d → 220,
e → 221,
f → 222.
We get:
[K(a)[ = 1, [K(c)[ = 2, [K(f)[ = 3, [A[ = 6, [B[ = 3.
6.5.1 Shannon’s Noiseless Coding Theorem
Shannon demonstrated that there is a definite limit to how much an informa-
tion source can be compressed. Shannon Entropy H(S) is the minimum number
of bits needed to convey a message. For a source S the entropy is related to the
shortest average length coding L
min
(S) by:
H(S) ≤ L
min
(S) < H(S) + 1. (6.5)
We can find the Shannon Entropy, of a particular source distribution measured
in bits by:
H(X) = −

i
pr
i
log
2
pr
i
. (6.6)
Here, log
2
(a log of base 2) means that the Shannon entropy is measured in bits.
pr
i
is a measure of probability (i.e. the frequency with which it is emitted) for a
symbol being generated by the source and the summation is a sum over all the
symbols i = 1, 2, . . . , n generated by the source.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
162 Classical Redundancy and Compression
Example Random and dependent sources.
Random Each symbol is chosen from the source totally randomly (with A
and B having equal probability), with no dependencies, this source is
uncompressible with Shannon Entropy of 1 bit per symbol.
Dependent Every second symbol is exactly the same as the last, which is
chosen randomly (e.g. AABBBBAABB). This has Shannon Entropy of
1
2
bit(s) per symbol.
Example We have a language ¦A, B, C, D, E¦ of symbols occurring with
the following frequency:
A = 0.5, B = 0.2, C = 0.1, D = 0.1, E = 0.1 .
The entropy is:
H(X) = −[(0.5 log
2
0.5 + 0.2 log
2
0.2 + (0.1 log
2
0.1) 3)]
= −[−0.5 + (−0.46438) + (−0.9965)]
= −[−1.9]
= 1.9.
So we need 2 bits per symbol to convey the message.
The minimum entropy is realised when the information source produces a sin-
gle letter constantly, this gives us a probability of 1 for that letter.
The maximum entropy is realised when we have no information about the
probability distribution of the source alphabet (when all symbols are equally
likely to occur).
A special case of the entropy is binary entropy where the source has just two
symbols with probabilities of p and 1 − p like the biased coin toss for exam-
ple. Note a fair coin toss has maximum entropy of 1 bit and a totally unfair,
weighted coin that always comes up heads or always comes up tails has mini-
mum entropy of 0 bits.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Redundancy and Compression 163
6.5.2 Quantum Information Sources
Shannon entropy gives us a lower bound on how many bits we need to store
a particular piece of information. The question is, is there any difference when
we use quantum states? The answer is yes if we use a superposition.
If the qubits involved are in well defined states (like [0) and [1)) a semiclas-
sical coin toss [Nielsen, M. A. 2002] gives us:
[0) with probability of
1
2
,
[1) with probability of
1
2
,
H
_
1
2
_
= 1.
If we replace one of these states with a superposition then a ”quantum coin
toss” gives us:
[0) with probability of
1
2
,
|0+|1

2
with probability of
1
2
,
H
_
1 +
1

2
2
_
= 0.6 .
Better than Shannon’s rate!
Generally a quantum information source produces state: [Ψ
j
) with probabil-
ities pr(j), and our quantum compression performs better than the Shannon
rate H(pr(j)).
6.5.3 Pure and Mixed States
A quantum system is said to be in a pure state if its state is well defined. This
does not mean the state vector will always collapse to a known value; but at
least the state vector is known as distinct fromwhat it collapses to. For example
given a photon and a polariser the photon can be in three states, horizontal (H),
vertical (V), and diagonal (D). If we make our photon diagonal at 45

then we
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
164 Classical Redundancy and Compression
have an equal superposition of H and V.
[D) =
1

2
[H) +
1

2
[V).
Now if we measure polarisation we have a 50% chance of detecting an [H) or a
50% of detecting a [V). The state was well defined before measurement, so we
call it pure (i.e. we have a well defined angle of polarisation viz 45

, and if we
measure with a polariser in this direction the result is certain). We don’t have
this situation if there is no direction in which the result is certain. So the state is
not well defined and we call this state mixed. For example, if we have a number
of photons, 50%of which are polarised horizontally and 50%vertically, nowwe
have a mixed state. Each photon has a well defined state [H) or [V), but not the
group. This situation is indistinguishable from a photon that is in an entangled
state.
When closed quantum systems get affected by external systems our pure states
can get entangled with the external world, leading to mixed states. This is
called decoherence, or in information theory terms, noise.
It is possible to have a well defined (pure) state that is composed of subsys-
tems in mixed states. Entangled states like Bell states are well defined for the
composite system (whole), but the state of each component qubit is not well
defined, i.e. mixed.
6.5.4 Schumacher’s Quantum Noiseless Coding Theorem
The quantum analogue of Shannon’s noiseless coding theorem is Schumacher’s
quantum noiseless coding theorem. Which is as follows [Nielsen, M. A. 2002]:
The best data rate R achievable is S(ρ). (6.7)
where S is Von Neumann entropy and ρ is the density matrix. ρ holds equivalent
information to the quantumstate Ψand quantummechanics can be formulated
in terms of ρ as an alternative to Ψ. We now look at ρ.
The Density Matrix
In studying quantum noise it turns out to be easier to work with the density
matrix than the state vector (think of it as just a tool; not a necessary compo-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Redundancy and Compression 165
nent of quantum computing).
According to Nielsen [Nielsen, M. A. 2002] there are three main approaches
to the density matrix, the ensemble point of view, subsystem, and fundamental
approaches. They are described briefly here:
Ensemble - This is the basic view of the density matrix which gives us mea-
surement statistics in a compact form.
Subsystem - If quantum system A is coupled to another quantum system B
we can’t always give A a state vector on its own (it is not well defined).
But we can assign an individual density matrix to either subsystem.
Fundamental - It is possible to restate the four postulates of quantummechan-
ics in terms of the density matrix.
For example, as mentioned above, we can view the statistics generated by an
entangled photon as equivalent to that of the corresponding ensemble.
Ensemble Point of View
Consider a collection of identical quantum systems in states in [Ψ
j
) with prob-
abilities pr
j
. The probability of outcome k when a measurement, which is de-
scribed by P
k
, is:
k = tr(ρP
k
) (6.8)
where,
ρ =

j
pr
j

j
)¸ψ
j
[ (6.9)
is the density matrix. ρ completely determines the measurement statistics. The
set of all probabilities and their associated state vectors ¦pr
j
, [ψ
j
)¦ is called an
ensemble of pure states.
If a measurement is done, with projectors P
k
on a system with density matrix ρ
the post measurement density matrix ρ
k
is:
ρ
k
=
P
k
ρP
k
tr(P
k
ρP
k
)
. (6.10)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
166 Classical Redundancy and Compression
A simple example involving the probabilities for a qubit in a known state is
below:
Example For a single qubit in the basis ¦[0), [1)¦.
ρ =
2

j=1
pr
j

j
)¸ψ
j
[.
For [Ψ) = 1 [0) +0 [1), i.e. measurement probabilities pr([0)) = 1 and pr([1))
= 0:
ρ = 1 [0)¸0[ + 0 [1)¸1[
= 1
_
1
0
_
_
1 0
_
+ 0
_
0
1
_
_
0 1
_
=
_
1 0
0 0
_
.
For [Ψ) = 0 [0) +1 [1), i.e. measurement probabilities pr([0)) = 0 and pr([1))
= 1:
ρ = 0 [0)¸0[ + 1 [1)¸1[
= 0
_
1
0
_
_
1 0
_
+ 1
_
0
1
_
_
0 1
_
=
_
0 0
0 1
_
.
Next we’ll have a look at a qubit in an unknown state, and the use of a trace
over the density matrix given a projector.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Redundancy and Compression 167
Example Given measurement probabilities pr([0)) = p and pr([1)) = 1 −p.
ρ = p[0)¸0[ + (1 −p)[1)¸1[
= p
_
1
0
_
_
1 0
_
+ (1 −p)
_
0
1
_
_
0 1
_
= p
_
1 0
0 0
_
+ 1 −p
_
0 0
0 1
_
=
_
p 0
0 1 −p
_
.
So, given a density matrix ρ and a projector P = [0)¸0[ we can extract the
final probability from ρ, say we measure in an orthonormal basis, ¦[0), [1)¦
then:
pr([0)) = tr(ρ[0)¸0[)
= tr
__
p 0
0 1 −p
__
1 0
0 0
__
= tr
__
p 0
0 0
__
= p + 0
= p,
pr([1)) = tr(ρ[1)¸1[)
= tr
__
p 0
0 1 −p
__
0 0
0 1
__
= tr
__
0 0
0 1 −p
__
= 0 + (1 −p)
= 1 −p.
How does a the density matrix evolve?
Suppose a unitary transform U is applied to a quantum system: i.e. U[Ψ);
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
168 Classical Redundancy and Compression
what is the new density matrix? To answer this, using the ensemble view, we
can say that if the system can be in states [Ψ
j
) with probabilities tr
j
then, after
the evolution occurs, it will be in state U[Ψ) with probabilities pr
j
.
Initially we have ρ =

j
pr
j

j
)¸ψ
j
[. So, after U is applied, we have:
ρ

=

j
pr
j
U[ψ
j
)¸ψ
j
[U

(6.11)
= U
_

j
pr
j
U[ψ
j
)¸ψ
j
[
_
U

(6.12)
= UρU

. (6.13)
Note that when [ψ
j
) goes to U[ψ
j
), ¸ψ
j
[ = [ψ
j
)

goes to (U[ψ
j
))

= ¸ψ
j
[U

.
Example Given measurement probabilities pr([0)) = p and pr([1)) = 1 − p
then ρ =
_
p 0
0 1 −p
_
.
If X is applied to ρ then:
ρ

= XρX
=
_
1 −p 0
0 p
_
.
Example For [Ψ) =
1

2
[00) +
1

2
[11) we have pr([00)) =
1
2
and pr([11)) =
1
2
.
This gives us a what is called completely mixed state and ρ =
I
2
. So,
ρ

= U
I
2
U

=
I
2
because UU

= 1.
Properties:
tr(ρ) = 1. (6.14)
ρ is a positive matrix. (6.15)
Subsystem Point of View
The density matrix can describe any subsystem of a larger quantum system,
including mixed subsystems. Subsystems are described by a reduced density
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Classical Redundancy and Compression 169
matrix. If we have two subsystems A and B of a system C where A ⊗ B = C.
The density matrices for the subsystems are ρ
A
and ρ
B
and the overall density
matrix is ρ
C
(also referred to as ρ
AB
). We can define ρ
A
and ρ
B
as:
ρ
A
= tr
B

C
) and ρ
B
= tr
A

C
). (6.16)
tr
A
and tr
B
are called partial traces over systems A and B respectively. The
partial trace is defined as follows:
ρ
A
= tr
B
([a
1
)¸a
2
[ ⊗[b
1
)¸b
2
[) = [a
1
)¸a
2
[tr([b
1
)¸b
2
[) (6.17)
= ¸b
1
[b
2
)[a
1
)¸a
2
[. (6.18)
Previously we mentioned the difference between pure and mixed states. There’s
a simple test we can do to determine is a state is mixed or pure, which is to run
a trace on that state, if we get tr(ρ
2
) < 1 then the state is mixed (tr(ρ
2
) = 1
for a pure state). Bell states for example have a pure combined state with
tr((ρ
C
)
2
) = 1, but they have mixed substates, i.e. tr((ρ
A
)
2
) < 1 and tr((ρ
B
)
2
) < 1.
Fundamental Point of View
In terms of the density matrix the four postulates of quantum mechanics are
[Nielsen, M. A. 2002]:
1. Instead of using a state vector, we can use the density matrix to describe a
quantum system in Hilbert space. If a system is in state ρ
j
with a proba-
bility of pr
j
it has a density matrix of

j
pr
j
ρ
j
.
2. Changes in a quantum system are described by ρ → ρ

= UρU

.
3. Measuring using projectors P
k
gives us k with probability tr(P
k
ρ) leaving
the system in a post measurement state of ρ
k
=
P
k
ρP
k
tr(P
k
ρP
k
)
.
4. A tensor product gives us the state of a composite system. A subsystem’s
state can be found by doing a partial trace on the remainder of the system
(i.e. over the other subsystems making up the system).
Von Neumann Entropy
The probability distributions in classical Shannon entropy H, are replaced by a
density matrix ρ in Von Neumann entropy, S:
S(ρ) = −tr(ρ log
2
ρ). (6.19)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
170 Classical Redundancy and Compression
We can also define the entropy in terms of eigenvalues λ
i
:
S(ρ) = −

i
λ
i
log
2
λ
i
(6.20)
where λ
i
are the eigenvalues of ρ.
If we want to define the uncertainty of a quantum state before measurement
we can use entropy, given a Hilbert space of dimension d then
0 ≤ S(ρ) ≤ log
2
d (6.21)
with S(ρ) = 0 meaning a pure state and S(ρ) = log
2
d giving us a totally mixed
state. For example we could compare two states, by measuring their Von Neu-
mann entropy and determine if one is more entangled than the other. We also
use Von Neumann entropy to define a limit for quantum data compression,
namely Schumacher compression, which is beyond the scope of this paper.
Properties:
S(ρ
A
⊗ρ
B
) = S(ρ
A
) +S(ρ
B
). (6.22)
S(ρ
AB
) ≤ S(ρ
A
) +S(ρ
B
). (6.23)
S(ρ
AB
) ≥ [S(ρ
A
) −S(ρ
B
)[. (6.24)
S(ρ
A
) = −tr(ρ
A
log
2
ρ
A
). (6.25)
S(ρ
B
) = −tr(ρ
B
log
2
ρ
B
). (6.26)
ρ
A
= tr
B

AB
). (6.27)
ρ
B
= tr
A

AB
). (6.28)
ρ
AB
= ρ
A
⊗ρ
B
. (6.29)
S(A) +S(B) ≤ S(AC) +S(BC). (6.30)
S(ABC) +S(B(≤ S(AB) +S(BC). (6.31)
For S(A) +S(B) ≤ S(AC) +S(BC) it holds for Shannon entropy since H(A) ≤
H(AC) and H(B) ≤ H(BC) we get an advantage with Von Neumann entropy
with:
S(A) > (AC) (6.32)
or,
S(B) > S(BC). (6.33)
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Noise and Error Correction 171
It should be noted that quantummechanics tells us that (6.32) and (6.33) cannot
be true simultaneously.
6.6 Noise and Error Correction
Noisy Channels
Noise is randomisation in a channel. To combat noise we use redundancy, i.e.
we send additional information to offset the noise. In the case of a binary chan-
nel we use repetition, e.g. we can use three 1’s to represent a single 1, that way
two bits have to be flipped to produce an error. An example of this is that a
011 can equate to 1. If two bit flips is highly improbable then upon receiving
011 we assume (with a high degree of certainty) that a 1 was sent (as 111) and a
single bit was flipped. Repetition is inefficient: to make the probability of error
occurring lower, longer encodings are required which increases transmission
times. Shannon found a better way,
”Given a noisy channel there is a characteristic rate R, such that any
information source with entropy less than R can be encoded so as to
transmit across the channel with arbitrarily few errors, above R we
get errors” [indigosim.com ? 2000].
So if there is no noise then R matches the channel capacity C.
Classical Error Correction
We’ll consider using binary symmetric channels with an error probability p with
p ≤ 0.5 and:
• If 0 is transmitted, 0 is received with probability 1 −p.
• If 0 is transmitted, 1 is received with probability p.
• If 1 is transmitted, 1 is received with probability 1 −p.
• If 1 is transmitted, 0 is received with probability p.
We generally use a greater number of bits than the original message to encode
the message with codewords. We call this a K
x
channel coding, with x being the
number of bits used to encode the original message.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
172 Noise and Error Correction
If we have a code (called a binary block code) K of length n it has an infor-
mation rate of:
R(K) =
k
n
(6.34)
if it has 2
k
codewords (k = 1 in the example below).
This means, we have an original message of k bits and we use codewords on n
bits.
Repetition Codes
Using repetition codes we have a greater chance of success by increasing the
number of coding bits for a bit to be transmitted and averaging the result bits.
Repetition codes have an information rate of R(K) =
1
n
.
Example A K
3
channel coding could be:
0 → 000,
1 → 111.
With a channel decoding of:
000 → 0, 001 → 0, 010 → 0, 100 → 0,
111 → 1, 110 → 1, 101 → 1, 011 → 1.
So our information rate is:
R(K
3
) =
1
3
.
So, bit flips in 1 out of 3 bits in codeword are fixable, but the information
rate is down to
1
3
.
6.6.1 Quantum Noise
In practice we cannot make perfect measurements and it’s hard to prepare and
apply quantum gates to perfect quantum states because real quantum systems
are quite noisy.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Noise and Error Correction 173
6.6.2 Quantum Error Correction
Quantum error correction codes have been successfully designed, but the area
still remains a hot topic. Some scientists still believe that quantum computing
may be impossible due to decoherence which is external influences destroying
or damaging quantum states. We use quantum error correction codes in place
of classical ones. The fact that they are quantum gives us a number of extra
problems:
1. No Cloning.
2. Continuous errors, many types of error can occur on a single qubit (not just
a bit flip as with a classical circuit). E.g. we might have a change of phase:
α[0) +β[1) → α[0) +e

β[1).
3. Measurement destroys quantuminformation (so if we used a repetition code,
how do we apply majority logic to recover the qubits?).
Below are some simple examples of quantum errors.
Example A qubit’s relative phase gets flipped:
a[0) +b[1) → a[0) −b[1).
Example A qubit’s amplitudes get flipped:
a[0) +b[1) → b[0) +a[1).
Example A qubit’s amplitudes and relative phase get flipped:
a[0) +b[1) → b[0) −a[1).
Quantum Repetition Code
A quantum repetition code is the analogue of a classical repetition code, for
classical states (states not in a superposition) this is easy:
[0) → [000),
[1) → [111).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
174 Noise and Error Correction
The no cloning theorem won’t allow us to make copies of qubits in a superpo-
sition, i.e. it prevents us from having:
[Ψ) → [Ψ)[Ψ)[Ψ)
which expanded would be:
(α[0) +β[1)) ⊗(α[0) +β[1)) ⊗(α[0) +β[1)).
So what we do is to encode our superposed state into the following entangled
state:
[Ψ) = α[0) +β[1) → α[0)[0)[0) +β[1)[1)[1) = [Ψ

)
or,
α[0) +β[1) → α[000) +β[111)
which, expanded is:
α[000) + 0[001) + 0[010) + 0[011) + 0[100) + 0[101) + 0[110) +β[111).
A simple circuit for this encoding scheme is shown below:
[Ψ) • •
[0)
· ¸¸_¸

)
[0)
· ¸¸_¸
So if we made our input state α[0) +β[1) then we would get:
α[0) +β [1) • •
[0)
· ¸¸_¸
α[000) +β [111)
[0)
· ¸¸_¸
↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
)
The diagram shows the stages in the evolution of [Ψ) as the CNOT gates are
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Noise and Error Correction 175
applied; the [Ψ
i
) are as follows:

1
) = α[000) +β[100).

2
) = α[000) +β[101).

2
) = α[000) +β[111).
Fixing Errors
The following circuit detects an amplitude flip (or bit flip) which is the equiv-
alent of X[Ψ) on [Ψ). For example noise can flip qubit three, i.e. α[000) +
β[111) → I ⊗I ⊗X → α[001) +β[110). We determine that there’s been an error
by entangling the encoded state with two ancilla qubits and performing mea-
surements on the ancilla qubits. We then adjust our state accordingly based on
the results of the measurements as described in the table below. Note that we
are assuming that an error has occurred AFTER the encoding and BEFORE we
input the state to this circuit.
Error Correction

1
α[001) +β[110) • • α[000) +β[111)

[0)
· ¸¸_¸ · ¸¸_¸ ´
¸¸ ¸¸
M
1

[0)
· ¸¸_¸ · ¸¸_¸ ´
¸¸ ¸¸
M
2
_ _ _

_ _ _

Error Syndrome
↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
) ↑ [ψ
4
) ↑ [ψ
5
)

1
) = α[001) +β[110).

2
) = α[00100) +β[11000).

3
) = α[00101) +β[11001).

4
) = (α[001) +β[110)) ⊗[0)[1).
The measurements M
1
and M
2
cause a readout of 01 on lines 4 and 5. So now
we feed 01 (called the error syndrome) into our error correction (or recovery) cir-
cuit R which does the following to α[001) +β[110):
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
176 Noise and Error Correction
M
1
M
2
Action
0 0 no action needed, e.g. [111) → [111)
0 1 flip qubit 3, e.g. [110) → [111)
1 0 flip qubit 2, e.g. [101) → [111)
1 1 flip qubit 1, e.g. [011) → [111)
So we apply a qubit flip to line 3 giving:

5
) = α[000) +β[111).
This circuit will fix a single bit flip in our three qubit repetition code. All that re-
mains is to decode [Ψ) to return to our original state. We get a problem though
if we have a relative phase error, i.e.:
α[000) +β[111) → α[000) −β[111)
which, decoded is:
α[0) +β[1) → α[0) −β[1).
It turns out we have to change our encoding method to deal with a relative
phase flip, which we can do with the following circuit:
α[0) +β [1) • •
H
[0)
· ¸¸_¸
H
[0)
· ¸¸_¸
H
The error correction circuit for a relative phase flip is almost exactly the same as
the error correction circuit for an amplitude flip, we just add in some Hadamard
gates at the start to deal with the superpositions we generated with the initial
encoding (shown immediately above). Again remember that any errors that
do happen, happen between the encoding and the circuit we are about to intro-
duce:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Noise and Error Correction 177
Error Correction
H

1 H
• •
H

[0)
· ¸¸_¸ · ¸¸_¸ ´
¸¸ ¸¸
M
1

[0)
· ¸¸_¸ · ¸¸_¸ ´
¸¸ ¸¸
M
2
_ _ _

_ _ _

Error Syndrome
↑ [ψ
1
) ↑ [ψ
2
)
Suppose we have a phase flip on line 2. If our input state is:

1
) = α[+ +−) +β [−−+)
then,

2
) = (α[001) +β [110)) [00) .
This is the same as [ψ
2
) in the bit flip case. Since the rest of the circuit is the
same we get the output of R being:
α[000) +β [111)
as before.
It should be noted that these errors are defined in terms of the ¦[0), [1)¦ ba-
sis. If we use the ¦[+), [−)¦ basis then the phase flip circuit above fixes a bit flip
and vice versa.
In terms of single qubits, a relative phase flip can be fixed with HZH and an
amplitude flip with X. But we still have a problem because the circuit above
cannot detect a amplitude flip. A third encoding circuit produces a Shor code
which is a nine qubit code that has enough information for us to be able to ap-
ply both types of error correcting circuits, and is our first real QECC (Quantum
Error Correction Code). The circuit is presented below.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
178 Bell States
[Ψ) • •
H
• •
[0)
· ¸¸_¸
[0)
· ¸¸_¸
[0)
· ¸¸_¸
H
• •
[0)
· ¸¸_¸
[0)
· ¸¸_¸
[0)
· ¸¸_¸
H
• •
[0)
· ¸¸_¸
[0)
· ¸¸_¸
The Shor code is one of many QECCs, another example is the Steane code. These
both in turn are CSS codes (Calderbank, Shor, Steane). CSS codes are part of a
more general group of QECCs called Stabiliser codes.
6.7 Bell States
As mentioned in chapter 4 the EPR experiment showed that entangled particles
seem to communicate certain quantum information instantly over an arbitrary
distance upon measurement. Einstein used this as an argument against the
notion that particles had no defined state until they were measured (i.e. he ar-
gued that they had ”hidden variables”). John Bell, 1928 - 1990 proved in 1964
that there could be no local hidden variables. In the following description of
his proof consider the fact that we can measure the spin of a particle in several
different directions which can be thought of as measuring in different bases.
During this section we’ll refer to Einstein’s position as EPR and the quantum
mechanical position as QM.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Bell States 179
Bell takes a system of two entangled spin particles being measured by two
remote observers (observers 1 and 2, say, who observe particles 1 and 2, respec-
tively). He shows that, if the observers measure spin in the same direction (e.g.
z) there is no empirical difference between the results predicted by the two po-
sitions (QM or EPR). For the purposes of our example we’ll begin by defining
the following entangled state:

A
) =
1

2
[0
1
1
2
) −
1

2
[1
1
0
2
). (6.35)
We’ve introduced the notation [0
1
1
2
) to distinguish between qubits 1 and 2,
which will become important later.
If we allow the directions to be different it is possible to get a empirically
testable difference. The intuition for this is that if, as QMsays, what happens at
observer 2 is dependent on what happens at observer 1, and the latter is depen-
dent on the direction at 1, then what happens at 2 will involve both directions
(we imagine that a measurement at 1, in some direction, causes state collapse
so that particle 2 ”points” in the antiparallel direction to 1 and is then measured
in observer 2’s direction; the probability for an outcome, spin up or spin down,
is dependent on the angle between the two directions - see below). Whereas,
in the EPR view, what happens at observer 2 cannot in any way involve the di-
rection at observer 1: what happens at observer 2 will, at most, be determined
by the value particle 2 carries away at emission and the direction at observer 2.
6.7.1 Same Measurement Direction
To see that same direction measurements cannot lead to a testable difference
first imagine that there are two separated observers, Alice and Bob, who run
many trials of the EPR experiment with spin particles. Let each measure the
spin of the particle that flies towards them. If they both measure in the same
direction, say z, then the results might be represented as follows:
Alice Bob Frequency
z z
1 0 50%
0 1 50%
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
180 Bell States
We soon realise that we can’t use this case to discriminate between the two po-
sitions.
QM position. This explains the result by saying that, upon Alice’s measure-
ment of 1, the state vector superposition [Ψ
A
) collapses into one or other of the
two terms.
either [0
1
1
2
) or [1
1
0
2
)
with 50% probability for Alice measuring 0 or 1. But then we no longer have
a superposition (Alice’s measurement has ”produced” a 0 on particle 1 and a
1 on particle 2, or vice versa) and Bob’s measurement outcome on 2 is com-
pletely determined (relative to the outcome on 1) and will be the opposite of
Alice’s outcome.
EPR position. This says the particles actually have well defined values at the
moment they are emitted, and these are (anti-)correlated and randomly dis-
tributed between 01 and 10 over repeated trials. When Alice measures 0 Bob
measures 1 not because Alice’s measurement has ”produced” anything; but
simply because the 1 is the value the particle had all along (which the measure-
ment reveals). The randomness here is due to initial conditions (emission); not
to collapse.
Either way we have the same prediction.
6.7.2 Different Measurement Directions
Bell’s innovation was to realise that a difference will occur if we bring in differ-
ent measurement directions. The intuition for this might go as follows.
Suppose there are two directions a(= z) and b. Start with [Ψ
A
) and allow Alice
to measure particle 1 in the a direction. This causes a collapse, as before, and
we have:
either [0
1
1
2
) or [1
1
0
2
).
Alice’s measurement has ”produced” a 1 (spin down) in the a direction on par-
ticle 2 (to take the first case). Bob now measures particle 2 in the b direction. To
work out what happens according to QM we have to express [1
2
) in terms of a
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Bell States 181
b basis. If b is at angle θ to a this turns out to be:
[1
2
) = sin
_
θ
2
_
[+
2
) + cos
_
θ
2
_
[−
2
) (6.36)
where [+
2
) means spin up along the b axis. This looks right. If θ = 90 (the case
when b = x) we get
1

2
, as before; when θ = 0 (the case when b = z) we get [−
2
)
(= [1) in that case). Likewise, for [0
2
):
[0
2
) = cos
_
θ
2
_
[+
2
) −sin
_
θ
2
_
[−
2
). (6.37)
The significant point is that, since θ is the angle between a and b, the direction
of Alice’s measurement is entering into (influencing) what happens for Bob.
But this can’t happen in a realist local view as, espoused by EPR, because:
1. The spin values of the particles are determined at the moment of emission,
and are not ”produced” at some later moment as a result of an act of
measurement (realism);
2. by construction, the events at Bob’s end are beyond the reach of the events
at Alice’s end (locality).
The rat is cornered: by bringing different directions of measurement into it, we
should get a detectable difference. So reasons Bell.
6.7.3 Bell’s Inequality
It turns out we need three directions. So allow Alice and Bob to measure in
three possible directions labelled a, b, and c; we will actually take the case where
these directions are all in the plane, perpendicular to line of flight, and at 120

to one another. When Alice and Bob measure in the same direction, say a and
a, they will observe correlation: 1 with 0, or 0 with 1, as above. However, if
they measure in different directions, say a and b, there is no requirement for
correlation, and Alice and Bob might both observe 1, for example (as in row 3
below).
QM View
If we put θ = 120 into 6.38 we have:
[1
2
) =

3
2
[+
2
) + 1/2[−
2
).
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
182 Bell States
This tells us that Alice having measured 0 in the a direction (as in 6.37). Bob
now measures + in the b (ie spin up or 0) direction with probability
3
4
and − in
the b direction (i.e. spin down or 1) with probability
1
4
. The net result is that we
have:
Alice Bob Probability
a b
0 0
3
4
0 1
1
4
Equivalent results will be obtained in other pairs of different directions (eg bc,
ie Alice chooses b, Bob c) since the angles between such directions are always
the same. In general we have:
If the directions are different the probability for outcomes to be the
same S (eg 00) is
3
4
; to be different D (eg 01) is
1
4
. On the other hand,
if the directions are the same the probability for different outcomes
(D) is 1.
Suppose we now run 900 trials. Randomly change the directions of measure-
ment, so that each combination occurs 100 times. The results must go as:
aa ab ac ba bb bc ca cb cc
Outcome S 0 75 75 75 0 75 75 75 0
Outcome D 100 25 25 25 100 25 25 25 100
The net result is that S occurs 450 times and D 450 times. We conclude:
the probability of different outcomes is
1
2
.
EPR View
We assume each particle carries a ”spin value” relative to each possible direc-
tion (as in classical physics), except that (to fit in with what is observed) the
measured value will always be ”spin up” (0) or ”spin down” (1), and not some
intermediate value (so the measured values cannot be regarded as the projec-
tion of a spin vector in 3D space onto the direction of the magnetic field, as
in classical physics). To try to account for this we say that, at the moment of
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Bell States 183
emission, each particle leaves with an ”instruction” (the particle’s property, or
hidden variable, or key, or component) - one for each possible direction (a, b, c)
in which it can be measured - which determines the measured outcome in that
direction (in the conventional, pre-quantum, sense that the measurement just
discovers or reveals what is already there). Since the measurement in the a di-
rection can discover two possible values, 0 or 1, the corresponding property,
which we call the A component, must have two values: either A=0, or A=1,
which determines the measurement outcome (as noted above, we cannot allow
randomness in the act of measurement - this would destroy the aa correlation,
etc ; the only possible randomness that can occur is in the assignment of initial
component values at the moment of emission, see below). Likewise, we have
B=0 or B=1; and C=0 or C=1. (It might seem we need an infinity of these prop-
erties to cater for the infinity of possible measurement directions. This doesn’t
constitute a problem in classical physics where we have spin behaving like a
magnetic needle: the infinity of possible observed components of the magnetic
moment, dependent on measurement direction, is no more mysterious than the
infinity of shadow lengths projected by a stick dependent on the sun’s direc-
tion. But note that it would seem strange to account for the infinity of shadow
length’s by saying the stick had an infinity of components - or ”instructions” -
specifying what shadow should appear, depending on the angle of the sun!).
The A,B,C values are set for each particle at the time of emission and carried off
by them. They can be randomly assigned except that, to obey conservation, if
A=0 for particle 1 then A=1 for particle 2 etc. But we can have A=0 for particle
1 and B=0 for particle 2 since, empirically, the spins are not correlated if we
measure in different directions (in this case if the measurements were in the a
and b directions the result would be 00).
Suppose particle 1 has the assignment A=0, B=1, C=1; ie 011. Interestingly, we
immediately knowwhat the components for particle 2 must be: A=1, B=0, C=0;
ie 100. This is necessary if the two particles are going to give anti-correlated re-
sults for the case where we do same direction measurements in each direction
(a, b, c).
We can then lay out the possible assignments of component values, as follows:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
184 Bell States
Alice Bob
Row a b c a b c
1. 1 1 1 0 0 0
2. 0 1 1 1 0 0
3. 1 0 1 0 1 0
4. 0 0 1 1 1 0
5. 1 1 0 0 0 1
6. 0 1 0 1 0 1
7. 1 0 0 0 1 1
8. 0 0 0 1 1 1
The table respects the rule that measurements in the same direction must be
correlated (this is howthe entries are generated - by allowing Alice’s abc values
to run over the 8 binary possibilities; for each case the correlation rule immedi-
ately determines the corresponding Bob entries - i.e. we have no choice). But it
allows for all possibilities in different directions: e.g. we can have Alice finding
1 in the a direction going with Bob finding 1 in this direction (rows 3 and 7) or
0 (rows 1 and 5).
We are nowclosing in. Suppose we consider the above 900 trials fromthe realist
perspective. There are only eight possible assignments of properties (Nature’s
choice). And there are nine possible combinations of measurement directions
(the experimenters’ choice). We are assuming that the particles fly off with
their assignments and the measurements simply reveal these (no disturbance
to worry about, as agreed). So in each case we can tell the outcome. For ex-
ample, if Nature chooses row 7 (above), ie 100 and the experimenters choose
ab then the outcome is completely determined as S, as follows. Alice gets a
100 particle, measures it in the a direction, and gets 1, Bob gets a 011 particle,
measures it in the b direction, and gets 1. Hence the overall outcome is 11, ie S.
We can now complete the table of outcomes:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Cryptology 185
Alice’s particle aa ab ac ba bb bc ca cb cc
111 D D D D D D D D D
011 D S S S D D S D D
101 D S D S D S D S D
001 D D S D D S S S D
110 D D S D D S S S D
010 D S D S D S D S D
100 D S S S D D S D D
000 D D D D D D D D D
What is the probability of different outcomes D? If Alice receives a particle
with equal components (eg 111) this probability is always 1. If Alice receives
a particle with unequal components (eg 011) the probability is always
5
9
(look
along the row for 011: D occurs 5 times out of 9. We don’t know the statistics of
the source: how often particles of the 8 various kinds are emitted. But we can
conclude that the overall probability for D is:
p
equal
+
5
9
p
unequal
.
Since both p’s must be positive we conclude: the probability for different out-
comes is greater than
5
9
This is an example of a Bell inequality.
Contradiction!
If we compare the two conclusions we have a contradiction. QMsays the prob-
ability should be
1
2
; realism says it should be greater than
5
9
so QM wins!
6.8 Cryptology
Now a proven technology, quantum cryptography provides total security be-
tween two communicating parties. Also, the unique properties of quantum
computers promise the ability to break classical encryption schemes like Data
Encryption Standard (DES) and RSA.
The field of quantum cryptology has two important sub-fields, they are:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
186 Cryptology
1. Cryptography - The use of secure codes.
2. Cryptanalysis - Code breaking.
We’ll concentrate on cryptography in this chapter. Later, in chapter 7 we look
at Shor’s algorithm, which can be used to break RSA encryption.
6.8.1 Classical Cryptography
Secret codes have a long history - dating back to ancient times, one famous
ancient code is the Caesar cipher which simply shifts each letter by three.
A → D, B → E, X → A. (6.38)
This is not very secure as it’s easy to guess and decrypt. Modern codes use
a key. A simple form of key is incorporated into a code wheel, an example of
which follows.
Example An example of a code wheel with the key: ABCDEF is described
below:
Key A B C D E F A B C D E F
Shift By 1 2 3 4 5 6 1 2 3 4 5 6
Message Q U A N T U M C O D E S
Encoding R W D R Y A N E R H J Y
With time secret keys and their respective codes got more complicated, cul-
minating in modern codes, e.g. codes called DES and IDEA were implemented
with typically 64 and 128 bit secret keys.
There is another kind of key, a public key. Public key encryption (e.g. RSA 1976
Diffie Hellman) uses a combination of a public and a secret key. In a public
key encryption scheme a public key encrypts a message but cannot decrypt it.
This is done by a secret decryption key known only to the owner. Surmising
the decryption key from public (encryption) key requires solving hard (time
complexity wise) problems.
Some codes are stronger than others, for example the DES and IDEA secret
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Cryptology 187
key codes are stronger than Caesar cipher codes. Possibly the strongest code
is the one-time PAD. A one-time PAD is a key that is large as the message to be
sent (for example a random binary file) and the sender and receiver both have
a copy of this key. The PAD is used only once to encrypt and decrypt the mes-
sage. The problem with one-time PADs is that the key needs to be transmitted
every time and eavesdroppers could be listening in on the key. Quantum key
distribution resolves this issue by providing perfectly secure key distribution.
6.8.2 Quantum Cryptography
Modern classical public key cryptographic systems use a trap door function with
security based on mathematical assumptions, notably that it is difficult to fac-
tor large integers. This assumption is now at risk from Shor’s algorithm.
The main advantage of quantum cryptography is that it gives us perfectly
secure data transfer. The first successful quantum cryptographic device was
tested in 1989 by C.H. Bennet, and G. Brassard [Castro, M. 1997]. The device
could translate a secret key over 30 centimetres using polarised light, calcite
crystal(s), and other electro-optical devices. This form of cryptography does
not rely on a trap door function for encryption, but on quantum effects like the
no-cloning theorem.
Asimple example of the no-cloning theorem’s ability to secure data is described
below. After that we’ll look at why it’s impossible to listen in on a quantum
channel, and finally we’ll examine a method for quantum key distribution.
Quantum Money
Stephen Wiesner wrote a paper in 1970 (unpublished until 1983) in which he
described uncounterfeitable quantum bank notes [Braunstein, S. L. & Lo, H. K.
2000].
Each bank note contains a unique serial number and a sequence of randomly
polarised photons (90

, 180

, 45

, and 135

). The basis of polarisation is kept se-
cret (either diagonal or rectilinear). The bank can verify the validity of a note by
matching a serial number with known (only known by the bank) polarisations.
This enables the bank to verify the polarisations without disturbing the quan-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
188 Cryptology
tum system (see the example below). Finally, the counterfeiter can’t counterfeit
the note due to the no cloning theorem. Remember, the no cloning theorem
says that given an unknown quantum state it is impossible to clone that state
exactly without disturbing the state.
Example Let’s say the bank receives a bank not with serial number 1573462.
The bank checks its ”quantum bank note archive” to find the polarisations
for bank note 1573462. The banks’ records give the following:
1573462 = ¦H, H, 135

, V, 45

¦.
¦H, H, 135

, V, 45

¦ is a record of the note polarisations, but our copy protec-
tion system does not distinguish between H and V or 135

and 45

. Because
the photons are not in superpositions relative to the basis we measure in (as
specified by the serial numbers) the bank doesn’t disturb the states upon
measurement. The bank only determines the basis of each photon, which is
¦[0), [1)¦, (rectilinear) or ¦[+), [1)¦, (diagonal). It should be noted that states
are always superpositions if we don’t say what the basis is.
Because the counterfeiter does not know the basis of each polarised
photon on the quantum bank note, he must measure using a random basis.
He could, theoretically measure each one and recreate it if he knows the
basis by which to measure each one. The chances of the counterfeiter
randomly measuring in the correct basis decrease by a
1
2
for each successive
polarised photon on the note. So the more polarised photons the bank note
has the harder it is to counterfeit.
Quantum Packet Sniffing
Quantum packet sniffing is impossible - so the sender and receiver can be sure
that no-one is listening in on their messages (eavesdropping). This phenomena
is due to the following properties of quantum mechanics:
1. Quantum uncertainty, for example given a photon polarised in an unknown
state (it might be horizontally (180

), vertically (90

), at 45

, or at 135

)
we can’t tell with certainty which polarisation the photon has without
measuring it.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Cryptology 189
2. The no cloning theorem.
3. Disturbance (information gain), if a measurement is done (distinguishing
between two non-orthogonal states) the signal is forever disturbed.
4. Measurements are irreversible, any non orthogonal state will collapse ran-
domly into a resultant state - losing the pre-measurement amplitudes.
Quantum Key Distribution
We can ensure secure communications by using one-time pads in conjunction
with quantum key distribution. The main drawback for classical one-time pads is
the distribution of encryption/decrytion keys, this is not a problem for quan-
tum cryptography as we can transfer key data in a totally secure fashion.
Quantum key distribution (QKD) is a means of distributing keys from one
party to another, and detecting eavesdropping (it is inspired by the quantum
money example). An unusually high error rate is a good indicator of eaves-
dropping. Even with a high error rate the eavesdropper cannot learn any use-
ful information. It should be noted that this method does not prevent Denial of
service (DOS) attacks.
An example follows on the next page.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
190 Cryptology
Example Alice and Bob want to use a key based encryption method,
they communicate on two channels. One channel is used to transmit the
encrypted message and another is used to transmit the encryption key. But
they need a way to avoid Eve eavesdropping on their conversation on the
key channel [Ekert, A. 1993].
The following steps allow a totally secure (in terms of eavesdropping)
transfer of the key (later we need to encrypt the message and send it via a
classical channel).
1. Alice randomly polarises photons at 45

, 90

,135

, and 180

- these are
sent to Bob over a quantum channel (which is secure due to quantum
effects, i.e. no eavesdropping).
2. Bob does measurements on the photons. he randomly uses either a rec-
tilinear (180

/90

) or diagonal polarising filter (45

/135

), and records
which one was used for each bit. Also for each bit he records the mea-
surement result as a 1 for 135

or 180

or 0 for 45

or 90

polarisations.
3. On a normal (insecure channel) Alice tells Bob which bits Bob used the
right polarisation on (which he also communicates over the classical
channel).
4. Alice and Bob check for quantumerrors to gauge whether or not an eaves-
dropper (Eve) was listening.
Comments
The following can be said about the key exchange:
• Eve can’t clone the bit and send it on, her measurements put Bob’s bits in a
new random state. Alice and Bob decide on an acceptable error rate, if
the key exchange’s error rate is higher than that (which means Eve may
have been listening) then they resend the message.
• Eve could do an DOS attack by constantly measuring on the key channel.
• Eve could shave off some of the light if each bit is represented by more than
one photon, so each bit transferred must only be represented by one qubit.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Alternative Models of Computation 191
• Eve could listen to a small number of bits and hope to be unnoticed - Alice
and Bob can prevent this by shrinking down their key.
• In 1984 Bennet and Brassard developed BB84, a method of mutual key gen-
eration, the first QKD system which is based in concepts similar to the
above.
6.8.3 Are we Essentially Information?
John Archibald Wheeler, in the early 90s stated that the main focus of physics
should be on information. When examined in terms of information, quantum
systems break down to elementary systems that each carry one bit of informa-
tion.
This makes sense as we can only ask yes or no questions - and the answers
are yes or no.
Physicist Anton Zellinger says the world appears quantised because the infor-
mation that describes the world is quantised [Baeyer, H. C. 2001]. He says that 1
bit of information can be represented by an elementary proposition, e.g. that an
electron’s spin along a certain axis is up or down. Once measured the bit is used
up and the other properties are random. His theory goes on to explain entan-
glement, in terms of information. Finally, Zellinger (and his student Brubeker)
have created an alternative measure of information, which is the number of
bits in a system. It is called total information and it takes quantum effects into
account.
6.9 Alternative Models of Computation
There are other candidates for physical phenomena to enhance computational
power. Some disciplines cannot currently be described by quantummechanics,
like relativity and complexity theory (or chaos theory).
Question Is there a universal computation model? or will there always be
some phenomena which is not well understood that has the potential to be
exploited for the purposes of computation?
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 7
Quantum Algorithms
7.0.1 Introduction
Quantum algorithms are ways of combining unitary operations in a quantum
systemto achieve some computational goal. Over the past twenty years a num-
ber of algorithms have been developed to harness the unique properties offered
by quantum computers. These algorithms have been designed to give special
advantages over their classical counterparts.
Shor’s algorithm (1995) gives the factorisation of arbitrarily large numbers a
time complexity class of O((log N)
3
), where that classical equivalent is roughly
exponential. This is extremely important for cryptography. For example, RSA
relies on factorisation being intractable, which means that no polynomial solu-
tion exists that covers all instances of the problem. Another example is Grover’s
database search algorithm which provides a quadratic speedup when search-
ing a list of N items. This takes the classical value of a linear search from O(N)
time to O(N
1
2
) time [TheFreeDictionary.com 2004]. Most known quantum al-
gorithms have similarities to, or partially borrow from, these two algorithms.
Some properties of Shor and Grover type algorithms are:
• Shor type algorithms use the quantum Fourier transform. These include: fac-
toring, the hidden subgroup problem, discrete logarithms, and order find-
ing (all variations on a theme).
• Grover type search algorithms can be used for applications like fast database
searching and statistical analysis.
193
194 Deutsch’s Algorithm
There are also hybrid algorithms like quantumcounting that combine elements
fromboth, and more esoteric algorithms like quantumsimulators. In this chap-
ter we’ll look at Deutsch’s algorithm, the Deutsch-Josza algorithm, Shor’s al-
gorithm, and Grover’s algorithm.
As with chapters 5 and 6 individual references to QCQI have been dropped.
7.1 Deutsch’s Algorithm
Deutsch’s algorithm is a simple example of quantum parallelism. The prob-
lem it solves is not an important one, but its simple nature makes it good for
demonstrating the properties of quantum superposition.
7.1.1 The Problem Defined
We have a function f(x) where f(x) : ¦0, 1¦ → ¦0, 1¦ with a one bit domain.
This means that f(x) takes a bit (either a 0 or a 1) as an argument and returns
a bit (again, either a 0 or a 1). Therefore both the input and output of this func-
tion can be represented by a bit, or a qubit.
We want to test if this function is one to one (balanced), where one to one
means:
f(1) = 1 and f(0) = 0 or f(0) = 1 and f(1) = 0.
The other alternative is that f(x) is not one to one (i.e. it is constant), in which
case we would get:
f(1) = 0 and f(0) = 0 or f(0) = 1 and f(1) = 1.
The circuit for determining some property of a function is called an oracle. It’s
important to note that the thing that quantum computers do well is to test
global properties of functions, not the results of those functions given particular
inputs. To do this efficiently we need to look at many values simultaneously.
7.1.2 The Classical Solution
The solution is as follows:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Deutsch’s Algorithm 195
iff f(0) ⊕f(1) = 1 the function is one to one (where ⊕ is equivalent to XOR).
This is made up of three operations, involving two function evaluations:
1. x = f(0),
2. y = f(1),
3. z = x ⊕y.
Can we do better with a quantum computer?
7.1.3 The Quantum Solution
The quantum circuit below performs the first two steps in the classical solution
in one operation, via superposition.
x [0)
H
U
f
x
H
y [1)
H
y ⊕f(x)
H
↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
) ↑ [ψ
4
)
Below are the steps [ψ
1
) to [ψ
4
) we need to solve the problem quantum me-
chanically.

1
) The qubits x and y have been set to the following (we call x the query
register and y the answer register):
x = [0),
y = [1).

2
) Apply H gates to the input registers so our state vector is now:
[Ψ) =
_
[0) +[1)

2
__
[0) −[1)

2
_
.

3
) U
f
acts on qubits x and y, specifically we use [Ψ) → U
f
→ [x) [y ⊕f(x)).
After some algebraic manipulation the result ends up in x, and y seems
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
196 Deutsch’s Algorithm
unchanged (see the example below).
For f(0) ,= f(1) (balanced) we get:
[Ψ) = ±
_
[0) −[1)

2
__
[0) −[1)

2
_
and for f(0) = f(1) (constant):
[Ψ) = ±
_
[0) +[1)

2
__
[0) −[1)

2
_
.
Note: The ± at the start of the state is just a result of internal calculations,
it does not matter whether it is positive or negative for the result of this
circuit (global phase factors have no significance).

4
) x is sent through the H gate again. The H gate, as well as turning a 1
or a 0 into a superposition will take a superposition back to a 1 or a 0
(depending on the sign):
_
[0) +[1)

2
_
→ H → [0),
_
[0) −[1)

2
_
→ H → [1).
So at step 4, for f(0) ,= f(1) we get:
[Ψ) = ±[1)
_
[0) −[1)

2
_
and for f(0) = f(1):
[Ψ) = ±[0)
_
[0) −[1)

2
_
.
At this point our state is, combining both cases:
[Ψ) = ±[f(0) ⊕f(1))
_
[0) −[1)

2
_
.
Up until now y has been useful to us, now we don’t care about it as x
holds the result. We can just do a partial measurement on x and discard y
as garbage. If x = 0 then the function is constant, and if x = 1 the function
is balanced.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Deutsch’s Algorithm 197
Example There’s only four possible combinations for f(x) , we’ll look at
two here. Given our state at [ψ
2
) is
1

2
[[0) + [1)]
1

2
[[0) − [1)] our state at [ψ
3
)
will look like the following:
[Ψ) =
_
[0) +[1)

2
__
[0 ⊕f(x)) −[1 ⊕f(x))

2
_
=
1
2
([0) [0 ⊕f(0)) −[0) [1 ⊕f(0)) +[1) [0 ⊕f(1)) −[1) [1 ⊕f(1))).
Keeping in mind that 0 ⊕0 = 0, 1 ⊕0 = 1, 1 ⊕1 = 0, and 0 ⊕1 = 1 we’ll start
with the constant function f(0) = 0 and f(1) = 0:
[Ψ) =
1
2
([0) [0 ⊕0) −[0) [1 ⊕0) +[1) [0 ⊕0) −[1) [1 ⊕0))
=
1
2
([00) −[01) +[10) −[11))
=
_
[0) +[1)

2
__
[0) −[1)

2
_
.
Now for a balanced function f(0) = 1 and f(1) = 0:
[Ψ) =
1
2
([0) [0 ⊕1) −[0) [1 ⊕1) +[1) [0 ⊕0) −[1) [1 ⊕0))
=
1
2
([01) −[00) +[10) −[11))
=
1
2
(−[00) +[01) +[10) −[11))
= (−1)
1
2
([00) −[01) −[10) +[11))
= −1
_
[0) −[1)

2
__
[0) −[1)

2
_
.
Notice that (-1) has been moved outside of the combined state, it is a global
phase factor and we can ignore it. At [ψ
4
) we put our entire state through
H ⊗H and get [01) for the constant function and [11) for the balanced one.
7.1.4 Physical Implementations
In theory A simple quantum computer implementing Deutsch’s algorithm can
be made out of a cardboard box, three mirrors, and two pairs of sunglasses
[Stay, M. 2004]. The sunglasses (in a certain configuration) polarise light ini-
tially into a non-orthogonal state (a superposition) then back again. The mir-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
198 The Deutsch-Josza Algorithm
rors within the box reflect the light in a certain way depending on their con-
figuration (at different angles depending on the type of function you want to
simulate). A torch is then shone into the box, if light comes out the function
is balanced, if not then it is constant. Now, if we use a special optical device
to send just one photon into the box and we have a sensitive photo detector at
the other end then we have an architecture that is a theoretically more efficient
oracle than any classical computer.
Deutsch’s algorithm can of course be executed on any quantum computer ar-
chitecture, and has been successfully implemented. For example, in 2001 the
algorithm was run on an NMR computer (see chapter 8) [Dorai, K. Arvind, ?.
Kumar, A. 2001]. Due to the relatively small number of qubits that can be cur-
rently made to work together many of the other quantum algorithms have not
been satisfactorily tested.
7.2 The Deutsch-Josza Algorithm
The Deutsch-Josza algorithm is an extension of Deutsch’s algorithm which can
evaluate more than one qubit in one operation. We can extend it to evaluate
any number of qubits simultaneously by using an n-qubit query register for x
instead of a single qubit.
7.2.1 The Problem Defined
The problem we are trying solve is slightly different to the one presented in
Deutsch’s algorithm, that is: is f(x) the same (constant) for all inputs? Or is
f(x) equal to 1 for half the input values and equal to 0 for the other half (which
means it is balanced)?
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
The Deutsch-Josza Algorithm 199
7.2.2 The Quantum Solution
The circuit looks like this:
x [0) /
n
H
⊗n
U
f
x
H
⊗n
y [1)
H
y ⊕f(x)
H
↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
) ↑ [ψ
4
)
The input (x) and output (y) registers have an H gate for each qubit in the
register. This is denoted by H
⊗n
and the /
n
notation just means n wires for n
qubits.
Here are the steps [ψ
1
) to [ψ
4
) we need to solve the problem quantum mechan-
ically.

1
) The registers x and y have been set to the following:
x = [0)
⊗n
,
y = [1).

2
) Apply H gates to both the x and y registers so our state vector is now:
[Ψ) =
1

2
n
2
n−1

x=0
[x)
_
[0) −[1)

2
_
.

3
) U
f
acts on registers x and y (remember y is just a single qubit because the
result of evaluating f is, by definition, just a 0 or 1). This time we use
[Ψ) = U
f

2
) [0) = [x
1
, x
2
, . . . , x
n
) [y ⊕f(x)) to evaluate f(x).

4
) x is sent through H
⊕n
and y through an H gate also. This leaves us with a
set of output qubits and a 1 in the answer register, i.e.
[Ψ) = [x
1
, x
2
, . . . , x
n
) [1) .
Now the rule is simple: if any of the qubits in the query (x) register are
[1) then the function is balanced, otherwise it is constant.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
200 Shor’s Algorithm
Example Here’s an example with a two qubit query register for the bal-
anced function f with f(00) = 0, f(01) = 0, f(10) = 1, and f(11) = 1. So at
state [ψ
1
) we have:
[Ψ) = [001) .
Then at state [ψ
2
), after the H gates we get:
[Ψ) =
_
[0) +[1)

2
__
[0) +[1)

2
__
[0) −[1)

2
_
.
We are now ready to examine our state at [ψ
3
):
[Ψ) =
_
[0) +[1)

2
__
[0) +[1)

2
__
[0 ⊕f(x)) −[1 ⊕f(x))

2
_
=
_
[00) +[01) +[10) +[11)

4
__
[0 ⊕f(x)) −[1 ⊕f(x))

2
_
=
1

8
([00) [0 ⊕f(00)) −[00) [1 ⊕f(00)) +[01) [0 ⊕f(01))
−[01) [1 ⊕f(01)) +[10) [0 ⊕f(10)) −[10) [1 ⊕f(10))
+[11) [0 ⊕f(11)) −[11) [1 ⊕f(11)))
=
1

8
([000) −[001) +[010) −[011) +[101) −[100) +[111) −[110))
=
1

8
([000) −[001) +[010) −[011) −[100) +[101) −[110) +[111))
=
_
[00) +[01) −[10) −[11)

4
__
[0) −[1)

2
_
=
_
[0) −[1)

2
__
[0) +[1)

2
__
[0) −[1)

2
_
.
At [ψ
4
) we put our entire state through H ⊗ H ⊗ H and get [101) meaning
that our function is balanced.
7.3 Shor’s Algorithm
7.3.1 The Quantum Fourier Transform
The quantum analogue of the discrete Fourier transform (see chapter 4) is the
quantum Fourier transform (QFT). The DFT takes a series of N complex num-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 201
bers, X
0
, X
1
, ..., X
N−1
and produces a series complex numbers Y
0
, Y
1
, ..., Y
N−1
.
Similarily, the QFT takes a state vector:
[Ψ) = α
0
[0) +α
1
[1) +... +α
N−1
[N −1) (7.1)
and performs a DFT on the amplitudes of [Ψ) giving us:
[Ψ) = β
0
[0) +β
1
[1) +... +β
N−1
[N −1). (7.2)
The main advantage of the QFT is the fact that it can do a DFT on a superposi-
tion of states. This can be done on a superposition like the following:
1

4
([00) +[01) −[10) −[11))
or a state where the probability amplitudes are of different values. E.g. the fol-
lowing state has probability amplitudes of 0 for the majority of its basis states:
1

3
([001) +[011) −[111)).
It’ll helpful over the next few sections to use integers when we are describing
states with a large number of qubits, so the previous state could have been
written as:
1

3
([1) +[3) −[7)).
The QFT is a unitary operator, and is reversible. In fact we use the inverse
quantum fourier transform (QFT

) for Shor’s algorithm. The QFT is defined as
follows:
Given a state vector [Ψ):
[Ψ) =
2
n−1

x=0
α
x
[x) (7.3)
where n is the number of qubits, QFT [Ψ) is defined as:

) = QFT [Ψ) =
2
n−1

x=0
2
n−1

y=0
α
x
e
2πixy/2
n

2
n
[y) . (7.4)
We can also represent the QFT as a matrix:
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
202 Shor’s Algorithm
1

2
n
_
¸
¸
¸
¸
¸
¸
¸
¸
¸
_
1 1 1 . . . 1
1 ω ω
2
. . . ω
2
n
−1
1 ω
2
ω
4
. . . ω
2(2
n
−1)
1 ω
3
ω
6
. . . ω
3(2
n
−1)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1 ω
2
n
−1
ω
2(2
n
−1)
. . . ω
(2
n
−1)(2
n
−1)
_
¸
¸
¸
¸
¸
¸
¸
¸
¸
_
(7.5)
where ω = e
2πi/2
n
.
How do we get this matrix? To make it easier to understand we’ll identify the
important part of the summation we need for the matrix representation (which
we’ll label M
xy
):
2
n−1

x=0
2
n−1

y=0
α
x
e
2πixy/2
n

2
n
[y) =
1

2
n
2
n−1

x=0
_
2
n−1

y=0
M
xy
α
x
_
[y) (7.6)
where M
xy
= e
2πixy/2
n
.
Now using the summations, here are a few values of x and y for M
xy
:
1

2
n
_
¸
¸
_
e
2πi·0·0/2
n
= e
0
= 1 e
2πi.1.0/2
n
= e
0
= 1 . . .
e
2πi·0·1/2
n
= e
0
= 1 e
2πi·1·1/2
n
= e
2πi/2
n
= ω
.
.
.
.
.
.
_
¸
¸
_
. (7.7)
Next we’ll look at two examples using the matrix representation of the QFT.
Examples follow on the next two pages.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 203
Example A simple one qubit QFT. Given:
[Ψ) =
2

5
[0) +
1

5
[0) .
Find,

) = QFT [Ψ) .
We’ll use the matrix representation, which is:
1

2
_
1 1
1 e

_
.
This matrix is actually just an H gate (since e

= −1), so we get:

) =
1

2
_
1 1
1 e

__
2

5
1

5
_
=
_
2

10
+
1

10
2

10
+
e
πi

10
_
=
_
3

10
2

10
+
−1

10
=
1

10
_
=
3

10
[0) +
1

10
[1) .
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
204 Shor’s Algorithm
Example A two qubit QFT. Given:
[Ψ) =
1

2
[00) +
1

2
[11) .
Find,

) = QFT [Ψ) .
The matrix representation is:
1

4
_
¸
¸
¸
¸
_
1 1 1 1
1 e
πi/4
e
πi2/4
e
πi3/4
1 e
πi2/4
e
πi4/4
e
πi6/4
1 e
πi3/4
e
πi6/4
e
πi9/4
_
¸
¸
¸
¸
_
.
So [Ψ

) is:

) =
1

4
_
¸
¸
¸
¸
_
1 1 1 1
1 e
πi/4
e
πi2/4
e
πi3/4
1 e
πi2/4
e
πi4/4
e
πi6/4
1 e
πi3/4
e
πi6/4
e
πi9/4
_
¸
¸
¸
¸
_
_
¸
¸
¸
¸
_
1

2
0
0
1

2
_
¸
¸
¸
¸
_
=
1

4
_
¸
¸
¸
¸
_
1

2
+ 0 + 0 +
1

2
1

2
+ 0 + 0 +
1

2
e
πi3/4
1

2
+ 0 + 0 +
1

2
e
πi6/4
1

2
+ 0 + 0 +
1

2
e
πi9/4
_
¸
¸
¸
¸
_
=
1

4
_
¸
¸
¸
¸
_
1

2
+ 0 + 0 +
1

2
1

2
+ 0 + 0 +
−1+i

2
1

2
+ 0 + 0 +
−i

2
1

2
+ 0 + 0 +
1+i

2
_
¸
¸
¸
¸
_
=
_
¸
¸
¸
¸
_
2

8

2−1+i
4
1−i

8

2+1+i
4
_
¸
¸
¸
¸
_
=
2

8
[00) +

2 −1 +i
4
[01) +
1 −i

8
[10) +

2 + 1 +i
4
[11) .
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 205
How Do we Implement a QFT?
As stated before, a one qubit QFT has the following rather simple circuit:
H
A three qubit QFT has a more complicated circuit:
H S T


H S
• •
H

We can extend this logic to n qubits by using H and n − 2 different rotation
gates (R
k
- see below) where:
R
k
=
_
1 0
1 e
2πi/2
k
_
. (7.8)
For n qubits we use gates R
2
. . . R
n
. For more information on generic QFT
circuits you’ll need to consult an external reference like QCQI.
7.3.2 Fast Factorisation
Finding unknown factors p and q such that p q = 347347 is very slow com-
pared to the reverse problem: calculating 129 156. We don’t yet know fast
algorithms for factorising on classical machines but we do now know (thanks
to Shor) a fast factorisation algorithm we can run on a quantum computer.
Public key encryption systems like RSA algorithm rely on the fact that it’s hard
to factorise large numbers; if we could find the factors we could use the infor-
mation provided in the public key to decrypt messages encrypted with it. In
terms of RSA our task is simple. Given an integer N we know n = pq where p
and q are large prime numbers we want to calculate p and q.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
206 Shor’s Algorithm
7.3.3 Order Finding
To factorise N we reduce the problem of factorisation to order finding, that is:
given 1 < x < N the order of x mod N is the smallest value of r where r ≥ 1
and x
r
mod N = 1.
This means that the list of powers of x, 1, x, x
2
, x
3
, x
4
, . . . mod N will repeat
with a period that is less than N.
We’re trying to find the period of a periodic function. Why? Because it turns
out there’s a close connection between finding the factors and finding the pe-
riod of a periodic function. The intuition is that quantum computers might be
good at this because of quantum parallelism: their ability to compute many
function values in parallel and hence be able to get at ”global properties” of the
function (as in Deutsch’s algorithm).
Example Say we have N = 55 and we choose x to be 13.
13
0
mod 55 = 1,
13
1
mod 55 = 13,
13
2
mod 55 = 4,
.
.
.
13
20
mod 55 = 1.
So r = 20, i.e. 13 mod 55 has a period of 20.
The calculation of x
i
mod N can be done in polynomial time and thus can
be done on a classical computer. Once we have the order r we can apply some
further classical calculations to it to obtain a factor of N.
The ”quantum” part gives us the period r in polynomial time by using a pro-
cess called phase estimation. Phase estimation attempts to determine an un-
known value γ of an eigenvalue e
2πiγ
of an eigenvector [u) for some unitary
U. We won’t worry about explicitly understanding phase estimation as Shor’s
algorithm has a number of specific steps that makes learning it unnecessary.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 207
Before we look at the circuit for Shor’s algorithm. A necessary component of
Shor’s algorithm, the continued fractions algorithm, is introduced.
The Continued Fractions Algorithm
The continued fractions algorithm allows us to calculate an array of integers to
represent a fraction. We simply split the fraction into its whole and fractional
parts, store the whole part, and repeat the process until we have no fractional
parts left. Here’s an example:
Example Convert
11
9
to integer array representation.
11
9
= 1 +
2
9
= 1 +
1
9
2
= 1 +
1
1 +
1
9
2
= 1 +
1
1 +
1
4 +
1
2
.
So, we end up with the following list:
[1, 1, 4, 2]
which is a four element array (that took four steps) that represents
11
9
.
Now we’ll look at the fast factorisation algorithm...
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
208 Shor’s Algorithm
The Fast Factorisation Circuit and Algorithm
[0)
H

QFT

.
.
.
[0)
H

. . .

[0)
H

. . .

[0)
H

. . .

[1)
⊗n
/ U
1
f
U
2
f
U
3
f
U
n
f

↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
) ↑ [ψ
4
) ↑ [ψ
5
)
The algorithm presented here is similar to Shor’s algorithm, and uses the QFT
introduced earlier. It’s simple, given a number N to be factored, to return a
factor f where f > 1. The algorithm is as follows:
1. If N is divisible by 2 then return f = 2.
2. For a ≥ 1 and b ≥ 2 if N = a
b
then return f = a (we can test this classically).
3. Randomly choose an integer x where 1 < x < N. We can test if two numbers
share a common divisor efficiently on a classical computer. There is an
efficient classical algorithm to test if numbers are coprime, that is their
greatest common divisor (gcd) is 1. In this step we test if gcd(x, N) > 1,
if it is then we return f = gcd(x, N). E.g. N = 15 if x = 3; we find
gcd(3, 15) = 3, so return 3.
4. This is where the quantumcomputer comes in. We apply the quantumorder
finding algorithm. Before we start we need to define the size of the input
registers, register 1 needs to be t qubits in size where 2N ≤ t (this is to
reduce the chance of errors in the output, and there seems to be some
contention in the reference material as to what this lower bound should
be). Register 2 needs to be L qubits in size where L is the number of qubits
needed to store N.

1
) Initialise register 1, which is t qubits in size to [0)
⊗t
and register 2,
which is L qubits in size to [1)
⊗L
.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 209

2
) Create a superposition on register 1:
[Ψ) =
1

2
t

2
t−1
r
1
=0
[R
1
) [1).

3
) Apply U
f
R
2
= x
R
1
mod N to register 2:
[Ψ) =
1

2
t

2
t−1
r
2
=0
[R
1
)
¸
¸
x
R
1
mod N
_
.

4
) We measure register 2, because it is entangled with register 1 and
our state becomes subset of the values in register 1 that correspond
with the value we observed in register 2.

5
) We apply QFT

to register 1 and then measure it.

6
) (not shown) Now we apply the continued fractions algorithm to

2
t
and the number of steps it takes will be the period r.
5. With the result r first test if r is even the see if x
r/2
,= −1 mod N then cal-
culate f =gcd(x
r/2
±, N). If the result is not 1 or N then return f as it is a
factor, otherwise the algorithm has failed and we have to start again.
Over the next two pages we’ll look at a couple of worked examples of Shor’s algorithm.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
210 Shor’s Algorithm
Example Find the factors for N = 15
1. N is not even, continue.
2. N ,= a
b
so continue.
3. We choose x = 7 gcd(7, 15) = 1 so continue.
4. t = 11 qubits for register 1 and L = 4 qubits for register 2.

1
) Initialise both the registers so the combined state becomes [Ψ) =
[000000000001111).

2
) Create a superposition on register 1, so we get [Ψ) =
1

2048
([0) + [1) +
[2) +. . . +[2047)) [15).

3
) applying x
R
1
mod 15 gives us the following:
R
1
[0) [1) [2) [3) [4) [5) [6) [7) [8) [9) [10) . . .
R
2
[1) [7) [4) [13) [1) [7) [4) [13) [1) [7) [4) . . .

4
) We Measure R
2
and randomly get a 4 leaving [Ψ) in the following post
measurement state:
R
1
[2) [6) [10) . . .
R
2
[4) [4) [4) . . .
Remember that both registers are actually part of the same state vec-
tor, it’s just convenient to think of them separately. The state above is
actually an entangled state that looks like (R
2
is bolded):
[Ψ) =
1

512
([000000000101000) +[000000001101000) +. . .) .

5
) After applying QFT

we get either 0, 512, 1024, or 1536 with a probabil-
ity of
1
4
. Say we observe 1536.

6
) The result from the continued fractions algorithm for
1536
2048
is 4.
5. r is even and satisfies
r
2
,= −1 mod N. So we try gcd(7
2
− 1, 15) = 3 and
gcd(7
2
+ 1, 15) = 5. Now, by testing that 3 5 = 15 = N we see we
have now found our factors.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Shor’s Algorithm 211
Example Find the factors for N = 55
1 & 2. N is not even and N ,= a
b
, so continue.
3. We choose x = 13 gcd(13, 55) = 1 so continue.
4. t = 13 qubits for register 1 and L = 6 qubits for register 2.

1
) Initialise both the registers so the combined state becomes [Ψ) =
[0000000000000111111).

2
) Create a superposition on register 1, so we get [Ψ) =
1

8192
([0) + [1) +
[2) +. . . +[8191)) [63).

3
) applying x
R
1
mod 55 gives us the following:
R
1
[0) [1) [2) . . . [8192)
R
2
[1) [13) [4) . . . [2)

4
) We Measure R
2
and randomly get a 28 leaving [Ψ) in the following post
measurement state:
R
1
[9) [29) [49) . . . [8189)
R
2
[28) [28) [28) . . . [28)
So the state vector (ie. with both registers) looks like this:
[Ψ) =
1

410
([9) [28) +[29) [28) +[49) [28) +. . . +[8189) [28)) .

5
) After applying QFT

we observe 4915 (the probability of observing this
is 4.4%).

6
) The result from the continued fractions algorithm for
4915
8192
is 20.
5. r is even and satisfies
r
2
,= −1 mod N. So we try gcd(13
10
−1, 15) = 5 and
gcd(13
10
+1, 55) = 11. Now, by testing that 5 11 = 55 = N we see we
have now found our factors.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
212 Grover’s Algorithm
7.4 Grover’s Algorithm
Grover’s algorithm gives us a quadratic speed up to a wide variety of clas-
sical search algorithms. The most commonly given examples of search algo-
rithms that can benefit from a quantum architecture are shortest route finding
algorithms and algorithms to find specific elements in an unsorted database.
7.4.1 The Travelling Salesman Problem
An example of shortest route finding is the travelling salesman problem. Put sim-
ply, given a number of interconnected cities, with certain distances between
them. Is there a route of less than k kilometres (or miles) for which the sales-
man can visit every city?
With Grover’s algorithm it is possible to complete to search for a route of less
than k kilometres in O(

N) steps rather than an average of
N
2
(which is O(N))
steps for the classical case. Suppose we have M different solutions for k then
the time complexity for Grover’s algorithm is O(
_
M
N
).
7.4.2 Quantum Searching
For the purpose of explaining Grover type algorithms we’ll use an unsorted
database table as an example.
Given a database table with N elements (it is best if we choose an N that is
approximately 2
n
where n is the number of qubits) with an index i. Our table
is shown below:
0 element 1
1 element 2
2 element 3
.
.
.
N −1 element N
Suppose there are M solutions where 1 < M ≤ N.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Grover’s Algorithm 213
In a similar way to Deutsch’s algorithm we use an oracle to decide if a par-
ticular index, x is a marked solution to the problem, i.e.
f(x) = 1 if x is a solution,
f(x) = 0 otherwise.
The search algorithm can actually be made up of several oracles. The oracles
functions are very similar to the Deutsch Josza algorithm, as shown below:
[x) [q) → O → [q ⊕f(x)) (7.9)
here [x) is a register, [q) is a qubit and O is the oracle. The oracle circuit looks
like this:
[x) /
n
U
f
[q)
q ⊕f(x)
As with the Deutsch Josza algorithm if we set q to [1) and then put it through
an H gate the answer appears in the [x) register and [q) appears the same after
the calculation so we end up with:
[x) → O → (−1)
f(x)
[x) . (7.10)
The function f(x) contains the logic for the type of search we are doing. Typ-
ically there are extra work qubits leading into the oracle that may behave as
ancilla qubits. This is called an oracle’s workspace (represented by w).
The circuit for Grover’s algorithm is shown below:
[0) /
n
H
⊗n
G G
. . .
G

[0) [0)
. . .
[0)
[w) /
. . .
↑ [ψ
1
) ↑ [ψ
2
) ↑ [ψ
3
) ↑ [ψ
4
) ↑ [ψ
5
) ↑ [ψ
6
)
The steps for the algorithm for M = 1 are as follows:

2
) Initialise qubits states.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
214 Grover’s Algorithm
E
T
/
/
/
/
/
/
/
/
/
/
/
/

Z
Z
Z
Z
Z
Z
Z
Z
Z

.
.
.
.
.
.
.
.
.
.
.
.

[v)
[u)
G
1
[ψ)
G
2
[ψ)
G
3
[ψ)
Figure 7.1: Visualising grover’s algorithm.

2
) We put [x) into a superposition:
[x) →
1

N
N−1

x=0
[x).

3
) → [ψ
5
) Each G is called a Grover iteration that performs the oracle and a
conditional phase flip on [x) which flips the sign on all qubits except for [0)
(denoted by CPF below). This is done after collapsing the superposition
on [x) via H
⊗n
. After the phase flip is completed the [x) register is put
back into a superposition. Each G looks like the following:
[x) /
n
[x) → (−1)
f(x)
[x)
H
⊗n
CPF H
⊗n
[q)
[W) /
For M = 1 we will need to apply G ¸π

2
n
/4| times.

6
) Finally we measure, as we have M = 1 the register [x) will contain the
only solution. If we had M > 1 we would randomly measure one of the
possible solutions.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Grover’s Algorithm 215
Visualising Grover’s Algorithm
We can define the superposition of solutions to Grover’s algorithm as:
[u) =
1

M

=
[x) (7.11)
and the superposition of values that are not solutions as:
[v) =
1

N −M

=
[x) . (7.12)
The operation of Grover’s algorithm can be seen if figure 7.1 as a series of ro-
tations of [Ψ) from[v) to [u). With each individual rotation being done by G, a
grover iteration.
A simple exmample follows:
Example Suppose we have an index size of 4, which gives us N = 4. We
have only one solution so M = 1 and our function, f(x) has a marked solu-
tion at x = 0. This is like saying the element we are looking for is at index
i = 0. These are the results returned by an oracle call:
f(0) = 1, f(1) = 0, f(2) = 0, and f(3) = 0.
The size of register [x) is 2 qubits. We also have a workspace of 1 qubit (which
we set to [1)), which we put through an H gate at the same time as the qubits
in [x) initially go through their respective H gates (we’ll ignore oracle qubit
q for this example). The steps for the algorithm are as follows:

1
) We initialise [x) and [w), so [Ψ) = [001).

2
) [x) and [w) go through their H gates giving us [x) =
1

4
[[00) + [01) +
[10) +[11)] and [w) =
1

2
[[0) −[1)].

3
) A single grover iteration is all we need to rotate [x) to match [u) (the
marked solution) so we jump straight to [ψ
5
).

5
) Now[x) = [00).

6
) Measuring register [x) gives us a 0.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Chapter 8
Using Quantum Mechanical Devices
8.1 Introduction
Today’s manufacturing methods can make chips (figure 8.1) with transistors
a fraction of a micron wide. As they get smaller, chips also tend to get faster.
Computer power doubles every fewyears (according to Moore’s law) and we’ll
soon reach the threshold below which transistors will not work because of
quantum effects. At tens of nanometres (which we are close to now) electrons
can tunnel between parts of a circuit, so transistor technology may not be able
to shrink much further [Benjamin, S. & Ekert, A. ? 2000].
In 1998 Neil Gershenfeld (MIT) built a three qubit device, then in 2000 Ray
LaFlemme built a seven qubit quantum computer. Currently we are still lim-
ited to tens of qubits and hundreds of gates with implementations being slow
and temperamental. The architectures of these machines vary, with scientists
even talking about using cups of coffee and small amounts of chloroform to
build a working quantum computer [Blume, H. 2000].
8.2 Physical Realisation
We’ll take a quick look at physical realisations here, but a warning for those
expecting detail - this section is mainly here for completeness and is strictly an
introduction.
According to Nielsen and Chuang [Nielsen, M. A. & Chuang, I. L. 2000] there
217
218 Physical Realisation
Figure 8.1: A silicon chip [Benjamin, S. & Ekert, A. ? 2000].
are four basic requirements for the physical implementation of a quantumcom-
puter. They are:
1. Qubit implementation - The biggest problem facing quantum computing is
the fickle nature of the minute components they work with. Qubits can
be implemented in various ways, like the spin states of a particle, ground
and excited states of atoms, and photon polarisation.
There are several considerations for implementing qubits, one consider-
ation is high decoherence times (low stability). E.g. 10
−3
seconds for an
electron’s spin, and 10
−6
seconds for a quantum dot (a kind of artificial
atom). Another consideration is speed, the stronger the qubit implemen-
tation can interact with the environment, the faster the computer. E.g.
nuclear spins give us much slower ”clock speed” than electron spins, be-
cause of the nuclear spin’s weak interactions with the ”outside world”.
There are two types of qubits, material qubits like the stationary ones
described above and flying qubits (usually photons). Stationary qubits are
most likely to be used to build quantum hardware, whereas flying qubits
are most likely to be used for communication.
2. Control of unitary evolution - How we control of the evolution of the cir-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Physical Realisation 219
cuits.
3. Initial state preparation (qubits) - Setting the values of initial qubits. We
need to be able to initialise qubits to values like [000 . . .). This is not just
for initial values of a circuit. E.g. quantum error correction needs a con-
stant supply of pre-initialised, stable qubits.
4. Measurement of the final state(s) - Measuring qubits. We need a way of
measuring the state of our qubits. We need to do this in a way that does
not disturb other parts of our quantum computer. we also need to con-
sider if the measurement is a non destructive measurement, which for ex-
ample leaves the qubit in the state which can be used later for initialisa-
tion. Another issue is that measurement techniques are less than perfect,
so we have to consider ”copying” values of the output qubits and aver-
aging the results.
Also, David P. Divenco [Divincenzo, D.P. 2003] has suggested two more ”fun-
damental requirements”:
5. Decoherence times need to be much longer than quantum gate times.
6. A universal set of quantum gates.
8.2.1 Implementation Technologies
There are many theoretical ways to implement a quantum computer, all of
which, at present suffer from poor scalability. Two of the important methods
are listed below [Black, P.E. Kuhn, D.R. & Williams, C.J. ? 2000].
• Optical photon computer - This is the easiest type of quantum computer
to understand. One of the ways qubits can be represented is by the fa-
miliar polarisation method. Gates can be represented by beamsplitters.
Measurement is done by detecting individual photons and initial state
preparation can be done by polarising photons. In practice, photons do
not interact well with the environment, although there are new methods
that use entanglement to combat this problem. There remain other prob-
lems with single photon detection (which is very hard to do), and the fact
that photons are hard to control as they move at the speed of light.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
220 Quantum Computer Languages
• Nuclear magnetic resonance - NMR uses the spin of an atomic nucleus to
represent a qubit. Chemical bonds between spins are manipulated by a
magnetic field to simulate gates. Spins are prepared by magnetising, and
induced voltages are used for measurement. Currently it is thought that
NMR will not scale to more than about twenty qubits.
Several atomic spins can be combined chemically in a molecule. Each
element resonates at a different frequency so we can manipulate different
spins by producing a radio wave pulse at the correct frequency. This spin
is ”rotated” by the radio pulse (the amount of which depends on the am-
plitude and direction). A computation is made up of a series of timed,
and sized radio pulses. We are not limited to using atoms as they can
be combined to form a macroscopic liquid with same state spins for all
the component atoms. A seven qubit computer has been made from five
fluorine atoms whose spins implement qubits.
To explain these in detail is beyond the scope of this text and there are many
more implementation technologies like ion traps (a number of ions, trapped
in a row in a magnetic field), SQUIDS (superconducting quantum interference
devices), electrons on liquid helium, optical lattices, and harmonic oscillators.
8.3 Quantum Computer Languages
Even though no quantum computer has been built that hasn’t stopped the pro-
liferation of papers on various aspects of the subject. Many such papers have
been written defining language specifications. Some quantum languages are
listed below [Glendinning, I. 2004].
• QCL - (Bernhard
¨
Omer) C like syntax and very complete. Accessible at http:
//tph.tuwien.ac.at/

oemer/qcl.html .
• qGCL - (Paolo Zuliani and others) Resembles a functional programming lan-
guage and claims to be better than Bernhard
¨
Omer’s QCL because QCL
does not include probabilism and nondeterminism, has no notion of pro-
gram refinement, and only allows standard observation. Accessible via
http://web.comlab.ox.ac.uk/oucl/work/paolo.zuliani/ .
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Encryption Devices 221
Figure 8.2: id Quantique’s QKD device.
• Quantum C - (Stephen Blaha) Currently just a specification, with a notion of
quantum assembler. Accessible at http://arxiv.org/abs/quant
-ph/0201082 .
• Conventions for QuantumPseudo Code - (E. Knill) Not actually a language,
but a nice way to represent quantum algorithms and operations. Accessi-
ble at www.eskimo.com/

knill/cv/reprints/knill
:qc1996e.ps .
Question It seems odd that there is no implementation of quantum BASIC,
is there any existing work? Maybe just a specification?
8.4 Encryption Devices
The first encryption devices using the quantum properties discussed previ-
ously have been released. For example, a quantum key distribution unit devel-
oped by id Quantique (which can be found at http://www.idquantique.
com/) is pictured in figure 8.2 and another encryption device was recently re-
leased by MagiQ.
Whether or not they become commercial success may affect the future of the
field as a whole.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Appendix A
Complexity Classes
A.1 Classical
Here is a summary of some of the main complexity classes. Most of these defi-
nitions are copied verbatim from [cs.umbc.edu.edu 2003]:
P - the set of languages accepted by deterministic Turing machines in polyno-
mial time.
NP - the set of languages accepted by nondeterministic Turing machines in
polynomial time.
NPI (NP intermediate) - the set of languages in NP but not in NP-complete.
co-NP - the set of languages rejected by nondeterministic Turing machines in
polynomial time.
NP-complete - a decision problem in NP is NP-complete if all other problems
in NP are reducible to it.
EXP - the set of languages accepted by deterministic Turing machines in t(n) =
2
cn
time.
NEXP - the set of languages accepted by nondeterministic Turing machines in
t(n) = 2
cn
time.
PEXP - the set of languages accepted by deterministic Turing machines in t(n) =
2
p(n)
time.
223
224 Classical
NPEXP - the set of languages accepted by nondeterministic Turing machines
in t(n) = 2
p(n)
time.
UP - the set of languages accepted by unambiguous nondeterministic Turing
machines, that have at least one accepting computation on any input, in
polynomial time.
The next set of classes relate to space complexity - which is the amount of space
(storage) required by the algorithm.
LOGSPACE - the set of languages accepted by deterministic Turing machines
in logarithmic space.
PSPACE - the set of languages accepted by deterministic Turing machines in
polynomial space.
NPSPACE - the set of languages accepted by nondeterministic Turing ma-
chines in polynomial space.
NLOGSPACE - the set of languages accepted by nondeterministic Turing ma-
chines.
The final set of classes refer to probabilistic Turning machines:
PP - the set of languages accepted by probabilistic polynomial-time Turing ma-
chines (not proved random = pseudo random).
BPP - the set of languages accepted by bounded probabilistic polynomial-time
Turing machines (balanced probability).
RP - the set of languages accepted by random probabilistic polynomial-time
Turing machines (one sided probability).
co-RP - the set of languages accepted by RP machines with accept and reject
probabilities reversed.
ZPP - RP intersection co-RP, the set of languages accepted by zero probability
of error polynomial-time Turing machines.
Some of the main classes are related in the following way [Nielsen, M. A. &
Chuang, I. L. 2000]:
• L ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Quantum 225
• Factoring is thought to be in NPI and not proven to be in NP-complete.
• Graph isomorphism is thought to be in NPI and not proven to be in NP-
complete.
• Time hierarchy theorem: TIME(f(n)) ⊂ TIME(f(n) log
2
(f(n))).
• Space hierarchy theorem: SPACE(f(n)) ⊂ SPACE(f(n) log(f(n))).
A.2 Quantum
Some of the quantum complexity classes are listed below. These definitions are
copied verbatim from [Meglicki, Z. 2002]:
QP - the problem can certainly be solved by a QTM in polynomial time at
worst, with P ⊂ QP.
ZQP - the problemcan be solved by a QTMwithout errors in polynomial time,
with ZP ⊂ ZQP.
BQP - the problem can be solved by a QTM in polynomial time at worst with
probability greater than
2
3
. I.e. in
1
3
of cases the computer may return an
erroneous result, also BPP ⊆ BQP.
Some of the quantumcomplexity classes are related in the following way [Nielsen,
M. A. & Chuang, I. L. 2000]:
• It is known that polynomial quantum algorithms are in PSPACE.
• It is thought that NP-complete problems cannot be solved by QTMs in poly-
nomial time but NPI problems can.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Bibliography
Arizona.edu 1999, Lecture 1 [Online]. Available: http://www.consciousness.
arizona.edu/quantum/Library/qmlecture1.htm [Accessed 5 December 2004]
Baeyer, H. C. 2001, In the Beginning was the Bit, New Scientist, February 17
Banerjee, S. ? 2004, Quantum Computation and Information Theory - Lecture 1 [On-
line]. Available: http://www.cse.iitd.ernet.in/¸

suban/quantum/lectures/
lecture1.pdf [Accessed 4 July 2004]
Barenco, A. Ekert, A. Sanpera, A. & Machiavello, C. 1996, A Short Introduction
to Quantum Computation [Online]. Available: http://www.Qubit.org/library/
intros/comp/comp.html [Accessed 30 June 2004]
Benjamin, S. & Ekert, A. ? 2000, A Short Introduction to Quantum-Scale Comput-
ing. [Online]. Available: http://www.qubit.org/library/intros/nano/nano.
html [Accessed 4 July 2004]
Bettelli, S. 2000, Introduction to Quantum Algorithms [Online]. Available: sra.
itc.it/people/serafini/quantum-computing/seminars/20001006-slides.ps
[Accessed 5 December 2004]
Black, P.E. Kuhn, D.R. & Williams, C.J. ? 2000, Quantum Computing and Commu-
nication [Online]. Available: http://hissa.nist.gov/

black/Papers/
quantumCom.pdf [Accessed 7 December 2004]
Blume, H. 2000, Reimagining the Cosmos. [Online]. Available: http://www.
theatlantic.com/unbound/digicult/dc2000-05-03.htm [Accessed 4 July 2004]
227
228 BIBLIOGRAPHY
Braunstein, S. L. & Lo, H. K. 2000, Scalable Quantum Computers - Paving the Way
to Realisation, 1st edn, Wiley Press, Canada.
Bulitko, V.V. 2002, On Quantum Computing and AI (Notes for a Graduate Class).
[Online]. Available: www.cs.ualberta.ca/

bulitko/qc/schedule/qcss-notes.
pdf [Accessed 10 December 2004]
Cabrera, B.J. ? 2000, John von Neumann and von Neumann Architecture for Comput-
ers [Online]. Available: http://www.salem.mass.edu/

tevans/VonNeuma.htm
[Accessed 9 September 2004]
Castro, M. 1997, Do I Invest in Quantum Communications Links For My Company?
[Online]. Available: http://www.doc.ic.ac.uk/

nd/surprise 97/journal/
vol1/mjc5/ [Accessed 4 July 2004]
Copeland, J. 2000, What is a Turing Machine? [Online]. Available: http://www.
alanturing.net/turing archive/pages/ReferenceArticles
/WhatisaTuringMachine.html [Accessed 9 August 2004]
cs.umbc.edu.edu 2003, Complexity Class Brief Definitions [Online]. Available:
http://www.csee.umbc.edu/help/theory/classes.shtml [Accessed 7 Decem-
ber 2004]
Dawar, A. 2004, Quantum Computing - Lectures. [Online]. Available: http:
//www.cl.cam.ac.uk/Teaching/current/QuantComp/ [Accessed 4 July 2004]
Dorai, K. Arvind, ?. Kumar, A. 2001, Implementation of a Deutsch-like quan-
tum algorithm utilising entanglement at the two-qubit level on an NMR quantum-
information processor [Online]. Available: http://eprints.iisc.ernet.in/archive
/00000300/01/Deutsch.pdf [Accessed 4 July 2004]
Designing Encodings ? 2000, Designing Encodings [Online]. Available: http:
//www.indigosim.com/tutorials/communication/t3s2.htm
Deutsch, D. & Ekert, A. 1998, Quantum Computation, Physics World, March
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
BIBLIOGRAPHY 229
Divincenzo, D.P. 2003, The Physical Implementation of Quantum Computa-
tion, quant-ph/0002077, vol. 13 April.
Ekert, A. 1993, Quantum Keys for Keeping Secrets, New Scientist, Jan 16
Forbes, S. Morton, M. Rae H. 1991, Skills in Mathematics Volumes 1 and 2, 2nd
edn, Forbes, Morton, and Rae, Auckland.
Gilleland, M. ? 2000, Big Square Roots [Online]. Available: http://www.
merriampark.com/bigsqrt.htm [Accessed 9 September 2004]
Glendinning, I. 2004, QuantumProgramming Languages and Tools. [Online]. Avail-
able: http://www.vcpc.univie.ac.at/

ian/hotlist/qc/programming.shtml
[Accessed 4 July 2004]
Hameroff, S. ? 2003, Consciousness at the Millennium: Quantum Approaches to
Understanding the Mind, Introductory Lectures [Online]. Available: http://www.
consciousness.arizona.edu/Quantum/ [Accessed 30 June 2004]
Hameroff, S. & Conrad, M. ? 2003, Consciousness at the Millennium: Quantum
Approaches to Understanding the Mind, Lecture 6 [Online]. Available: http://
www.consciousness.arizona.edu/Quantum/week6.htm [Accessed 30 June 2004]
Jones, J. Wilson, W. 1995, An Incomplete Education , ? edn, ?, ?
Knill, E. Laflamme, R. Barnum, H. Dalvit, D. Dziarmaga, J. Gubernatis, J. Gurvits,
L. Ortiz, G. Viola, L. & Zurek, W.H. 2002, Introduction to Quantum Information
Processing
Marshall, J. 2001, Theory of Computation [Online]. Available: http://pages.
pomona.edu/

jbm04747/courses/fall2001/cs10/lectures/Computation
/Computation.html [Accessed 9 August 2004]
McEvoy, J.P. & Zarate, 0. 2002, Introducing Quantum Theory, 2nd edn, Icon
Books, UK.
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
230 BIBLIOGRAPHY
Meglicki, Z. 2002, Quantum Complexity and Quantum Algorithms [Online]. Avail-
able: http://beige.ucs.indiana.edu/B679/node27.html [Accessed 7 Decem-
ber 2004]
Natural Theology 2004, Goedel [Online]. Available: http://www
.naturaltheology.net/Synopsis/s26Goedel.html
Nielsen, M. A. 2002, Eight Introductory Lectures on Quantum Information Science
[Online]. Available: http://www.qinfo.org/people/nielsen/qicss.html [Ac-
cessed 30 June 2004]
Nielsen, M. A. & Chuang, I. L. 2000, Quantum Computation and Quantum In-
formation, 3rd edn, Cambridge Press, UK.
Odenwald, S. 1997, Ask the Astronomer (Question) [Online]. Available: http:
//www.astronomycafe.net/qadir/q971.html [Accessed 30 June 2004]
Rae, A. 1996, Quantum Physics: Illusion or Reality?, 2nd edn, Cambridge Press,
UK.
Searle, J. R. 1990, Is the Brain’s Mind a Computer Program, Scientific Ameri-
can, January, pp. 20-25.
Shannon, C. E. 1948, A Mathematical Theory of Communication [Online]. Avail-
able: http://cm.bell-labs.com/cm/ms/what/shannonday/paper.html [Accessed
29 April 2006]
Shatkay, H. 1995, The Fourier Transform - A Primer [Online]. Available: http://
citeseer.ist.psu.edu/shatkay95fourier.html [Accessed 10 December 2004]
Smithsonian NMAH 1999, Jacquard’s Punched Card [Online]. Available: http:
//history.acusd.edu/gen/recording/jacquard1.html [Accessed 9 September
2004]
Stay. M. 2004, Deutsch’s algorithm with a pair of sunglasses and some mirrors [On-
line]. Available: http://www.cs.auckland.ac.nz/

msta039/deutsch.txt [Ac-
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
BIBLIOGRAPHY 231
cessed 4 July 2004]
Steane, A. M. 1998, Quantum Computing, Rept.Prog.Phys., vol. 61 pp. 117-
173
TheFreeDictionary.com 2004, Grover’s Algorithm [Online]. Available: http://
encyclopedia.thefreedictionary.com/groversalgorithm
[Accessed 4 July 2004]
TheFreeDictionary.com 2004, Probabilistic Turing machine [Online]. Available:
http://encyclopedia.thefreedictionary.com/Probabilistic+Turing+machine
[Accessed 3 December 2004]
wikipedia.org 2004, Complexity classes P and NP [Online]. Available: http://
en.wikipedia.org/wiki/Complexity classes P and NP [Accessed 3 November
2004]
Wolfram, S. 2002, A New Kind of Science, 1st edn, Wolfram Media, USA
Image References
Figure 2.1
http://www.mathe.tu-freiberg.de/

dempe/schuelerpr neu/babbage.htm
http://www.inzine.sk/article.asp?art=8491
Figure 2.2
http://www.cs.us.es/cursos/tco/
http://www-groups.dcs.st-and.ac.uk/

history/Mathematicians
/Turing.html
Figure 2.3
http://www-groups.dcs.st-and.ac.uk/

history/Mathematicians
/Von Neumann.html
Figure 2.4
aima.cs.berkeley.edu/cover.html
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
232 BIBLIOGRAPHY
Figure 2.5
http://www.phy.bg.ac.yu/web projects/giants/hilbert.html
http://www-groups.dcs.st-and.ac.uk/

history/Mathematicians/Godel.html
Figure 2.9
http://pr.caltech.edu/events/caltech nobel/
Figure 2.12
http://www.elis.UGent.be/ELISgroups/solar/projects/computer.html
Figure 3.9
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Fourier.html
Figure 4.1
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/Maxwell.html
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/Newton.html
Figure 4.2
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians
/Copernicus.html
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Galileo.html
Figure 4.3
http://www.svarog.org/filozofija/graph/democritus.jpg
http://www.slcc.edu/schools/hum sci/physics/whatis/biography
/dalton.html
Figure 4.4
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Helmholtz.html
http://www.eat-online.net/english/education/biographies/clausius¸.htm
Figure 4.6
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians
/Boltzmann.html
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/bohr.html
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
BIBLIOGRAPHY 233
Figure 4.7
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Einstein.html
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Balmer.html
Figure 4.8
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/Planck.html
http://www.trinityprep.org/MAZZAR/thinkquest/History/Thomson.htm
Figure 4.9
http://www.chemheritage.org/EducationalServices/chemach/ans/er.html
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians
/Sommerfeld.html
Figure 4.13
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Pauli.html
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/Broglie.html
Figure 4.14
http://www-groups.dcs.st-and.ac.uk/

history/Mathematicians
/Schrodinger.html
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Born.html
Figure 4.15
http://www-gap.dcs.st-and.ac.uk/

history/Mathematicians/Born.html
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Dirac.html
Figure 6.1
http://www-history.mcs.st-andrews.ac.uk/history/PictDisplay
/Shannon.html
http://www-gap.dcs.st-and.ac.uk/

history/PictDisplay/Boole.html
Figure 8.1
http://www.qubit.org/oldsite/intros/nano/nano.html
Figure 8.2
http://www.idquantique.com/
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
Index
Absorbtion spectrum, 97
Adjoint, 68
Analytical engine, 4
Ancilla bits, 28, 142
AND gate, 15
Angles in other quadrants, 38
Anti-Commutator, 77
Aristotle, 91
Artificial intelligence, 32
Asymptotically equivalent, 21
Atoms, 91
Automaton, 9
Babbage, Charles, 4
Balmer, Johann Jakob, 98
Basis, 57
BB84, 191
Bell state circuit, 144
Bell states, 128, 178
Bennet, C.H., 187
Bennett, Charles, 28
Big Ω notation, 21
Big Θ notation, 21
Big O notation, 21
Binary entropy, 162
Binary numbers, 6
Binary representation, 8
Binary symmetric channels, 171
Bit swap Circuit, 143
Bits, 8
Black body, 95
Black body radiation, 95
Bloch sphere, 120
Bohr, Niels, 94
Boltzmann’s constant, 94
Boltzmann, Ludwig, 94
Boole, George, 156
Boolean algebra, 156
Born, Max, 104
Bra, 56
Bra-ket notation, 60
Brassard, G., 187
Bright line spectra, 97
Bubble sort, 19
Caesar cipher, 186
Cauchy-Schwartz inequality, 60
Cause and effect, 91
Cavity, 95
Channel capacity, 157
Characteristic equation, 70
Characteristic polynomial, 70
Chinese room, 32
Christmas pudding model, 100
Church, Alonzo, 6
Church-Turing thesis, 6
Classical circuits, 14
Classical complexity classes, 223
Classical Cryptography, 186
Classical error correction, 171
Classical gates, 14
Classical information sources, 158
Classical physics, 90
Classical redundancy and compression, 160
Classical registers, 15
Classical wires, 15
Clausius, Rudolf , 92
CNOT gate, 29, 138
Code wheel, 186
Codewords, 171
Column notation, 54
Commutative law of multiplication, 104
235
236 INDEX
Commutator, 77
Completely mixed state, 168
Completeness relation, 68
Complex conjugate, 42
Complex number, 41
Complex plane, 43
Complexity classes, 223
Computational basis, 57
Computational Resources and Efficiency, 18
Constant coefficients, 36
Continued fractions algorithm, 207
Continuous spectrum, 97
Control lines, 28
Control of unitary evolution, 219
Controlled U gate, 142
Conventions for quantum pseudo code, 221
Converting between degrees and radians, 38
Copenhagen interpretation, 105
Copernicus, Nicolaus, 90
Copying circuit, 143
CROSSOVER, 18
Cryptology, 185
CSS codes, 178
de Broglie, Louis, 103
Decision problem, 23
Decoherence, 164, 173
Degenerate, 70
Degrees, 38
Democritan, 33
Democritus, 91
Density matrix, 164
Determinant, 50
Determinism, 91
Deterministic Turing machines, 23
Deutsch - Church - Turing principle, 25
Deutsch’s algorithm, 194
Deutsch, David, 25
Deutsch-Josza algorithm, 198
Diagonal polarisation, 116
Diagonalisable matrix, 76
Dirac, Paul, 105
Discrete fourier transform, 81
Dot product, 53, 59
Dual vector, 56
Eigenspace, 70
Eigenvalue, 70
Eigenvector, 70
Einstein, Albert, 97
Electromagnetism, 90
Electron, 98
Emission spectrum, 97
Ensemble point of view, 165
Entangled states, 127
Entanglement, 111
Entropy, 93
EPR, 111
EPR pair, 128, 178
Error syndrome, 175
Excited state, 101
Exponential form, 45
FANIN, 18
FANOUT, 18
Fast factorisation, 205
Fast Factorisation algorithm, 208
Fast Factorisation circuit, 208
Feynman, Richard, 24
Finite state automata, 11
First law of thermodynamics, 92
Fluctuation, 94
Flying qubits, 218
For all, 36
Formal languages, 9
Four postulates of quantum mechanics, 112,
149, 169
Fourier series, 82
Fourier transform, 81
Fourier, Jean Baptiste Joseph, 81
Fredkin gate, 30, 141
Frequency domain, 81
Full rank, 50
Fundamental point of view, 169
G¨ odel’s incompleteness theorem, 6
G¨ odel, Kurt, 6
Galilei, Galileo, 90
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
INDEX 237
Garbage bits, 28, 142
Global phase, 118
Global properties of functions, 194
Gram Schmidt method, 64
Ground state, 100
Grover workspace, 213
Grover’s algorithm, 212
Grover, Lov, 113
Hadamard gate, 134
Haltig problem, 12
Heisenberg uncertainty principle, 105
Heisenberg, Werner, 104
Helmholtz, Von, 92
Hermitian operator, 73, 76
Hilbert space, 51, 60
Hilbert, David, 6
id Quantique, 221
Identity matrix, 49
If and only if, 37
Imaginary axis, 43
Independent and identically distributed, 158
Initial point, 51
Inner product, 53, 59
Interference, 107
Intractable, 22, 193
Inverse matrix, 49
Inverse quantum fourier transform, 201
Invertible, 26
Jacquard, Joseph Marie, 4
Ket, 54, 119
Keyes, R.W., 28
King, Ada Augusta, 4
Kronecker product, 80
Landauer’s principle, 26
Landauer, Rolf, 26
Least significant digit, 8
Length of codes, 160
Linear combination, 56
Linear operator, 64
Linearly independent, 57
Local state, 111
Logarithms, 40
Logical symbols, 36
MagiQ, 221
Marked solution, 213
Markov process, 150
Matrices, 47
Matrix addition, 47
Matrix arithmetic, 47
Matrix entries, 47
Matrix multiplication, 48
Maxwell’s demon, 27
Maxwell, James Clerk, 90
Measurement of final states, 219
Message Destination, 157
Message Receiver, 157
Message Source, 156
Message Transmitter, 156
Mixed states, 163
Modulus, 42
Moore’s law, 5
Moore, Gordon, 5
Multi qubit gates, 138
Mutual key generation, 191
NAND gate, 16
Neumann, Jon Von, 4
New quantum theory, 95
Newton, Issac, 90
Newtonian mechanics, 90
No programming theorem, 149
Noisy channels, 171
Non destructive measurement, 219
Non deterministic Turing machines, 23
Non-deterministic polynomial time, 22
NOR gate, 16
Norm, 42
Normal operator, 73
Normalise, 62
NOT gate, 15
NOT
2
gate, 140
NP, 22
Nuclear Magnetic Resonance, 220
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
238 INDEX
Nuclear spins, 110
Observable, 127
Old quantum theory, 95
One-time PAD, 187
Optical photon computer, 219
OR gate, 15
Oracle, 194
Order, 206
Order finding, 206
Orthogonal, 61
Orthonormal basis, 63
Outer product, 65
Outer product notation, 135
P, 22
Panexperientielism, 33
Partial Measurement, 123
Partial measurement, 123
Pauli exclusion principle, 102
Pauli gates, 130, 136
Pauli operators, 74
Pauli, Wolfgang, 102
Period, 206
Phase estimation, 206
Phase gate, 133
Photoelectric effect, 96
π
8
gate, 133
Planck’s constant, 96
Polar coordinates, 43
Polar decomposition, 78
Polar form, 42
Polarisation of photons, 110
Polynomial time, 22
Polynomially equivalent, 25
Polynomials, 36
Positive operator, 73, 76
POVMs, 153
Principle of invariance, 18
Probabilistic complexity classes, 224
Probabilistic Turing machine, 24
Probability amplitudes, 58
Probability distribution, 158
Programmable quantum computer, 148
Projective measurements, 127
Projectors, 66, 127, 151
Proto-conscious field, 33
Public key encryption, 186
Pure states, 163
Pythagorean theorem, 37
QCL, 220
qGCL, 220
Quantised, 89
Quantum bits, 114
Quantum C, 221
Quantum circuits, 129
Quantum complexity classes, 225
Quantum computer languages, 220
Quantum cryptography, 187
Quantum dot, 218
Quantum fourier transform, 200
Quantum fourier transform circuits, 205
Quantum information sources, 163
Quantum key distribution, 189
Quantum logic gates, 130
Quantum mechanics, 89
Quantum money, 187
Quantum noise, 172
Quantum numbers, 101
Quantum packet sniffing, 188
Quantum repetition code, 173
Quantum searching, 212
Quantum Turing machine, 25
Qubit implementation, 218
Qubit initial state preparation, 219
Qubits, 114
Quick sort, 20
Radians, 38
Rank, 50
Rationalising and dividing complex numbers,
44
Rayleigh-Jeans law, 103
Rectilinear polarisation, 116
Reduced density matrix, 168
Relative phase, 117
Repetition, 171
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
INDEX 239
Repetition codes, 172
Reversible circuits, 31
Reversible computation, 28
Reversible gates, 28
Reversibly, 26
Right angled triangles, 37
Rotation operators, 137
RSA, 186, 193, 205
Rutherford, Ernest, 100
Rydberg constant, 98
Scalar, 47
Scalar multiplication by a matrix, 47
Schr¨ odinger’s cat, 105
Schr¨ odinger, Erwin, 104
Schumacher compression, 170
Schumacher’s quantum noiseless coding the-
orem, 164
Searle, John, 32
Second law of thermodynamics, 92
Shannon Entropy, 161
Shannon’s communication model, 156
Shannon’s noiseless coding theorem, 161
Shannon, Claude E., 155
Shor code, 177
Shor’s algorithm, 200
Shor, Peter, 113
Shortest route finding, 212
Simultaneous diagonalisation theorem, 78
Single qubit gates, 130
Single value decomposition, 78
Singular, 50
Socratic, 33
Sommerfeld, Arnold, 102
Source of Noise, 156
Spanning set, 57
Spectral decomposition, 79
Spin, 102
Square root of NOT gate, 134
Stabiliser codes, 178
State vector, 58, 116
Statistical correlation, 111
Statistical mechanics, 93
Steane code, 178
Strong AI, 32
Strong Church-Turing thesis, 23
subsystem point of view, 168
Superdense coding, 145
Superposition, 107
Teleportation circuit, 146
Tensor product, 79, 123
Terminal point, 51
There exists, 36
Thermodynamics, 91
Thomson, Joseph J., 98
Time domain, 81
Toffoli gate, 29, 141
Total information, 191
Trace, 71
Transpose matrix, 50
Trap door function, 187
Travelling salesman problem, 212
Trigonometric inverses, 38
Trigonometry, 37
Trigonometry identities, 40
Truth tables, 14
Turing Machine, 6
Turing test, 32
Turing, Alan, 4
Uncertainty, 110
Unit vector, 62
Unitary operator, 73
Universal computer, 4
Universal Turning Machine, 11
Vector addition, 55
Vector scalar multiplication and addition, 55
Vectors, 51
Visualising grover’s algorithm, 215
Von Neumann architecture, 4
Von Neumann entropy, 164, 169
Weak AI, 32
Wheeler, John Archibald , 191
Wien’s law, 103
Wiesner, Stephen, 187
Wire, 130
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006
240 INDEX
Witnesses, 23
XOR gate, 16
Zellinger, Anton, 191
Zero matrix, 49
Zero memory information sources, 159
Zero vector, 55
The Temple of Quantum Computing - c _Riley T. Perry 2004 - 2006

Contents
Acknowledgements The Website and Contact Details 1 Introduction 1.1 1.2 What is Quantum Computing? . . . . . . . . . . . . . . . . . . . . Why Another Quantum Computing Tutorial? . . . . . . . . . . . . 1.2.1 2 The Bible of Quantum Computing . . . . . . . . . . . . . . vii viii 1 1 2 2 3 3 3 6 6

Computer Science 2.1 2.2 2.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 2.3.2 2.3.3 2.3.4 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.6 Binary Numbers and Formal Languages . . . . . . . . . .

Turing Machines in Action . . . . . . . . . . . . . . . . . . 10 The Universal Turing Machine . . . . . . . . . . . . . . . . 11 The Halting Problem . . . . . . . . . . . . . . . . . . . . . . 12 Common Gates . . . . . . . . . . . . . . . . . . . . . . . . . 15 Combinations of Gates . . . . . . . . . . . . . . . . . . . . . 17 Relevant Properties . . . . . . . . . . . . . . . . . . . . . . . 18 Universality . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Quantifying Computational Resources . . . . . . . . . . . 20 Standard Complexity Classes . . . . . . . . . . . . . . . . . 22 The Strong Church-Turing Thesis . . . . . . . . . . . . . . . 23 Quantum Turing Machines . . . . . . . . . . . . . . . . . . 25

Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Computational Resources and Efficiency . . . . . . . . . . . . . . . 18

Energy and Computation . . . . . . . . . . . . . . . . . . . . . . . 26 i

ii 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.7 2.7.1 2.7.2

CONTENTS Reversibility . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Irreversibility . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Landauer’s Principle . . . . . . . . . . . . . . . . . . . . . . 26 Maxwell’s Demon . . . . . . . . . . . . . . . . . . . . . . . 27 Reversible Computation . . . . . . . . . . . . . . . . . . . . 28 Reversible Gates . . . . . . . . . . . . . . . . . . . . . . . . 29 Reversible Circuits . . . . . . . . . . . . . . . . . . . . . . . 31 The Chinese Room . . . . . . . . . . . . . . . . . . . . . . . 32 Quantum Computers and Intelligence . . . . . . . . . . . . 33 35

Artificial Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3 Mathematics for Quantum Computing 3.1 3.2 3.3 3.4

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Logical Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Trigonometry Review . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 Right Angled Triangles . . . . . . . . . . . . . . . . . . . . 37 Converting Between Degrees and Radians . . . . . . . . . 38 Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Angles in Other Quadrants . . . . . . . . . . . . . . . . . . 38 Visualisations and Identities . . . . . . . . . . . . . . . . . . 39

3.5 3.6

Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.6.1 3.6.2 3.6.3 Polar Coordinates and Complex Conjugates . . . . . . . . 42 Rationalising and Dividing . . . . . . . . . . . . . . . . . . 44 Exponential Form . . . . . . . . . . . . . . . . . . . . . . . . 45 Matrix Operations . . . . . . . . . . . . . . . . . . . . . . . 47 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Column Notation . . . . . . . . . . . . . . . . . . . . . . . . 54 The Zero Vector . . . . . . . . . . . . . . . . . . . . . . . . . 55 Properties of Vectors in Cn . . . . . . . . . . . . . . . . . . . 55 The Dual Vector . . . . . . . . . . . . . . . . . . . . . . . . . 56 Linear Combinations . . . . . . . . . . . . . . . . . . . . . . 56 Linear Independence . . . . . . . . . . . . . . . . . . . . . . 57 The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

3.7 3.8

Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.7.1 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 Vectors and Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . 51

CONTENTS 3.8.8 3.8.9

iii Spanning Set . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

3.8.10 Probability Amplitudes . . . . . . . . . . . . . . . . . . . . 58 3.8.11 The Inner Product . . . . . . . . . . . . . . . . . . . . . . . 59 3.8.12 Orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.8.13 The Unit Vector . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.8.14 Bases for Cn . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.8.15 The Gram Schmidt Method . . . . . . . . . . . . . . . . . . 64 3.8.16 Linear Operators . . . . . . . . . . . . . . . . . . . . . . . . 64 3.8.17 Outer Products and Projectors . . . . . . . . . . . . . . . . 65 3.8.18 The Adjoint . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.8.19 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . 70 3.8.20 Trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 3.8.21 Normal Operators . . . . . . . . . . . . . . . . . . . . . . . 73 3.8.22 Unitary Operators . . . . . . . . . . . . . . . . . . . . . . . 73 3.8.23 Hermitian and Positive Operators . . . . . . . . . . . . . . 76 3.8.24 Diagonalisable Matrix . . . . . . . . . . . . . . . . . . . . . 76 3.8.25 The Commutator and Anti-Commutator . . . . . . . . . . 77 3.8.26 Polar Decomposition . . . . . . . . . . . . . . . . . . . . . . 78 3.8.27 Spectral Decomposition . . . . . . . . . . . . . . . . . . . . 79 3.8.28 Tensor Products . . . . . . . . . . . . . . . . . . . . . . . . . 79 3.9 Fourier Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.9.1 3.9.2 4 The Fourier Series . . . . . . . . . . . . . . . . . . . . . . . 82 The Discrete Fourier Transform . . . . . . . . . . . . . . . . 85 89

Quantum Mechanics 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.2

History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Classical Physics . . . . . . . . . . . . . . . . . . . . . . . . 90 Important Concepts . . . . . . . . . . . . . . . . . . . . . . 91 Statistical Mechanics . . . . . . . . . . . . . . . . . . . . . . 93 Important Experiments . . . . . . . . . . . . . . . . . . . . 94 The Photoelectric Effect . . . . . . . . . . . . . . . . . . . . 96 Bright Line Spectra . . . . . . . . . . . . . . . . . . . . . . . 97 Proto Quantum Mechanics . . . . . . . . . . . . . . . . . . 98 The New Theory of Quantum Mechanics . . . . . . . . . . 103

Important Principles for Quantum Computing . . . . . . . . . . . 106

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

. . . . . . . . 160 . .4. . . . . . . . . . .2. . . . . . . . . . . 108 Representing Information . . . . . . . . . .1 6. 156 6. . . . . . . .1. . . . 156 Shannon’s Communication Model . . . . . . 163 Pure and Mixed States . . . . . . . . . . .3 5. . . . . . . . . . . . . .4 4.5. . . . . . . . . . . . . . 127 Quantum Circuits . . . . . . . . . . . .1. . . . . 148 Postulate One . . . . . . . . . . . . 150 Postulate Four . .2 5. . . 155 History . . . . Perry 2004 . . . . . . . . . . . . . . . . . . . . . . . .1 4. . . . . . . . . . .2 5. . . . . . . . . . . . . . . . . 107 Dirac Notation . . . . . . . . 114 Entangled States . . . . . . . . . . . . . . . . . .2. . . . . . .1 6. . . . . . . . . . . .4 5. . . . . . . . . . . . . . . . . . . . . . 149 Postulate Three . . . . . . . . . . . . 113 History . . . . . . . .1. . . .1 5. . . . . . .c Riley T. . .3. . . .1 6. . . . . . . . . .2006 Classical Information Sources . . .4 6. . . . . .2 4. . . . . .iv 4. . . .6 4. . 110 Uncertainty . . . . . . . . . . . . 110 Entanglement . .3 4. . .4. . . . . . . . . . . . . . . .2. . . . . . . . . .5 4. . . . . . . . . . . . . .2. . . . 164 The Temple of Quantum Computing . . . .5 Introduction . . . . .4. . . . . . . . . .1 5. . . . . . . . 149 Postulate Two .5 5. . . . . . . . . 158 Shannon’s Noiseless Coding Theorem . . . . . . . . . . . . . . . . . . . .3. . . . . . . . . . . 163 Schumacher’s Quantum Noiseless Coding Theorem . .2. . . . . . . . . . . . . . . 107 Superposition . . . . . . . .3 6. . . . . . . 111 The Four Postulates of Quantum Mechanics . . . . . . . .4 5. 149 6 Information Theory 6. . . . .2. . 129 Common Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Channel Capacity . . .2 6. . . . . .4. .5.4 Elements of Quantum Computing . . .5. .3 6. . . . . . . . . . . . . . . . .1 5. . . . . . . . . . . . . . . . . . . . . 161 Quantum Information Sources . . . . . . 157 Independent Information Sources . . . . . . . . . . . . . . . . . 158 Classical Redundancy and Compression . . . 142 The Reality of Building Circuits . . . . . . . . . . . . . . . . . . . . . . .5. . . . . . . . . . . . . . . . 113 Introduction . . . . . . . . . . . . . . . . . . 113 Bits and Qubits . . . .2. . . . . . . . . . . 142 Building a Programmable Quantum Computer . . . .1. . . . .3 5. . . . . . . . . . . . . . .2 5. . . . . 153 155 Important Properties of Quantum Circuits . . . .3 5. . 148 The Four Postulates of Quantum Mechanics . .7 CONTENTS Linear Algebra . . . . . .1 5. . .1 6. . . .2 6. .4. . . . . .2. . . . . 112 113 5 Quantum Computing 5. .1 5.1.

. . .2 6. . . . . . . . . . .7 Bell States . .2 Quantum Noise . . . 185 6. . . . . . . . . . . . . . . . . . . . . . .2006 . . . . . . . . . . . . . .1 7. .4 7. . . . . . . . . . . . 173 Same Measurement Direction . . 194 The Classical Solution . . . . . . . . . . . . . .1 6. . . . . .7.6. . . . . .2. . . . . . . . . . . .8 Cryptology . . . . . . . . . . . 194 The Deutsch-Josza Algorithm . . . . . .3 7. .1 8. . . .3 7. . . . . . . . . 187 Are we Essentially Information? . . 193 The Problem Defined . .3. . . . . . . . .3 8. . . . . . . . . . . . . .3 7. . . . .1 7. . 172 Quantum Error Correction . . . . . . .1. . . . . . . . . . 191 193 Quantum Algorithms 7. . 219 Quantum Computer Languages . 220 Encryption Devices . .1 6. . . . . . . . . . . . . . . . . . . . . . . . . . .4. . . . . . . . . . . . . . . . . 217 8. . . . . . .2 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Shor’s Algorithm . . . . . . .4 Introduction . .3 6. .8. Perry 2004 . . . 198 The Quantum Solution . . 205 Order Finding . . 212 Quantum Searching . . . .1 7. . . 178 6. 200 Fast Factorisation . . . . . . .0. . . . . . . . . . . . . . . . . . . . 221 The Temple of Quantum Computing . . . . . . . . .7. .2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. . 212 8 Using Quantum Mechanical Devices 8. . . . . . . . . . . . .3. . . . . .1 7. . . .8. . . . . . 197 The Problem Defined . . . . .2. 212 217 Deutsch’s Algorithm . . . . . . . . . . . . . . 171 6. . . . . . . 186 Quantum Cryptography .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Physical Realisation . . . . .4. . . . . . . . . . . . .1 7. . . . . . . . . . . . . . .2 7. 194 The Quantum Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 The Travelling Salesman Problem . .3 6. . .1 Implementation Technologies . . . . . . . . . .7. . . . . . . . . .2 7. . . . . . . . . . . .2. . . .9 7 Alternative Models of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .CONTENTS 6. . . . .6. . . . . . . . . . . . . . . .6 v Noise and Error Correction . . . . 191 6. . . . . . . . . . . . . . . 199 The Quantum Fourier Transform . . . .c Riley T. . . . .4 7. . . . . . .2 8. . .1 7. . . . . . . . . . . . . .8. . . . . . . . . . . . . . . . . . . . . . . . . . .1. . . . . . 180 Bell’s Inequality . . . 181 Classical Cryptography . . . .1 6. . . . . . 200 Grover’s Algorithm . . 179 Different Measurement Directions . . . . . . . . . . . . . . . . . . . . 195 Physical Implementations . . . . . . . . . .2 7. . . . . .1. . . . . . . . . . . . .2 7. . . . . .

. . . . . . .1 Classical . . . . . .2 Quantum . . . .2006 . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 A. . . . . . . . . . . . . 225 Bibliography Index 227 235 The Temple of Quantum Computing . Perry 2004 . . .c Riley T. . . . . . . .vi A Complexity Classes CONTENTS 223 A. . .

Most of the credit for the corrections and improved content in version 1. and inspiration. James Hari. companionship. The people at Slashdot (http://slashdot. my dear girlfriend. to whom this version is dedicated.1 goes to Andreas Gunnarsson. Waranyoo Pulsawat. Birdie 1013. Waranyoo has been a constant source of support. Without his help this work would never have been completed.0 in their blogs. my supervisor. c All the members of the QC4Dummies Yahoo group (http://groups.yahoo. Andreas’ attention to detail is astonishing. Xerxes had some valuable comments about a version 1. and Slashdotters AC. who always provided detailed answers to my questions. He wrote the section on Bell states. A special thanks to Xerxes R˚ nby. Simply put. Sean Kaye and Micheal Nielson for mentioning version 1. thanks to all of the readers.1 into Portuguese. com/group/QC4dummies/) and administrators David Morris and David Rickman. I’ve also had great fun discussing a variety of different eclectic topics with him via email.ucm. Also. and a substantial amount of the other chapters.es/) for posting version 1. and s/nemesis.org/) and QubitNews (http:// quantum.0 and found a number of errors.fis. some parts of the chapter on quantum mechanics. Let the proofreading continue! . Brian is directly responsible for some parts of this text.0 for review. So a big thanks to Andreas. Carlos Gon¸ alves who has kindly offered to translate version 1.Acknowledgements I would like to thank the following people: Brian Lederer. this version would not have been possible without him.

com/ .Net development. a shameless plug for the company I work for. and a bunch of useful links.toqc. Distributed Development specialises in . Visit our site at: http://www.disdev. Finally. TOQC news.com/ You can check the site for any updates. . my current contact details. .The Website and Contact Details The Temple of Quantum Computing (TOQC) Website is available at: http://www. B2B and A2A integration. and Visual Studio Team System.

and may take component miniaturisation to its fundamental limit. This text describes some of the introductory aspects of quantum computing. elementary quantum computing topics like qubits. We’ll examine some basic quantum mechanics. and aspects of computer science [Nielsen. on conventional computers. allow an exponential amount of parallelism. basic concepts from computer science (like complexity theory. dramatic computing speed increases. The field is a relatively new one that promises secure data transfer. physical realisations of those algorithms. & Chuang.Chapter 1 Introduction 1. information theory. and more. special purpose machines like quantum cryptographic devices use entanglement and other peculiarities like quantum uncertainty. in some cases. A. quantum algorithms. Turing machines. L. 1 . 2000]. M. or even impossible. information theory. I. Quantum computing combines quantum mechanics. and linear algebra). Properties called superposition and entanglement may. Quantum computers use a specific physical implementation to gain a computational advantage over conventional computers. Also.1 What is Quantum Computing? In quantum computers we exploit quantum effects to compute in ways that are faster or more efficient than.

a collection of worked examples from various web sites.2 Why Another Quantum Computing Tutorial? Most of the books or papers on quantum computing require (or assume) prior knowledge of certain areas like linear algebra or physics. Chuang.qinfo. The Temple of Quantum Computing . journal entries. or interested layman. QCQI may be a little hard to get into at first.org/people/nielsen/qicss. It contains a lot of the background in math. and computer science that you will need. So the Temple of Quantum Computing is. These topics are presented in the following format: Question The topic is presented in bold-italics.2 Why Another Quantum Computing Tutorial? 1.pdf. physics. Nielsen and Isaac L. An honourable mention goes out to Vadim V. in part. also written by Nielsen.cs. particularly for those without a strong background in math. Bulitko who has managed to condense a large part of QCQI into 14 pages! His paper. html. The main references for this work are QCQI and a great set of lecture notes. Perry 2004 . which we’ll abbreviate to QCQI.2006 . entitled On Quantum Computing and AI (Notes for a Graduate Class) is available at www. topics that could make interesting research topics have been identified.ca/∼bulitko/qc/schedule/qcss-notes. Quantum Computation and Quantum Information by Michael A. ualberta. and books which may aid in understanding of some of the concepts in QCQI. This text attempts to teach basic quantum computing from the ground up in an easily readable way.1 The Bible of Quantum Computing Every Temple needs a Bible right? Well there is one book out there that is by far the most complete book available for quantum computing. At certain places in this document. sets of lecture notes. 1.c Riley T. The majority of the literature that is currently available is hard to understand for the average computer enthusiast. Nielsen’s lecture notes are currently available at http://www. although it is assumed that you know a little about computer programming.2. papers.

In this chapter we’ll see how quantum effects can give us a new kind of Turing machine. Although information theory can be seen as a part of computer science it is treated separately in this text with its own dedicated chapter. There are also much older sources like early 3 .1 Introduction The special properties of quantum computers force us to rethink some of the most fundamental aspects of computer science. There’s also a little math and notation used in this chapter which is presented in the first few sections of chapter 3 and some basic C and javascript code for which you may need an external reference. new kinds of circuits.2 History The origins of computer science can at least be traced back to the invention of algorithms like Euclid’s Algorithm (c. This is important as it was thought that these things were not affected by what the computer was built from. 300 BC) for finding the greatest common divisor of two numbers. 2. and new kinds of complexity classes. A distinction has been made between computer science and information theory. This is because The quantum aspects of information theory require some of the concepts introduced in the chapters that follow this one.Chapter 2 Computer Science 2. but it turns out that they are.

1791 . Von Neumann architecture specifies an Arithmetic Logic Unit (ALU). Ada Augusta King. which was invented by Joseph Marie Jacquard (1752 .1871 (figure 2. 2000 .c Riley T. The first electronic computers were developed in the 1940’s and led Jon Von Neumann. control unit.1954 (figure 2. Perry 2004 .4 History Figure 2. a bus. J.4 for the difference engine built in 1822) that had many of the features of modern computers.1) designed and partially built several programmable computing machines (see figure 2. ? 2000]. The architecture originated in 1945 in the first draft of a report on EDVAC [Cabrera.1834) in 1804 [Smithsonian NMAH 1999]. 1903 . 1912 . But up until the 19th century it’s difficult to separate computer science from other sciences like mathematics and engineering. Babbage’s friend. Modern computer science can be said to have started in 1936 when logician Alan Turing.2006 . Babylonian cuneiform tablets (c. Babbage’s work was largely forgotten until the 1930s and the advent of modern computer science. The Temple of Quantum Computing .1700 BC) that contain clear evidence of algorithmic processes [Gilleland M.1957 (figure 2. input/output (IO).3) to develop a generic architecture on which modern computers are loosely based. One of these machines called the analytical engine had removable programs on punch cards based on those used in the Jacquard loom. B. Countess of Lovelace. So we might say that computer science began in the 19th century.1) and the daughter of Lord Byron is considered by some as the first programmer for her writings on the Analytical engine. Sadly. In the early to mid 19th century Charles Babbage. 1815 .1852 (figure 2. ? 2000].2) wrote a paper which contained the notion of a universal computer.1: Charles Babbage and Ada Byron. and a computing process. memory.

possibly ending Moore’s law. Perry 2004 . the current version of which states that processor complexity will double every eighteen months with respect to cost (in reality it’s more like two years) [wikipedia. integrated circuits in 1959. This law still holds but is starting to falter. & Ekert. A. ? 2000] that quantum effects will become unavoidable. but by fully utilising those effects we can achieve much more.c Riley T. Figure 2.2006 .org 2006]. partly due to the development of the transistor in 1947. and components are getting smaller.2: Alan Turing and Alonzo Church. Soon they will be so small.History 5 Figure 2. There are ways in which we can use quantum effects to our advantage in a classical sense. and increasingly intuitive user interfaces.3: Jon Von Neumann. Computers increased in power and versatility rapidly over the next sixty years. The Temple of Quantum Computing . S. being made up of a few atoms [Benjamin. Gordon Moore proposed Moore’s law in 1965.

Wilson. but by doing so you’ll only create a larger system with its own unprovable statements. Perry 2004 .c Riley T.1943 (figure 2. 1862 . 1903 . in 1936 Alan Turing and Alonzo Church. J.5) in 1931 by way of his incompleteness theorem which can be roughly summed up as follows: You might be able to prove every conceivable statement about numbers within a system by going outside the system in order to come up with new rules and axioms.3 Turing Machines In 1928 David Hilbert. in 1930 he went as far as claiming that there were no unsolvable problems in mathematics [Natural Theology 2004].1 Binary Numbers and Formal Languages Before defining a Turing machine we need to say something about binary numbers.1976 (figure 2. p. 1995. ?] Then.5) asked if there was a universal algorithmic process to decide whether any mathematical proposition was true. aimed at resolving whether or not mathematics contained problems that were ”uncomputable”. ¨ This was promptly refuted by Kurt Godel. as Turing’s model was subsequently called. The thesis that any algorithm capable of being devised can be run on a Turing machine. 2. the Church-Turing thesis [Nielsen. It turned out that the models of Turing and Church were equivalent in power. M. then. since this is usually (although not confined to) the format in which data is presented to a Turing machine (see the tape is figure 2.2) independently came up with models of computation. His intuition suggested ”yes”. Turing’s model.6. now called a called a Turing Machine (TM) is depicted in figure 2.1995 (figure 2.2006 . was given the names of both these pioneers.6). These were problems for which there were no algorithmic solutions (an algorithm is a procedure for solving a mathematical problem that is guaranteed to end after a number of steps).6 This approach is the basis for quantum computing. W. A. [Jones. 1908 . The Temple of Quantum Computing . 2002].3. Turing Machines 2.

Perry 2004 .Turing Machines 7 Figure 2.4: Babbage’s difference engine. The Temple of Quantum Computing .c Riley T.2006 .

. Binary Representation Computers represent numbers in binary form.c Riley T. because this is easy to implement in hardware (compared with other forms. decimal). as a series of zeros and ones.8 Turing Machines ¨ Figure 2. Any information can be converted to and from zeros and ones and we call this representation a binary representation.5: David Hilbert and Kurt Godel.g. 1110 in decimal is 14. Perry 2004 . Example Here are some binary numbers and their decimal equivalents: The binary number. . e. b2 b1 b0 where n is the number of binary digits (or bits.2006 . We can convert the binary string to a decimal number D using the following The Temple of Quantum Computing . with each digit being a 0 or a 1) and b0 is the least significant digit. The decimal 212 when converted to binary becomes 11010100. The binary numbers (on the left hand side) that represent the decimals 0-4 are as follows: 0=0 1=1 10 = 2 11 = 3 100 = 4 A binary number has the form bn−1 .

We say a language L has an alphabet from . in decimal which is base 10. .g. 2.e. Perry 2004 . + 22 (b1 ) + 21 (b1 ) + 20 (b0 ). . 1.2006 .c Riley T. even machine instructions are in binary format. the class of algorithm that the model can implement. . . . 9. All data in modern computers is stored in binary format. with the language: {01.1) D = 27 (1) + 26 (1) + 25 (0) + 24 (1) + 23 (0) + 22 (1) + 21 (0) + 20 (0) = 128 + 64 + 16 + 4 = 212 We call the binary numbers a base 2 number system because it is based on just two symbols 0 and 1.Turing Machines formula: D = 2n−1 (bn−1 ) + . 001.. . In simple languages the strings all follow an obvious pattern. . If = {0. The language is a subset of the set ∗ of all finite strings of symbols Example {0. we have 0.} is a langauge over It turns out that the ”power” of a computational model (or automaton) i. . This allows both data and instructions to be stored in computer memory and it allows all of the fundamental logical operations of the machine to be represented as binary operations. e. By contrast. Here is another example: Example Converting the binary number 11010100 to decimal: 9 (2. 100.} The Temple of Quantum Computing . 10. . 1} then the set of all even binary numbers .. . 3. 0001. . can be determined by considering a related question: What type of ”language” can the automaton recognise? A formal language in this setting is just a set of binary strings. Formal Languages Turing machines and other computer science models of computation use formal languages to represent their inputs and outputs. 110.

2000]: 1.2006 . A controller . Note that this gives us a alphabet of = {0. 3. or overwrites the current symbol on each step and moves one square to the left or right.10 Turing Machines Figure 2. If an automaton.made up of cells containing 0. 2. 2.6: A Turing machine.c Riley T. 1. move the tape left or right one square 5. or blank. 1. change state 6. when presented with any string from the language can read each symbol and then halt after the last symbol we say it recognises the language (providing it doesn’t do this for strings not in the language). Perry 2004 . the pattern is that we have one or more zeroes followed by a 1. write a symbol by overwriting what’s already there 4. The Temple of Quantum Computing .controls the elements of the machine to do the following: 1. blank}. A tape . J. halt.2 Turing Machines in Action A Turing machine (which we’ll sometimes abbreviate to TM) has the following components [Copeland.3. A read/write head . read the current symbol 2.reads. Then the power of the automaton is gauged by the complexity of the patterns for the languages it can recognise.

Church. The great thing about the UTM is that it shows that all algorithms (Turing ma¨ chines) can be reduced to a single algorithm.Turing Machines 11 4. for example: 001 → 110 The behaviour of the machine can be represented by a two state FSA. represented by a finite state automata (FSA). and a number of other great thinkers did find alternative ways to represent algorithms.2006 . When the UTM halts its tape contains the result that would have been produced by the ordinary TM (the one that describes the workings of the UTM). State 1 1 1 Value New State 0 1 blank 1 1 2 . The controller’s behaviour .3. Perry 2004 .HALT N/A New Value Direction 1 0 blank N/A Move Right Move Right Move Right N/A 2 . The Temple of Quantum Computing .c Riley T. The UTM simulates the ordinary TM performing the behaviour generated when the ordinary TM acts upon its data. As stated above. The operation of a TM is best described by a simple example: Example Inversion inverts each input bit. The FSA is represented below in table form (where the states are labelled 1 and 2: 1 for the start state.the way the TM switches states depending on the symbol it’s reading. Godel. a program describing the behaviour of another TM.HALT N/A 2. and 2 for the halt state). but it was only Turing who found a way of reducing all algorithms to a single one. from a tape. This reduction in algorithms is a bit like what we have in information theory where all messages can be reduced to zeroes and ones.3 The Universal Turing Machine A Universal Turning Machine (UTM) is a TM (with an in built mechanism described by a FSA) that is capable of reading.

but powerful model of computation (essentially the stored program computer) Turing then looked at its limitations by devising a problem that it could not solve. looks to see whether that algorithm acting on it’s data.that made the sentence problematic). Having discovered the simple. H can receive a description of the algorithm in question (its program) and the algorithm’s data.c Riley T. This can be skipped it you’ve had enough of Turing machines for now. so to does H fail to assign a halting number 1 or 0 to the variant (the design of the latter involving the same ingredients. rather than running a given algorithm. Perry 2004 .2006 . The Temple of Quantum Computing . asked Turing. What. will actually halt (in a finite number of steps rather than looping forever or crashing). When given a number. say 1 or 0 it decides whether or not the given algorithm would then halt.12 Turing Machines 2.3. Is such a machine possible (so asked Turing)? The answer he found was ”no” (look below). It still remains unproven that the halting problem cannot be solved in all computational models. a variant of H itself!! The clue to this ingenious way of thinking came from the liar’s paradox . self-reference and negation . Just as a ”universal truth machine” fails in assigning this funny sentence a truth value (try it). and machines that are computationally equivalent. Turing called this hypothetical new TM called H (for halting machine). as the algorithm description (program) and data that H should work on.the question of whether or not the sentence: This sentence is false. Then H works on this information and produces a result. can be assigned a truth value. The next section contains a detailed explanation of the halting problem by means of an example. Like a UTM. The very concept of H involves a contradiction! He demonstrated this by taking. The UTM can run any algorithm.4 The Halting Problem This is a famous problem in computer science. if we have another UTM that. This proof by contradiction only applies to Turing machines.

but is it possible for all algorithms to be covered in the .Proof by Contradiction The halting problem in Javascript [Marshall. Perry 2004 .}".Code to check if program can halt.2006 .c Riley T. say we could have a program that could determine whether or not another program will halt. function Halt(program. program) == true) { while (1 == 1) {. } } Given two programs..here is the proof. 2001]. } else { return false. J.. 1) So it would be possible given these special cases.}}". given a new program: function Contradiction(program) { if (Halt(program.. section? No . 1) \\ returns \\ returns true false Halt("function Looper(1)while (1==1) {. one that halts and one that does not: function Halter(input) { alert(’finished’). data) { if ( . } function Looper(input) { while (1==1) {.Turing Machines The Halting Problem .} } In our example Halt() would return the following: Halt("function Halter(1){alert(’finished’).. 13 The proof is by contradiction.} } else { The Temple of Quantum Computing .... ) { return true..Code to check if program can halt.

which perform logical operations on inputs.c Riley T. what a modern or conventional computer gives in efficiency it loses in transparency (compared with a TM). It is for this reason that a TM is still of value in theoretical discussions. Perry 2004 . Classical circuits are made up of the following: 1. } } If Contradiction() is given an arbitrary program as an input then: Circuits • If Halt() returns true then Contradiction() goes into an infinite loop.4 Circuits Although modern computers are no more powerful than TM’s (in terms of the languages they can recognise) they are a lot more efficient (for more on efficiency see section 2. For this reason we’ll examine conventional (classical) circuits. We won’t go fully into the architecture of a conventional computer. registers. The Temple of Quantum Computing .5).14 alert(’finished’). If Contradiction() is given itself as input then: • Contradiction() loops infinitely if Contradiction() halts (given itself as input). in comparing the ”hardness” of various classes of problems. e. However.g. However some of the concepts needed for quantum computing are related. These operations can be represented by truth tables which specify all of the different combinations of the outputs with respect to the inputs. • Contradiction() halts if Contradiction() goes into an infinite loop (given itself as input). Gates . we can’t decide algorithmically what the behaviour of Contradiction() will be. and gates. • If Halt() returns false then Contradiction() halts. e. Contradiction() here does not loop or halt. circuits. 2. Given input(s) with values of 0 or 1 they produce an output of 0 or 1 (see below).g.2006 .

The Temple of Quantum Computing . NOT inverts the input. x 1 0 OR a 0 1 0 1 b 0 0 1 1 x 0 1 1 1 AND only returns a 1 if both of the inputs are 1.4.Circuits 2. NOT a 0 1 OR returns a 1 if either of the inputs is 1. i.e. Perry 2004 . 15 2.2006 .made up of cells containing 0 or 1.1 Common Gates The commonly used gates are listed below with their respective truth tables. Registers .carry signals between gates and registers. bits.c Riley T. 3. Wires .

NAND a 0 1 0 1 b 0 0 1 1 x 1 1 1 0 XOR returns a 1 if only one of its inputs is 1. NOR a 0 1 0 1 b 0 0 1 1 x 1 0 0 0 NAND is an AND and a NOT gate combined. The Temple of Quantum Computing . Perry 2004 .c Riley T.2006 .16 AND a 0 1 0 1 b 0 0 1 1 x 0 0 0 1 Circuits NOR is an OR and a NOT gate combined.

Circuits 17 XOR a 0 1 0 1 b 0 0 1 1 x 0 1 1 0 2.c Riley T.4. The circuit shown above has the following truth table: a 0 0 0 0 1 1 1 1 b c f 0 1 0 0 0 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 The Temple of Quantum Computing .2006 . Perry 2004 .2 Combinations of Gates Shown below. a circuit also has a truth table.

no matter how complicated can be expressed as a combination of NAND gates.4. we can compare algorithms that perform the same task and measure whether one is more efficient than the other.7).8). FANIN . In terms of algorithms. and CROSSOVER means that the value of two bits are interchanged. 2. this is called the principle of invariance.2006 . This circuit has an expression associated with it. if the same algorithm is implemented on different architectures then the time complexities should not differ by more than a constant.18 Computational Resources and Efficiency Figure 2. c)).4. FANIN means that many outputs can be tied together with an OR.c Riley T.3 Relevant Properties These circuits are capable of FANOUT. this means that any circuit. many inputs) can be tied to one output (figure 2. So. For this reason the NAND gate is considered a universal gate.5 Computational Resources and Efficiency Computational time complexity is a measure of how fast and with how many resources a computational problem can be solved.7: FANOUT. 2. The Temple of Quantum Computing . b).4 Universality Combinations of NAND gates can be used to emulate any other gate (see figure 2. AND(NOT(b).e. 2. which is as follows: f = OR(AND(a. Perry 2004 . and CROSSOVER (unlike quantum circuits) where FANOUT means that many wires (i. Conversely. The quantum analogue of this is called the CNOT gate.

i ++) for(j = n. We’ll also use the code for the bubble sort algorithm in an example on page 22.1. } } } The Temple of Quantum Computing . A simple example of differing time complexities is with sorting algorithms. i.2006 .c Riley T.1]) { Swap(list[j].j --) { if (list[j]<list[j .j > = i + 1. Bubble sort: for(i = 1.Computational Resources and Efficiency 19 Figure 2. The following example uses the bubble sort and quick sort algorithms.1]). Perry 2004 . algorithms used to sort a list of numbers.8: The universal NAND gate.e. but the code for quick sort is not given explicitly. Some code for bubble sort is given below.i < = n .list[j .

Quick Sort: The quick sort has the following four steps: 1. The important parts of the function are shown here: The Temple of Quantum Computing .e. This process is repeated until all of the numbers are checked without any swaps. 2. line by line (see the end of this section for an example) how fast it is going to run given a particular variable n which describes the ”size” of the input. E.e. bubble sort. O(n) time complexity (i. 4.1 Quantifying Computational Resources Let’s say we’ve gone through an algorithm systematically and worked out. We say that the algorithm that generated this result has. 2.2006 . n grows faster than log n and the constant. Select a pivot point.e. consider the following expression: 3n + 2 log n + 12. 3. Repeat steps 1 to 3 for each list generated in step 3.with numbers smaller than the pivot value in one list and numbers larger than the pivot value in the other list. Suppose we can quantify the computational work involved as function of n. Perry 2004 .g.c Riley T. the number of elements in a list to be sorted. i. they are swapped if required.5.20 Example Computational Resources and Efficiency Quick sort vs. regardless of the architecture it is running on. we ignore the 3). On average the bubble sort is much slower than the quick sort. Finish if there are no more elements to be sorted (i. 1 or less elements). Bubble Sort: Each item in a list is compared with the item next to it. The important part of this function is 3n as it grows more quickly than the other terms. The list is split into two lists .

The Temple of Quantum Computing . at worst this algorithm will take approximately n cycles to complete (plus a vanishingly small unimportant figure). i. Example 2n is in Ω(n2 ) as n2 ≤ 2n (∀ sufficiently large n). it gives us no notion of the average complexity of an algorithm. For a lower bound we use big Ω notation (Big Omega).2) As promised. Note that this is the worst case.e. So. Perry 2004 . formally: f (n) = Θ(g(n)) ⇐⇒ O(g(n)) = Ω(g(n)). Example 4n2 − 40n + 2 = Θ(n2 ) = Θ(n3 ) = Θ(n).Computational Resources and Efficiency 50 40 30 20 10 0 ¡ 21 3n + 2 log n + 12 3n 2 log n 12 0 10 20 30 40 50 So we’ve split the function 3n + 2 log n + 12 into its parts : 3n. The class of O(n) contains all functions that are quicker than O(n). Finally. 3n ≤ 3n2 so 3n is bounded by the class O(3n2 ) (∀ positive n). and 12. big Θ is used to show that a function is asymptotically equivalent in both lower and upper bounds. 2 log n. (2. More formally Big O notation allows us to set an upper bound on the behaviour of the algorithm. here is a more in-depth example of the average complexity of an algorithm.2006 .c Riley T. for example.

Or put another way. bubble sort [Nielsen. If we do the same to the quick sort algorithm. but we are interested in time complexity for now.22 Example Computational Resources and Efficiency Time Complexity: Quick sort vs. exponentially. There are many types of resources (e.2006 .g. What we mean by hard is that as we make n large the time taken to solve the problem goes up as 2n . i.2 Standard Complexity Classes Computational complexity is the study of how hard a problem is to compute. and easy. so we say it is generally O(n2 ). So now we have a precise mathematical notion for the speed of an algorithm. M. So we say that O(2n ) is hard or intractable. 2n is exponential and hard. Hard problems grow faster than any polynomial in n. & Chuang. that is it is bounded by a polynomial in n.. for example: n2 is polynomial.c Riley T. The main distinction between hard and easy problems is the rate at which they grow. time and space). the average time complexity is just O(n log n). 2000]. then it is easy.. If the problem can be solved in polynomial time. NP means that The Temple of Quantum Computing .e. what is the least amount of resources required by the best known algorithm for solving the problem. Here our n is the number of elements in a list. P means that the problem can be solved in polynomial time. The average and worst case time (n − 1) + (n − 2) + . whereas. 2. I.5. + 1 = complexities are O(n2 ). The complexity classes of most interest to us are P (Polynomial) and NP (NonDeterministic Polynomial). L. the number of swap operations is: n(n − 1) 2 2 The most important factor here is n . A. Perry 2004 .

For example. whose solution can be found in polynomial time on a non-deterministic machine [wikipedia. • It is not proven that P = NP it is just very unlikely as this would mean that all problems in NP can be solved in polynomial time. A. 61 is a factor (61 × 127 = 7747) which is easily checked. M. if we ask if 7747 has a factor less than 60 there is no easily checkable witnesses for the no instance [Nielsen. It’s a common mistake to call a quantum computer an NTM. and NP complete means it almost definitely can’t. So we have a witness to a yes instance of the problem.c Riley T.2006 .3 The Strong Church-Turing Thesis Originally. as we shall see later we can only use quantum parallelism indirectly. the strong Church-Turing thesis went something like this: The Temple of Quantum Computing . the class NP consists of all those decision problems whose positive solutions can be verified in polynomial time given the right information. • Non deterministic Turing machines (NTMs) differ from normal deterministic Turing machines in that at each step of the computation the Turing machine can ”spawn” copies. Now. or equivalently. or new Turing machines that work in parallel with the original.Computational Resources and Efficiency 23 it probably can’t. 2002].1 for a list of common complexity classes. Most problems can be represented as decision problems. 2. checking if 7747 has a factor less than 70 is a decision problem.5. Where: • A decision problem is a function that takes an arbitrary value or values as input and returns a yes or a no. Perry 2004 . More formally: The class P consists of all those decision problems that can be solved on a deterministic sequential machine in an amount of time that is polynomial in the size of the input. • Witnesses are solutions to decision problems that can be checked in polynomial time. See appendix A.org 2004].

2000]. A. and results if necessary. We are saying a TM is as powerful as any other model of computation in terms of the class of problems it can solve. 2000.2006 . 1918 . this led to a revision of the strong Church-Turing thesis.2]. This means that algorithms given the same inputs can have different run times. an equal likelihood of writing a 1 or a 0 on to the tape) [TheFreeDictionary.1. of an algorithm that can benefit from a PTM is quicksort. I.com 2004]. which do give a computational advantage based on the machine’s architecture [Nielsen. M. So. Although on average quicksort runs in O(n log n) it still has a worst case running time of O(n2 ) if say the list is already sorted. Perry 2004 . S. Can we efficiently simulate any non-probabilistic algorithm on a probabilistic Turing machine without exponential slowdown? The answer is ”yes” according to the new strong Church-Turing thesis: Any model of computation can be simulated on a probabilistic Turing machine with at most a polynomial increase in the number of elementary operations [Bettelli.this alluded to a kind of The Temple of Quantum Computing .c Riley T. A new challenge came from another quarter when in the early eighties Richard Feynman. p. & Chuang. any efficiency gain due to using a particular model. L. An example.9) suggested that it would be possible to simulate quantum systems using quantum mechanics . S. which now relates to a probabilistic Turing machine (PTM).24 Computational Resources and Efficiency Any algorithmic process can be simulated with no loss of efficiency using a Turing machine [Banerjee. some of which are listed in appendix A. is at most polynomial. ? 2004]. who introduced truly randomised algorithms.1988 (figure 2. A probabilistic Turing machine can be described as: A deterministic Turing machine having an additional write instruction where the value of the write is uniformly distributed in the Turing machine’s alphabet (generally. Randomising the list before hand ensures the algorithm runs more often in O(n log n). The PTM has its own set of complexity classes. This was challenged in 1977 by Robert Solovay and Volker Strassen.

c Riley T. 2.see chapter 7). exponentially so. in fact it gets exponentially harder the more components you have [Nielsen.9: Richard Feynman. reasoned Feynman. The head and tape of a QTM exist in quantum states. classical) Turing machines.Church Turing principle [Nielsen. Perry 2004 .5. It is hard (time-wise) to simulate quantum systems effectively. based on Feynman’s ideas. Intuitively. proto-quantum computer. He then went on to ask if it was possible to simulate quantum systems on conventional (i. 2002]. M. if the simulator was ”built of quantum components” perhaps it wouldn’t fall behind.Computational Resources and Efficiency 25 Figure 2.e.4 Quantum Turing Machines A quantum Turing machine (QTM) is a normal Turing machine with quantum parallelism. The idea really took shape in 1985 when.2006 . A. So such a ”quantum computer” would seem to be more efficient than a TM. More algorithms were developed that seemed to work better on a quantum Turing machine (see below) rather than a classical one (notably Shor’s factorisation and Grover’s search algorithms . He then demonstrated a simple quantum algorithm which seemed to prove the new revision. 2002]). The strong Church-Turing thesis would seem to have been violated (as the two models are not polynomially equivalent). David Deutsch proposed another revision to the strong Church Turing thesis. the TM simulation can’t keep up with the evolution of the physical system itself: it falls further and further behind. Then. He proposed a new architecture based on quantum mechanics. M. and each The Temple of Quantum Computing . on the assumption that all physics is derived from quantum mechanics (this is the Deutsch . A.

Question The architecture itself can change the time complexity of algorithms. This means that they lose information in the process of generating outputs from inputs.c Riley T. will have to implement all the logical operations reversibly.26 Energy and Computation cell of the tape holds a quantum bit (qubit) which can contain what’s called a superposition of the values 0 and 1. 2. 2.2 for a list of some of them and the relationships between them. This implies that if a quantum computer has components.e. in quantum parallelism a single processor operates on all the values simultaneously. i. 2. An example of this is the NAND gate (figure 2. see appendix A.2 Irreversibility Most classical circuits are not reversible. There are a number of complexity classes for QTMs. knowing the output is 1 does not allow one to determine the input: it could be 00. IBM physicist Rolf Landauer.1 Reversibility When an isolated quantum system evolves it always does so reversibly.6.6. Don’t worry too much about that now as it’ll be explained in detail later. they are not invertible. what’s important is that a QTM can perform calculations on a number of values simultaneously by using quantum effects. or 01. E. to invert the output. there could be further revisions. when information is lost in an irreversible circuit that information is dissipated as heat The Temple of Quantum Computing . Unlike classical parallelism which requires a separate processor for each value operated on in parallel.g. 1927 . similar to gates. Perry 2004 . that perform logical operations then these components.6.1999 showed that. if behaving according to quantum mechanics.2006 . 10. Could there be other revisions? If physics itself is not purely based on quantum mechanics and combinations of discrete particles have emergent properties for example.6 Energy and Computation 2.3 Landauer’s Principle In 1961.10). It is not possible in general.

open and close the door in a certain way to actually decrease the amount of entropy in the system. The demon only opens the door when fast particles come from the right and slow ones from the left. A demon opens and closes a door in the centre of the box that allows particles to travel through it.2006 . the slow particles on the right. We have a box filled with particles with different velocities (shown by the arrows). The demon makes a temperature difference without doing any work (which violates the second law of thermodynamics). The second law of thermodynamics (see chapter 4) says that the amount of entropy in a closed system never decreases.10: An irreversible NAND gate. and no use of energy! Practically though we still need to waste some energy for correcting any physical errors that occur during the computation. This result was obtained for circuits based on classical physics.4 Maxwell’s Demon Maxwell’s demon is a thought experiment comprised of (see figure 2. [Nielsen. 4. The Temple of Quantum Computing . A good example of the link between reversibility and information is Maxwell’s demon. The fast particles end up on the left hand side.Energy and Computation 27 Figure 2. 2. Here are a list of steps to understanding the problem: 1. which is described next. Entropy is the amount of disorder in a system or in this case the amount of energy. M. The wall has a little door that can be opened and closed by a demon. 2. 3. Theoretically. if we were to build a classical computer with reversible components then work could be done with no heat loss. 2002]. Perry 2004 . The demon can.c Riley T.11) a box filled with gas separated into two halves by a wall. in theory. A.6.

E.5 Reversible Computation In 1973 Charles Bennett expanded on Landauer’s work and asked whether it was possible. Almost anything can be done in a reversible manner (with no entropy cost). Keyes resolved the paradox when they examined the thermodynamic costs of information processing. 2. For example. in CNOT below. The Temple of Quantum Computing . We can simulate any classical gate with reversible gates. 6.11: Maxwell’s Demon.W. the NOT operation is applied to bit b if the control bit is on (=1). in general. Control lines ensure we have enough bits to recover the inputs from the outputs. the operations are reversible until his memory is cleared. Rolf Landauer and R. a reversible NAND gate can be made from a reversible gate called a Toffoli gate. The loss of heat is not important to quantum circuits.28 Energy and Computation Figure 2. 5.6.c Riley T. Bits in reversible circuits may then go on to become garbage bits that are only there to ensure reversibility.2006 . to do computational tasks without dissipating heat. Perry 2004 . but because quantum mechanics is reversible we must build quantum computers with reversible gates. The demon’s mind gets ”hotter” as his memory stores the results. The reason they are called control lines is that they control (as in an if statement) whether or not a logic operation is applied to the non-control bit(s). Reversible gates use control lines which in reversible circuits can be fed from ancilla bits (which are work bits).g.

Toffoli Gate If the two control lines are set it flips the third bit (i.unm. b can also be expressed as a XOR b.6 Reversible Gates Listed below are some of the common reversible gates and their truth tables. a b c • •   (2. 0) : b = a = a = FANOUT. a b •   a b CNOT a 0 0 1 1 b 0 1 0 1 a 0 0 1 1 b 0 1 1 0 Properties of the CNOT gate. Perry 2004 .phys.Energy and Computation 29 2. The Toffoli gate is also called a controlled-controlled NOT.c Riley T.e. a. Note: the reversible gate diagrams.3) a b c The Temple of Quantum Computing . Controlled NOT Like a NOT gate (on b) but with a control line.2006 . b): CNOT(x.6. CNOT(a. applies NOT). and quantum circuit diagrams were built A with a LTEX macro package called Q-Circuit which is available at http:// info.edu/Qcircuit/.

5) (2. b. c): TF (a. a b c • × × a b c (2.7) (2. A combination of Toffoli gates can simulate a Fredkin gate.8) The Temple of Quantum Computing .c Riley T. y. 1. 1) : c = x NAND y. TF (a.2006 .30 Toffoli a 0 0 0 0 1 1 1 1 b 0 1 1 0 0 1 1 c 0 0 1 0 1 0 1 a 0 0 0 0 1 1 1 1 b 0 0 1 1 0 0 1 1 c 0 1 0 1 0 1 1 0 Energy and Computation 0 1 Properties of the Toffoli Gate. b. Fredkin Gate If the control line is set it flips the second and third bits. 0) : c = a = a = FANOUT. c) = (a. y. b. TF (x. 0) : c = x AND y. 1. Perry 2004 . TF (x. TF (x. TF (1.4) (2.6) (2. x) : c = NOT x. c XOR(a AND b)).

FR (x.Energy and Computation 31 Figure 2.12: A conventional reversible circuit. The Temple of Quantum Computing . 0.2006 . Fredkin a 0 0 0 0 1 1 1 1 b c a 0 0 0 0 1 1 1 1 b 0 0 1 1 0 1 0 1 c 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 Properties of the Fredkin Gate.6.10) (2. with b = NOT x. (2. x. Perry 2004 .11) 2.7 Reversible Circuits Reversible circuits have been implemented in a classical sense.9) (2. y) : b = x AND y. FR (a. c): FR (x. b. FR (1. A combination of Fredkin gates can simulate a Toffoli gate. y) : b = c and c = b.c Riley T. an example of a reversible circuit built with conventional technology is shown in figure 2. 1. 0) : c = a = c = FANOUT.12. which is CROSSOVER.

Suppose also that I am given a rule book in English for matching Chinese symbols with other Chinese Symbols. The Temple of Quantum Computing . Now suppose I am placed in a room containing baskets full of Chinese symbols. The rules identify the symbols entirely by their shapes and do not require that I understand any of them. Intelligence is intimately tied up with the ”stuff” that goes to make up a brain. 2.in programming terms one could almost consider a case statement to be intelligent. Chapters 6 and 7 contain many examples of these algorithms and their associated circuits.7 Artificial Intelligence Can an algorithm think? that’s really what we are asking when we ask if a computer can think. I do not understand Chinese. R. or artificial. Turing said that if one can’t distinguish between the two then the source can be considered to be intelligent. 2. This is called strong AI.7. the Turing test has problems. Imagine that people outside the room who understand Chinese hand in small bunches of symbols and that in response to the rule book and hand back more small bunches of symbols [Searle.32 Artificial Intelligence Quantum computers use reversible circuits to implement quantum algorithms. To me Chinese writing looks like so many meaningless squiggles. Consider a language you don’t understand. p. In my case. This is the kind of intelligence that is tested with the Turing test which simply asks if responses from a hidden source can be determined to be human.c Riley T. 20]. This system could pass the Turing test . because a modern computer’s architecture is arbitrary.2006 . Perry 2004 . 1990. J.1 The Chinese Room John Searle has a good example of how the Turing test does not achieve its goal. but a more realistic approach in which the modelling of mental processes is used in the study of real mental processes is called weak AI. Clearly.

Perry 2004 . and fundamental. S. Currently the modern Socratic view prevails.edu 1999] cause individual conscious events. ? 2003]. Question Given the new quantum architecture can quantum computers think? because of their fundamental nature do they give new hope to strong AI? Or are they just another example of an algorithmic architecture which isn’t made of the ”right stuff”? The Temple of Quantum Computing . whirlpools.2006 . modern Democritans believe consciousness to be irreducible.Artificial Intelligence 33 2. There are two main explanations of what consciousness is. Whiteheads (1920) theory of panexperientielism suggests that quantum state reductions (measurements) in a universal proto-conscious field [Arizona. Contrasting this. etc. and more.2 Quantum Computers and Intelligence The idea that consciousness and quantum mechanics are related is a core part of the original theory of quantum mechanics [Hameroff.7. For example.c Riley T. There are many other theories of consciousness that relate to quantum effects like electron tunnelling. that is that consciousness is an emergent property and proponents of the emergent theory point to many emergent phenomena (Jupiter’s red spot. in which conscious thoughts are products of the cerebrum and the Democritan in which consciousness is a fundamental feature of reality accessed by brain. quantum indeterminacy.). quantum superposition/interference. The Socratic.

.

because the components of the quantum state vector are. chances are that you’ll know at least some of the math. or as a reference. This is especially true for the sections on polynomials. • Matrices to represent gates acting on the values. The quantum analogue of this is a matrix operator operating on a qubit state vector.Chapter 3 Mathematics for Quantum Computing 3.1 Introduction In conventional computers we have logical operators (gates) such as NOT that acts on bits. trigonometry. • Complex numbers. and logs which are very succinct. As well as there being material here that you may not be familiar with (complex vector spaces for example). The math we need to handle this includes: • Vectors to represent the quantum state. 35 . • Projectors to handle quantum measurements. in general complex. • Probability theory for computing the probability of measurement outcomes. The sections you know might be useful for revision. • Trig functions for the polar representation of complex numbers and the fourier series.

The Temple of Quantum Computing . powers. ∃ n such that f (n) = 4 means there is a value of n that will make Example f (n) return 4.2 Polynomials A polynomial is an expression in the form: c0 + c1 x + c2 x2 + . c2 . ∃ means there exists. c1 . 3. they are explained below: ∀ means for all. 3. radicals. a cubic.e.e. then the n value in question is n = 1. i. + cn xn where c0 . 4t3 − 5 is a polynomial in t of degree 3. Perry 2004 . factorisation. 6x2 + 2x−1 is not a polynomial as it contains a negative power for x. limits.3 Logical Symbols A number of logical symbols are used in this text to compress formulae. f (n) = 4 means that for all values of n greater than 5 f (n) Example will return 4. This includes topics like fractions... Example Different types of polynomials. i. If you’re not comfortable with these topics then you may need to study them before continuing on with this chapter. .36 Polynomials So what’s not in here? There’s obviously some elementary math that is not covered. (3.c Riley T. ∀ n > 5.2006 . summations. and simple geometry. Say if f (n) = (n − 1)2 + 4. basic algebra.. a quadratic. percentages.1) 3v 2 + 4v + 7 is a polynomial in v of degree 2. cn are constant coefficients with cn = 0... We say that the above is a polynomial in x of degree n.

4 Trigonometry Review 3. c (3.2006 .Trigonometry Review iff means if and only if. a a . Example 37 f (n) = 4 iff n = 8 means f (n) will return 4 if n = 8 but for no other values of n.c Riley T.6) The Temple of Quantum Computing .4) tan θA = tan θB = (3. hyp tan = opp . Perry 2004 .3) sin θA = a . c a . c cos θB = sin θA = (3.2) and for the opposite side. b sin θB = b . Pythagorean theorem (3. c b . 3. hyp cos = adj .1 Right Angled Triangles Given the triangle. and hypotenuse: sin = opp .5) cos θA = sin θB = b . adj (3. adjacent side. & & & θC c && & & & & & a θB & & θA b we can say the following: a 2 + b2 = c2 .4.

rads. cos−1 = arccos = θ from cos θ.9) (3. Perry 2004 . π (3. and tan θ: sin−1 = arcsin = θ from sin θ.10) (3. For converting degrees to radians: rads = n◦ × π .c Riley T.11) 3. from 0◦ to 90◦ ). (3.8) Some common angle conversions are: 360◦ = 0◦ = 2π rads.4. 270◦ = 3π 2 1 rad = 57◦ . If we want to measure larger angles like 247◦ we must determine which quadrant the angle is in (here we don’t consider angles larger than 360◦ ).2006 . 3. π 180 45◦ = π 4 90◦ = π 2 ◦ 1◦ = rads. 180 = π rads.e. rads.4.2 Converting Between Degrees and Radians Angles in trigonometry can be represented in radians and degrees.38 Trigonometry Review 3. The following diagram has the rules for doing so: The Temple of Quantum Computing . cos θ. 180 (3.4 Angles in Other Quadrants The angles for right angled triangles are in quadrant 1 (i.7) For converting radians to degrees we have: n◦ = 180 × rads .4. tan−1 = arctan = θ from tan θ.3 Inverses Here are some inverses for obtaining θ from sin θ. rads.

Perry 2004 .5 0 −0.Trigonometry Review 39 Change θ to 180◦ − θ Make cos and tan negative No change 90◦ ≤ θ ≤ 180◦ 180◦ ≤ θ ≤ 270◦ 0◦ ≤ θ ≤ 90◦ 270◦ ≤ θ ≤ 360◦ (0◦ ) Change θ to θ − 180◦ Change θ to 360◦ − θ Make sin and cos negative Make sin and tan negative Example Using the diagram above we can say that sin(315◦ ) = − sin(45◦ ) and cos(315◦ ) = cos(45◦ ). where x is in radians.5 1 0.c Riley T. 3.5 Visualisations and Identities The functions y = sin(x) and y = cos(x) are shown graphically below.5 −1 −1. 1.5 -10 -5 0 5 10 sin(x) The Temple of Quantum Computing .2006 .4.

tan(−θ) = − tan θ. Put another way. The log of x = 100 to base b = 10 is the power (2) of 10 that gives back 100.e. i. here are some important identities: sin2 θ + cos2 θ = 1.g. cos(−θ) = cos θ. with: y = logb x and. Example log2 16 = 4 is equivalent to 24 = 16. sin(−θ) = − sin θ.17) (3. b >= 0. 102 = 100.13) (3. i. and b = 1.c Riley T.2006 (3. Perry 2004 . The Temple of Quantum Computing . blogb x = x.e. x = by where x >= 0.16) . E.5 0 −0.12) (3.40 1.5 Logs The logarithm of a number (say x) to base b is the power of b that gives back the number.5 -10 -5 0 5 10 Logs cos(x) Finally.5 −1 −1. So log10 100 = 2.15) 3. (3.5 1 0. the answer to a logarithm is the power y put to a base b given an answer x.14) (3.

the operations of addition. With these operations defined via the examples in the box below.18) −1. i. i5 = i. Except for the rules regarding i. except for division by 0. So the pattern (−i. The complex num- ber z is said to be in C (the complex numbers). Perry 2004 . Here are examples of i itself: i−3 = i.e.Complex Numbers T 41 3 a z '    θ      r b   E 3 c Figure 3. and multiplication of complex numbers follow the normal rules of arithmetic. The system of complex numbers is closed in that. b ∈ R (the real numbers) where i stands for √ (3. i2 = −1. and ratios of complex numbers give back a complex number: i. i6 = −1. we stay within the system. i = √ −1. products. −1) repeats indefinitely. 3. i−2 = −1. a and b.1: Representing z = a + ib in the complex plane with coordinates a = 3 and b = 3. sums. i4 = 1. 1. b) to express this.6 Complex Numbers A complex number. which is introduced in the next section. i3 = −i. Sometimes we write z = (a.c Riley T. Division requires using a complex conjugate. z is called complex because it is made of two parts. i−1 = −i.2006 . z is a number in the form: z = a + ib where a. subtraction. The Temple of Quantum Computing .

3. (r. −25 has roots 5i and −5i. Perry 2004 . |z| = where z ∗ is the complex conjugate of z: z ∗ = a − ib.6. Complex Numbers (5 + 2i)(−4 + 3i) = 5(−4) + 5(3)i + 2(−4)i + (2)(3)i2 = −20 + 15i − 8i − 6 = −26 + 7i. θ) = (|z|. r ∈ R and |z| is the norm (also called the modulus) of z: |z| = or.21) √ a 2 + b2 (3.c Riley T.2006 .22) √ z∗z (3. θ) = |z|(cos θ + i sin θ) where θ. Finding Roots: (−5i)2 = 5i2 = 52 i2 = 25(−1) = −25.1 Polar Coordinates and Complex Conjugates Complex numbers can be represented in polar form.42 Example Addition: (5 + 2i) + (−4 + 7i) = 1 + 9i Multiplication: Basic complex numbers.20) (3. (3.19) The Temple of Quantum Computing . θ): (r.

b) of length r on the complex plane and the x axis with the coordinates being taken for the complex number as x = a and y = b.c Riley T.24) which lies in the following quadrant: 1. Conversely.1) we can say that θ is the angle between a line drawn between a point (a. z ∗ . θ) where r = |z| = √ a2 + b2 and θ is the solution to tan θ = b a (3. So for converting from polar to cartesian coordinates: (r. Perry 2004 .23) where a = r cos θ and b = r sin θ. If a > 0 and b > 0 2. These are shown in figure 3. and −z. converting cartesian to polar form is a little more complicated: a + bi = (r.2: z. Polar Coordinates For polar coordinates (figure 3. θ) = a + bi (3. If a < 0 and b > 0 The Temple of Quantum Computing .2. −z ∗ . −z ∗ and -z graphically. z ∗ .2006 .Complex Numbers T 43 −z ∗ s d d '   d        z d d   d   d   E −z   ©   d d d ∗ ‚ z c Figure 3. The horizontal axis is called the real axis and the vertical axis is called the imaginary axis. It’s also helpful to look at the relationships between z.

c Riley T. tan θ = Since a < 0 and b > 0 we use quadrant 2 which gives us θ = 116.2006 .3 b = r sin θ = 3 cos 40◦ = 3(0. Example Complex Numbers Convert −1 + 2i to (r.2 b a 2 = −1 = −2 .9i .3 + 1. This gives us a = −1 and b = 2. Example Convert (3. 116. 40◦ ) to a + bi.2.77) = 2. If a > 0 and b < 0.2 Rationalising and Dividing 1 a+bi is rationalised by multiplying the numerator and denominator by a − bi.6◦ and the solution is: −1 + 2i = (2. a = r cos θ = 3 cos 40◦ = 3(0. Perry 2004 . θ).9 z = 2.44 3. r= = √ (−1)2 + 22 5 = 2.6◦ ) .64) = 1. If a < 0 and b < 0 4. 3.6. The Temple of Quantum Computing .

e−iθ = cos θ − i sin θ. 29 29 45 Division of complex numbers is done by rationalising in terms of the denominator. which can be rewritten as: cos θ = eiθ + e−iθ . 1 (5 − 2i) 1 = 5 + 2i 5 + 2i (5 − 2i) 5 2 = − i.2006 . Example Division of complex numbers.6. 2 3.28) (3.29) (3.Complex Numbers Example Rationalisation. This is because: eiθ = cos θ + i sin θ. 2 eiθ − e−iθ sin θ = . 2i (3. 3 + 2i 3 + 2i (−2i) = 2i 2i (−2i) −6i − 4i2 = −4i2 −6i + 4 = 4 3 =1− i. Perry 2004 .26) (3. The derivation of which is: z = |z|(cos θ + i sin θ) = r(cos θ + i sin θ) = reiθ .3 Exponential Form Complex numbers can also be represented in exponential form: z = reiθ .c Riley T.25) The Temple of Quantum Computing .27) (3.

2 Properties: z ∗ = re−iθ . Find the modulus. Example Convert eπi3/4 to the form: a + bi (also called rectangular form). r = |z| = √ = 18. .30) (3. 2.. √ 32 + 32 (3.2006 . . we can use the a and b components of z as opposite and adjacent sides of a right angled triangle in quadrant one which means need to apply arctan.31) (3. To find θ.32) (3. This requires two main steps.26) we use a power series exponent (which is an infinite polynomial): x2 x3 + + . Perry 2004 . . e−i2π = 1.35) The Temple of Quantum Computing ..46 Complex Numbers To prove (3.33) Convert 3 + 3i to exponential form... (3.) 2! 4! 3! = cos θ + i sin θ.c Riley T.34) (3. 2! 3! 4! θ2 θ4 iθ3 =1− + + i(θ − + . 2! 3! iθ2 iθ3 θ4 iθ e = 1 + iθ − − + − . So given tan−1 like: 3 3 = π 4 then z in exponential form looks √ 18eπi/4 . ex = 1 + x + Example which are: 1. eπi3/4 = ei(3π/4) 3π 3π = cos + i sin 4 4 ◦ = cos 135 + i sin 135◦ −1 i =√ +√ 2 2 −1 + i = √ .

we can do the same for matrices. a number) by a matrix is a new matrix that is found by multiplying each entry in the given matrix. the numbers in the matrix are called entries.1 Matrix Operations Just as we could define arithmetic operators .c Riley T. for example:  17 24 5 6 1 8    23 4  14  . Given the following 3 matrices: MA = 2 1 3 4 2 1 3 5 2 1 0 3 4 0 .2006 4 2 6 9 . and vectors. 13 20 7 3. MC = Addition . operators. MB = . Perry 2004 . Given a scalar The Temple of Quantum Computing . Addition can only be done when the matrices are of the same dimensions (the same number of columns and rows).g: MA + MB = Scalar Multiplication The product of multiplying a scalar (i. So even if you know this material it’ll be useful to revise as they are used so often. A matrix is an array of numbers.7.7 Matrices Matrices will be needed in quantum computing to represent gates. .e. e.Matrices 47 3.addition and multiplication for complex numbers.

48 α=2: αMA = 4 2 6 8 . Matrices Matrix Multiplication The product of multiplying matrices M and N with dimensions M = m×r and N = r×n is a matrix O with dimension O = m×n.37) (3.47) (3. α(N − O) = αN − αO.40) (3.38) The Temple of Quantum Computing . MB MC = = (2 × 2) + (1 × 3) (2 × 1) + (1 × 4) (2 × 0) + (1 × 0) (3 × 2) + (5 × 3) (3 × 1) + (5 × 4) (3 × 0) + (5 × 0) 7 6 0 21 23 0 .46) (3.41) (3. and O are matrices and α and β are scalars: M + N = N + M. The matrices M and N must also satisfy the condition that the number of columns in M is the same as the number of rows in N .2006 . M + (N + O) = (M + N ) + O. Perry 2004 .44) (3. Commutative law for addition Associative law for addition Distributive law Distributive law (3. (α − β)O = αO − βO.39) (3.c Riley T. α(N + O) = αN + αO.36) (3. M (N O) = (M N )O.48) Associative law for multiplication (3. α(N O) = (αN )O = N (αO). Basic Matrix Arithmetic Suppose M .43) (3. (α + β)O = αO + βO. N . (N − O)M = N M − OM. (N + O)M = N M + OM. M (N + O) = M N + M O. M (N − O) = M N − M O. The resulting matrix is found by Oij = r k=1 Mi rNr j where i and j denote row and column respectively. (αβ)O = α(βO).42) (3.45) (3.

Inverse Matrix A number a has an inverse a−1 where aa−1 = a−1 a = 1. An example of an inverse is below. which follows the same non-commutative multiplication law. Perry 2004 . It is not always the case that M N = N M . (3. Zero Matrix The special case of a matrix filled with zeroes. −1 MA = 4 5 −3 5 −1 5 2 5 .50) MA I = .49) Identity Matrix A matrix multiplied by the identity matrix (corresponding to unity in the ordinary numbers) will not change.c Riley T. (3. Equivalently a matrix A has an inverse: A−1 where AA−1 = A−1 A = I. I= 1 0 0 1 2 1 3 4 .Matrices 49 You may have noticed that there is no commutative law for multiplication. The Temple of Quantum Computing .51) Even with a simple 2×2 matrix it is not a trivial matter to determine its inverses (if it has any at all). This is important in quantum mechanics. Note A−1 only exists iff A has full rank (see Determinants and Rank below).2006 . (3. 0= 0 0 0 0 . for a full explanation of how to calculate an inverse you’ll need to consult an external reference.

0 0 For a square matrix like MA you get the transpose by reflecting about the diagonal (i. It’s deter2 minant. Determinants and Rank Rank is the number of rows (or columns) which are not linear combinations (see section 3. A matrix has full rank when the rank is the number of rows or columns. The determinant of a simple 2 × 2 matrix is defined as: det a b c d = ad − bc. for example: The Temple of Quantum Computing .e.53) 2 3 So now for an example of rank. flipping the values). m = n). doesn’t have an inverse). We can say it has rank 1 because row 2 is a multiple (by 3 ) of row 1.6) of other rows. whichever is smaller. MD = 2 4 3 6 .8.50 Transpose Matrix AT is the transpose of matrix A if: AT = Aij .2006 . (3.c Riley T.e.e..52)   T MC =  1 4  . A non-zero determinant (see below) determines that the matrix has full rank. 2 × 6 − 3 × 4 is 0. In the case of a square matrix A (i. So a non-zero determinant implies the matrix has an inverse and vice-versa. then A is invertible iff A has rank n (we say that A has full rank). if the determinant is 0 the matrix is singular (i. given the matrix below. Determinants of larger matrices can be found by decomposing them into smaller 2 × 2 matrices. ji Here’s an example:   Matrices (3. Perry 2004 .

This can be further extended to more dimensions using n space (Rn ). like inverses are not trivial to calculate. The Temple of Quantum Computing . Vectors for quantum computing are in complex vector space Cn called n dimensional Hilbert space.8 Vectors and Vector Spaces 3. for a full explanation you’ll need to consult an external reference. Vectors in R A vector in R (the real numbers) can be represented by a point on the cartesian plane (x. The tail does not have to start at the origin and the vector can move anywhere in the cartesian plane as long as it keeps the same direction and length.c Riley T.7). But it’s helpful to look at simpler vectors in real space (i. y) if the tail of the vector starts at the origin (see figure 3. the initial point and the terminal point.2006 . 3. (3.1 Introduction Vectors are line segments that have both magnitude and direction.54) Determinants.3). ordinary 2D space) first.Vectors and Vector Spaces 51    det  d e f  = a · det g h i a b c  e f h i − b · det d f g i + c · det d e g h . The collection of all the vectors corresponding to all the different points in the plane make up the space (R2 ). Perry 2004 . For simplicity’s sake our vectors in R all have an initial point at the origin and our coordinates just refer to the terminal point. When vectors do not start at the origin they are made up of two points.e. The x and y coordinates that relate to the x and y axes are called the components of the vector.8. Again. We can make a vector 3D by using another axis (the z axis) and extending into 3 space (R3 ) (see figure 3.

3) (−3.2006 .c Riley T.e. Perry 2004 .52 Vectors and Vector Spaces T (3. uy . z uz T d d d ux ¡ x ¡ ¡  ¡ ¡     ¡d ¡ d d u = (ux .3: Vectors in R2 (i. uy . −1) c Figure 3. uz )      uy ¡ Ey d d¡ ¡ ¡ Figure 3.4: A 3D vector with components ux . ordinary 2D space like a table top). 1) '        y ˆˆˆ ˆˆˆ     d ‚ d E (−1. The Temple of Quantum Computing . uz .

Two Interesting Properties of Vectors in R3 Vectors in R3 are represented here by a bolded letter.2006 . Example A point in 5 dimensional space is represented by the ordered 5 tuple (4. 20). uz ) and v = (vx . We can think of some vectors as having local coordinate systems that are offset from the origin.c Riley T.5: Vector examples. Example Example vectors in R in figure 3.6). This operation takes two vectors and returns a number (not a vector). Let u = (ux . 7. 17. uy . An important operation is the dot product (used below to get the angle between two vectors): u · v = ux vx + uy vy + uz vz . (3. The Temple of Quantum Computing . vy . or dot product. d = e = a. 8.5. Perry 2004 .Vectors and Vector Spaces T 53 d d d d d d ‚ d d d a    d d ' d ‚ b E e s d d d c d d d d ‚ c Figure 3. In computer graphics the distinction is that coordinate systems are measured in world coordinates and vectors are terminal points that are local to that coordinate system (see figure 3. vz ) (two vectors).55) The dot (·) here means the inner. a = b = c.

this is the set containing all column vectors with n complex numbers laid out vertically (the above examples were row vectors with components laid out horizontally). u2 ) (3. Perry 2004 . 1. (3.8. 1) and v = (2. 3. √ 3. We also define a vector subspace as a non empty set of vectors which satisfy the same conditions as the parent’s vector space.54 Vectors and Vector Spaces Knowing the components we can calculate the magnitude (the length of the vector) using Pythagoras’ theorem as follows: u = Example Example ux ux + uy uy + uz uz . 1) then u = if u = (1.2006 . u1 u2 (3. the quantum mechanical notation for a ket can be used to represent a vector. 1.56) if u = (1. 1. 3) then: 2+1+3 cos θ = √ √ 3 14 6 = .c Riley T.58) The Temple of Quantum Computing . |u = where u1 = a1 + b1 i and u2 = a2 + b2 i.57) |u can also be represented in row form: |u = (u1 .2 Column Notation In C2 for example. 7 Vectors in C V = Cn is a complex vector space with dimension n.

62) (3.64) The Temple of Quantum Computing .60) Associative law for scalar multiplication (3.4 Properties of Vectors in Cn Given scalars (α. β) ∈ C and vectors (|u . Scalar Multiplication and Addition Listed here are some basic properties of complex scalar multiplication and addition. Perry 2004 .61) (3.  . |1 = 0 1 . |u + |v =  . . α(|u + |v ) = α|u + α|v .  αun α(β|u ) = αβ|u . 3. 3.8. |v . |0 = Example 1 0 and.63) (3.  .Vectors and Vector Spaces Example Column Notation. |w ) ∈ Cn .c Riley T.59) (3.  α|u =  . Vector Addition A sum of vectors can be represented by:   u1 + v 1   . α(|u + |v ) = α|u + α|v . 55 Here’s a more complex example: |u = (1 + i)|0 + (2 − 3i)|1 = 1+i 2 − 3i . (α + β)|u = α|u + β|u .   un + v n Distributive law for scalar addition  (3.3 The Zero Vector The 0 vector is the vector where all entries are 0.2006 . .8.  αu1  .

in quantum mechanics.5 The Dual Vector The dual vector u| corresponding to a ket vector |u is obtained by transposing the corresponding column vector and conjugating its components. .c Riley T. + αn |vn (3. . Perry 2004 .8.8. a bra and we have: u| = |u † = [u∗ .68) Commutative (3. . . Example The dual of |0 . Given the vector |u where: |u = 1−i 1+i .65) Associative (3. 0| = |0 Example † = [1∗ . |vn if |u can be expressed by: |u = α1 |v1 + α2 |v2 + . . 1 2 n (3.6 Linear Combinations A vector |u is a linear combination of vectors |v1 . (|u + |v ) + |w = |u + (|v + |w ). (1 + i)∗ ] = [(1 + i). . . 0∗ ]. |u + 0 = |u . This is called.70) The Temple of Quantum Computing .8. .2006 . |v2 .67) 3. For every |u ∈ Cn there is a corresponding unique vector −|u such that: |u + (−|u ) = 0. The dual of |u is: u| = [(1 − i)∗ .56 Vectors and Vector Spaces This sum has the following properties: |u + |v = |v + |u . (3. † is called the adjoint and is introduced in section 3. .18. .66) (3. u∗ . u∗ ]. (1 − i)] 3.69) The dagger symbol.

Perry 2004 . 3.7 Linear Independence A set of non-zero vectors |υ1 . (3. . y.. 0. Most of the time with quantum computing we’ll use a standard basis. [1. 0]. . 3.. i=1 (3..72) Example Linear dependence.. 1] = [0. αn are complex numbers.Vectors and Vector Spaces where scalars α1 ... The row vectors (bras) [1. 2]. . z] = xu + yv + zw. . 1] span R3 because all vectors [x. −1].e there is a linear combination with a1 = 1. . and w = [0. a2 = 1. y. Example Vectors u = [1. −1] + [1.8 Spanning Set A spanning set is a set of vectors |υ1 . 2] − [2. So they are not linearly independent. = an = 0. This is also called an orthonormal basis (see section The Temple of Quantum Computing . z] in R3 can be written as a linear combination of u.2006 . α2 . 2] are linearly dependent because: [1. 0]. a3 = −1 (other than the zero condition above) that evaluates to 0.. v. 1. |υn for V in terms of which every vector in V can be written as a linear combination. and [2. called the computational basis. and w like the following: [x. .8. We can represent a linear combination as: n 57 |u = i=1 αi |vi . 0] i.c Riley T.8.71) 3.8.. v = [0. 0. |υn is linearly independent if: n ai |υi = 0 iff a1 = .9 Basis A basis is any set of vectors that are a spanning set and are linearly independent.

see section 3.8. The scalars (e.6 .3 and (100) = 66. 3 3 ˙ ˙ So this give us a 33. The Temple of Quantum Computing .28). when the appropriate measurement is performed (see chapter 4). In C4 we can use |00 .c Riley T.58 Vectors and Vector Spaces 3. check if the probabilities sum to 1. First.10 Probability Amplitudes We can write a vector as a combination of basis vectors. Example 1 |0 3 (3. and |11 for a basis (the tensor product is needed to understand this . In quantum mechanics we use a state vector |Ψ .3% chance of measuring a |0 and a 66.|01 . Because in quantum mechanics they give the probabilities of projecting the state into a basis state.73) Determine the probabilities of measuring a |0 or a |1 for 2 |1 3 + . α and β in α|0 + β|1 ) associated with our basis vectors are called probability amplitudes.14).6% chance of measuring a |1 . Perry 2004 . In C2 we can use |0 and |1 for the basis. The state vector in C2 is often written as |Ψ = α|0 + β|1 . They do sum to 1 so convert to percentages.2006 . |0 or a |1 . To fit with the probability interpretation the square of the absolute values of the probability amplitudes must sum to 1: |α|2 + |β|2 = 1.8. 3. 2 1 ˙ ˙ (100) = 33.|10 .g.8. 2 2 1 |0 + 3 2 |1 = 3 = 1 3 + 2 3 1 2 + 3 3 = 1.

An inner product in Cn combines two vectors and produces a complex number. The inner product in quantum computing is defined in terms of Cn . The Temple of Quantum Computing .1.  α1  .6): u · v = u v cos θ and rearranging we get: θ = cos−1 u·v u v .11 The Inner Product We’ve already met the inner (or dot) product in R2 in section 3.  |u =  . which is defined in terms of a dual.2006 .c Riley T. So given. which is the angle between two vectors.   .74) Now we’ll look at the inner product in Cn . Perry 2004 . but it’s helpful to think of what the inner product gives us in R2 .  βn  and. The dot product in R2 is shown here (also see figure 3.7.   . 3.75) (3.  |v =  .Vectors and Vector Spaces T 59 '         I  θ      E c Figure 3.  αn   β1  .6: The dot product. (3.8.

77) (3. α β =α This is called bra-ket notation.  βn = u|v . ∀ |u [R u|u ≥ 0].82) (3. 0∗ ] or using dot product notation..81) (3.60 we can calculate the inner product: Vectors and Vector Spaces  β1  . (3. 0|(α|0 + β|1 ) = 1 0 • α β = α.  ∗ ∗ [α1 . |v ) = u| × |v = u|v = [u∗ . . v1 v2 = (|u .79) (3. If u|u = 0 then |u = 0. Perry 2004 .2006 ..83) The Cauchy-Schwartz inequality (3. αn ]  . |v ) = u|v . An inner product can also be represented in the following format: (|u .. u∗ ] 1 2 v1 v2  (3. 1 2 Example tor’s dual: Using the inner product notation from above we can extract a probability amplitude if we use one of the basis vectors as the original vec0|(α|0 + β|1 ) = [1∗ .c Riley T. u|αv = α∗ u|v = α u|v . Properties: u|v = v|u ∗ .80) (3.84) The Temple of Quantum Computing . So for C2 the following are equivalent: u1 u2 . | u|v |2 ≤ u|u v|v .78) = u∗ v1 + u∗ v2 .  = u| × |v  . Hilbert space is the vector space for complex inner products. u|v + w = u|v = u|w .76) (3.

8. two vectors are orthogonal iff: |u = 0. 1 1 and |v = 1 −1 1+i 2 − 2i and |v = −i 1 2 = 0.86) The Temple of Quantum Computing . and u|v = 0. (3.8.2006 .c Riley T. Perry 2004 .85) 1 0 and |v = 0 1 0 1 = 0. 1). Example The vectors: |u = are orthogonal because: [1 − i.Vectors and Vector Spaces 61 3. 3.12 Orthogonality Orthogonal vectors can be thought of as being ”perpendicular to each other”. −1)) = 1 × 1 + 1 × (−1) = 0. Example The vectors: |u = are orthogonal because: [1∗ . 0∗ ] Example The vectors: |u = are orthogonal because: u|v = ((1. 2 + 2i] −i 1 2 (3.13 The Unit Vector A vector’s norm is: |u = u|u . (1. |v = 0.

    . First we find the norm: |u = = Now we normalise |u to get: 1 1 |ˆ = √ u 2 1 =√ 2 = 1 √ 2 1 √ 2 [1∗ .2006 .   .88) Example Normalise |u = 1 1 (= |0 + |1 ). . .89)  0  .   1 0 The Temple of Quantum Computing . (3..62 Vectors and Vector Spaces A unit vector is a vector where its norm is equal to 1.14 Bases for Cn Cn has a standard basis (see 3.9) which is:      0 1        0   1  .. (3. which here is represented by theˆ(hat) symbol.. Perry 2004 ..7. We must normalise it by dividing by the norm: |ˆ = u |u |u .. 1 1 1 1 1 1 = √ |0 + √ |1 ... 2 2 3.87) If we want to make an arbitrary vector a unit vector. 1∗ ] √ 2..8. |u = 1.c Riley T..       0 0  (3..

2006 . 1 √ (|0 2 − |1 ) are often used for quantum computing. The ”ortho” part of orthonormal stands for orthogonal. |1 . . In figure 3. y. The basis is called orthonormal because the vectors are of unit length and mutually orthogonal. It’s useful at this point to consider what an orthonormal basis is in R3 . |1 and 1 √ (|0 2 + |1 ). |n − 1 . The ”normal” part refers to normalised (unit) vectors. ... . which means the vectors are perpendicular to each other. We can use an orthonormal basis in R3 to separate world coordinates from a local coordinate system in 3D computer graphics. z) are orthogonal. . Example Orthonormal bases |0 .Vectors and Vector Spaces z T 63 T ¡  ¡ ¡ ¡ ¡ E Ey x ¡  ¡ ¡ ¡ Figure 3. for example the 3D axes (x. There are other orthonormal bases in Cn and. This is written as |0 . in quantum computing.. In this way we can transform the local coordinates system. In this system we define the position of the local coordinate system in world coordinates and then we can define the positions of individual objects in terms of the local coordinate system. The Temple of Quantum Computing .7: A local coordinate system.c Riley T. .7 the local coordinate system forms an orthonormal basis. |1 . Perry 2004 . Any other vector in the same space can be expanded in terms of |0 . together with everything in it while leaving the world coordinates system intact. |n − 1 . it is sometimes convenient to switch between bases.

Perry 2004 . |u2 = (0.91) Example Given the following vectors in C3 : |u1 = (i.√ . |un is a basis (any basis will do) for vector space V that has an inner product. Suppose this basis is not orthonormal. 0. (3.√ 3 3 3 |u2 − v1 |u2 |v1 |u2 − v1 |u2 |v1 2i i i −√ . .8. . i. . . The Gram Schmidt method can be used to produce an orthonormal basis set |v1 . |vn for V by. i) find an orthonormal basis |v1 . .16 Linear Operators A linear operator A : V → W where V and W are complex vector spaces is defined as: A(α|u + β|v ) = α(A(|u ) + β(A|v )). i).2006 . |v1 = and given |vk+1 for 1 ≤ k < n − 1: |vk+1 = |uk+1 − |uk+1 − k i=1 k i=1 |u1 |u1 (3.92) The Temple of Quantum Computing . |v2 . . i. . |v3 .15 The Gram Schmidt Method Suppose |u1 . |u1 |u1 (i.8. . i) √ 3 i i i √ . √ .c Riley T.90) vi |uk+1 |vi vi |uk+1 |vi .64 Vectors and Vector Spaces 3. and |u3 = (0. i). i. 2 2 |v1 = = = |v2 = = |v3 = = 3. (3. − . √ 6 6 6 |u3 − v1 |u3 |v1 − v2 |u3 |v2 |u3 − v1 |u3 |v1 − v2 |u3 |v2 i i 0. .

1 |0 3 + 2 |1 3 : A 1 |0 + 3 2 |1 3 = 0 1 1 0 0 1 1 0  2 3 1 3     1 |0 + 3  1 3 2 3 2 |1 3 =  = = Properties: 2 |0 + 3 1 |1 . 2. apply it to A= 0 1 1 0 . The result of the linear operator |u v| acting on |w or. The result of multiplying |u by v|w .17 ing: Outer Products and Projectors We define an outer product.93) 3. Perry 2004 . |u v| as a linear operator A which does the follow- (|u v|)(|w ) = |u v|w = v|w |u .94) The Temple of Quantum Computing .2006 . (3. 3 u|A|v is the inner product of u| and A|v . (3.Vectors and Vector Spaces 65 With dimensions n for V and m for W the linear operator can be represented by an m × n matrix. 1.c Riley T. This can be read as.8. Example Given a linear operator A.

95) |1 1|Ψ = |1 1|(α|0 + β|1 ) = |1 β = β|1 . Given a subspace which is spanned by orthonormal vectors. . P projects any vector in V onto Vs (components not in Vs are discarded). . We can represent projectors with outer product notation. . The Temple of Quantum Computing . .  . Say we have a vector space V = {|00 . + |un un |. . A projector P on to the subspace Vs = {|00 . u1 v n  (3. |un }.97) = |u1 u1 | + |u2 u2 | + . ..96) (3. .66 In terms of matrices.   ∗ . . u2 v n  . . . |01 . |10 . .   .c Riley T. ∗ ∗ un v1 un v2 Example Take |Ψ = α|0 + β|1 for |w then: Vectors and Vector Spaces ∗  . Perry 2004 . |0 0|Ψ = |0 0|(α|0 + β|1 ) = |0 α = α|0 . A projection on to this subspace can be represented by a summation of outer products: n P = i=1 |ui ui | (3. . |0 1|Ψ = |0 1|(α|0 + β|1 ) = |0 β = β|0 . |u v| can be represented by:  ∗ ∗   u1 v1 u1 v2 u1  ∗    u v ∗ u2 v2  u2  v ∗ v ∗ . In the chapters ahead we will use projectors to deal with quantum measurements. .2006 . |01 } behaves as follows: P (α00 |00 + α01 |01 + α10 |10 + α11 |11 ) = α00 |00 + α01 |01 .. =  2 1 1 2  . {|u1 . . |1 0|Ψ = |1 0|(α|0 + β|1 ) = |1 α = α|1 . . . . |11 }. un vn ∗ . |u2 .

2006 . 1∗ 0∗ . These two matrices are defined below. but it turns out they are quite handy for quantum computing. We can also represent a matrix (an operator for example) using outer product notation. We’ll be using them frequently in the chapters ahead: |0 1| = = |1 1| = = |0 0| = = |1 0| = = 1 0 0 1 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 1 0 0 1 0 0∗ 1∗ .c Riley T.Vectors and Vector Spaces 67 So. 1∗ 0∗ . Z= 1 0 0 −1 = |0 0| − |1 1|. we can replace the projector notation P with the explicit outer product notation: (|00 00| + |01 01|)(α00 |00 + α01 |01 + α10 |10 + α11 |11 ) = α00 |00 + α01 |01 . 0∗ 1∗ . X= 0 1 1 0 = |0 1| + |1 0|. Perry 2004 . as shown in the next example. Example Representing operators X and Z. The Temple of Quantum Computing .

. By saying |i i| we actually mean ”for each element n in the set {|i } then add |n n| to the total”. Perry 2004 .101 we can say that this is equivalent to: pr(m) = Ψ| Mm |Ψ . .103) . . 3. |k |k + 1 . P † = P.101) (3.100 and 3.99) (3. . . and we’ll use M m to represent a measurement. . .100) (3. 1+i 1−i −1 1 † (3. |d in 3. .c Riley T. Q = I − P is called the orthogonal complement and is a projector onto |k + 1 . M m = P ) for measurement then the probability of measuring m is: † pr(m) = Ψ| Mm Mm |Ψ . Example An adjoint. |k then V = |1 . By 3.18 The Adjoint The adjoint A† is the matrix obtained from A by conjugating all the elements of A (to get A∗ ) and then forming the transpose: A† = (A∗ )T .104) = 1 − i −1 1+i 1 .98.2006 . . If we use a projector (i. Notice how we have slightly changed the notation here for i (3.98) Given a subspace Vs = |1 .102) (3.23). . . . . |d . Later we’ll look at quantum measurements. . .68 Properties: |i i| = I for any orthonormal basis {|i }. The Temple of Quantum Computing . . Each component |u u| of P is hermitian and P itself is hermitian (see 3. P 2 = P.8.e. i Vectors and Vector Spaces The completeness relation (3.8.

2006 . (A|u )† = u|A† but not A|u = u|A† .106) (3. (αA + βB)† = α∗ A† + β ∗ B † . 1 i 1 + 2i 1 − 2i 1 1 The Temple of Quantum Computing . u|Av = A† u|v . A† |u = = A† u|v = = 2. 1+i 1−i −1 2 0 . Example Example of u|Av = A† u|v .c Riley T. |v = 1 1 and A = 1+i 1−i −1 1 1 1 .105) (3.110) (3. Given. (AB)† = B † A† . (|u )† = u|.111) A|v = = u|Av = 2.108) (3.107) (3. (A† )† = A.Vectors and Vector Spaces Properties: A|u = u|A† . |u = 1 i . 69 (3. 1 1 − i −1 1+i 1 − 2i 1 + 2i 1 .109) (3. Perry 2004 .

Properties: A’s ith eigenvalue λi has eigenvector |ui iff A|ui = λi |ui . there will be n eigenvalues (but some may be the same as others).2006 .112) Note: The eigenvectors that match different eigenvalues are linearly independent.113) (3. here j is the index for eigenvectors of λi . (3. An eigenspace is degenerate when it has dimension > 1 i. We can then solve the characteristic polynomial to find all the eigenvalues for A.8. Perry 2004 .115) (3. Solving the characteristic equation gives us the characteristic polynomial of A. If A is an n × n matrix. called the characteristic equation of A: c(λ) = det(A − λI) = 0.19 Eigenvalues and Eigenvectors The complex number λ is an eigenvalue of a linear operator A if there exists vector |u such that: A|u = λ|u where |u is called an eigenvector of A.e.116) (3.70 Vectors and Vector Spaces 3. This comes from noting that: A|u = λ|u ⇔ (A − λI)|u = 0 ⇔ A − λI is singular ⇔ det(A − λI) = 0.c Riley T. more than one eigenvector. which means we can have an orthonormal set of eigenvectors for an operator A. An example is on the next page. Eigenvalues of A can be found by using the following equation.114) (3. The Temple of Quantum Computing . An eigenspace for λi is the set of eigenvectors that satisfies A|uj = λi |uj .

The Temple of Quantum Computing . so after normalisation our eigenvector is: 1 1 |λ−1 = √ |0 − √ |1 .20 Trace The trace of A is the sum of its eigenvalues. 2 2 Notice that we’ve used the eigenvalue λ = −1 to label the eigenvector |λ−1 .c Riley T. 3.8.117) i. This is the characteristic polynomial. The two solutions to λ2 − 1 = 0 are λ = −1 and λ = +1. the sum of its diagonal entries.Vectors and Vector Spaces Example Eigenvalues and eigenvectors of X. Perry 2004 . X= 0 1 1 0 . 71 det(X − λI) = −λ 1 1 −λ = λ2 − 1.2006 .e. We get α = −β. If we use the eigenvalue of λ = −1 to determine the corresponding eigenvector |λ−1 of X we get: X|λ−1 = −1|λ−1 0 1 1 0 α β β α = = −α −β −α −β . or: n tr(A) = i=1 aii (3.

Perry 2004 . tr(α(A + B)) = αtr(A) + αtr(B). We can also say that:   λ1   . tr(X) = 0 + 0 = 0 or the sum of the eigenvalues 1 + (−1) = 0.125) As stated.126) (3. For unit norm |u : tr(|u u|) = tr(|u u||u u|) = u||u u||u = u|u u|u = ||u |4 = 1.   λn which also has a trace which is the sum the eigenvalues of A as tr(U † AU ) = tr(A) (see section 3.129) (3.24 below). tr(A|u u|) = u|A|u if |u is unitary.130) (3.8.127) (3. tr(|u v|) = u|v .120) (3. tr(U † AU ) = tr(A). (3. .123) (3.2006 .. The Temple of Quantum Computing .128) (3. tr(αA) = αtr(A). the trace of A is the sum of its eigenvalues. tr(U AU † ) = tr(A).c Riley T.118) (3. U † AU =  . Properties: tr(A + B) = tr(A) + tr(B).72 Example Trace of X and I X= 0 1 1 0 1 0 0 1 .121) (3.119) (3.124) (3. tr(AB) = tr(BA).122) Similarity transform for U (3. For I we have tr(I) = 2. Vectors and Vector Spaces I= .

Vectors and Vector Spaces

73

Figure 3.8: Relationships between operators.

3.8.21

Normal Operators

A normal operator satisfies the following condition: AA† = A† A. (3.131)

The class of normal operators has a number of subsets. In the following sections we’ll look at some of the important normal operators. These include unitary, hermitian, and positive operators. The relationships between these operators is shown in figure 3.8.

3.8.22

Unitary Operators

Matrix U is unitary (unitary operators are usually represented by U ) if: U −1 = U † or, U U † = U † U = I. The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006 (3.133) (3.132)

74

Vectors and Vector Spaces

Eigenvectors of unitary matrices have a modulus of 1:

U |u

= |u

∀ |u .

(3.134)

Unitary operators have the property that they preserve norm, and are invertible. There are some particularly important operators called the Pauli operators. We’ve seen some of them already, they are referred to by the letters I, X, Y, and Z. In some texts X, Y, and Z are referred to by another notation, where σ1 = σX = X, σ2 = σY = Y, and σ3 = σZ = Z. The Pauli operators are defined as: 1 0 0 1 0 1 1 0 0 −i i 1 0 0

I= X= Y = Z=

, , , .

(3.135) (3.136) (3.137) (3.138)

0 −1

Example

I, X, Y, and Z are unitary because: II † = I 2 = XX † = X 2 = YY† =Y2 = ZZ † = Z 2 = 1 0 0 1 0 1 1 0 0 −i i 1 0 0 1 0 0 1 0 1 1 0 0 −i i 1 0 0 = = = = 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 . . . .

0 −1

0 −1

Note: I = I † , X = X † , Y = Y † , and Z = Z † .

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Vectors and Vector Spaces Properties (of unitary operators): U=
j

75

|j j|.

(3.139) (3.140) (3.141) (3.142) (3.143) (3.144) = u . |vi ui |.
i

(U |u , U |v ) = u|U † U |v = u|v . Unitary matrices are also normal. Unitary matrices allow for spectral decomposition, (see section 3.8.27). Unitary matrices allow for reversal, i.e. U † (U |u ) = I|u = |u . Unitary matrices preserve inner product (U |u , U |v ) = (|u , |v ) = u|v . Unitary matrices preserve norm U |u Given an orthonormal basis set {|ui }, {U |ui } = {vi } is also an orthonormal basis with U =

(3.145) (3.146) (3.147) (3.148)

Unitary matrices have eigenvalues of modulus 1. If(|u , A|u ) > 0 ∀|u in V (all positive eigenvalues).

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

76

Vectors and Vector Spaces

3.8.23 Hermitian and Positive Operators
A hermitian matrix A has the property: A = A† . (3.149)

The eigenvalues of a hermitian matrix are real numbers and hermitian matrices are also normal (although not all normal matrices need real eigenvalues). Example The matrix X is Hermitian because: X= 0 1 1 0 =, X † = 0 1 1 0 .

Properties: A = B + iC can represent any operator if B and C are hermitian with C = 0 if A itself is hermitian. If A is hermitian then for |u , u|A|u ∈ R. If A is hermitian then A is a positive operator iff for |u , u|Au ∈ R and u|Au ≥ 0. If A is positive it has no negative eigenvalues. (3.152) (3.153) (3.150) (3.151)

3.8.24 Diagonalisable Matrix
An operator A is diagonalisable if: A=
i

λi |ui ui |.

(3.154)

The vectors |ui form an orthonormal set of eigenvectors for A, with eigenvalues of λi . This is the same as saying that A can be transformed to:   λ1   ... .    λn

(3.155)

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Vectors and Vector Spaces Example Representing operator X: X= 0 1 1 0 .

77

The two normalised eigenvectors for X are: 1 1 1 1 √ |0 − √ |1 and √ |0 + √ |1 . 2 2 2 2 The two vectors are orthogonal (with eigenvalues −1 and +1), 1 1 √ 0| − √ 1| 2 2 1 1 √ |0 + √ |1 2 2 1 = [ 0|0 − 0|1 + 1|0 − 1|1 ] 2 1 = [1 − 0 + 0 − 1] 2 = 0.

So X is diagonalisable and is given by: 1 1 X = [|0 + |1 ][ 0| + 1|] − [|0 − |1 ][ 0| − 1|]. 2 2 Which expanded is: 1 1 ([ 0|0 + 0|1 + 1|0 + 1|1 ]) − ([ 0|0 − 0|1 − 1|0 + 1|1 ]). 2 2

3.8.25

The Commutator and Anti-Commutator

Here is a set of properties for the Commutator and Anti-Commutator which relate to commutative relationships between two operators A and B. Commutator: [A, B] = AB − BA, A and B commute (AB = BA) if [A, B] = 0. Anti-commutator: {A, B} = AB + BA, we say A and B anti-commute if {A, B} = 0. The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006 (3.157) (3.156)

[HA .2006 . (3.159) (3. B} . 2 [A. HB are hermitian. they are both diagonal in a common basis. B] + {A. HB ] is hermitian if HA . and D a diagonal matrix with non-negative elements in R such that A = UA DUB .c Riley T.161) (3. B]† = [A† .e. A]. Perry 2004 . AB = [A. 0 1 1 0 0 −2 2 0 1 0 − 1 0 0 1 1 0 0 −1 0 −1 So X and Z do not commute.78 Vectors and Vector Spaces Example We test X and Z against the commutator. B † ]. HB ] = 0 if ∃ a set of orthonormal eigenvectors for both HA .158) i.e. The simultaneous diagonalisation theorem says that if HA and HB are hermitian. [HA .162) 3. Single value decomposition says that if a linear operator A that is a square matrix (i.160) (3. [X. HB so: HA = i λi |i i| and HB = i λi |i i|. the same input and output dimension) then there exist unitaries UA and UB .8. The Temple of Quantum Computing . B] = −[B. (3. Properties: [A. Z] = = = 0.26 Polar Decomposition Polar decomposition says that any linear operator A can be represented as A = √ √ U A† A (called the left polar decomposition) = AA† U (called the right polar decomposition) where U is a unitary operator.

and −1 Then.27 Spectral Decomposition A linear operator is normal (A† A = AA† ) iff it has orthogonal eigenvectors and the normalised (orthonormal) versions {ui } of the eigenvectors can diagonalise the operator: A= i λi |ui ui |. Perry 2004 . 1 2 1 −1 1 −1 [1 − 1] −1 1 1 1 1 1 0 1 1 0 1 2 Properties: A = U DU † where U is a unitary and D is a diagonal operator.2006 . formally: The Temple of Quantum Computing . Z= 1 0 0 −1 = |0 0| − |1 1|. we get back X: |+ +| − |− −| = = = 1 2 1 2 1 1 [11] − − . X has eigenvectors |+ = 1 √ |0 2 + |1 . (3. and |− = 1 √ |0 2 − |1 and eigenvalues of +1. 3.165) |a a|.8. if we expand.164) (3. If A is normal then it has a spectral decomposition of a (3. The elements of the smaller vector spaces are combined whilst preserving scalar multiplication and linearity.163) Example Spectral decomposition of X and Z. X= 0 1 1 0 = |+ +| − |− −|.c Riley T.8.28 Tensor Products In a tensor product we have a combination of two smaller vector spaces to form a larger one.Vectors and Vector Spaces 79 3.

v = |uv . |1 ⊗ |0 = |1 |0 = |1.167) (3. We can write this in the following way: |u ⊗ |v = |u |v = |u. 0 = |10 . Example A simple tensor product. The Kronecker product is defined as: a b c d x y v w (3. and Y X= 0 1 1 0 and Y = 0 −i i 0 . X ⊗Y = =  0·Y 1·Y 0 1 1 0 0 0 1·Y 0·Y 0 −i i 0 0 −i    0 0 1 =  0 −i 0  i 0 0  0  .166) A⊗B = =  ⊗ (3.80 Vectors and Vector Spaces If {|u } and {|v } are bases for V and W respectively then {|u ⊗ |v } form a basis for V ⊗ W . Perry 2004 . Example (3.2006 .169) A Kronecker product on Pauli matrices X.c Riley T.     av aw bv bw =  cx cy dx dy  cv cw dv dw where A and B are linear operators.168) a·B b·B c·B d·B ax ay bx by    . 0   0 The Temple of Quantum Computing .

181) (3. The discrete Fourier transform (DFT) is a version of the Fourier transform which.177) (3. |uv = |vu . v = |u. .178) (3. (A ⊗ B)† = A† ⊗ B † . ⊗ |u )k k times. (3. The Fourier transform itself is not limited to periodic functions.9 Fourier Transforms The Fourier transform.185) (A ⊗ B)∗ = A∗ ⊗ B ∗ .179) (3.Fourier Transforms Properties: Tensor products are related to the inner product: (|uv . |ab † = ab|. 3.173) (3. v1 + v2 = |u. does not involve calculus and can be directly implemented on computers but is limited to periodic functions. For hermitian operators HA and HB .175) (3. 1768 .1830 (figure 3. For unitary operators UA and UB . v .174) (3. |u )(|v . |v ) = u|u v|v . HA ⊗ HB will be hermitian. . |u1 + u2 .171) |u ⊗k = (|u ⊗ . v2 . A ⊗ B(|uv ) = A|u ⊗ A|v . v ) = |αu. v = |u1 . For normal operators NA and NB . unlike the basic Fourier transform. UA ⊗ UB will be unitary.172) (3. v + |u2 .170) (3. which is named after Jean Baptiste Joseph Fourier. NA ⊗ NB will be normal. αv .9).2006 . α(|u.176) (3. For positive operators PA and PB . For linear operators A and B. |u v ) = (|u . Perry 2004 .182) (3. v1 + |u.184) (3.c Riley T. PA ⊗ PB will be positive.180) (3. 81 (3. (A ⊗ B)T = AT ⊗ B T . The Temple of Quantum Computing .183) (3. |u. maps data from the time domain to the frequency domain.

a1 .5. We won’t go into the derivation of these coefficients (or how to find the number of sines and cosines) here. then the Fourier series is: f (t) = 0. .82 Fourier Transforms Figure 3. The definition will be enough. continuous function as a linear combination of sines and cosines.9.c Riley T. like |0 and |1 forms an orthonormal basis for quantum computing. sin and cos form an orthonormal basis for the time domain based representation of a waveform. . We can represent any periodic. 2 n=1 n=1 ∞ ∞ (3. In fact. an and b0 . One way to describe an orthonormal basis is: That which you measure against.1 The Fourier Series Representing a periodic function as a linear combination of sines and cosines is called a Fourier series expansion of the function. . .2006 . as this is only meant to be a brief introduction to the Fourier series. 3.9: Jean Baptiste Joseph Fourier. Perry 2004 . b1 . . a4 = 2 and b2 = 4 and all the rest are 0. The fourier series has the form: a0 f (t) = + an sin(nt) + bn cos(nt). . . . suppose we’ve found a1 = 0. bn and the number of sines and cosines.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) which is represented by the following graph: The Temple of Quantum Computing . For example.186) So if we have a waveform we want to model we only need to find the coefficients a0 .

2 sin(4πt).Fourier Transforms 8 6 4 2 0 −2 −4 −6 −8 0 1 2 3 4 5 0. Perry 2004 .c Riley T.2006 . Again. it’s helpful to look at them graphically: 6 0.5 sin(πt) 4 2 0 −2 −4 −6 0 1 2 3 4 5 The Temple of Quantum Computing .5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) 83 The function f (t) is made up of the following waveforms.5 sin(πt). 0. and 4 cos(2πt).

84 6 Fourier Transforms 2 sin(4πt) 4 2 0 −2 −4 −6 0 1 2 3 4 5 6 4 cos(2πt) 4 2 0 −2 −4 −6 0 1 2 3 4 5 If we analyse the frequencies and amplitudes of the components of f (t) we get the following results [Shatkay. 1995]: Waveform 0. exponential form. The Temple of Quantum Computing . H.c Riley T. Perry 2004 .2006 .5 sin(πt) 2 sin(4πt) 4 cos(2πt) Sine Amplitude 1 2 Cosine Amplitude 0 0 4 Frequency 2 1 2 2 0 1 We can also rewrite the sinusoids above as a sum of numbers in complex.

The Temple of Quantum Computing .5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) with sampling points at the whole numbers (1. . . . . Formally..Fourier Transforms 85 3. . The sample rate N determines the accuracy of our transformation.2006 . tN −1 are transformed into the N complex numbers f0 . fN − 1 according to the formula: N −1 fj = k=0 tk e− N 2πi jk j = 0.2 The Discrete Fourier Transform The DFT maps from a discrete. . so we can take the conversion back to its original form using: tk = 1 N N −1 fj e N j=0 2πi kj k = 0. exponential form. The DFT takes as input and outputs an array of complex numbers. Let’s look at doing a DFT on f (t) = 0. Perry 2004 .188) We have chosen to represent our periodic functions as a sequence of sines and cosines. .c Riley T.. .. The number of elements in the array is governed by the sampling rate and the length of the waveform. 2. .. To use the above formulas they need to be converted to complex. .. Because the sequence we are after is discrete we need to sample various points along the sequence.9. periodic sequence tk to a set of coefficients representing the frequencies of the discrete sequence. .. N ) as you can see if we only sample at this point we get no notion of a wave at all. N − 1. The N complex numbers t0 .187) The DFT is a linear operator with an invertible matrix representation. . (3. (3.5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) and adjust the sampling rate until we get an acceptable waveform in the frequency domain: The graph below is just f (t) = 0. . N − 1. . With the lower bound on the sampling rate being found by applying Nyquist’s theorem (which is beyond the scope of this paper).

5 sin(πt) + 2 sin(4πt) + 4 cos(2πt) 4 2 0 −2 −4 −6 0 2 4 6 8 10 12 Instead of adjusting the sample rate to be fractional. So we are effectively sampling at twice the rate. we just have to adjust the function slightly. 6 4 2 0 −2 −4 −6 0 2 4 6 8 10 12 t t t 0. which just makes the x-axis longer but retains our wave. Perry 2004 .5 sin(π 2 ) + 2 sin(4π 2 ) + 4 cos(2π 2 ) The Temple of Quantum Computing .2006 .c Riley T. The function now looks like this: f (t) = 0.5 sin π t 2 + 2 sin 4π t 2 + 4 cos 2π t 2 .86 6 Fourier Transforms 0.

it is now in the frequency domain: 50 40 30 20 10 0 t t t DFT(0. Perry 2004 . the function now looks like this: f (t) = 0. here is f (t) = 0. in chapter 7.5 sin(π 50 ) + 2 sin(4π 50 ) + 4 cos(2π 50 )) 0 20 40 60 80 100 120 Later.5 sin(π 50 ) + 2 sin(4π 50 ) + 4 cos(2π 50 ) t t t Finally. t t t 0. we’ll see how the quantum analogue of the DFT (called the quantum fourier transform) can be used for quantum computing.5 sin π 8 6 4 2 0 −2 −4 −6 −8 0 50 100 150 200 250 t 50 + 2 sin 4π t 50 + 4 cos 2π t 50 .Fourier Transforms 87 Below we show a sampling rate of 50 times the original rate and our waveform looks good.2006 .5 sin(π 50 ) + 2 sin(4π 50 ) + 4 cos(2π 50 ) after it has been put through the DFT.c Riley T. The Temple of Quantum Computing .

.

but at present the theory remains incomplete as it has not been successfully combined with classical theories of gravity. Then. in the second part we will examine some important concepts (like the ones above) of quantum mechanics and how they relate to quantum computing.P. Some strange effects happen at the quantum scale.Chapter 4 Quantum Mechanics Quantum mechanics is generally about the novel behaviour of very small things. this means that it can be subdivided no more. In the first part we’ll look briefly at the history of quantum mechanics. The main references used for this chapter are. the periodic table. McEvoy and Oscar Zarate. and Quantum Physics. One day scientists hope to use quantum mechanics to explain everything. how matter is structured. The following effects are important for quantum computing: • Superposition and interference • Uncertainty • Entanglement This chapter is broken into two parts. and countless other phenomena. Quantum mechanics has never been wrong. 89 . Introducing Quantum Theory by J. Both of these are very accessible introductory books. At this scale matter becomes quantised. Illusion or Reality by Alastair Rae. it explains why the stars shine.

Prior to this. 1831 . 1452 . 1564 . 4.1: James Clerk Maxwell and Isaac Newton. they are: The Temple of Quantum Computing .1) and Isaac Newton’s mechanics.1543 and Galileo Galilei. Figure 4. Perry 2004 .1642 (figure 4.1 Classical Physics Classical physics roughly means pre-20th century physics.1879 (figure 4.1 History 4.c Riley T. Nicolaus Copernicus.90 History Figure 4.1519) by testing theories with observation and experimentation. Isaac Newton.2) created the modern scientific method (we might also include Leonardo Davinci. 1642 . or pre-quantum physics. 1473 . by James Clerk Maxwell.1727 (figure 4.1) is arguably the most important scientist of all time due to the large body of work he produced that is still relevant today. Two of the most important classical theories are electromagnetism. Classical physics has a number of fundamental assumptions.2006 .1.2: Nicolaus Copernicus and Galileo Galilei.

or is it? No.c Riley T. • We can measure any system to an arbitrary accuracy and correct for any errors caused by the measuring tool. These are four equations that describe all electric and magnetic phenomena. 460 . this is Galileo’s principle of inertia).2006 . Atoms Atoms are defined as indivisible parts of matter first postulated by Democritus.322 BC) but two thousand years later the idea started gaining acceptance. the heat energy in a gas is the kinetic energies of all the The Temple of Quantum Computing . • Particles and waves exist.3) predicted properties of elements and compounds using the atomic concept. we can say exactly what it has been and what it will be at any time.3). if a state of motion is known now then because the universe is predictable. all non-uniform motion and action is caused by something (uniform motion doesn’t need a cause.e. Perry 2004 . Heat is understood to be disordered energy.1. These are the concepts of atoms. i.1844 (figure 4. thermodynamics. (384 . and statistical analysis. Thermodynamics Thermodynamics is the theory of heat energy.History • The universe is a giant machine. 4. • Determinism. It’s all proven. the above assumptions do not hold for quantum mechanics.2 Important Concepts In the lead up to quantum mechanics there are some important concepts from classical physics that we should look at. The first major breakthrough was in 1806 when John Dalton. 1766 .g. The idea was dismissed as a waste of time by Aristotle. • Light is a wave that is completely described by Maxwell’s wave equations.370 BC (figure 4. 91 • Cause and effect. e. but they are distinct.

1894 (figure 4. The temperature is a measure of how fast the molecules are travelling (if a gas or liquid.2006 . Figure 4.4). • The second law of thermodynamics The Temple of Quantum Computing .4: Hermann von Helmholtz and Rudolf Clausius.c Riley T. Perry 2004 . Thermodynamics is made up of two laws: • The first law of thermodynamics In a closed system. 1824 . molecules. This law of conservation of energy was originally stated by Herman Von Helmholtz. how fast they are vibrating about their fixed positions in the solid). whenever a certain amount of energy disappears in one place an equivalent amount must appear elsewhere in the system is some form.3: Democritus and John Dalton.92 History Figure 4. if solid.

e. He introduced a new concept. b. Rudolf Clausius. p. using the atomic model. Maxwell.18]. Heat always flows from hot to cold [Rae.1.C. J. 400◦ K. So this implies that an isolated system’s entropy is always increasing until the system reaches thermal equilibrium (i. A. The v axis denotes velocity. entropy which in terms of heat transfer is: The total entropy of a system increases when heat flows from a hot body to a cold one. The graph is shown in figure 4.3 Statistical Mechanics In 1859. 4. and c represent molecules at 100◦ K. Perry 2004 . remember hotter molecules tend to go faster. all parts of the system are at the same temperature). The Temple of Quantum Computing . 1822 .1888 (figure 4. came up with a way of statistically averaging the velocities of randomly chosen molecules of a gas in a closed system like a box (because it was impossible to track each one).c Riley T. and 1600◦ K respectively.5: Maxwell distribution. the graph’s n axis denotes the number of molecules (this particular graph shows CO2 ).5. 1996.History 93 Figure 4.2006 . The letters a.4) called the previous law the first of two laws.

1906 (figure 4.38 × 10−23 J/K. to measure this disorder we consider the number of configurations or states that the collection of atoms can be in. a statistical improbability that may seem nonsensical but nonetheless the theory must cater for it.1) 4. and are free to move.c Riley T. if we have a box containing a gas a fluctuation could be all particles of the gas randomly clumping together in one corner of the box. In the 1870s Ludwig Boltzmann. So the behaviour of ”large things” could now be predicted by the average statistical behaviour of the their smaller parts.6) generalised the theory to any collection of entities that interact randomly. 1844 .4 Important Experiments There are two major periods in the development of quantum theory.6: Ludwig Boltzmann and Niels Bohr. Perry 2004 .1962 (figure 4. There also remains the probability that a fluctuation can occur. He rewrote the second law of thermodynamics to say: As the energy in a system degrades the system’s atoms become more disordered and there is an increase in entropy. (4. the first culminating in 1913 with the Niels Bohr. are independent. For example. 1885 .2006 . which is important for quantum mechanics. If this number is W then the entropy S is defined as: S = k log W where k is Boltzmann’s constant k = 1.94 History Figure 4.6) model of the The Temple of Quantum Computing .1.

This is called old quantum theory. E. To determine the temperature of a black body we have to observe the radiation emitted from it. they are: • Black body radiation. The old quantum theory was developed in some part to explain the results of three experiments which could not be explained by classical physics.g. It didn’t take long for physicists to apply a Maxwell style statistical analysis to the waves of electromagnetic energy present in the cavity. Perry 2004 . They found the frequency distributions to be similar to Maxwell’s velocity distributions. • The Photoelectric effect. a kind of oven with a little hole for a small amount of heat (light. i.History 95 atom and ending in about 1924. the frequency gets higher. • Bright Line Spectra. This was called the ultraviolet catastrophe. This means that as the temperature was raised the radiation should keep getting stronger and stronger indefinitely. (figure 4. fortunately this doesn’t occur so the catastrophe is not in nature but in classical physics which The Temple of Quantum Computing .e. Black Body Radiation A black body absorbs all electromagnetic radiation (light) that falls on it and would appear black to an observer because it reflects no light. and their subsequent explanations are described in the next three sections. The new quantum theory began in 1925. 1858 .1947.c Riley T. the element of your electric stove goes from red hot to white hot as the temperature increases. and the ultraviolet catastrophe. If nature did indeed behave in this way you would get singed sitting in front of a fire by all the ultraviolet light coming out of it. These experiments. The colour of the light emitted is dependent on the temperature. The difference being is that classical physics saw waves as continuous which means that more and more waves could be packed into a ”box” as the wavelengths get smaller. radiation) to escape for observation.2006 . Because the radiation is confined in the cavity it settles down to an equilibrium distribution of the molecules in a gas.8) measured the distribution of radiation and energy over frequency in a cavity. Associates of Max Planck.

Planck imagined that the waves emitted from the black body were produced by a finite number of tiny oscillators (a kind of precursor to modern atoms). He couldn’t find a classical solution.5 The Photoelectric Effect If a light is shone onto certain kinds of material (e. (4. The results of several experiments had given the correct frequency distributions and it was Max Planck who found a formula that matched the results.96 History Figure 4. Which finally gives us the first important formula for quantum mechanics: E = hf where E is energy. Eventually he had to divide the energy into finite chunks of a certain size to fit his own radiation formula. f is frequency and h is Planck’s constant which is: h = 0. so grudgingly he used Boltzmann’s version of the second law of thermodynamics.7: Albert Einstein and Johann Jakob Balmer. Perry 2004 .000000000000000000000000006626.3) (4.c Riley T.2) 4. predicted something that doesn’t happen. some metals or semi conductors) then electrons are released. When this effect was examined it was found that the results of the experiments did not agree with classical electromagnetic theory which predicted that the energy of the released electron should depend on the intensity of the incident light wave. However it was found that the energy released was dependent not on intensity (an electron would come out no matter how low the intensity was) but on the frequency of the light. The Temple of Quantum Computing .g.2006 .1.

The spectrum for this. with dark regions in between. This is called an absorbtion spectrum.1955 (figure 4. if that light is concentrated and broken up into the separate colours by a prism. The Temple of Quantum Computing . Perry 2004 .c Riley T.6 Bright Line Spectra When a solid is heated and emits white light then. 1879 . we get a rainbow like spectrum (continuous spectrum) like the following: If we do the same thing with a hot gas emitting light then the spectrum consists of a number of bright lines that have the colours of the rainbow above.History 97 Albert Einstein.2006 . which is called an emission spectrum is shown below. 4. so the electron is ejected from the metal. If a cold gas is placed between a hot solid emitting white light and the prism we get the inverse of the above. shown below. With different kinds of metals it can be easier or harder for electrons to escape. Put simply a light particle hits the metal’s surface and its energy is transferred to an electron and becomes kinetic energy.1.7) showed that if we look at the light as a collection of particles carrying energy proportional to the frequency (as given by Planck’s law E = hf ) and if those particles can transfer energy to electrons in a target metal then the experimental results could be explained.

4) where R is the Rydberg constant of 3. Perry 2004 .c Riley T.7 Proto Quantum Mechanics During the last part of the 19th century it was discovered that a number of ”rays” were actually particles. 4. In 1885 Johann Jakob Balmer. The hot gas is emitting light at certain frequencies and example three shows us that the cold gas is absorbing light at the same frequencies. In a study of cathode ray The Temple of Quantum Computing .98 History Figure 4. 1856 . One of these particles was the electron. Thomson.7) derived a formula for the spectral lines of Hydrogen. These lines are different for each element. Which is: f =R 1 1 − 2 2 nf ni (4. The trouble was that no one knew how to explain the formula.1.29163 × 101 5 cycles/second and nf and ni are whole numbers. The explanation came in 1913 with Niels Bohr’s atomic model.1898 (figure 4. discovered by Joseph J. and they allow us to determine the composition of a gas even at astronomical distances. by observing its spectrum.1940 (figure 4.2006 . 1825 . Thomson.8).8: Max Planck and Joseph J.

History 99 Figure 4.9: Ernest Rutherford and Arnold Sommerfeld. Figure 4.10: Thomson’s atomic model.c Riley T. The Temple of Quantum Computing . Figure 4.2006 . Perry 2004 .11: Rutherford’s atomic model.

9). but the atomic model was thought to still follow the rules of classical physics. according to classical electromagnetic theory an orbiting electron.2006 . in 1907.stationary because. which was found by firing alpha particles (Helium ions) at gold foil and observing that. The new model was like a mini solar system with electrons orbiting the nucleus. Perry 2004 . However.11). this was questioned by Heisenberg) it would not radiate.1937 (figure 4. The Temple of Quantum Computing . 1871 . one would bounce back. so this restored stability to the atom. The frequency of the light emitted as a jump was given by Einstein’s formula: f= E h (4. This model had a tiny but massive nucleus surrounded by electrons (figure 4. very occasionally. Ernest Rutherford. In this scheme there was a lowest stationary state. However. later. even if the electron was orbiting in such a state (and. This first atomic model was called the Christmas pudding model. if the electron jumped from a stationary state to one of lower energy then the transmission was accompanied by the emission of a photon. Then. and all the atoms of an element emitted the same line spectrum.10). despite what electromagnetic theory said. These energies of the stationary states could be calculated from classical physics if one additional assumption was introduced: that the orbital angular momentum was an integer multiple of Planck’s constant. Thomson went on to help develop the first model of the atom which had his (negatively charged) electrons contained within a positively charged sphere (figure 4. Then the calculated frequencies were found to agree with those observed. developed a new model.5) where E is the difference in the energies of the stationary states involved. subject to centripetal acceleration (the electron is attracted by the positively charged nucleus) would radiate energy and so rapidly spiral in towards the nucleus. called the ground state below which the electron could not jump.c Riley T. vice versa there was absorption of light in going from a lower to a higher energy. But this did not happen: atoms were stable. To explain this Bohr assumed that the atom could exist in only certain stationary states .100 History tubes Thompson showed that electrically charged particles (electrons) are emitted when a wire is heated.

c Riley T. the shell number. In real terms the value of r is 5. h is Planck’s constant. (4.12).6) where r is the radius of the orbital. Of particular interest are the ground state at n = 1 and the excited state at n > 1 of an atom.7) The Temple of Quantum Computing .History 101 Figure 4. and m and q are the mass and charge of the electron. Quantum angular momentum: L=n h 2π .3 nanometres for n = 1. Perry 2004 . Bohr developed a formula for the radius of the electron orbits in a hydrogen atom: r= h2 4π 2 mq 2 n2 (4. He gave us the first of several quantum numbers which are useful in quantum computing. Bohr went on with this model to derive the Balmer’s formula for hydrogen by two postulates: 1.2006 .12: Bohr’s first atomic model. Bohr quantised electron orbits in units of Planck’s constant. So Bohr developed a model based on stable orbital shells which only gave a certain number of shells to each atom. n (see figure 4.

A jump between orbitals will emit or absorb radiation by: hf = Ei − Ef (4. It was soon discovered that m could not account for all the spectral lines produced by magnetic fields. Although very close. k to deal with the shape of the orbit.1951 (figure 4. Niels Bohr went on to explain the periodic table in terms of orbital shells with the outer most shell being the valence shell that allows binding and the formation of molecules.e. 2. Bohr then introduced quantum number m to explain the Zeeman effect which produced extra spectral lines when a magnetic field was applied to the atom (i.102 History Figure 4. 1868 . Wolfgang Pauli.8) where Ei is the initial energy of the electron and Ef is the final energy of the electron. the direction the field was pointing). it didn’t quite match up to the spectral line data.c Riley T.2006 . so we still use spin up and spin down to describe this property of an electron. 1900 . Arnold Sommerfeld.1958 (figure 4.9) then proposed a new model with elliptical orbits and a new quantum number was added. It was thought. The Temple of Quantum Computing . Pauli then described why electrons fill the higher energy levels and don’t just occupy the ground state which we now call the Pauli exclusion principle. Perry 2004 .13: Wolfgang Pauli and Louis de Broglie.13) hypothesised another quantum number to account for this. but not accepted by Pauli that the electron was ”spinning around” and it turns out that Pauli was right but the name stuck.

but of photons.1. assuming waves. Einstein looked at fluctuations of the energy about its average value. He stated: The Temple of Quantum Computing . one which you would get if light was made up of waves and the other if it was made up of particles. not of molecules. Perry 2004 .14: Werner Heisenberg and Erwin Schrodinger. So you had both particles and waves playing a part. The clue to this was Einstein’s observation that the high frequency part of Planck’s distribution for black body radiation (described by Wien’s law) could be derived by assuming a gas of photons and applying statistical mechanics to it. a few years after demonstrating the photoelectric effect. with the number of photons being proportional to the intensity.e. Louis de Broglie. 1892 . the energy transferred to/from an oscillator occurred in ”grains” less than h times the frequency of the oscillator). it was Einstein’s hypothesis that the energy in the field itself was quantised: that for certain purposes. In 1924. 4. By contrast.e. in the cavity. each with energy h times frequency. as in classical theory. the field behaved like an ideal gas. and observed that the formula obtained had two forms.8 The New Theory of Quantum Mechanics In 1909. Einstein used his photon hypothesis to obtain a simple derivation of Planck’s black body distribution. Hence we have wave-particle duality. was continuously distributed. Planck himself had not gone as far as Einstein: he had indeed assumed that the transfer of energy between matter (the oscillators in the walls of the cavity) and radiation was quantised (i. This was in contrast to the low frequency part (described by the Rayleigh-Jeans law) which could be successfully obtained using classical electromagnetic theory. i.History 103 ¨ Figure 4.13) extended the particle duality for light to all matter. But Planck had assumed the energy in the electromagnetic field.1987 (figure 4.2006 . Furthermore.c Riley T.

He then showed that Heisenberg’s matrix mechanics and his wave mechanics were equivalent. ¨ At around the same time Erwin Schrodinger. meaning electrons move around the nucleus guided by pilot waves.1961 (figure 4. Later we will see matrices cropping up in quantum computing.but pure mathematics.2006 . physical value. The first complete version of quantum mechanics was born. He also discovered that quantum mechanics does not follow the commutative law of multiplication i. de Broglie was able to show that Bohr’s orbital radii could be obtained by fitting a whole number of waves around the nucleus. When Max Born.104 History The motion of a particle of any sort is associated with the propagation of a wave. de Broglie then suggested the idea of electron waves be extended to bound particles in atoms. Perry 2004 . z) and. de Broglie waves and Bohr’s particles. when squared.1976 (figure 4. This gives us a new. This became matrix mechanics. again a duality. not a real. The probability amplitude is a function of the electron’s position (x. gives the probability of finding the electron in a unit volume at the point (x. It turns out that the results derived from this equation agree with the Bohr model.14).14) built on de Broglie’s work on matter waves. The new quantum theory was developed between June 1925 and June 1926. ¨ Max Born proposed that Ψ. 1882 .15) saw this he suggested that Heisenberg use matrices. y. It’s interesting to note that it was not observation. probabilistic atomic model.16 and The Temple of Quantum Computing . y.c Riley T. z). or visualisation that was used to deduce to theory . using a totally different and more simple atomic model (one that did not use orbits) worked out a code to connect quantum numbers and spectra. He developed a wave equation (for which Ψ is the solution) for the core of bound electrons. 1887 . in which there is a high probability that the electron will be found in a particular orbital shell. as in the Hydrogen atom. This gave an explanation of Bohr’s angular momentum quantum condition (see above). This is the idea of a pilot wave which guides a free particle’s motion. Werner Heisenberg.e pq = qp.1970 (figure 4. eventually all the spectral lines and quantum numbers were deduced for hydrogen. 1901 . the solution to Schrodinger’s equation can be interpreted as a probability amplitude. A representation of the ground state of hydrogen is shown in figure 4. So.

Einstein kept trying to refute it by thought experiment. This became know as the Copenhagen interpretation of quantum mechanics. he expanded Schrodinger’s equation.2006 . a superposition state (we’ll look at superposition soon). and predicted antimatter. He ¨ then put together various aspects of the work by Heisenberg. but Bohr always had an answer. Einstein did not like the Copenhagen interpretation and. 1902 . Schrodinger. which simply put refers to the situation of a cat being in both states of dead Ψ1 and alive Ψ2 until it is observed. The linear nature of the wave equation means that if Ψ1 and Ψ2 are two solutions then so is Ψ1 + Ψ2 . The uncertainty is due to the uncontrollable effect on the particle of any attempt to observe it (because of the quantum interaction. see 4.c Riley T.15) developed a new approach and the bra-ket notation we use for quantum computing. This is called Schr¨ dinger’s o cat.History 105 at the places where the density of points is high there is a high probability of finding the particle.1984 (figure 4. It states that the more accurate our knowledge of a particle’s position. His approach expanded to a quan¨ tum field theory. and Einstein’s relativity. the more inaccurate our knowledge of its momentum will be and vice versa. for a good deal of time. This signalled the breakdown of determinism. But in 1935 Einstein raised an issue that was to later have proThe Temple of Quantum Computing . This probabilistic interpretation of quantum mechanics implies the system is in both states until measured. the Heisenberg uncertainty principle which relates to the position and momentum of a particle. In 1927 Heisenberg made his second major discovery. incorporated spin. Perry 2004 .25). a paradox. Now back to Niels Bohr. and Born and concluded that the properties of a system (such as position and momentum) are undefined having only potential values with certain probabilities of being measured. In 1927 Niels Bohr described the concept of complementarity: it depends on what type of measurement operations you are using to look at the system as to whether it behaves like a particle or a wave. ¨ Schrodinger was unhappy with the probabilistic interpretation (superposition) and created a scenario that would show it was false. Paul Dirac.

106

Important Principles for Quantum Computing

Figure 4.15: Max Born and Paul Dirac.

Figure 4.16: Born’s atomic model. found implications for quantum computation and lead to the phenomenon we now call entanglement, a concept we’ll look at in a few pages.

4.2 Important Principles for Quantum Computing
The main parts of quantum mechanics that are important for quantum computing are: • Linear algebra. • Superposition. • Dirac notation. • Representing information. The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Important Principles for Quantum Computing • Uncertainty. • Entanglement. • The 4 postulates of quantum mechanics.

107

4.2.1

Linear Algebra

Quantum mechanics leans heavily on linear algebra. Some of the concepts of quantum mechanics come from the mathematical formalism, not thought experiments - that’s what can give rise to counter intuitive conclusions.

4.2.2

Superposition

Superposition means a system can be in two or more of its states simultaneously. For example a single particle can be travelling along two different paths at once. This implies that the particle has wave-like properties, which can mean that the waves from the different paths can interfere with each other. Interference can cause the particle to act in ways that are impossible to explain without these wave-like properties. The ability for the particle to be in a superposition is where we get the parallel nature of quantum computing: If each of the states corresponds to a different value then, if we have a superposition of such states and act on the system, we effectively act on all the states simultaneously. An Example With Silvered Mirrors Superposition can be explained by way of a simple example using silvered and half silvered mirrors [Barenco, A. Ekert, A. Sanpera, A. & Machiavello, C. 1996]. A half silvered mirror reflects half of the light that hits it and transmits the other half of the light through it (figure 4.17). If we send a single photon through this system then this gives us a 50% chance of the light hitting detector 1 and a 50% chance of hitting detector 2. It is tempting to think that the light takes one or the other path, but in fact it takes both! It’s just that the photo detector that measures the photon first breaks the superposition, so it’s the detectors that cause the randomness, not the half silvered mirror. This can be demonstrated The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

108

Important Principles for Quantum Computing

Figure 4.17: Uncertainty. by adding in some fully silvered mirrors and bouncing both parts of the superposed photon (which is at this point is in two places at once) so that they meet and interfere with each other at their meeting point. If another half silvered mirror (figure 4.18) is placed at this meeting point and if light was just particlelike we would expect that the light would behave as before (going either way with 50% probability), but the interference (like wave interference when two stones are thrown into a pond near each other simultaneously) causes the photon to always be detected by detector 1. A third example (figure 4.19) shows clearly that the photons travel both paths because blocking one path will break the superposition and stop the interference.

4.2.3 Dirac Notation
As described in the previous chapter Dirac notation is used for quantum computing. We can represent the states of a quantum system as kets. For example, an electron’s spin can be represented as |0 = spin up and |1 as spin down. The electron can be thought of as a little magnet, the effect of a charged particle spinning on its axis. When we pass a horizontally travelling electron through an inhomogeneous magnetic field, in say, the vertical direction, the electron eiThe Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Important Principles for Quantum Computing

109

Figure 4.18: Superposition 1.

Figure 4.19: Superposition 2.

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

110

Important Principles for Quantum Computing

ther goes up or down. If we then repeat this with the up electron it goes up, with the down electron it goes down. We say the up electron after the first measurement is in the state |0 and the down electron is in state |1 . But, if we take the up electron and pass it through a horizontal field it comes out on one side 50% of the time and on the other side 50% of the time. If we represent these two states as |+ and |− we can say that the up spin electron was in a superposition of the two states |+ and |− : 1 1 |0 = √ |+ + √ |− 2 2 such that, when we make a measurement with the field horizontal we project the electron into one or the other of the two states, with equal probabilities (given by the square of the amplitudes).
1 2

4.2.4 Representing Information
Quantum mechanical information can be physically realised in many ways. To have something analogous to a classical bit we need a quantum mechanical system with two states only, when measured. We have just seen two examples: electron spin and photon direction. Two more methods for representing binary information in a way that is capable of exhibiting quantum effects (e.g. entanglement and superposition) are: polarisation of photons and nuclear spins. We examine various physical implementations of these ”quantum bits” (qubits) in chapter 8.

4.2.5 Uncertainty
The quantum world is irreducibly small so it’s impossible to measure a quantum system without having an effect on that system as our measurement device is also quantum mechanical. As a result there is no way of accurately predicting all of the properties of a particle. There is a trade off - the properties occur in complementary pairs (like position and momentum, or vertical spin and horizontal spin) and if we know one property with a high degree of certainty then we must know almost nothing about the other property. That unknown property’s behaviour is essentially random. An example of this is a particle’s position and velocity: if we know exactly where it is then we know nothing The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Although the original hypothesis was later proven wrong (i. it was proven that quantum systems do not have local state before measurement). The results of their experiment seemed to show that quantum systems were defined. having local state BEFORE measurement.e. It has been postulated (and currently accepted) that particles in fact DO NOT have defined values for unknown properties until they are measured. The effect they demonstrated was still important. The reason we say that they communicate instantaneously is because they store no local state [Rae.2006 . Entanglement has applications in a wide variety of quantum algorithms and machinery.2.c Riley T. it has been proven that entangled particles have no local state. To become entangled. This indeterminacy is exploited in quantum cryptography (see chapter 7). and later became known as entanglement. but there is a statistical correlation between results of measurements on each particle that is hard to understand using classical physics. we can be sure of the value of velocity of the other one (before it is measured). two particles are allowed to interact. on measuring say. This is like saying that something does not exist until it is looked at. Perry 2004 .Important Principles for Quantum Computing 111 about how fast it is going. Because of this limitation particles can’t be used to transmit classical messages faster than the speed of light as we only know the states upon measurement.6 Entanglement In 1935 Einstein (along with colleagues Podolski and Rosen) demonstrated a paradox (named EPR after them) in an attempt to refute the undefined nature of quantum systems.7. The Temple of Quantum Computing . A. the velocity of one of them (regardless of the distance between them). Particles don’t exactly communicate. this is explained in section 6. 1996] and only have well defined state once they are measured. Entanglement is the ability for pairs of particles to interact over any distance instantaneously. they then separate and. As stated before. 4. some of which we’ll look at later.

The Temple of Quantum Computing .112 Important Principles for Quantum Computing 4. Later. The evolution of a closed system is a unitary transform. This means that we can totally describe the behaviour of a system by using unitary matrices. In a closed quantum system we need a way of describing the state of all the particles within it. The first postulate gives us a way to do this by using a single state vector to represent the entire system.7 The Four Postulates of Quantum Mechanics The theory of quantum mechanics has four main postulates. These are introduced here as simple sentences. 3. Perry 2004 . 1.2.the state at some stage |Ψ is related to the state at some previous stage (or time) |Ψ by a unitary transform |Ψ = U |Ψ .4.no measurement . and the affect those measurements have on that system. this would be C2 for a spin system. while the system is evolving under its own steam . Say the state is to be a vector in Cn .2006 . 2. in section 5. they will be explained in more detail in terms of quantum computing. Say that. Postulate four relates to combining or separating different closed quantum systems using tensor products.c Riley T. The third postulate relates to making measurements on a closed quantum system. 4.

A. This became known as Shor’s algorithm. 2000] and [Dawar. The first prototypes of quantum computers were also 113 .1 Elements of Quantum Computing 5.1. This section borrows heavily from [Nielsen. David Deutsch developed the basis for quantum computing between 1984 and 1985. building on this. Then in 1996 Lov Grover developed a fast database search algorithm (known as Grover’s algorithm). At around the same time the quantum complexity classes were developed and the quantum Turing machine was described. 5. Since there are only a few things a quantum computer does better than a classical computer it makes sense to do the bulk of the processing on the classical machine.1.1 Introduction Generally we’ll think of a quantum computer as a classical computer with a quantum circuit attached to it with some kind of interface between conventional and quantum logic.Chapter 5 Quantum Computing 5. L. The next major breakthrough came in 1994 when Peter Shor described a method to factor large numbers in quantum poly-time (which breaks RSA encryption). I. 2004] so the use of individual citations for these references has been dropped. & Chuang. M.2 History In 1982 Richard Feynman theorised that classic computation could be dramatically improved by quantum effects. A.

Quantum bits. but only during the computational phase of a quantum operation. Sanpera. the value of the bit cannot be in a superposition. can be made to work to our computational advantage. The amount of information stored during the ”computational phase” is essentially infinite .1. Ekert. and circuits. 1998]. & Machiavello.g. Physical implementations of quantum computers improved with a three qubit machine in 1999 and a seven qubit machine in 2000. gates. A. a qubit can become either: The Temple of Quantum Computing . A. There is no intermediate state between them. can on the other hand be in a state ”between” 0 and 1. i. & Ekert. The inaccessibility of the information is related to quantum measurement: When we attempt to readout a superposition state holding many values the state collapses and we get only one value (the rest get lost). A. Quantum computers perform operations on qubits which are analogous to conventional bits (see below) but they have an additional property in that they can be in a superposition. When measured. D. This is tantalising but.c Riley T.its just that we can’t get at it. In 1997 quantum error correction techniques were developed at Bell labs and IBM. 1996] and a 250 qubit register holds more numbers (superposed) than there are atoms in the universe! [Deutsch.e. A bit has the following two values: 0 and 1. A. in some cases. 5. A quantum register with 3 qubits can store 8 numbers in superposition simultaneously [Barenco.2006 .114 Elements of Quantum Computing built in 1996. this state is called a binary digit (or bit for short). It describes qubits. Perry 2004 .3 Bits and Qubits This section is about the ”nuts and bolts” of quantum computing. Single Qubits Classical computers use two discrete states (e. C. or qubits. states of charging of a capacitor) to represent a unit of information.

There may be. Once the qubit is measured it will remain in that state if the same measurement is repeated provided the system remains closed between measurements (see chapter 4). just like a classical bit. will collapse to states |0 or |1 is |α|2 for |0 and |β|2 for |1 . The percentages must add to 100%. The probability that the qubit’s state. |0 and |1 are actually vectors.e. They can be used to calculate the probabilities of the system jumping into |0 or |1 following a measurement or readout operation. In terms of their representation qubits must satisfy: |α|2 + |β|2 = 1. Generally. we readout 0 or 1. In terms of the above it essentially means the same thing as 0 and 1 (this is explained a little further on).c Riley T.Elements of Quantum Computing 115 |0 or |1 i. when measured. say a 25% chance a 0 is measured and a 75% chance a 1 is measured. α|0 + β|1 . they are called the computational basis states that form an orthonormal basis for the vector space C2 . This is the same as saying a spin particle can be in a superposition state but. The Temple of Quantum Computing . a qubit’s state during the computational phase is represented by a linear combination of states otherwise called a superposition state.2006 (5. when in a superposition. Here α and β are the probability amplitudes.1) . The | symbolic notation is part of the Dirac notation (see chapters 3 and 4). Perry 2004 . This the same thing as saying the probabilities add to 100%. it shows only one value (see chapter 4).

You may find these notational conventions being used: |0 = | → . Perry 2004 . . Our state vector in the case of one qubit is: |Ψ = α|0 + β|1 .6) Some examples of measurement probabilities are on the next page. 1 √ (|0 + |1 ) = |+ = | 2 1 √ (|0 − |1 ) = |− = | 2 (5. These bases are sometimes represented with arrows which are described below. and are referred to as rectilinear and diagonal which can say refer to the polarisation of a photon.4) . which is often shortened to just |+ .3) (5. Quantum computing also commonly uses 2 1 √ (|0 2 + |1 ) and 1 √ (|0 2 − |1 ) as a basis for C .2) The α and β might vary with time as the state evolves during the computation but the sum of the squares of α and β must always must be equal to 1.5) (5. and |− .2006 . (5. (5.c Riley T. The Temple of Quantum Computing .116 Elements of Quantum Computing The state vector |Ψ of a quantum system describes the state at any point in time of the entire system. |1 = | ↑ .

Example More measurement probabilities. So.2006 . 4 So 75% of the time we’ll measure a |0 and 25% of the time we’ll measure a The sign in the middle of the two values can change. 2 2 2 2 117 = 1 .Elements of Quantum Computing Example Measurement probabilities. When measuring in the basis {|0 .c Riley T. which affects the internal evolution of the qubit. √ 3 1 |Ψ = |0 − |1 . |1 } the sign is actually the relative phase of the qubit. 2 2 The probability of measuring a |0 is: 1 √ 2 The probability of measuring a |1 is: 1 √ 2 |1 . Formally we say they differ by a relative phase facThe Temple of Quantum Computing . 1 1 |Ψ = √ |0 + √ |1 . 2 = 1 . 4 = 1 . not the outcome of a measurement. α|0 + β|1 and α|0 − β|1 have the same output values and probabilities but behave differently during the computational phase. 2 2 = 3 . 2 So 50% of the time we’ll measure a |0 and 50% of the time we’ll measure a The probability of measuring a |0 is: √ 3 2 The probability of measuring a |1 is: 1 2 |1 . Perry 2004 .

2 π The Temple of Quantum Computing . −i 1 |Ψ = √ |0 + √ |1 . is determined entirely by the phase. as the global phase factor is not observable. Likewise the relative phase (which figures in interference effects) is unaffected if α and β are multiplied by a common phase factor. We can also say here that because −i = e−i 2 we have a phase of − π . Remembering that −i × −i = +1 we say the factor at the front of our state vector (−i) is a global phase factor. One reason for this is that the probabilities for the outcomes |α| and |β| are unaffected if α and β are each multiplied by the same complex number of magnitude 1.118 Elements of Quantum Computing tor. It is called a phase factor because it always has magnitude 1 and so its value. 2 can be rewritten as: 1 |Ψ = (−1) (|00 − |01 + |10 + |11 ). This is best described by an example (below). Perry 2004 .c Riley T. as a complex number. 2 2 can be rewritten as: |Ψ = −i 1 i √ |0 − √ |1 2 2 . Two states can differ by a global phase factor and still be considered the same. The other type of phase is called global phase.2006 . 2 Example More global phase. Example Global phase. So in the case of the qubits above they differ by a phase factor of -1. What this means is that if we have a state on n qubits we can put a complex factor in front of the entire state to make it more readable. 1 |Ψ = (−|00 + |01 − |10 + |11 ).

The state of a single qubit is a unit vector in C2 .c Riley T. (5.1: 2D qubit representations.1 which is similar to the way we represent polar coordinates for complex numbers. Perry 2004 .2006 .7) Two Dimensional Qubit Visualisation Single qubits can be represented in value and relative phase in two dimensions by the diagram in figure 5. So. The Ket | Part of Dirac’s notation is the ket (| ). α β is a vector. The graph shows the general form of 2D qubit The Temple of Quantum Computing .8) 1 0 (5. and is written as: α|0 + β|1 with |0 = and |1 = 0 1 .Elements of Quantum Computing |1 T 119 a        E |0 '   d d   d d d ‚ b c − |1 Figure 5. The ket is just a notation for a vector.

in terms of the angle θ and ϕ the Bloch sphere looks like this: (5.c Riley T.html.9) Note: An applet written by Jose Castro was used to generate the images of the Bloch sphere. What’s probably more helpful at this stage is to see where all of the potential states of a qubit lie on the Bloch sphere.120 representation where a = 1 √ |0 2 Elements of Quantum Computing + 1 √ |1 2 and b = 1 √ |0 2 − 1 √ |1 2 . This applet is available at http://pegasus. This diagram is ok for real numbered values of α and β but cannot accurately depict all the possible states of a qubit. 2 2 We can ignore the global phase factor in front so |Ψ becomes: θ θ |Ψ = cos |0 + eiϕ sin |1 .edu/ ∼jcastro/java/BlochSphere. Perry 2004 .ucf. We can say that the state of a single qubit can be written as: θ θ |Ψ = eiγ (cos |0 + eiϕ sin |1 ).cc. This is shown below with the points x. For this we need three dimensions.The Bloch Sphere The Bloch sphere is a tool with which the state of single qubit can be viewed in three dimensions and is useful for visualising all single qubit operations.10) (5. Three Dimensional Qubit Visualisation . 2 2 So.2006 . y . and z labelling each positive axis: ˆ ˆ ˆ The Temple of Quantum Computing .

individual qubits can be physically realised using various quantum two state systems. We now look at the equivalent of a register: i. e.g. Ions in a trap (see chapter 8). E. or orbital). Multiple Qubits The potential amount of information available during the computational phase grows exponentially with the size of the system. Perry 2004 .e.Elements of Quantum Computing 121 As stated in chapter 4. the energy level.g.e. This is because if we have n qubits the number of basis states is 2n . the number of qubits.c Riley T. i. forming a quantum register then there are four (= 22 ) The Temple of Quantum Computing . if we have two qubits. • Nuclear spins. • Ground and excited states of an atom (i. a composite system of qubits.e.2006 . here are a few ways this can be done: • Polarisations of a photon.

where ⊗ is the tensor product (see below). We can have up to 32 (= 25 ) basis states in a superposition. + αn−1 |N − 1 =     If N = 2n we require an n qubit register. + α2n −1 |11111 . |01 . We don’t have to represent values with 0s and 1s. α0 α1 α2 .2006 . and |11 . |10 . . .122 computational basis states: forming.11) Here |01 means that qubit 1 is in state |0 and qubit 2 is in state |1 . formally for the general case of n qubits this is can be written as: 2n −1 |αi |2 = 1. i. .    (5. Like a single qubit. αN − 1      . We actually have |01 = |0 ⊗ |1 . .13) Example n = 5 (5 qubits). etc.e.14) The Temple of Quantum Computing . probability amplitudes): |Ψ = α0 |00 + α1 |01 + α2 |10 + α3 |11 . Perry 2004 . A qudit has the following format in CN :      Ψ = α0 |0 + α1 |1 + α2 |2 + .c Riley T. i=0 (5. (5.12) Again all of the probabilities must sum to 1. Elements of Quantum Computing |00 .. (5.. the two qubit register can exist in a superposition of the four states (below we change the notation for the complex coefficients. Ψ = α0 |00000 + α1 |00001 + .

2006 .e. 1 1 1 (|00 + |01 + |10 + |11 ) = √ (|0 + |1 ) ⊗ √ (|0 + |1 ). Example Decomposition using a tensor product.Elements of Quantum Computing Tensor Products 123 A decomposition into single qubits of a multi-qubit system can be represented by a tensor product. (α0 |0 + α1 |1 ) ⊗ (β0 |0 + β1 |1 ) = α0 β0 |00 + α0 β1 |01 + α1 β0 |10 + α1 β1 |11 . We’ll first consider nonentangled states. Perry 2004 . i.15) Partial Measurement We can measure a subset of an n-qubit system.c Riley T. The Temple of Quantum Computing . (5. The simplest way to measure a subset of states is shown in the following example with two qubits. we don’t have to get read outs on all the qubits (some can be left unmeasured). ⊗. An example is presented on the next page. 2 2 2 A tensor product can also be used to combine different qubits.

3. We prepare a quantum system in the following state. Perry 2004 . If we measured a |0 the post measurement state is: |0 ⊗ α0 |0 + α1 |1 |α0 |2 + |α1 |2 (i. the probability of qubit two being a |0 is: pr(0) = |α0 |2 + |α2 |2 and its post measurement state would be: α0 |0 + α2 |1 |α0 |2 + |α2 |2 This logic can be extended to n qubits. 2.124 Example Elements of Quantum Computing measuring the first bit in a two qubit system. ⊗ |0 . the qubit we are going to measure is bolded. We now measure. so the probability of it being 0 is: pr(0) = |α0 |2 + |α1 |2 and. a non-entangled state would mean that all the probability amplitudes are non-zero: Ψ = α0 |00 + α1 |01 + α2 |10 + α3 |11 . if we measured a |1 measured the post measurement state is: |1 ⊗ α2 |0 + α3 |1 |α2 |2 + |α3 |2 .e. 1. |01 } subspace and the α2 and α3 terms drop out).2006 . Similarly. The Temple of Quantum Computing .c Riley T. We can do the same for qubit two. the probability of it being 1 is: pr(1) = |α2 |2 + |α3 |2 . we project on to the {|00 .

Elements of Quantum Computing 125 Quantum measurement can be described as a set {Mm } of linear operators with 1 ≤ m ≤ n where n is the number of possible outcomes. Perry 2004 . Now we must make sure that the second qubit is normalised. For a single qubit with an orhtonormal basis of |0 and |1 we can define measurement operators M0 = |0 0| and M1 = |1 1| (which are also both projectors). so we multiply it by a factor: √ 5 |Ψ = √ |0 ⊗ 30 This gives us state is: |Ψ = |0 ⊗ √ 2 √5 30 1 2 √ |0 + √ |1 5 5 5 + √ |1 ⊗ 30 3 4 |0 + |1 . Another way of looking at measuring the first bit in a two qubit 1 2 3 4 |Ψ = √ |00 + √ |01 + √ |10 + √ |11 30 30 30 30 When we measure qubit one the resulting states would look like this (unnormalised): |Ψ = |0 ⊗ 1 2 √ |0 + √ |1 30 30 for measuring a |0 and for measuring a |1 : |Ψ = |1 ⊗ 3 4 √ |0 + √ |1 30 30 .c Riley T.16) If the outcome is m then the state collapses to: Mm |Ψ † Ψ|Mm Mm |Ψ . So if we measure a |0 then our post measurement 1 2 √ |0 + √ |1 5 5 and if we measure a |1 then our post measurement state is: |Ψ = |1 ⊗ 3 4 |0 + |1 5 5 . The Temple of Quantum Computing .2006 . 5 5 √5 30 2 = 1 6 probability of measuring a |0 and a = 5 6 prob- ability of measuring a |1 . If we have a system in state |Ψ then outcome m has a probability of: † pr(m) = Ψ|Mm Mm |Ψ .17) Example system. (5. (5.

e. 30 30 Say we change our measurement basis to {|0 .2006 . pr(0) = Ψ|P0 ⊗ I|Ψ = Ψ| |0 0| ⊗ I|Ψ 2 1 = Ψ| √ |00 + √ |01 30 30 1 = 6 and this gives us a post-measurement state of: |Ψ = = P0 ⊗ I|Ψ √1 |00 30 Ψ|P0 ⊗ I|Ψ + √2 |01 30  1 6 √1 |0 30 = |0 ⊗  = |0 ⊗ + 1 6 √2 |1 30   1 2 √ |0 + √ |1 5 5 . The Temple of Quantum Computing . i. Elements of Quantum Computing Measurement of qubit one in a two qubit system using a simple 1 2 3 4 |Ψ = √ |00 + √ |01 + √ |10 + √ |11 . Perry 2004 .126 Example projector. P0 ⊗ I. We measure the probability of the first qubit being 0 by using P0 on qubit one and I on qubit two.c Riley T. If we wanted to measure the probability of the first qubit being 1 then we would use P1 ⊗ I. |1 } then we can represent projectors P0 and P1 as |0 0| and |1 1| respectively. 30 30 30 30 We find the probability of measuring a |0 by using a projector |00 00| + |01 01|: (|00 00| + |01 01|) 2 3 4 1 √ |00 + √ |01 + √ |10 + √ |11 30 30 30 30 = (|00 00| + |01 01|) |Ψ 1 2 = √ |00 + √ |01 .

u|v = 0 means |u and |v are not orthogonal. This can be useful for computational purposes. this means that they are connected.e. i. (5. i=1 Mi† Mi = I. The unitary transform is called the observable. i=1 pr(i) = i=1 Ψ|Mi† Mi |Ψ = 1 this is m the result of the completeness equation.19) where m is each eigenvalue and Pm is a projector made up of Pm = |m m|. Perry 2004 .4 Entangled States Subatomic particles can be entangled. First we need to find the spectral decomposition of OM (Z for example). Their effect on each other upon measurement is instantaneous.2006 .Elements of Quantum Computing Properties: m m 127 All probabilities sum to 1.c Riley T. Projective Measurements Projective measurements are a means by which we can accomplish two tasks.e.18) Note: our basis needs to be orthogonal.1. otherwise we can’t reliably distinguish between two basis states |u and |v . Consider the following state (which is not entangled): 1 √ (|00 + |01 ) 2 The Temple of Quantum Computing . regardless of distance. So we need a unitary transform U and |Ψ to perform a measurement. Measure |Ψ . Apply a unitary transform to |Ψ . i. which is denoted here by OM . 5. for OM we have: OM = m mPm (5. 2. they are: 1.

2006 . 2 2 When expanded this is: Measuring the first qubit gives us |00 50% of the time and |11 50% of the time. see section 6. This is a distinct advantage over classical computation. The Temple of Quantum Computing . i.128 it can be expanded to: Elements of Quantum Computing 1 1 √ |00 + √ |01 + 0|10 + 0|11 .7) we find that the results for the qubits are correlated. Example Consider: 1 √ (|00 + |11 ) . If we try this on an entangled state (in this case an EPR pair or Bell state.e. Perry 2004 . 2 1 1 √ |00 + 0|01 + 0|10 + √ |11 . This type of correlation can be used in a variety of ways in application to the first or second qubit to give us correlations that are strongly statistically connected. Measuring entangled states accounts for the correlations between them. So the second qubit is always the same as the first.c Riley T. The next example show the measurement of a partially entangled state. 2 2 Upon measuring the first qubit (a partial measurement) we get 0 100% of the time and the state of the second qubit becomes: 1 1 √ |0 + √ |1 2 2 giving us equal probability for a 0 or a 1. we get two qubit values for the price of one measurement.

Elements of Quantum Computing Example The following state vector represents an entangled system. 3 Now say we measure qubit 1. Perry 2004 .1. and apply a sequence of unitary operators (quantum gates) the result is a quantum circuit. so we multiply it by a factor: √ |Ψ = 5 |0 ⊗ 3 2 1 √ |0 + √ |1 5 5 + i2 |1 ⊗ |0 . The Temple of Quantum Computing . 2 i2 1 |Ψ = |01 + |10 + |00 . representing one or more qubits. Upon measuring a |1 the state collapses to: |Ψ = |1 ⊗ |0 . Input states U1 U2 NM U3 This gives us a simple form of quantum circuit (above) which is a series of operations and measurements on the state of n-qubits. Each operation is unitary and can be described by an 2n × 2n matrix. Upon measurement of |0 the state collapses to: |Ψ = |0 ⊗ 2 1 √ |0 + √ |1 5 5 .2006 . We now take a register and let gates act on qubits. 3 Now we must make sure that the second qubit is normalised. 5. in analogy to a conventional circuit.5 Quantum Circuits If we take a quantum state.c Riley T. 3 3 3 129 If we separate out the qubits (tensor decomposition) The state looks like this (unnormalised): |Ψ = |0 ⊗ 2 1 |1 + |0 3 3 + |1 ⊗ i2 |0 .

we have a different circuit for each algorithm). a gate acting on the qubit can be represented by a 2 × 2 matrix. The only constraint these gates have to satisfy (as required by quantum mechanics) is that they have to be unitary. The quantum equivalent of a NOT gate.e. If (before the gate is applied) |α|2 + |β|2 = 1 then.20) where α and β are the values for the probability amplitudes for the qubit after the operation has been applied. The operator’s matrix must be unitary because the resultant values must satisfy the normalisation condition. has the following form: 0 1 1 0 .c Riley T. the boxes containing Un are quantum logic gates (or a series of gates) and the meter symbol is a measurement. Single Qubit Gates Just as a single qubit can be represented by a column vector. input.130 Elements of Quantum Computing Each of the lines is an abstract wire. U † U = I. and output mechanisms implement quantum algorithms. Unlike classical circuits which can contain loops. wires. the gates. The Temple of Quantum Computing . Together. The matrix acts as a quantum operator on a qubit. for example. This allows for a lot of potential gates. Perry 2004 . Unitarity implies that the probability amplitudes must still sum to 1. where a unitary matrix is one that satisfies the condition underneath. quantum circuits are ”one shot circuits” that just run once from left to right (and are special purpose: i. It should be noted that it is always possible to rearrange quantum circuits so that all the measurements are done at the end of the circuit.2006 . after the gate is applied: |α |2 + |β |2 = 1 (5.

|1 → I → |1 .28) 0 1 1 0 (5.23) (5.24) 1 0 0 1 (5.c Riley T. X σ1 = σX = X = which gives us the following: |0 → X → |1 . Perry 2004 . σ0 = I = which gives us the following: |0 → I → |0 . (5. |1 → X → |0 . α|0 + β|1 → X → β|0 + α|1 .26) (5. Pauli X Gate The Pauli X gate is a quantum NOT gate.21) The operation of the Pauli X gate can be visualised on the Bloch sphere as follows: The Temple of Quantum Computing .25) (5.2006 .27) (5.Elements of Quantum Computing 131 Here are some examples: Pauli I Gate This is the identity gate.22) (5. α|0 + β|1 → I → α|0 + β|1 .

31) (5.30) (5.132 Elements of Quantum Computing Here (and in subsequent images) the blue (dark) point is the original state vector and the green (light) point is the state vector after the transformation.2006 . α|0 + β|1 → Y → −βi|0 + αi|1 .32) This gate flips a qubit’s sign. Pauli Z Gate (5. i. changes the relative phase by a factor of -1. Z 1 0 σ3 = σY = Z = 0 −1 (5. Perry 2004 .e. |1 → Y → −i|0 .c Riley T.29) (5.33) The Temple of Quantum Computing . Pauli Y Gate Y 0 −i i 0 σ2 = σY = Y = which gives us the following: |0 → Y → i|1 .

38) (5.c Riley T. The Temple of Quantum Computing .Elements of Quantum Computing which gives us the following: |0 → Z → |0 . α|0 + β|1 → S → α|0 + βi|1 .40) Note. |1 → T → e |1 .39) (5.35) (5. the Phase gate can be expressed in terms of the T gate (see below): S = T2 π 8 (5. |1 → Z → −|1 .45) iπ 4 If we apply T again we get the same as applying S once. Perry 2004 .34) (5.44) (5. (5.37) (5. α|0 + β|1 → T → α|0 + ei 4 β|1 .2006 .42) (5.41) Gate (T Gate) T 1 0 π T = which gives us the following: |0 → T → |0 . α|0 + β|1 → Z → α|0 − β|1 . π 0 ei 4 (5. Phase Gate S 1 0 0 i 133 (5. |1 → S → i|1 .43) (5.36) S= which gives us the following: |0 → S → |0 .

2006 . 2 (2) We can put |0 into state |− by using an H gate followed by a Z gate : 1 1 |0 → H → √ (|0 + |1 ) → Z → √ (|0 − |1 ).46) 1 −1 α|0 + β|1 → H → α +β . it turns a |0 or a |1 into a superposition (note the different sign).49) Example Using H and Z gates and measuring in the {|+ . (1) We can put |0 into state |+ by using an H gate: 1 |0 → H → √ (|0 + |1 ).48) 1 1 (5. 2 1 |1 → H → √ (|0 − |1 ). |− } basis. H H= which gives us the following: 1 |0 → H → √ (|0 + |1 ).47) (5.134 Hadamard Gate Elements of Quantum Computing Sometimes called the square root of NOT gate. (5. 2 |0 + |1 √ 2 |0 − |1 √ 2 (5. This gate is one of the most important in quantum computing.c Riley T. 2 2 The operation of the H gate can be visualised on the Bloch sphere as follows: The Temple of Quantum Computing . Perry 2004 . We’ll use this gate later for a demonstration of a simple algorithm.

The Temple of Quantum Computing . 1|1 = 1. Instead of doing all that math. we get: X(α|0 + β|1 ) = (|1 0| + |0 1|)(α|0 + β|1 ) = |1 0|(α|0 + β|1 ) + |0 1|(α|0 + β|1 ) = α|1 1 + β|1 0 + α|0 0 + β|0 1 = β|0 + α|1 .Elements of Quantum Computing 135 Outer Product Notation A handy way to represent gates is with outer product notation. for example a Pauli X gate can be represented by: |1 0| + |0 1|. For each component of the sequence.c Riley T. just think of it this way. For the above it’s useful to remember the following: 0|0 = 1. u| from |v u|.2006 . Perry 2004 . and the new qubit’s coefficient will be the old qubit’s coefficient for the ket part |v . 0|1 = 0. 1|0 = 0. take the bra part. When applied to α|0 + β|1 .

. and |1 with eigenvalues of 1 and 1 respectively. spectral decomposition. Using the spectral decomposition theorem: I = 1 · |0 0| + 1 · |1 1| = |0 0| + |1 1|. Perry 2004 .50) X has eigenvectors 1 √ (|0 2 + |1 ). . (5. so for the matrix: α00 α01 α10 α11 The outer product representation looks like: α00 |0 0| + α01 |0 1| + α10 |1 0| + α11 |1 1|. −i|0 1| and β|1 becomes −iβ|0 and finally we get: |Ψ = −iβ|0 + iα|1 . Elements of Quantum Computing Say we use this method on the Pauli Y outer product representai|1 0| − i|0 1|. Now we take the second part. eigenvalues. When applied to |Ψ = α|0 + β|1 ) we’ll see what we get: The first part of the outer product notation is i|1 0| so this means we take the α|0 part of |Ψ and convert it to iα|1 so our partially built state now looks like: |Ψ = .c Riley T. I has eigenvectors |0 . and 1 √ (|0 2 − |1 ) with eigenvalues of 1 and -1 The Temple of Quantum Computing . Further Properties of the Pauli Gates Next we’ll look at the eigenvectors. Finally. + iα|1 . and outer product representation of the Pauli gates. the coefficients of outer product representations are the same as the matrix entries.136 Example tion.2006 . .

The Pauli matrices are: Unitary (σk )† = I ∀ k. 1 1 1 1 X = 1 · √ (|0 + |1 ) √ ( 0| + 1|) + (−1) · √ (|0 − |1 ) √ ( 0| − 1|) 2 2 2 2 = |1 0| + |0 1|.2006 .61) = e−iθZ/2 .57) = e−iθX/2 . and RZ . 137 (5. RY . 1 √ (−i|0 2 + |1 ).c Riley T. RX = θ cos 2 θ −i sin 2 θ −i sin 2 θ cos 2 (5. and |1 with eigenvalues of 1 and -1 respectively. Hermitian (σk )† = σk ∀ k. Z = 1 · |0 0| + (−1) · |1 1| = |0 0| − |1 1|.51) Y has eigenvectors -1 respectively.60) (5. Rotation Operators There are three useful operators that work well with the Bloch sphere.58) (5. RZ = e−iθ/2 0 e 0 −iθ/2 (5.Elements of Quantum Computing respectively.59) = e−iθY /2 . (5. Perry 2004 . These are the rotation operators RX .54) (5. RY = θ θ cos 2 − sin 2 θ sin 2 θ cos 2 (5. and 1 √ (|0 2 − i|1 ) with eigenvalues of 1 and 1 1 1 1 Y = 1 · √ (−i|0 + |1 ) √ (i 0| + 1|) + (−1) · √ (|0 − i|1 ) √ ( 0| + i 1|) 2 2 2 2 = i|1 0| − i|0 1|.56) (5. The Temple of Quantum Computing .52) Z has eigenvectors |0 .53) (5.55) (5.

Perry 2004 . So if we apply the gate to state |Ψ = |1 we get the following: 1 √ 2 1 √ 2 1 − √2 1 √ 2 0 1 = 1 − √2 1 √ 2 1 1 = − √ |0 + √ |1 2 2 1 1 = √ |0 − √ |1 .c Riley T. Y.138 The rotation operators can be rewritten as Elements of Quantum Computing θ θ cos I − i sin Pσ 2 2 where Pσ means a Pauli operator identified by σ = X. Because it is a two qubit gate it is represented by a The Temple of Quantum Computing . 2 2 At that last step we multiplied the entire state by a global phase factor of −1. Example We can represent RY (90◦ ) by the following matrix: 1 √ 2 1 −1 1 1 = 1 √ 2 1 √ 2 1 − √2 1 √ 2 . (5. |a |b •   |a |b ⊕ a In the case of the CNOT gate. where the control line is unaffected by the unitary transformation.2006 . or Z. Multi Qubit Gates A true quantum gate must be reversible. this time with emphasis on quantum computing. this requires that multi qubit gates use a control line. We’ll look again at the reversible gates that were introduced in chapter 2.62) In fact if we assume different angles for θ then all single qubit gates can be represented by the product of RY and RZ . the ⊕ is a classical XOR with the input on the b line and the control line a.

69) (5.64) (5. |0 (α|0 + β|1 ) → CNOT → α|00 + β|01 .68) (5.66) (5. |1 (α|0 + β|1 ) → CNOT → α|11 + β|10 . (α|0 + β|1 )|0 expanded is α|00 + β|10 .2006 . so in matrix form we have:            0 1 0 0  0   0        0 0 0 1  β  =  0       0 0 1 0 0 β = α|00 + β|11 . (α|0 + β|1 )|1 → CNOT → α|01 + β|10 .c Riley T.67) (5.63) (5. |10 → CNOT → |11 .70) Example Evaluating (α|0 + β|1 )|0 → CNOT → α|00 + β|11 .Elements of Quantum Computing 4 × 4 matrix:     0 1 0 0     0 0 0 1    0 0 1 0 which gives the following: |00 → CNOT → |00 . |11 → CNOT → |10 .65) (5. |01 → CNOT → |01 . Perry 2004 . 1 0 0 0 α α The Temple of Quantum Computing . 1 0 0 0  139 (5.

|11 → NOT2 → |10 .71)    1 0 0 0     0 0 0 1    0 0 1 0 which gives the following: |00 → NOT2 → |01 . |10 → I ⊗ X → |11 . Viola. Dziarmaga.74) (5. 2002]: NOT2 = I ⊗ X =  1 0 0 1 ⊗ 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0    . E. Dalvit. Perry 2004 .81) The Temple of Quantum Computing . & Zurek.75) Although it’s not a commonly used gate it’s interesting to note that the gate can be represented as a Kronecker product of I and X as follows [Knill. Gubernatis. shown below: |00 → I ⊗ X → |01 .73) (5.78) (5. J. Gurvits. as well as using the NOT2 notation we can use the tensor product of Pauli gates on qubits one and two.79) (5.c Riley T.72) (5. 0 1 0 0 (5.140 Qubit Two NOT Gate Elements of Quantum Computing As distinct from the CNOT gate we have a NOT2 gate. H.80) (5. J. G. |10 → NOT2 → |11 .77) (5.H. |11 → I ⊗ X → |10 . D.   (5.2006 . Barnum. |01 → I ⊗ X → |00 . W. Laflamme. R. L.76)  1  =   0 So. (5. which just does NOT on qubit two and has the following matrix representation:   (5. L. Ortiz. |01 → NOT2 → |00 .

but impossible in quantum computing because of the no cloning theorem (see chapter 6). and FANOUT. Perry 2004 .Elements of Quantum Computing Toffoli Gate 141 The Toffoli gate was first introduced in chapter 2. which is classical bit copying (but we can’t copy superposed probability amplitudes). |a |b |c • •   |a |b |c The Toffoli gate can simulate NAND gates and it can perform FANOUT.c Riley T.2006 . The most important property being that any classical circuit can be emulated by using Toffoli gates. NOT. T. This gate can simulate AND. CROSSOVER. Fredkin Gate Also introduced in chapter 2. and S gates. Here we’ll look at some properties that relate to quantum computing. the Fredkin gate is another three qubit gate. |a |b |c • × × |a |b |c The Temple of Quantum Computing . A Toffoli gate can be simulated using a number of H. it also has the interesting property that it conserves 1’s. FANOUT is easy in classical computing.

1 Common Circuits Controlled U Gate Let U be a unitary matrix. 2. 1.2 Important Properties of Quantum Circuits Quantum circuit diagrams have the following constraints which make them different from classical diagrams.c Riley T. if the control qubit is |1 then The Temple of Quantum Computing . As stated in chapter 2.2. 5. No FANOUT. 3.2006 . They are acyclic (no loops). 5. i. Garbage bits are useless qubits left over after computation and ancilla bits are extra qubits needed for temporary calculations. as we can’t copy a qubit’s state during the computational phase because of the no-cloning theorem (explained in chapter 6). and therefore not unitary.142 Important Properties of Quantum Circuits x Classical circuit f (x) x Quantum circuit ancilla bits f (x) garbage bits Figure 5. All of the above can be simulated with the use of ancilla and garbage bits if we assume that no qubits will be in a superposition (figure 5.2). as FANIN implies that the circuit is NOT reversible. Perry 2004 .2: Garbage and ancilla bits. No FANIN.e. which uses an arbitrary number of qubits. A controlled U gate is a U gate with a control line.

otherwise they are left alone. • 143 U Bit Swap Circuit This circuit swaps the values of qubits between lines.Important Properties of Quantum Circuits U acts on its data qubits.c Riley T. × × × × |1 |0 |0 |1 × × |b |a •     •   |b |a • The Temple of Quantum Computing .2006 . |a |b The circuit can be simplified to: |a |b Here are some examples: |0 |1 |1 |0 Copying Circuit If we have no superposition then we can copy bits in a classical sense with a CNOT. Perry 2004 .

|β01 . Which is not a copy of the original state because: (α|0 + β|1 )(α|0 + β|1 ) = α|00 + β|11 .2006 . when it is copied it must first be measured to be copied. We’ll represent a Bell state circuit by β. The information held in the probability amplitudes α and β is lost. •   The Temple of Quantum Computing . Bell State Circuit This circuit produces Bell states that are entangled.c Riley T. and |β11 . α|00 + β|10 → CNOT → α|00 + β|11 . A qubit in an unknown state (as an input) cannot be copied. Perry 2004 . and the individual Bell states as |β00 .144 |a |0 |0 |0 |1 |0 Important Properties of Quantum Circuits •   |a |a |0 |0 |1 |1 •   •   But when we use a superposition as input: α |0 + β |1 |0 The combined state becomes: (α|0 + β|1 )|0 = α|00 + β|10 . |β10 .

X|1 = |0 ) → √ (|10 + |01 ). − |10 ) = |β11 . say we start with β00 . This is described below and the combined state is shown after the gate’s operation with Alice’s qubit shown bolded: 1 |00 → I → √ (|00 + |11 ). 2.Important Properties of Quantum Circuits |a H • |βxx |b   145 1 |00 → β → √ (|00 2 1 |01 → β → √ (|01 2 1 |10 → β → √ (|00 2 1 |11 → β → √ (|01 2 Superdense Coding + |11 ) = |β00 . Perry 2004 . by using entangled pairs.2006 1 √ (|00 2 1 √ (|00 2 + |11 ) and − |11 ). They then move apart to an . Here’s how: 1. 2 3. 2 1 |11 → XZ → √ (|01 − |10 ). 2 1 |10 → X(X|0 = |1 . It’s possible. she applies a gate (or gates) to her qubit. − |11 ) = |β10 . Alice now sends her qubit to Bob via a classical channel. This means that Alice has the bolded qubit in Bob has the bolded qubit in arbitrary distance. Z|1 = −|1 ) → √ (|00 − |11 ). + |10 ) = |β01 .c Riley T. to communicate two bits of information by transmitting one qubit. Initially Alice and Bob each take one half of an EPR pair. 2 1 |01 → Z(Z|0 = |0 . The Temple of Quantum Computing . Depending on which value Alice wants to send to Bob.

Perry 2004 . 1 √ (α|0 − β|1 ) → H → |1 . 1 √ (α|00 2 1 √ (α|10 2 1 √ (α|00 2 1 √ (α|01 2 1 + β|11 ) → CNOT → √ (α|00 2 1 + β|01 ) → CNOT → √ (α|01 2 1 − β|11 ) → CNOT → √ (α|00 2 1 − β|10 ) → CNOT → √ (α|01 2 1 + β|10 ) = √ (α|0 2 1 + β|11 ) = √ (α|0 2 1 − β|10 ) = √ (α|0 2 1 − β|11 ) = √ (α|0 2 + β|1 )|0 . superdense coding takes a quantum state to two classical bits.e. 2 1 √ (α|0 + β|1 ) → H → |0 . − β|1 )|0 → (H ⊗ I) → |10 . + β|1 )|1 → (H ⊗ I) → |01 .c Riley T. − β|1 )|0 . Teleportation Circuit Teleportation is basically the opposite of superdense coding. 2 So Bob gets the following: 1 √ (α|0 2 1 √ (α|0 2 1 √ (α|0 2 1 √ (α|0 2 + β|1 )|0 → (H ⊗ I) → |00 . Teleportation takes two classical bits to one quantum state.146 Important Properties of Quantum Circuits 4. Bob can now measure the two qubits in the computational basis and the result will be the value that Alice wanted to send. i. 5. Alice’s circuit |Ψ β00 •   H NM NM The Temple of Quantum Computing . + β|1 )|1 . − β|1 )|1 → (H ⊗ I) → |11 . Bob now uses a CNOT which allows him to ”factor out the second qubit” while the first one stays in a superposition.2006 . Now Bob applies an H gate to the first bit to collapse the superposition. − β|1 )|1 .

This means that Alice has the bolded qubit in 1 √ (|00 2 − |11 ) and Bob has the bolded qubit in 1 √ (|00 2 − |11 ). 2 This gives the following combined state (Alice’s qubits are bolded): 1 |Ψ = √ (α|000 + α|011 + β|100 + β|111 ). including Bob’s qubit. i. 2. Alice has a qubit in an unknown state: |Ψ = α|0 + β|1 . the qubit we want to teleport (or H ⊗ I ⊗ I for the combined system): 1 (α(|000 + |100 + |011 + |111 ) + β(|010 − |110 + |001 − |101 )). 1 √ (α|000 + α|011 + β|110 + β|101 ).c Riley T. Perry 2004 .Important Properties of Quantum Circuits Bob chooses one of the following four circuits β00 β00 β00 β00 I X Z X Z |Ψ |Ψ |Ψ |Ψ 147 1. Which she combines with her entangled qubit: (α|0 + β|1 ) 1 √ (|00 + |11 ) . They then move apart to an arbitrary distance. Note . Like superdense coding. Alice then applies an H gate to her first qubit. 2 3. initially Alice and Bob each take one half of an EPR pair. say we start with β00 . 2 4.e. Alice then applies a CNOT.This is like using (CNOT⊗I) on the combined three qubit system.2006 . 2 The Temple of Quantum Computing .

c Riley T. or a |11 ) to Bob. This is helpful because sometimes we are limited in what we can use to build a quantum circuit. This result resembles the classical result that any boolean function can be implemented with NAND gates. a |00 . Bob now may use X and/or Z gate(s) to fix up the phase and order of the probability amplitudes. Perry 2004 .3 The Reality of Building Circuits There is a general theorem: Any unitary operation on n qubits can be implemented using a set of two qubit operations. Summarised below are the gates he must use: Case 00 = α|0 + β|1 → I → α|0 + β|1 . Alice now performs measurements on her state to determine which of the above bolded states her qubits are in. (he selects gates based on what Alice tells him) so that the result restores the original qubit. 6.e. 1 = (|00 α|0 + |10 α|0 + |01 α|1 + |11 α|1 + |01 β|0 − |11 β|0 2 + |00 β|1 − |10 β|1 ). |10 . 5. Case 10 = α|0 − β|1 → Z → α|0 + β|1 . Case 01 = α|1 + β|0 → X → α|0 + β|1 .2006 .3.1 Building a Programmable Quantum Computer Is it Possible to Build a Programmable Quantum Computer Can we build a programmable quantum computer? This means a quantum computer that has an architecture similar to Von Neumann (or Harvard) architecture? No! This is because: The Temple of Quantum Computing . 5. 5.148 The Reality of Building Circuits Now we rearrange the state to move amplitudes α and β so that we can read the first two bits leaving the third in a superposition. Case 11 = α|1 − β|0 → XZ → α|0 + β|1 . 1 = (|00 (α|0 + β|1 ) + |01 (α|1 + β|0 ) + |10 (α|0 − β|1 ) 2 + |11 (α|1 − β|0 )). She then communicates via a classical channel what she measured (i. This can include CNOTs and other single bit operations. |01 .

Example The simplest system we are interested in is a qubit which is in C2 . A qubit is a unit vector |Ψ in C. |1 }). A. 5.. 2002].4. Most of the time we’ll attach an orthonormal basis (like {|0 . If we were to have a programmable quantum computer our ”program” would consist of one or more unitary operators. M. 5. A..2 Postulate Two Simple form The Temple of Quantum Computing .|Un [Nielsen.The Four Postulates of Quantum Mechanics 149 Distinct unitary operators U0 ..c Riley T.4 The Four Postulates of Quantum Mechanics Now we can look at the four postulates in a bit more detail than in chapter 4. in terms of quantum computing.. We will use a state space called a Hilbert space.Un require orthogonal programs |U0 . 5. Perry 2004 . Our qubit can be described by: |Ψ = α|0 + β|1 = α β here α and β are known as probability amplitudes and we say the qubit is in a quantum superposition of states |0 and |1 . M.4.1 Postulate One An isolated system has an associated complex vector space called a state space.2006 . Since there are an infinite number of these unitary operators the program register would have to be infinite in size (that is our input to the quantum computer that contains the program) [Nielsen. 2002] This is called the no programming theorem. The state of the quantum system can be described by a unit vector in this space called a state vector. .

¨ Note: We can rewrite the above in terms of Schrodinger’s equation. . |On }. |O1 . because: U † U |Ψ = |Ψ .2006 (5. t2 ) is a unitary operator than can vary The history of the quantum system does not matter as it is completely described 5.83) (5. . . The Temple of Quantum Computing .82) here t1 and t2 are points in time and U (t1 . We can also say that the process is reversible. Perry 2004 .4. by the current state (this is know as a Markov process). but that is beyond the scope of this paper.c Riley T.150 The Four Postulates of Quantum Mechanics An isolated (closed) system’s evolution can be described by a unitary transform. |Ψ = U |Ψ . (5. We’ll measure a particular outcome j with probability: pr(j) = | Oj |Ψ |2 .3 Postulate Three Simple form This deals with what happens if |Ψ is measured in an orthonormal basis: {|O1 . Example If we measure in the computational basis we have: pr(0) = | 0|Ψ |2 = | 0|(α |0 + β |1 )|2 = |α|2 and pr(1) = |β|2 .85) . Form including time If we include time (as quantum interactions happen in continuous time): |Ψ(t2 ) = U (t1 . . t2 )|Ψ(t1 ) with time.84) (5.

V2 . Then we have a larger quantum system B such that A ⊂ B.The Four Postulates of Quantum Mechanics 151 After the measurement the system is in state |Oj .c Riley T. Pm ) to filter out everything other than the subspace we are looking for (i. |O2 . Vm which are connected in the following way: V = V1 ⊕ V2 ⊕ .2006 . . . Example The state vector: |Ψ = (α|O1 + β|O2 ) + γ|O3 can be rewritten as: V (|O1 . . . ⊕ Vm . projector P1 on V1 (|e1 . The Temple of Quantum Computing .e. |On is part of or comprised of one or many of the orthogonal subspaces V1 . we have an orthonormal basis A = {|e1 . If we measure A what is the effect on B? We can say that |O1 . . . . . |O3 ) = V1 (|e1 . .e.e. . Projectors Suppose we have a larger quantum system which is a combination of smaller systems. . Perry 2004 . . i. . If |u1 and |u2 are not orthogonal (i. Example From the last example. |e2 ) gives us: P1 (α|e1 + β|e2 + γ|e3 ) = α|e1 + β|e2 . |en } where n is the dimension of A. (5. .86) We can use projectors (P1 . . |e2 ) ⊕ V2 (|e3 ). everything orthogonal to our subspace V ). u1 |u2 = 0) then we can’t reliably distinguish between them on measurement. . . This is because measurement disturbs the system. .

. pr(j) = Ψ|Pj |Ψ leaving the system in the post measurement state: Pj |Ψ .152 The Four Postulates of Quantum Mechanics Formally. (5. pr(2) = Ψ|P2 |Ψ   α   = [α∗ β ∗ γ ∗ ]  0  γ = |γ|2 . . |1 ) and P2 on V2 (|2 ) gives us: pr(1) = Ψ|P1 |Ψ     = [α∗ β ∗ γ ∗ ]  β  0 = |α|2 + |β|2 . Ψ|Pj |Ψ Example Given a qutrit |Ψ = α|0 + β|1 + γ|2 ). So our separated look like this: |Ψ1 = = |Ψ2 = P1 |Ψ Ψ|P1 |Ψ α|0 + β|1 |α|2 + |β|2 P2 |Ψ .88) (5. Perry 2004 . . Pm is a set of projectors which covers all the orthogonal subspaces of the state space.c Riley T.2006 . |γ|2 The Temple of Quantum Computing .87) P1 on V1 (|0 . 0 Ψ|P2 |Ψ γ|2 = . if P1 . upon measuring |Ψ we have. .

Example If |Ψ = α00 |00 + α01 |01 + α10 |10 + α11 |11 : For measuring qubit one in the computational basis we get |0 with probability: pr(0) = Ψ|P0 ⊗ I|Ψ = (α00 |00 + α01 |01 + α10 |10 + α11 |11 ) • (α00 |00 + α01 |01 ) = |α00 |2 + |α01 |2 .89) The Temple of Quantum Computing . So the state spaces of the individual systems are combined so: Cn ⊗ Cn = Cn . e. 5. Perry 2004 .c Riley T.2006 . An example is on the next page. If the system to be measured in the basis {|O1 . the following example uses the tensor product which is also part of postulate 4.The Four Postulates of Quantum Mechanics 153 More importantly we can look at partial measurement of a group of qubits.4. There is another type of measurement called a POVM (Positive Operator Valued Measure) of which projectors are a certain type. 2 (5.g. describes the system. for |O2 of qubit two we use (I ⊗ P2 ). |O2 } then we use the projector with a tensor product with I on the qubit we don’t want to measure.4 Postulate Four A tensor product of the components of a composite physical system. POVMs are beyond the scope of this text.

|Ψ → (I ⊗ X) → |Ψ = |Ψ → (X ⊗ I) → |Ψ = √ √ 0.3|11 + 0.4|10 .154 Example The Four Postulates of Quantum Mechanics C4 ⊗ C4 = C16 can look like: (|ΨA = |1 + |2 + |3 + |4 ) ⊗ (|ΨB = |a + |b + |c + |d ) and can be written as: |ΨAB = |1a + |1b + |1c + . if their systems are combined the joint state is: |ΨAB = |u ⊗ |v .2|01 + √ 0. .2|11 + √ √ 0. 0.2|00 + 0. Example If Alice has |ΨA = |u and Bob has |ΨB = |v .3|00 + √ √ 0. Perry 2004 .1|00 + √ 0.1|10 + √ √ 0. Example Given the following: |Ψ = then. .3|10 + √ 0.4|01 . √ 0.4|11 The Temple of Quantum Computing .c Riley T. + |4d .2006 .1|01 + 0. If Bob applies gate U to this system it means I ⊗ U is applied to the joint system.

which has many parallels in conventional information theory. and quantum cryptology. This information can be represented in many different ways to express the same meaning. 1998]. as promised. 1916 . In this chapter we’ll look at these and other related topics like quantum error correction. 155 . As with chapter 5 individual references to QCQI have been dropped as they would appear too frequently.1).1 Introduction Information theory examines the ways information can be represented and transformed efficiently [Steane. If we consider information in these terms then it becomes a property like energy that can be transferred from one physical system to another. E.2001 (figure 6. there is a fairly in-depth section on Bell states and the chapter ends with some open questions on the nature of information and alternate methods of computation. M. We are interested in quantum information.g. Also. ”How are you?” and ”Comment allez vous?” express the same meaning. Conventional information theory relies heavily on the classical theorems of Claude E. A. The Information stored on a particular physical medium is not ”tied” to that medium and can be converted from one form to another. Shannon. All known ways of representing this information must have a physical medium like magnetic storage or ink on paper. There are a number of quantum equivalents for the various parts of his classical theorems.Chapter 6 Information Theory 6.

OR. The message is sent from the source in its raw form. Transmitter . Shannon also defined the most basic unit of information theory .3 Shannon’s Communication Model To formally describe the process of transmitting information from a source to a destination we can use Shannon’s communication model.The transmitter encodes and may compress the message at which point the message becomes a signal which is transported from transmitter to receiver. 1948].5. Source of Noise . Shannon and George Boole. Boolean algebra introduced the concept of using logical operations (like AND.1) [Shannon C. E.1864 (figure 6.The noise source can introduce random noise into the signal.c Riley T.1).2006 . 6.156 History Figure 6. 6. which is shown in figure 6. and NOT) on the binary number system. Perry 2004 .2 History The history of information theory can be said to have started with the invention of boolean algebra in 1847 by George Boole. The components of this are described as follows: Source .the bit (binary digit).4). The next milestone was in 1948 when Shannon wrote ”the mathematical theory of communication” in which he outlined the concepts of Shannon entropy (see section 6. potentially scrambling it.2.1: Claude E. switches.The origin of the message. 1815 . Earlier Shannon had shown that boolean algebra could be used to represent relays. The Temple of Quantum Computing . and other components in electronic circuits. which itself has a formal definition (see section 6.

6.1 Channel Capacity A message is chosen from a set of all possible messages and then transmitted.2: Shannon’s communication model.The receiver may decode and decompress the signal back into the original message.g. Perry 2004 . Destination . Receiver . 000 bits per second.The destination of the raw message. 56.Shannon’s Communication Model 157 Figure 6. His expression for capacity is: C = lim log2 N T (6. Each symbol transferred takes a certain amount of time (which is called the channel capacity).2006 .c Riley T. The Temple of Quantum Computing . Shannon’s name for channel capacity on a binary channel is ”one bit per time period” e.3.1) T →∞ where N is the number of possible messages of length T .

M. If dashes are represented by 1110 and a dot is 10 for this we have: C = 0. 6. A. so. but it could in principle be any series of symbols. 2002]. The alphabet that is most commonly used is binary (1 and 0). where dashes take longer to transmit than dots.2006 . 6. given an unknown book one could.4 Classical Information Sources A source of information produces a discrete set of symbols from a specific alphabet. Perry 2004 .1 Independent Information Sources An independent and identically Distributed (IID) information source is an information source in which each output has no dependency on other outputs from the source. and furthermore each output has the same probability of occurring The Temple of Quantum Computing . C= log2 N T = 1 bit per time period. predict to a certain degree of accuracy the frequency of words and letters within the book [Nielsen. Example Another example is morse code. N (T ) = 2T and. 3 bits = 8 different messages in 3 time periods.4.34 bit per time period.158 Example For binary we have: Classical Information Sources 2 bits = 4 different messages in 2 time periods.c Riley T. The way an information source can be modelled is via a probability that certain letters or combinations of letters (words) will be produced by the source. in advance. An example for this probability distribution would be.

Perry 2004 . Strictly speaking. Not many sources are perfect like the above. they correspond to a Markov process). 159 An IID is an information source with an alphabet (i.c Riley T. for example a book has correlations between syllables. all systems should have the same probabilities for letters to appear in their alphabets. . . .2006 The biased coin has a probability p of heads and a probability of 1 − p of tails. . an } with probabilities pr(a1 ). i=1 (6. pr(tails) = 0. 2002]. tails}: pr(heads) = 0.e a set of symbols or outputs ai ): A = {a1 . M. This means that there should be no statistical variation (with a probability of 1) between possible sources.7 .3. . = {heads. Independent information sources are also called zero memory information sources (i. 2. M. Given a language . Shannon’s results only hold for a subset of information sources that conform to the following: 1.pr(an ) such that: n (6. The reason is that. The Temple of Quantum Computing . Shannon suggested that most information sources can be approximated. words. A. .pr(a2 ). We can measure certain qualities and the source becomes more like an IID (like JUST letter frequency).Classical Information Sources each time it is produced [Nielsen. (not just letters) like ”he” and ”wh” [Nielsen. M. . Example [Nielsen. 2002].3) This source will produce a letter with probability pr(ai ) with no dependency on the previous symbols. An information source must be an ergodic source.2) pr(ai ) = 1 where 0 ≤ pr(ai ) ≤ 1 ∀ i.e. 2002] A biased coin is a good example of an IID. A. one by one with no dependency on current symbols and preceding choices.e. etc. Our coin will come up tails 70% of the time. A. Symbols must be chosen with fixed probabilities. . I.

B. C. We often talk about using a coding K to represent our message. Example A simple coding. an in A is found by: K(w) = K(a1 )K(a2 ) . D → 1111.2006 (6. A = {A. When we talk about compression in this section we mean simple algorithmic compression that can be applied to all information sources. . 1}. Formally. Possible encodings are: A → 0001. Length of Codes We define the size of an alphabet A as |A| and the length of a word w can be shown with |w|. Perry 2004 . A word. . . K(a) is a word with letters from B.e. The Temple of Quantum Computing . B = {0.5 Classical Redundancy and Compression Compression of data means using less information to represent a message and reconstructing it after it has been transmitted. B → 0101.160 Classical Redundancy and Compression 6.c Riley T. K(an ). D}.4) . So we encode the word ABBA as: K(ABBA) = 0001 0101 0101 0001. C → 1001. changing the text in a sentence to convey the same meaning or using special techniques to only work on a subset of messages or information sources (like using a simple formula to exactly represent a picture of a sphere). w = a1 a2 . a coding is a function that takes a source alphabet A to a coding alphabet B. . This is distinct from say. i. K : A → B. For every symbol a in the language A.

1 Shannon’s Noiseless Coding Theorem Shannon demonstrated that there is a definite limit to how much an information source can be compressed.c Riley T. . (6.2006 .6) Here. We get: |K(a)| = 1. . n generated by the source. |B| = 3. 1. . b → 1. d.5) We can find the Shannon Entropy. f }. c. |A| = 6. 2. Shannon Entropy H(S) is the minimum number of bits needed to convey a message.5. f → 222. |K(c)| = 2. B = {0. the frequency with which it is emitted) for a symbol being generated by the source and the summation is a sum over all the symbols i = 1.e.Classical Redundancy and Compression Example |A| and |w|. A = {a. of a particular source distribution measured in bits by: H(X) = − i pri log2 pri . Possible encodings are: a → 0. |K(f )| = 3. e. e → 221. . The Temple of Quantum Computing . d → 220. Perry 2004 . log2 (a log of base 2) means that the Shannon entropy is measured in bits. 161 6. 2}. b. pri is a measure of probability (i. For a source S the entropy is related to the shortest average length coding Lmin (S) by: H(S) ≤ Lmin (S) < H(S) + 1. (6. c → 20.

The Temple of Quantum Computing . C.46438) + (−0. AABBBBAABB). E = 0. B = 0.9] = 1.5 + (−0. The maximum entropy is realised when we have no information about the probability distribution of the source alphabet (when all symbols are equally likely to occur).2 + (0. E} of symbols occurring with Example the following frequency: A = 0.1 log2 0. this gives us a probability of 1 for that letter. We have a language {A. D.g. with no dependencies.162 Example Classical Redundancy and Compression Random and dependent sources. B. This has Shannon Entropy of 1 2 bit(s) per symbol.9965)] = −[−1. Note a fair coin toss has maximum entropy of 1 bit and a totally unfair. Dependent Every second symbol is exactly the same as the last.1. C = 0. D = 0.1.1 . weighted coin that always comes up heads or always comes up tails has minimum entropy of 0 bits. The entropy is: H(X) = −[(0. which is chosen randomly (e.5 + 0. Random Each symbol is chosen from the source totally randomly (with A and B having equal probability).1) × 3)] = −[−0. this source is uncompressible with Shannon Entropy of 1 bit per symbol. A special case of the entropy is binary entropy where the source has just two symbols with probabilities of p and 1 − p like the biased coin toss for example.2.2006 .5 log2 0.c Riley T.2 log2 0. So we need 2 bits per symbol to convey the message. The minimum entropy is realised when the information source produces a single letter constantly.9. Perry 2004 .5.

5.2 Quantum Information Sources Shannon entropy gives us a lower bound on how many bits we need to store a particular piece of information. vertical (V). For example given a photon and a polariser the photon can be in three states. 6. If we make our photon diagonal at 45◦ then we The Temple of Quantum Computing . is there any difference when we use quantum states? The answer is yes if we use a superposition. 2 |0 +|1 √ 2 with probability of 1 .Classical Redundancy and Compression 163 6. A.2006 . This does not mean the state vector will always collapse to a known value.c Riley T. M. 2 H 1+ 2 1 √ 2 = 0. but at least the state vector is known as distinct from what it collapses to. If the qubits involved are in well defined states (like |0 and |1 ) a semiclassical coin toss [Nielsen. and our quantum compression performs better than the Shannon rate H(pr(j)). Better than Shannon’s rate! Generally a quantum information source produces state: |Ψj with probabilities pr(j). 2 |1 with probability of 1 . Perry 2004 . horizontal (H). 2002] gives us: |0 with probability of 1 . The question is.3 Pure and Mixed States A quantum system is said to be in a pure state if its state is well defined. and diagonal (D). 2 H 1 2 = 1. If we replace one of these states with a superposition then a ”quantum coin toss” gives us: |0 with probability of 1 .6 .5.

if we have a number of photons. but not the group.c Riley T.2006 . ρ holds equivalent information to the quantum state Ψ and quantum mechanics can be formulated in terms of ρ as an alternative to Ψ. A. Each photon has a well defined state |H or |V . and if we measure with a polariser in this direction the result is certain). now we have a mixed state. So the state is not well defined and we call this state mixed. so we call it pure (i.e.e. 1 1 |D = √ |H + √ |V . mixed. The state was well defined before measurement. not a necessary compoThe Temple of Quantum Computing . The Density Matrix In studying quantum noise it turns out to be easier to work with the density matrix than the state vector (think of it as just a tool. Perry 2004 . When closed quantum systems get affected by external systems our pure states can get entangled with the external world. i.164 Classical Redundancy and Compression have an equal superposition of H and V. noise. leading to mixed states. we have a well defined angle of polarisation viz 45◦ . but the state of each component qubit is not well defined. or in information theory terms. 50% of which are polarised horizontally and 50% vertically. We don’t have this situation if there is no direction in which the result is certain. For example. We now look at ρ.7) where S is Von Neumann entropy and ρ is the density matrix. M. 2002]: The best data rate R achievable is S(ρ). (6.5. Which is as follows [Nielsen. 2 2 Now if we measure polarisation we have a 50% chance of detecting an |H or a 50% of detecting a |V . 6. This situation is indistinguishable from a photon that is in an entangled state. Entangled states like Bell states are well defined for the composite system (whole).4 Schumacher’s Quantum Noiseless Coding Theorem The quantum analogue of Shannon’s noiseless coding theorem is Schumacher’s quantum noiseless coding theorem. It is possible to have a well defined (pure) state that is composed of subsystems in mixed states. This is called decoherence.

|ψj } is called an ensemble of pure states. subsystem. For example.8) prj |ψj ψj | (6. the ensemble point of view. The probability of outcome k when a measurement. as mentioned above. is: k = tr(ρPk ) where. 165 According to Nielsen [Nielsen. and fundamental approaches.9) is the density matrix.2006 .c Riley T. Subsystem . But we can assign an individual density matrix to either subsystem.This is the basic view of the density matrix which gives us measurement statistics in a compact form. They are described briefly here: Ensemble . ρ completely determines the measurement statistics.It is possible to restate the four postulates of quantum mechanics in terms of the density matrix.Classical Redundancy and Compression nent of quantum computing). M. A. with projectors Pk on a system with density matrix ρ the post measurement density matrix ρk is: Pk ρPk . Fundamental . Perry 2004 . tr(Pk ρPk ) ρk = (6. which is described by Pk . 2002] there are three main approaches to the density matrix. Ensemble Point of View Consider a collection of identical quantum systems in states in |Ψj with probabilities prj . ρ= j (6. The set of all probabilities and their associated state vectors {prj . we can view the statistics generated by an entangled photon as equivalent to that of the corresponding ensemble.10) The Temple of Quantum Computing .If quantum system A is coupled to another quantum system B we can’t always give A a state vector on its own (it is not well defined). If a measurement is done.

measurement probabilities pr(|0 ) = 0 and pr(|1 ) = 1: ρ = 0 · |0 0| + 1 · |1 1| =0· = 1 0 0 0 0 1 . 2 ρ= j=1 prj |ψj ψj |. Perry 2004 .c Riley T. measurement probabilities pr(|0 ) = 1 and pr(|1 ) = 0: ρ = 1 · |0 0| + 0 · |1 1| =1· = 1 0 1 0 0 0 .2006 .e.166 Classical Redundancy and Compression A simple example involving the probabilities for a qubit in a known state is below: Example For a single qubit in the basis {|0 . i. For |Ψ = 1 · |0 + 0 · |1 . The Temple of Quantum Computing . and the use of a trace over the density matrix given a projector. |1 }. 1 0 +1· 0 1 0 1 Next we’ll have a look at a qubit in an unknown state. 1 0 +0· 0 1 0 1 For |Ψ = 0 · |0 + 1 · |1 . i.e.

c Riley T. |1 } then: pr(|0 ) = tr(ρ|0 0|) = tr = tr =p+0 = p.2006 .Classical Redundancy and Compression Example 167 Given measurement probabilities pr(|0 ) = p and pr(|1 ) = 1 − p. say we measure in an orthonormal basis.e. ρ = p|0 0| + (1 − p)|1 1| =p =p = p 1 0 1 0 0 0 0 0 1−p 1 0 + (1 − p) 0 0 0 1 0 1 0 1 +1−p . Perry 2004 . pr(|1 ) = tr(ρ|1 1|) = tr = tr p 0 0 0 0 0 0 1 0 1−p 0 1−p p p 0 0 0 0 1 0 0 0 0 1−p = 0 + (1 − p) = 1 − p. The Temple of Quantum Computing . {|0 . given a density matrix ρ and a projector P = |0 0| we can extract the final probability from ρ. How does a the density matrix evolve? Suppose a unitary transform U is applied to a quantum system: i. U |Ψ . So.

c Riley T. So.14) (6.2006 (6. Given measurement probabilities pr(|0 ) = p and pr(|1 ) = 1 − p p 0 .15) 1 √ |11 2 we have pr(|00 ) = and pr(|11 ) = 1 . 2 . after the evolution occurs. 2 I ρ = U U† 2 I = because U U † = 1. 2 Properties: tr(ρ) = 1. Note that when |ψj goes to U |ψj . Subsystem Point of View The density matrix can describe any subsystem of a larger quantum system. 0 1−p If X is applied to ρ then: ρ = XρX = Example For |Ψ = 1 √ |00 2 1−p 0 0 p .12) (6. Perry 2004 .168 Classical Redundancy and Compression what is the new density matrix? To answer this. 1 2 + This gives us a what is called completely mixed state and ρ = I . using the ensemble view. Initially we have ρ = j prj |ψj ψj |. it will be in state U |Ψ with probabilities prj . ψj | = |ψj Example then ρ = † goes to (U |ψj )† = ψj |U † . including mixed subsystems. after U is applied.11) (6. we can say that if the system can be in states |Ψj with probabilities trj then. Subsystems are described by a reduced density The Temple of Quantum Computing . we have: ρ = j prj U |ψj ψj |U † prj U |ψj ψj | U † j (6. So.13) =U = U ρU † . ρ is a positive matrix.

tr((ρA )2 ) < 1 and tr((ρB )2 ) < 1. Bell states for example have a pure combined state with tr((ρC )2 ) = 1. S: S(ρ) = −tr(ρ log2 ρ). The Temple of Quantum Computing .Classical Redundancy and Compression 169 matrix. 2002]: 1. Instead of using a state vector. we can use the density matrix to describe a quantum system in Hilbert space. A tensor product gives us the state of a composite system. M. There’s a simple test we can do to determine is a state is mixed or pure. if we get tr(ρ2 ) < 1 then the state is mixed (tr(ρ2 ) = 1 for a pure state). 4. but they have mixed substates. i. are replaced by a density matrix ρ in Von Neumann entropy. Measuring using projectors Pk gives us k with probability tr(Pk ρ) leaving the system in a post measurement state of ρk = Pk ρPk tr(Pk ρPk ) .e. If a system is in state ρj with a probability of prj it has a density matrix of j prj ρj .16) trA and trB are called partial traces over systems A and B respectively. The density matrices for the subsystems are ρA and ρB and the overall density matrix is ρC (also referred to as ρAB ). (6. which is to run a trace on that state.19) . Perry 2004 . Fundamental Point of View In terms of the density matrix the four postulates of quantum mechanics are [Nielsen.c Riley T. We can define ρA and ρB as: ρA = trB (ρC ) and ρB = trA (ρC ). (6. If we have two subsystems A and B of a system C where A ⊗ B = C. The partial trace is defined as follows: ρA = trB (|a1 a2 | ⊗ |b1 b2 |) = |a1 a2 |tr(|b1 b2 |) = b1 |b2 |a1 a2 |. Changes in a quantum system are described by ρ → ρ = U ρU † . Von Neumann Entropy The probability distributions in classical Shannon entropy H. A subsystem’s state can be found by doing a partial trace on the remainder of the system (i. over the other subsystems making up the system). A. 2.2006 (6.17) (6.e. 3.18) Previously we mentioned the difference between pure and mixed states.

22) (6. S(ρB ) = −tr(ρB log2 ρB ).33) (6. which is beyond the scope of this paper. (6.31) For S(A) + S(B) ≤ S(AC) + S(BC) it holds for Shannon entropy since H(A) ≤ H(AC) and H(B) ≤ H(BC) we get an advantage with Von Neumann entropy with: S(A) > (AC) or. Properties: S(ρA ⊗ ρB ) = S(ρA ) + S(ρB ). For example we could compare two states. We also use Von Neumann entropy to define a limit for quantum data compression.24) (6.30) (6. ρA = trB (ρAB ).29) (6.23) (6. ρAB = ρA ⊗ ρB .32) The Temple of Quantum Computing .26) (6.c Riley T. S(A) + S(B) ≤ S(AC) + S(BC). If we want to define the uncertainty of a quantum state before measurement we can use entropy. S(ABC) + S(B(≤ S(AB) + S(BC).21) with S(ρ) = 0 meaning a pure state and S(ρ) = log2 d giving us a totally mixed state.2006 .25) (6. namely Schumacher compression.28) (6.27) (6. given a Hilbert space of dimension d then 0 ≤ S(ρ) ≤ log2 d (6. Perry 2004 . S(ρAB ) ≥ |S(ρA ) − S(ρB )|. ρB = trA (ρAB ). S(ρA ) = −tr(ρA log2 ρA ). (6. S(ρAB ) ≤ S(ρA ) + S(ρB ). by measuring their Von Neumann entropy and determine if one is more entangled than the other.170 Classical Redundancy and Compression We can also define the entropy in terms of eigenvalues λi : S(ρ) = − i λi log2 λi (6. S(B) > S(BC).20) where λi are the eigenvalues of ρ.

1 is received with probability 1 − p. ”Given a noisy channel there is a characteristic rate R. such that any information source with entropy less than R can be encoded so as to transmit across the channel with arbitrarily few errors. 1 is received with probability p.e. • If 1 is transmitted. with x being the number of bits used to encode the original message. So if there is no noise then R matches the channel capacity C. Classical Error Correction We’ll consider using binary symmetric channels with an error probability p with p ≤ 0. i. Repetition is inefficient: to make the probability of error occurring lower.33) cannot be true simultaneously. The Temple of Quantum Computing . Shannon found a better way. longer encodings are required which increases transmission times. In the case of a binary channel we use repetition.5 and: • If 0 is transmitted.Noise and Error Correction 171 It should be noted that quantum mechanics tells us that (6.6 Noise and Error Correction Noisy Channels Noise is randomisation in a channel.2006 . 0 is received with probability 1 − p. • If 0 is transmitted.32) and (6. we send additional information to offset the noise. An example of this is that a 011 can equate to 1.g. e. To combat noise we use redundancy. above R we get errors” [indigosim. we can use three 1’s to represent a single 1. We generally use a greater number of bits than the original message to encode the message with codewords. 6.c Riley T. • If 1 is transmitted.com ? 2000]. 0 is received with probability p. We call this a Kx channel coding. Perry 2004 . If two bit flips is highly improbable then upon receiving 011 we assume (with a high degree of certainty) that a 1 was sent (as 111) and a single bit was flipped. that way two bits have to be flipped to produce an error.

bit flips in 1 out of 3 bits in codeword are fixable. 3 So. The Temple of Quantum Computing . 101 → 1. 1 Repetition codes have an information rate of R(K) = n . 010 → 0. 111 → 1. Perry 2004 . 1 . 011 → 1.34) if it has 2k codewords (k = 1 in the example below).2006 . 1 → 111. Repetition Codes Using repetition codes we have a greater chance of success by increasing the number of coding bits for a bit to be transmitted and averaging the result bits. 001 → 0.6. 110 → 1.172 Noise and Error Correction If we have a code (called a binary block code) K of length n it has an information rate of: R(K) = k n (6. 100 → 0. we have an original message of k bits and we use codewords on n bits. With a channel decoding of: 000 → 0. Example A K3 channel coding could be: 0 → 000.1 Quantum Noise In practice we cannot make perfect measurements and it’s hard to prepare and apply quantum gates to perfect quantum states because real quantum systems are quite noisy. 3 So our information rate is: 6. but the information R(K3 ) = rate is down to 1 .c Riley T. This means.

we might have a change of phase: α|0 + β|1 → α|0 + eiθ β|1 . Below are some simple examples of quantum errors. but the area still remains a hot topic. 3. Some scientists still believe that quantum computing may be impossible due to decoherence which is external influences destroying or damaging quantum states. Measurement destroys quantum information (so if we used a repetition code. The fact that they are quantum gives us a number of extra problems: 1.c Riley T. The Temple of Quantum Computing . how do we apply majority logic to recover the qubits?). Perry 2004 . E. Quantum Repetition Code A quantum repetition code is the analogue of a classical repetition code.2 Quantum Error Correction Quantum error correction codes have been successfully designed.Noise and Error Correction 173 6. many types of error can occur on a single qubit (not just a bit flip as with a classical circuit). Continuous errors.g. Example A qubit’s amplitudes get flipped: a|0 + b|1 → b|0 + a|1 . 2. |1 → |111 . No Cloning. for classical states (states not in a superposition) this is easy: |0 → |000 . Example A qubit’s amplitudes and relative phase get flipped: a|0 + b|1 → b|0 − a|1 . We use quantum error correction codes in place of classical ones.2006 . Example A qubit’s relative phase gets flipped: a|0 + b|1 → a|0 − b|1 .6.

e.2006 . So what we do is to encode our superposed state into the following entangled state: |Ψ = α|0 + β|1 → α|0 |0 |0 + β|1 |1 |1 = |Ψ or. A simple circuit for this encoding scheme is shown below: |Ψ |0 |0   • •   |Ψ So if we made our input state α|0 + β|1 then we would get: α |0 + β |1 |0 |0   • •   α |000 + β |111 ↑ |ψ1 ↑ |ψ2 ↑ |ψ3 The diagram shows the stages in the evolution of |Ψ as the CNOT gates are The Temple of Quantum Computing . it prevents us from having: |Ψ → |Ψ |Ψ |Ψ which expanded would be: (α|0 + β|1 ) ⊗ (α|0 + β|1 ) ⊗ (α|0 + β|1 ).174 Noise and Error Correction The no cloning theorem won’t allow us to make copies of qubits in a superposition. expanded is: α|000 + 0|001 + 0|010 + 0|011 + 0|100 + 0|101 + 0|110 + β|111 . Perry 2004 .c Riley T. i. α|0 + β|1 → α|000 + β|111 which.

α|000 + β|111 → I ⊗ I ⊗ X → α|001 + β|110 . We then adjust our state accordingly based on the results of the measurements as described in the table below. |ψ2 = α|000 + β|101 . the |Ψi are as follows: |ψ1 = α|000 + β|100 . We determine that there’s been an error by entangling the encoded state with two ancilla qubits and performing measurements on the ancilla qubits. For example noise can flip qubit three. • α|001 + β|110 |0 |0   Error Correction •        • • _ _ _   76 54  01 1 M 23   76 54  01 23  M2  _ _ _ R • • α|000 + β|111 Error Syndrome ↑ |ψ1 ↑ |ψ2 ↑ |ψ3 ↑ |ψ4 ↑ |ψ5 |ψ1 = α|001 + β|110 . |ψ3 = α|00101 + β|11001 . |ψ4 = (α|001 + β|110 ) ⊗ |0 |1 .Noise and Error Correction applied.c Riley T. i. So now we feed 01 (called the error syndrome) into our error correction (or recovery) circuit R which does the following to α|001 + β|110 : The Temple of Quantum Computing . The measurements M1 and M2 cause a readout of 01 on lines 4 and 5. 175 Fixing Errors The following circuit detects an amplitude flip (or bit flip) which is the equivalent of X|Ψ on |Ψ .2006 . Note that we are assuming that an error has occurred AFTER the encoding and BEFORE we input the state to this circuit. |ψ2 = α|000 + β|111 .e. Perry 2004 . |ψ2 = α|00100 + β|11000 .

|011 → |111 So we apply a qubit flip to line 3 giving: |ψ5 = α|000 + β|111 . All that remains is to decode |Ψ to return to our original state.g. we just add in some Hadamard gates at the start to deal with the superpositions we generated with the initial encoding (shown immediately above). It turns out we have to change our encoding method to deal with a relative phase flip.: α|000 + β|111 → α|000 − β|111 which. Again remember that any errors that do happen. |101 → |111 flip qubit 1.g. We get a problem though if we have a relative phase error. |110 → |111 flip qubit 2. which we can do with the following circuit: α |0 + β |1 |0 |0   • •   H H H The error correction circuit for a relative phase flip is almost exactly the same as the error correction circuit for an amplitude flip. happen between the encoding and the circuit we are about to introduce: The Temple of Quantum Computing . |111 → |111 flip qubit 3. This circuit will fix a single bit flip in our three qubit repetition code.g. Perry 2004 .e. i. e. decoded is: α|0 + β|1 → α|0 − β|1 .2006 . e.g. e.c Riley T. e.176 M1 0 0 1 1 M2 0 1 0 1 Action Noise and Error Correction no action needed.

a relative phase flip can be fixed with HZH and an amplitude flip with X. If we use the {|+ .2006 . If our input state is: |ψ1 = α |+ + − + β |− − + then. Perry 2004 . In terms of single qubits. But we still have a problem because the circuit above cannot detect a amplitude flip. The Temple of Quantum Computing . A third encoding circuit produces a Shor code which is a nine qubit code that has enough information for us to be able to apply both types of error correcting circuits.Noise and Error Correction Error Correction H H H |0 |0 ↑ |ψ1 ↑ |ψ2          177 • • • • _ _ _   76 54  01 23 M 1 R  • • Error Syndrome  76 54  01 23  M2  _ _ _ Suppose we have a phase flip on line 2. Since the rest of the circuit is the same we get the output of R being: α |000 + β |111 as before. This is the same as |ψ2 in the bit flip case. The circuit is presented below. It should be noted that these errors are defined in terms of the {|0 .c Riley T. |1 } basis. |ψ2 = (α |001 + β |110 ) |00 . |− } basis then the phase flip circuit above fixes a bit flip and vice versa. and is our first real QECC (Quantum Error Correction Code).

2006 . he argued that they had ”hidden variables”). The Temple of Quantum Computing . Einstein used this as an argument against the notion that particles had no defined state until they were measured (i. In the following description of his proof consider the fact that we can measure the spin of a particle in several different directions which can be thought of as measuring in different bases.1990 proved in 1964 that there could be no local hidden variables. During this section we’ll refer to Einstein’s position as EPR and the quantum mechanical position as QM. Shor. These both in turn are CSS codes (Calderbank.178 |Ψ • • |0 |0 |0     Bell States H • •   H |0 |0 • •     |0   H |0 |0 • •     The Shor code is one of many QECCs. Steane). John Bell.7 Bell States As mentioned in chapter 4 the EPR experiment showed that entangled particles seem to communicate certain quantum information instantly over an arbitrary distance upon measurement. 1928 . Perry 2004 . 6.c Riley T. CSS codes are part of a more general group of QECCs called Stabiliser codes.e. another example is the Steane code.

If we allow the directions to be different it is possible to get a empirically testable difference. respectively). z) there is no empirical difference between the results predicted by the two positions (QM or EPR). The intuition for this is that if. at most.Bell States 179 Bell takes a system of two entangled spin particles being measured by two remote observers (observers 1 and 2. 2 2 which will become important later. who observe particles 1 and 2.see below). the probability for an outcome. then what happens at 2 will involve both directions (we imagine that a measurement at 1. say.2006 . 6. as QM says. what happens at observer 2 cannot in any way involve the direction at observer 1: what happens at observer 2 will.g. Perry 2004 . be determined by the value particle 2 carries away at emission and the direction at observer 2.7. say z. Alice and Bob. if the observers measure spin in the same direction (e.c Riley T. He shows that. Let each measure the spin of the particle that flies towards them. and the latter is dependent on the direction at 1. is dependent on the angle between the two directions . what happens at observer 2 is dependent on what happens at observer 1. For the purposes of our example we’ll begin by defining the following entangled state: 1 1 |ΨA = √ |01 12 − √ |11 02 . in the EPR view. in some direction. then the results might be represented as follows: Alice z 1 0 Bob z 0 1 50% 50% Frequency The Temple of Quantum Computing . causes state collapse so that particle 2 ”points” in the antiparallel direction to 1 and is then measured in observer 2’s direction.1 Same Measurement Direction To see that same direction measurements cannot lead to a testable difference first imagine that there are two separated observers. If they both measure in the same direction. (6. who run many trials of the EPR experiment with spin particles. Whereas. spin up or spin down.35) We’ve introduced the notation |01 12 to distinguish between qubits 1 and 2.

Bob now measures particle 2 in the b direction.c Riley T. Either way we have the same prediction. Perry 2004 . This says the particles actually have well defined values at the moment they are emitted. and we have: either |01 12 or |11 02 .2006 . EPR position. When Alice measures 0 Bob measures 1 not because Alice’s measurement has ”produced” anything. But then we no longer have a superposition (Alice’s measurement has ”produced” a 0 on particle 1 and a 1 on particle 2. 6. Alice’s measurement has ”produced” a 1 (spin down) in the a direction on particle 2 (to take the first case). QM position. or vice versa) and Bob’s measurement outcome on 2 is completely determined (relative to the outcome on 1) and will be the opposite of Alice’s outcome.180 Bell States We soon realise that we can’t use this case to discriminate between the two positions. but simply because the 1 is the value the particle had all along (which the measurement reveals). not to collapse. To work out what happens according to QM we have to express |12 in terms of a The Temple of Quantum Computing . This explains the result by saying that. Suppose there are two directions a(= z) and b. upon Alice’s measurement of 1. and these are (anti-)correlated and randomly distributed between 01 and 10 over repeated trials.7. This causes a collapse. The randomness here is due to initial conditions (emission). Start with |ΨA and allow Alice to measure particle 1 in the a direction. the state vector superposition |ΨA collapses into one or other of the two terms. The intuition for this might go as follows. as before. either |01 12 or |11 02 with 50% probability for Alice measuring 0 or 1.2 Different Measurement Directions Bell’s innovation was to realise that a difference will occur if we bring in different measurement directions.

Bell States b basis. The spin values of the particles are determined at the moment of emission. there is no requirement for correlation. for |02 : |02 = cos |+2 − sin |−2 .38 we have: √ 3 |12 = |+2 + 1/2|−2 . when θ = 0 (the case when b = z) we get |−2 θ 2 θ 2 (= |1 in that case). Perry 2004 . (6. 2 The Temple of Quantum Computing . 2 as before. 6. and c. and Alice and Bob might both observe 1. So reasons Bell. by construction.c Riley T. b.3 Bell’s Inequality It turns out we need three directions. the events at Bob’s end are beyond the reach of the events at Alice’s end (locality). if they measure in different directions. for example (as in row 3 below).36) where |+2 means spin up along the b axis. However. perpendicular to line of flight. 2. espoused by EPR. because: 1.37) The significant point is that. The rat is cornered: by bringing different directions of measurement into it. Likewise.7. or 0 with 1. say a and a. QM View If we put θ = 120 into 6. say a and b. they will observe correlation: 1 with 0. as above. This looks right. If b is at angle θ to a this turns out to be: |12 = sin θ 2 |+2 + cos θ 2 |−2 181 (6. we will actually take the case where these directions are all in the plane. When Alice and Bob measure in the same direction. If θ = 90 (the case when b = x) we get 1 √ . and are not ”produced” at some later moment as a result of an act of measurement (realism). and at 120◦ to one another. since θ is the angle between a and b.2006 . we should get a detectable difference. So allow Alice and Bob to measure in three possible directions labelled a. But this can’t happen in a realist local view as. the direction of Alice’s measurement is entering into (influencing) what happens for Bob.

The results must go as: aa Outcome S Outcome D 0 ab 75 ac ba bb 0 bc 75 ca cb cc 0 100 75 75 25 25 75 75 25 25 100 25 100 25 The net result is that S occurs 450 times and D 450 times. spin down or 1) with probability have: Alice a 0 0 Bob b 0 1 3 4 1 4 1 . To try to account for this we say that.c Riley T. We conclude: 1 the probability of different outcomes is 2 . ie Alice chooses b. at the moment of The Temple of Quantum Computing . 4 3 4 and − in The net result is that we Probability Equivalent results will be obtained in other pairs of different directions (eg bc.2006 . In general we have: If the directions are different the probability for outcomes to be the 3 same S (eg 00) is 4 . EPR View We assume each particle carries a ”spin value” relative to each possible direction (as in classical physics). On the other hand.182 Bell States This tells us that Alice having measured 0 in the a direction (as in 6.e. Bob now measures + in the b (ie spin up or 0) direction with probability the b direction (i. except that (to fit in with what is observed) the measured value will always be ”spin up” (0) or ”spin down” (1). to be different D (eg 01) is 1 . and not some intermediate value (so the measured values cannot be regarded as the projection of a spin vector in 3D space onto the direction of the magnetic field. 4 if the directions are the same the probability for different outcomes (D) is 1. as in classical physics). Bob c) since the angles between such directions are always the same. Randomly change the directions of measurement. so that each combination occurs 100 times. Perry 2004 . Suppose we now run 900 trials.37).

b.Bell States 183 emission. the only possible randomness that can occur is in the assignment of initial component values at the moment of emission. This doesn’t constitute a problem in classical physics where we have spin behaving like a magnetic needle: the infinity of possible observed components of the magnetic moment. C=1. ie 011. dependent on measurement direction. or hidden variable. Suppose particle 1 has the assignment A=0. sense that the measurement just discovers or reveals what is already there). This is necessary if the two particles are going to give anti-correlated results for the case where we do same direction measurements in each direction (a. to obey conservation. c). b. ie 100. or key. C=0. or A=1.2006 . and C=0 or C=1. which determines the measurement outcome (as noted above. Since the measurement in the a direction can discover two possible values.c Riley T. etc . Likewise.B. the corresponding property.or ”instructions” specifying what shadow should appear. c) in which it can be measured .C values are set for each particle at the time of emission and carried off by them. They can be randomly assigned except that. But note that it would seem strange to account for the infinity of shadow length’s by saying the stick had an infinity of components . depending on the angle of the sun!).which determines the measured outcome in that direction (in the conventional. B=1. if A=0 for particle 1 then A=1 for particle 2 etc. 0 or 1. must have two values: either A=0. we cannot allow randomness in the act of measurement . pre-quantum. is no more mysterious than the infinity of shadow lengths projected by a stick dependent on the sun’s direction. each particle leaves with an ”instruction” (the particle’s property. The A. the spins are not correlated if we measure in different directions (in this case if the measurements were in the a and b directions the result would be 00). as follows: The Temple of Quantum Computing . see below). (It might seem we need an infinity of these properties to cater for the infinity of possible measurement directions.one for each possible direction (a. Perry 2004 . which we call the A component. Interestingly. B=0. empirically. But we can have A=0 for particle 1 and B=0 for particle 2 since.this would destroy the aa correlation. we have B=0 or B=1. or component) . we immediately know what the components for particle 2 must be: A=1. We can then lay out the possible assignments of component values.

5. So in each case we can tell the outcome.e. Bob gets a 011 particle. 3.g.c Riley T. 8.by allowing Alice’s abc values to run over the 8 binary possibilities. 1 0 1 0 1 0 1 0 b c a 0 1 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 0 1 0 0 0 0 0 Bob b c 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 1 The table respects the rule that measurements in the same direction must be correlated (this is how the entries are generated . ie S. Perry 2004 . if Nature chooses row 7 (above). and gets 1. We can now complete the table of outcomes: The Temple of Quantum Computing . and gets 1. Hence the overall outcome is 11. Alice gets a 100 particle. 2. But it allows for all possibilities in different directions: e.184 Bell States Alice Row a 1. we can have Alice finding 1 in the a direction going with Bob finding 1 in this direction (rows 3 and 7) or 0 (rows 1 and 5).2006 . For example. Suppose we consider the above 900 trials from the realist perspective. We are now closing in. as agreed). 6. measures it in the a direction. We are assuming that the particles fly off with their assignments and the measurements simply reveal these (no disturbance to worry about. measures it in the b direction. for each case the correlation rule immediately determines the corresponding Bob entries . There are only eight possible assignments of properties (Nature’s choice). as follows.i. And there are nine possible combinations of measurement directions (the experimenters’ choice). 7. we have no choice). ie 100 and the experimenters choose ab then the outcome is completely determined as S. 4.

QM says the probability should be 1 . But we can conclude that the overall probability for D is: 5 pequal + punequal . Perry 2004 . the unique properties of quantum computers promise the ability to break classical encryption schemes like Data Encryption Standard (DES) and RSA. quantum cryptography provides total security between two communicating parties. realism says it should be greater than 2 5 9 so QM wins! 6.2006 . We don’t know the statistics of the source: how often particles of the 8 various kinds are emitted. Also. Contradiction! If we compare the two conclusions we have a contradiction.Cryptology Alice’s particle 111 011 101 001 110 010 100 000 aa D D D D D D D D ab D S S D D S S D ac D S D S S D S D ba D S S D D S S D bb D D D D D D D D bc D D S S S S D D ca D S D S S D S D cb cc D D S S S S D D D D D D D D D D 185 What is the probability of different outcomes D? If Alice receives a particle with equal components (eg 111) this probability is always 1.8 Cryptology Now a proven technology. they are: The Temple of Quantum Computing . If Alice receives a particle with unequal components (eg 011) the probability is always 5 9 (look along the row for 011: D occurs 5 times out of 9. 9 Since both p’s must be positive we conclude: the probability for different outcomes is greater than 5 9 This is an example of a Bell inequality.c Riley T. The field of quantum cryptology has two important sub-fields.

Surmising the decryption key from public (encryption) key requires solving hard (time complexity wise) problems. codes called DES and IDEA were implemented with typically 64 and 128 bit secret keys. Perry 2004 . A → D. one famous ancient code is the Caesar cipher which simply shifts each letter by three.c Riley T. RSA 1976 Diffie Hellman) uses a combination of a public and a secret key. This is done by a secret decryption key known only to the owner. Public key encryption (e. 2.The use of secure codes.1 Classical Cryptography Secret codes have a long history .8. which can be used to break RSA encryption. There is another kind of key.186 1. Cryptology We’ll concentrate on cryptography in this chapter. Modern codes use a key.38) This is not very secure as it’s easy to guess and decrypt. a public key.g. Cryptography . Example below: Key Shift By Message Encoding A 1 Q R B 2 U W C 3 A D D 4 N R E 5 T Y F 6 U A A 1 N B 2 E C 3 O R D 4 D H E 5 E J F 6 S Y An example of a code wheel with the key: ABCDEF is described M C With time secret keys and their respective codes got more complicated.g.Code breaking. 6. X → A. Some codes are stronger than others.2006 . e. for example the DES and IDEA secret The Temple of Quantum Computing . an example of which follows.dating back to ancient times. B → E. Later. Cryptanalysis . in chapter 7 we look at Shor’s algorithm. In a public key encryption scheme a public key encrypts a message but cannot decrypt it. (6. culminating in modern codes. A simple form of key is incorporated into a code wheel.

The PAD is used only once to encrypt and decrypt the message. This enables the bank to verify the polarisations without disturbing the quanThe Temple of Quantum Computing . The main advantage of quantum cryptography is that it gives us perfectly secure data transfer. H. The first successful quantum cryptographic device was tested in 1989 by C. Brassard [Castro. Each bank note contains a unique serial number and a sequence of randomly polarised photons (90◦ . M. 180◦ .c Riley T. 6. This assumption is now at risk from Shor’s algorithm. The basis of polarisation is kept secret (either diagonal or rectilinear). The device could translate a secret key over 30 centimetres using polarised light. A one-time PAD is a key that is large as the message to be sent (for example a random binary file) and the sender and receiver both have a copy of this key. 2000]. K. calcite crystal(s). 45◦ . but on quantum effects like the no-cloning theorem.2006 . and finally we’ll examine a method for quantum key distribution. The bank can verify the validity of a note by matching a serial number with known (only known by the bank) polarisations.H. A simple example of the no-cloning theorem’s ability to secure data is described below. Perry 2004 . and 135◦ ). Quantum key distribution resolves this issue by providing perfectly secure key distribution. notably that it is difficult to factor large integers. Bennet. 1997]. L.8. After that we’ll look at why it’s impossible to listen in on a quantum channel. The problem with one-time PADs is that the key needs to be transmitted every time and eavesdroppers could be listening in on the key.2 Quantum Cryptography Modern classical public key cryptographic systems use a trap door function with security based on mathematical assumptions. and other electro-optical devices. S. Quantum Money Stephen Wiesner wrote a paper in 1970 (unpublished until 1983) in which he described uncounterfeitable quantum bank notes [Braunstein. This form of cryptography does not rely on a trap door function for encryption. and G.Cryptology 187 key codes are stronger than Caesar cipher codes. & Lo. Possibly the strongest code is the one-time PAD.

Quantum uncertainty. The banks’ records give the following: 1573462 = {H. the no cloning theorem says that given an unknown quantum state it is impossible to clone that state exactly without disturbing the state. 135◦ . So the more polarised photons the bank note Quantum Packet Sniffing Quantum packet sniffing is impossible . at 45◦ . V. H. 135◦ . which is {|0 . The chances of the counterfeiter 1 2 randomly measuring in the correct basis decrease by a has the harder it is to counterfeit. |1 }. theoretically measure each one and recreate it if he knows the basis by which to measure each one. (rectilinear) or {|+ .2006 . for each successive polarised photon on the note. The bank checks its ”quantum bank note archive” to find the polarisations for bank note 1573462. vertically (90◦ ). he must measure using a random basis. V. (diagonal). 45◦ }. H.188 Cryptology tum system (see the example below). Because the counterfeiter does not know the basis of each polarised photon on the quantum bank note. He could. This phenomena is due to the following properties of quantum mechanics: 1. for example given a photon polarised in an unknown state (it might be horizontally (180◦ ). or at 135◦ ) we can’t tell with certainty which polarisation the photon has without measuring it. Perry 2004 . 45◦ } is a record of the note polarisations. Example Let’s say the bank receives a bank not with serial number 1573462. but our copy protection system does not distinguish between H and V or 135◦ and 45◦ . the counterfeiter can’t counterfeit the note due to the no cloning theorem. The bank only determines the basis of each photon. The Temple of Quantum Computing . {H. Remember. |1 }. It should be noted that states are always superpositions if we don’t say what the basis is.c Riley T. Because the photons are not in superpositions relative to the basis we measure in (as specified by the serial numbers) the bank doesn’t disturb the states upon measurement.so the sender and receiver can be sure that no-one is listening in on their messages (eavesdropping). Finally.

any non orthogonal state will collapse randomly into a resultant state . Measurements are irreversible. this is not a problem for quantum cryptography as we can transfer key data in a totally secure fashion.losing the pre-measurement amplitudes. The main drawback for classical one-time pads is the distribution of encryption/decrytion keys. Even with a high error rate the eavesdropper cannot learn any useful information. An example follows on the next page.c Riley T. Quantum key distribution (QKD) is a means of distributing keys from one party to another. An unusually high error rate is a good indicator of eavesdropping. Perry 2004 . The Temple of Quantum Computing . and detecting eavesdropping (it is inspired by the quantum money example). The no cloning theorem. It should be noted that this method does not prevent Denial of service (DOS) attacks. 189 3.Cryptology 2. 4.2006 . Disturbance (information gain). Quantum Key Distribution We can ensure secure communications by using one-time pads in conjunction with quantum key distribution. if a measurement is done (distinguishing between two non-orthogonal states) the signal is forever disturbed.

1993].2006 .135◦ . Comments The following can be said about the key exchange: • Eve can’t clone the bit and send it on. One channel is used to transmit the encrypted message and another is used to transmit the encryption key. and records which one was used for each bit. 90◦ . i. Perry 2004 . 1. A. they communicate on two channels. and 180◦ . But they need a way to avoid Eve eavesdropping on their conversation on the key channel [Ekert. 2. Alice and Bob decide on an acceptable error rate.these are sent to Bob over a quantum channel (which is secure due to quantum effects. Alice and Bob check for quantum errors to gauge whether or not an eavesdropper (Eve) was listening. On a normal (insecure channel) Alice tells Bob which bits Bob used the right polarisation on (which he also communicates over the classical channel). 3. her measurements put Bob’s bits in a new random state.190 Example Cryptology Alice and Bob want to use a key based encryption method. Alice randomly polarises photons at 45◦ . • Eve could do an DOS attack by constantly measuring on the key channel.e. if the key exchange’s error rate is higher than that (which means Eve may have been listening) then they resend the message. no eavesdropping). he randomly uses either a rectilinear (180◦ /90◦ ) or diagonal polarising filter (45◦ /135◦ ). The following steps allow a totally secure (in terms of eavesdropping) transfer of the key (later we need to encrypt the message and send it via a classical channel). Bob does measurements on the photons. • Eve could shave off some of the light if each bit is represented by more than one photon. Also for each bit he records the measurement result as a 1 for 135◦ or 180◦ or 0 for 45◦ or 90◦ polarisations. 4. The Temple of Quantum Computing . so each bit transferred must only be represented by one qubit.c Riley T.

in terms of information.2006 . H.9 Alternative Models of Computation There are other candidates for physical phenomena to enhance computational power. Perry 2004 . in the early 90s stated that the main focus of physics should be on information. which is the number of bits in a system. e. the first QKD system which is based in concepts similar to the above.Alternative Models of Computation 191 • Eve could listen to a small number of bits and hope to be unnoticed .8. Physicist Anton Zellinger says the world appears quantised because the information that describes the world is quantised [Baeyer.c Riley T. that an electron’s spin along a certain axis is up or down. This makes sense as we can only ask yes or no questions . When examined in terms of information. C. Zellinger (and his student Brubeker) have created an alternative measure of information. 6. Finally. a method of mutual key generation. quantum systems break down to elementary systems that each carry one bit of information. It is called total information and it takes quantum effects into account. Once measured the bit is used up and the other properties are random. 2001]. Question Is there a universal computation model? or will there always be some phenomena which is not well understood that has the potential to be exploited for the purposes of computation? The Temple of Quantum Computing . • In 1984 Bennet and Brassard developed BB84. 6. like relativity and complexity theory (or chaos theory).g.Alice and Bob can prevent this by shrinking down their key. Some disciplines cannot currently be described by quantum mechanics.3 Are we Essentially Information? John Archibald Wheeler. He says that 1 bit of information can be represented by an elementary proposition. His theory goes on to explain entanglement.and the answers are yes or no.

.

0.com 2004]. or partially borrow from. For example. These include: factoring. Some properties of Shor and Grover type algorithms are: • Shor type algorithms use the quantum Fourier transform. Over the past twenty years a number of algorithms have been developed to harness the unique properties offered by quantum computers.Chapter 7 Quantum Algorithms 7. Most known quantum algorithms have similarities to. which means that no polynomial solution exists that covers all instances of the problem. These algorithms have been designed to give special advantages over their classical counterparts. This is extremely important for cryptography.1 Introduction Quantum algorithms are ways of combining unitary operations in a quantum system to achieve some computational goal. Shor’s algorithm (1995) gives the factorisation of arbitrarily large numbers a time complexity class of O((log N )3 ). This takes the classical value of a linear search from O(N ) time to O(N 2 ) time [TheFreeDictionary. the hidden subgroup problem. discrete logarithms. these two algorithms. where that classical equivalent is roughly exponential. RSA relies on factorisation being intractable. • Grover type search algorithms can be used for applications like fast database searching and statistical analysis. Another example is Grover’s database search algorithm which provides a quadratic speedup when searching a list of N items. and order finding (all variations on a theme). 193 1 .

7. Shor’s algorithm.e. where one to one means: f (1) = 1 and f (0) = 0 or f (0) = 1 and f (1) = 0. and Grover’s algorithm.1 Deutsch’s Algorithm Deutsch’s algorithm is a simple example of quantum parallelism.c Riley T. it is constant). As with chapters 5 and 6 individual references to QCQI have been dropped. but its simple nature makes it good for demonstrating the properties of quantum superposition. 7.1 The Problem Defined We have a function f (x) where f (x) : {0.1. Perry 2004 .1. We want to test if this function is one to one (balanced). To do this efficiently we need to look at many values simultaneously. or a qubit. In this chapter we’ll look at Deutsch’s algorithm. 1} → {0.2 The Classical Solution The solution is as follows: The Temple of Quantum Computing . It’s important to note that the thing that quantum computers do well is to test global properties of functions.2006 . the Deutsch-Josza algorithm. not the results of those functions given particular inputs.194 Deutsch’s Algorithm There are also hybrid algorithms like quantum counting that combine elements from both. Therefore both the input and output of this function can be represented by a bit. in which case we would get: f (1) = 0 and f (0) = 0 or f (0) = 1 and f (1) = 1. and more esoteric algorithms like quantum simulators. The problem it solves is not an important one. 1} with a one bit domain. either a 0 or a 1). The circuit for determining some property of a function is called an oracle. This means that f (x) takes a bit (either a 0 or a 1) as an argument and returns a bit (again. 7. The other alternative is that f (x) is not one to one (i.

involving two function evaluations: 1. Perry 2004 . x = f (0). y = f (1). z = x ⊕ y. 3. |ψ3 Uf acts on qubits x and y. y = |1 . via superposition.3 The Quantum Solution The quantum circuit below performs the first two steps in the classical solution in one operation. specifically we use |Ψ → Uf → |x |y ⊕ f (x) .1. |ψ1 The qubits x and y have been set to the following (we call x the query register and y the answer register): x = |0 . 2.2006 . |ψ2 Apply H gates to the input registers so our state vector is now: |0 + |1 √ 2 |0 − |1 √ 2 |Ψ = . This is made up of three operations. After some algebraic manipulation the result ends up in x. and y seems The Temple of Quantum Computing .Deutsch’s Algorithm 195 iff f (0) ⊕ f (1) = 1 the function is one to one (where ⊕ is equivalent to XOR). Can we do better with a quantum computer? 7. x |0 y |1 H Uf H ↑ |ψ1 ↑ |ψ2 ↑ |ψ3 x y ⊕ f (x) H ↑ |ψ4 H Below are the steps |ψ1 to |ψ4 we need to solve the problem quantum mechanically.c Riley T.

as well as turning a 1 or a 0 into a superposition will take a superposition back to a 1 or a 0 (depending on the sign): |0 + |1 √ 2 |0 − |1 √ 2 So at step 4. |0 − |1 √ 2 → H → |0 . At this point our state is. |ψ4 x is sent through the H gate again.2006 . For f (0) = f (1) (balanced) we get: |Ψ = ± and for f (0) = f (1) (constant): |Ψ = ± |0 + |1 √ 2 |0 − |1 √ 2 . now we don’t care about it as x holds the result.c Riley T. The Temple of Quantum Computing . If x = 0 then the function is constant.196 unchanged (see the example below). |0 − |1 √ 2 |0 − |1 √ 2 Deutsch’s Algorithm Note: The ± at the start of the state is just a result of internal calculations. it does not matter whether it is positive or negative for the result of this circuit (global phase factors have no significance). Up until now y has been useful to us. The H gate. We can just do a partial measurement on x and discard y as garbage. combining both cases: |Ψ = ±|f (0) ⊕ f (1) |0 − |1 √ 2 . for f (0) = f (1) we get: |Ψ = ±|1 and for f (0) = f (1): |Ψ = ±|0 |0 − |1 √ 2 . → H → |1 . Perry 2004 . and if x = 1 the function is balanced.

4 Physical Implementations In theory A simple quantum computer implementing Deutsch’s algorithm can be made out of a cardboard box.Deutsch’s Algorithm Example 197 There’s only four possible combinations for f (x) . 7. Given our state at |ψ2 is will look like the following: |Ψ = |0 + |1 √ 2 |0 ⊕ f (x) − |1 ⊕ f (x) √ 2 1 = (|0 |0 ⊕ f (0) − |0 |1 ⊕ f (0) + |1 |0 ⊕ f (1) − |1 |1 ⊕ f (1) ). The mirThe Temple of Quantum Computing .1. M. 1 ⊕ 1 = 0.c Riley T. At |ψ4 we put our entire state through H ⊗ H and get |01 for the constant function and |11 for the balanced one.2006 . and 0 ⊕ 1 = 1 we’ll start with the constant function f (0) = 0 and f (1) = 0: 1 |Ψ = (|0 |0 ⊕ 0 − |0 |1 ⊕ 0 + |1 |0 ⊕ 0 − |1 |1 ⊕ 0 ) 2 1 = (|00 − |01 + |10 − |11 ) 2 |0 − |1 |0 + |1 √ √ . we’ll look at 1 √ [|0 2 1 + |1 ] √2 [|0 − |1 ] our state at |ψ3 two here. = 2 2 Now for a balanced function f (0) = 1 and f (1) = 0: 1 |Ψ = (|0 |0 ⊕ 1 − |0 |1 ⊕ 1 + |1 |0 ⊕ 0 − |1 |1 ⊕ 0 ) 2 1 = (|01 − |00 + |10 − |11 ) 2 1 = (− |00 + |01 + |10 − |11 ) 2 1 = (−1) (|00 − |01 − |10 + |11 ) 2 |0 − |1 |0 − |1 √ √ . The sunglasses (in a certain configuration) polarise light initially into a non-orthogonal state (a superposition) then back again. = −1 2 2 Notice that (-1) has been moved outside of the combined state. Perry 2004 . 2 Keeping in mind that 0 ⊕ 0 = 0. it is a global phase factor and we can ignore it. three mirrors. 1 ⊕ 0 = 1. 2004]. and two pairs of sunglasses [Stay.

Kumar. Perry 2004 . in 2001 the algorithm was run on an NMR computer (see chapter 8) [Dorai.2 The Deutsch-Josza Algorithm The Deutsch-Josza algorithm is an extension of Deutsch’s algorithm which can evaluate more than one qubit in one operation. Arvind. Deutsch’s algorithm can of course be executed on any quantum computer architecture. A. if light comes out the function is balanced. 2001]. A torch is then shone into the box. Due to the relatively small number of qubits that can be currently made to work together many of the other quantum algorithms have not been satisfactorily tested. if not then it is constant. For example. 7. ?.2. and has been successfully implemented.2006 . if we use a special optical device to send just one photon into the box and we have a sensitive photo detector at the other end then we have an architecture that is a theoretically more efficient oracle than any classical computer. 7.c Riley T. Now. K.1 The Problem Defined The problem we are trying solve is slightly different to the one presented in Deutsch’s algorithm. We can extend it to evaluate any number of qubits simultaneously by using an n-qubit query register for x instead of a single qubit.198 The Deutsch-Josza Algorithm rors within the box reflect the light in a certain way depending on their configuration (at different angles depending on the type of function you want to simulate). that is: is f (x) the same (constant) for all inputs? Or is f (x) equal to 1 for half the input values and equal to 0 for the other half (which means it is balanced)? The Temple of Quantum Computing .

. .2. .2 The Quantum Solution The circuit looks like this: x |0 y |1 ↑ |ψ1 /n H ⊗n Uf H ↑ |ψ2 ↑ |ψ3 x y ⊕ f (x) H ↑ |ψ4 H ⊗n The input (x) and output (y) registers have an H gate for each qubit in the register. . xn |y ⊕ f (x) to evaluate f (x).c Riley T. x2 . . . Now the rule is simple: if any of the qubits in the query (x) register are |1 then the function is balanced. y = |1 . otherwise it is constant. by definition. |ψ3 Uf acts on registers x and y (remember y is just a single qubit because the result of evaluating f is. just a 0 or 1).The Deutsch-Josza Algorithm 199 7.e. i. This leaves us with a set of output qubits and a 1 in the answer register. . Here are the steps |ψ1 to |ψ4 we need to solve the problem quantum mechanically.2006 . |Ψ = |x1 . xn |1 . This time we use |Ψ = Uf |Ψ2 |0 = |x1 . This is denoted by H ⊗n and the /n notation just means n wires for n qubits. |ψ1 The registers x and y have been set to the following: x = |0 ⊗n . |ψ2 Apply H gates to both the x and y registers so our state vector is now: 1 |Ψ = √ 2n 2n−1 |x x=0 |0 − |1 √ 2 . The Temple of Quantum Computing . Perry 2004 . . x2 . |ψ4 x is sent through H ⊕n and y through an H gate also.

200 Example Shor’s Algorithm Here’s an example with a two qubit query register for the bal- anced function f with f (00) = 0. |0 − |1 √ 2 At |ψ4 we put our entire state through H ⊗ H ⊗ H and get |101 meaning that our function is balanced.3 Shor’s Algorithm 7. The DFT takes a series of N complex numThe Temple of Quantum Computing . after the H gates we get: |Ψ = |0 + |1 √ 2 |0 + |1 √ 2 |0 − |1 √ 2 .1 The Quantum Fourier Transform The quantum analogue of the discrete Fourier transform (see chapter 4) is the quantum Fourier transform (QF T ). Perry 2004 . Then at state |ψ2 . We are now ready to examine our state at |ψ3 : |Ψ = = |0 + |1 √ 2 |0 + |1 √ 2 |0 ⊕ f (x) − |1 ⊕ f (x) √ 2 |00 + |01 + |10 + |11 |0 ⊕ f (x) − |1 ⊕ f (x) √ √ 4 2 1 = √ (|00 |0 ⊕ f (00) − |00 |1 ⊕ f (00) + |01 |0 ⊕ f (01) 8 − |01 |1 ⊕ f (01) + |10 |0 ⊕ f (10) − |10 |1 ⊕ f (10) + |11 |0 ⊕ f (11) − |11 |1 ⊕ f (11) ) 1 = √ (|000 − |001 + |010 − |011 + |101 − |100 + |111 − |110 ) 8 1 = √ (|000 − |001 + |010 − |011 − |100 + |101 − |110 + |111 ) 8 = = |00 + |01 − |10 − |11 √ 4 |0 − |1 √ 2 |0 + |1 √ 2 |0 − |1 √ 2 . and f (11) = 1. So at state |ψ1 we have: |Ψ = |001 .c Riley T. f (01) = 0. 7.3.2006 . f (10) = 1.

4) We can also represent the QF T as a matrix: The Temple of Quantum Computing .. Perry 2004 .. Y1 .c Riley T.. YN −1 . QF T |Ψ is defined as: 2n−1 2n−1 |Ψ = QF T |Ψ = x=0 y=0 αx e2πixy/2 √ |y . the following state has probability amplitudes of 0 for the majority of its basis states: 1 √ (|001 + |011 − |111 ). (7.2) (7. ..g. the QF T takes a state vector: |Ψ = α0 |0 + α1 |1 + .. XN −1 and produces a series complex numbers Y0 .. + βN −1 |N − 1 . .3) where n is the number of qubits..1) The main advantage of the QF T is the fact that it can do a DFT on a superposition of states. X0 . so the previous state could have been written as: 1 √ (|1 + |3 − |7 ). The QF T is defined as follows: Given a state vector |Ψ : 2n−1 |Ψ = x=0 αx |x (7.. Similarily. + αN −1 |N − 1 and performs a DFT on the amplitudes of |Ψ giving us: |Ψ = β0 |0 + β1 |1 + .2006 . 3 It’ll helpful over the next few sections to use integers when we are describing states with a large number of qubits. This can be done on a superposition like the following: 1 √ (|00 + |01 − |10 − |11 ) 4 or a state where the probability amplitudes are of different values.. 2n n (7. E.Shor’s Algorithm 201 bers. X1 . and is reversible. 3 The QF T is a unitary operator. In fact we use the inverse quantum fourier transform (QF T † ) for Shor’s algorithm..

.. Examples follow on the next two pages.. . .7) Next we’ll look at two examples using the matrix representation of the QF T ... . n −1 1 ω2 ω4 ω6 . 1 ω ω2 ω3 . n −1)(2n −1) (7. .. .202 Shor’s Algorithm     1   √  n  2    1 1 1 1 .5) 1 ω2 where ω = e2πi/2 .. ... . .. Perry 2004 .1.  1  n n n .. √  e2πi·0·1/2 = e0 = 1 e2πi·1·1/2 = e2πi/2 = ω  2n  . The Temple of Quantum Computing .. . . here are a few values of x and y for Mxy :   n n e2πi·0·0/2 = e0 = 1 e2πi. ω (2 How do we get this matrix? To make it easier to understand we’ll identify the important part of the summation we need for the matrix representation (which we’ll label Mxy ): 2n−1 2n−1 x=0 y=0 n αx e2πixy/2 1 √ |y = √ 2n 2n n 2n−1 2n−1 Mxy αx x=0 y=0 |y (7.6) where Mxy = e2πixy/2 . . .c Riley T. 1 ω2 n −1 n −1) n            ω 2(2 ω 3(2 −1) .0/2 = e0 = 1 . . n . ω 2(2 n −1) . . (7. ..2006 . Now using the summations. . . .

which is: 1 √ 2 1 1 . Perry 2004 .c Riley T. 10 10 √2 10 The Temple of Quantum Computing . We’ll use the matrix representation. 203 1 eiπ This matrix is actually just an H gate (since eiπ = −1).2006 . Given: 2 1 |Ψ = √ |0 + √ |0 . so we get: 1 |Ψ = √ 2 = = √2 10 √2 10 1 + + + 1 √1 10 eπi √ 10 √3 10 −1 √ 10 1 eiπ 2 √ 5 1 √ 5 = √1 10 3 1 = √ |0 + √ |1 . |Ψ = QF T |Ψ .Shor’s Algorithm Example A simple one qubit QF T . 5 5 Find.

The matrix representation is:  1 1 1 1  1  1 eπi/4 eπi2/4 eπi3/4 √  4  1 eπi2/4 eπi4/4 eπi6/4  1 eπi3/4 eπi6/4 eπi9/4 So |Ψ is:   1  1 eπi/4 eπi2/4 eπi3/4 |Ψ = √  4  1 eπi2/4 eπi4/4 eπi6/4    1  =√  4    1  =√  4     =   1 1 1 1     0     0    1 √ 2 1 √ 2 Shor’s Algorithm    . 4 The Temple of Quantum Computing .c Riley T. Perry 2004 . 2 2 Find.204 Example A two qubit QF T .2006 . |Ψ = QF T |Ψ .    2 √ 8 2−1+i 4 1−i √ √ 8 2+1+i 4 √ 1 eπi3/4 eπi6/4 eπi9/4  1 1 √ +0+0+ √ 2 2  1 1 √ + 0 + 0 + √ eπi3/4  2 2  1 1 √ + 0 + 0 + √ eπi6/4   2 2 1 1 πi9/4 √ +0+0+ √ e 2 2  1 1 √ +0+0+ √ 2 2  1 √ + 0 + 0 + −1+i  √ 2 2  1 −i  √ +0+0+ √ 2 2  1 1+i √ +0+0+ √ 2 2       √ 2 = √ |00 + 8 1−i 2−1+i |01 + √ |10 + 4 8 √ 2+1+i |11 . Given: 1 1 |Ψ = √ |00 + √ |11 .

We don’t yet know fast algorithms for factorising on classical machines but we do now know (thanks to Shor) a fast factorisation algorithm we can run on a quantum computer. a one qubit QF T has the following rather simple circuit: H A three qubit QF T has a more complicated circuit: H S • • gates (Rk . The Temple of Quantum Computing . 7. if we could find the factors we could use the information provided in the public key to decrypt messages encrypted with it. Perry 2004 . Rn .3. In terms of RSA our task is simple.2 Fast Factorisation Finding unknown factors p and q such that p × q = 347347 is very slow compared to the reverse problem: calculating 129 × 156.2006 .8) For n qubits we use gates R2 . . Given an integer N we know n = pq where p and q are large prime numbers we want to calculate p and q. (7.Shor’s Algorithm How Do we Implement a QFT? As stated before.c Riley T. For more information on generic QF T circuits you’ll need to consult an external reference like QCQI. .see below) where: Rk = 1 0 k 205 T H S • H × × We can extend this logic to n qubits by using H and n − 2 different rotation 1 e2πi/2 . Public key encryption systems like RSA algorithm rely on the fact that it’s hard to factorise large numbers.

1. Perry 2004 . This means that the list of powers of x. .3.2006 . mod N will repeat with a period that is less than N . 1320 mod 55 = 1. The ”quantum” part gives us the period r in polynomial time by using a process called phase estimation. We won’t worry about explicitly understanding phase estimation as Shor’s algorithm has a number of specific steps that makes learning it unnecessary. x. Once we have the order r we can apply some further classical calculations to it to obtain a factor of N . 130 131 132 . .c Riley T. mod 55 = 4. that is: given 1 < x < N the order of x mod N is the smallest value of r where r ≥ 1 and xr mod N = 1. So r = 20. x2 . The Temple of Quantum Computing . Why? Because it turns out there’s a close connection between finding the factors and finding the period of a periodic function.206 Shor’s Algorithm 7. Phase estimation attempts to determine an unknown value γ of an eigenvalue e2πiγ of an eigenvector |u for some unitary U .e. 13 mod 55 has a period of 20. The calculation of xi mod N can be done in polynomial time and thus can be done on a classical computer. We’re trying to find the period of a periodic function. i. mod 55 = 13. Example Say we have N = 55 and we choose x to be 13.3 Order Finding To factorise N we reduce the problem of factorisation to order finding. mod 55 = 1. . x3 . . x4 . The intuition is that quantum computers might be good at this because of quantum parallelism: their ability to compute many function values in parallel and hence be able to get at ”global properties” of the function (as in Deutsch’s algorithm). .

The Continued Fractions Algorithm The continued fractions algorithm allows us to calculate an array of integers to represent a fraction.. and repeat the process until we have no fractional parts left. We simply split the fraction into its whole and fractional parts. 4. Perry 2004 .2006 . is introduced. 9 The Temple of Quantum Computing . the continued fractions algorithm. Here’s an example: Example Convert 11 9 to integer array representation.. 1. 2 11 =1+ 9 9 1 =1+ 9 2 =1+ 1 1+ 1 9 2 1 1+ 1 4+ 1 2 .Shor’s Algorithm 207 Before we look at the circuit for Shor’s algorithm. 11 . 2] which is a four element array (that took four steps) that represents Now we’ll look at the fast factorisation algorithm. store the whole part. =1+ So. A necessary component of Shor’s algorithm. we end up with the following list: [1.c Riley T.

N ) > 1.g.2006 .. Register 2 needs to be L qubits in size where L is the number of qubits needed to store N . so return 3. This is where the quantum computer comes in. that is their greatest common divisor (gcd) is 1. It’s simple. 15) = 3. 2. to return a factor f where f > 1. N ). . For a ≥ 1 and b ≥ 2 if N = ab then return f = a (we can test this classically). Perry 2004 . The algorithm is as follows: 1.. 4. if it is then we return f = gcd(x. H H H / • 1 Uf 2 Uf • • • . and there seems to be some contention in the reference material as to what this lower bound should be). . If N is divisible by 2 then return f = 2. There is an efficient classical algorithm to test if numbers are coprime.. 3. NM NM NM NM QF T † |1 3 Uf n Uf NM ↑ |ψ1 ↑ |ψ2 ↑ |ψ3 ↑ |ψ4 ↑ |ψ5 The algorithm presented here is similar to Shor’s algorithm. given a number N to be factored. and uses the QF T introduced earlier. we find gcd(3.. .. We apply the quantum order finding algorithm.. N = 15 if x = 3. .208 The Fast Factorisation Circuit and Algorithm |0 |0 |0 |0 ⊗n Shor’s Algorithm H . which is t qubits in size to |0 which is L qubits in size to |1 ⊗L ⊗t and register 2. Before we start we need to define the size of the input registers. . |ψ1 Initialise register 1. The Temple of Quantum Computing . We can test if two numbers share a common divisor efficiently on a classical computer. register 1 needs to be t qubits in size where 2N ≤ t (this is to reduce the chance of errors in the output. Randomly choose an integer x where 1 < x < N .c Riley T. In this step we test if gcd(x. E.

Shor’s Algorithm |ψ2 Create a superposition on register 1: |Ψ = |Ψ = 1 √ 2t 2t−1 r1 =0 209 |R1 |1 . N ). |R1 xR1 mod N . |Ψ 2t The Temple of Quantum Computing . Perry 2004 . With the result r first test if r is even the see if xr/2 = −1 mod N then calculate f =gcd(xr/2 ±.c Riley T. otherwise the algorithm has failed and we have to start again. |ψ3 Apply Uf R2 = xR1 mod N to register 2: 1 √ 2t 2t−1 r2 =0 |ψ4 We measure register 2. |ψ6 (not shown) Now we apply the continued fractions algorithm to and the number of steps it takes will be the period r. |ψ5 We apply QF T † to register 1 and then measure it. Over the next two pages we’ll look at a couple of worked examples of Shor’s algorithm.2006 . If the result is not 1 or N then return f as it is a factor. 5. because it is entangled with register 1 and our state becomes subset of the values in register 1 that correspond with the value we observed in register 2.

. 4 Say we observe 1536. 1536 2048 |ψ6 The result from the continued fractions algorithm for 5. so we get |Ψ = |2 + . .. 512. |ψ1 Initialise both the registers so the combined state becomes |Ψ |000000000001111 . = −1 mod N . 15) = 1 so continue.. Now. So we try gcd(72 − 1. . t = 11 qubits for register 1 and L = 4 qubits for register 2. |ψ3 applying xR1 mod 15 gives us the following: R1 R2 |0 |1 |1 |7 |2 |4 |3 |13 |4 |1 |5 |7 |6 |4 |7 |13 |8 |1 |9 |7 |10 |4 . by testing that 3 × 5 = 15 = N we see we have now found our factors... Perry 2004 ..210 Example Find the factors for N = 15 Shor’s Algorithm 1. 512 |ψ5 After applying QF T † we get either 0. + |2047 ) |15 . N = ab so continue. 1024. r is even and satisfies r 2 is 4. 4. continue. or 1536 with a probability of 1 . |ψ2 Create a superposition on register 1.2006 .) . We choose x = 7 gcd(7.. The Temple of Quantum Computing .. 2. 3. 15) = 3 and gcd(72 + 1. . Remember that both registers are actually part of the same state vector. √ 1 (|0 2048 = + |1 + |ψ4 We Measure R2 and randomly get a 4 leaving |Ψ in the following post measurement state: R1 R2 |2 |4 |6 |4 |10 |4 .c Riley T.. The state above is actually an entangled state that looks like (R2 is bolded): |Ψ = √ 1 (|000000000101000 + |000000001101000 + . 15) = 5. it’s just convenient to think of them separately. . N is not even. .

|ψ3 applying xR1 mod 55 gives us the following: R1 R2 |0 |1 |1 |13 |2 |4 .Shor’s Algorithm Example Find the factors for N = 55 211 1 & 2. We choose x = 13 gcd(13. So we try gcd(1310 − 1. so we get |Ψ = |2 + . t = 13 qubits for register 1 and L = 6 qubits for register 2. + |8189 |28 ) . 15) = 5 and gcd(1310 + 1. The Temple of Quantum Computing .. 4.c Riley T. |8189 |28 So the state vector (ie. 55) = 11. Perry 2004 . with both registers) looks like this: |Ψ = √ 1 (|9 |28 + |29 |28 + |49 |28 + . + |8191 ) |63 .. . . |ψ2 Create a superposition on register 1.. |ψ1 Initialise both the registers so the combined state becomes |Ψ |0000000000000111111 . so continue. = −1 mod N . . .. r is even and satisfies r 2 4915 8192 is 20. N is not even and N = ab .4%). Now..2006 . . 55) = 1 so continue. |8192 |2 √ 1 (|0 8192 = + |1 + |ψ4 We Measure R2 and randomly get a 28 leaving |Ψ in the following post measurement state: R1 R2 |9 |28 |29 |28 |49 |28 . by testing that 5 × 11 = 55 = N we see we have now found our factors. |ψ6 The result from the continued fractions algorithm for 5. 410 |ψ5 After applying QF T † we observe 4915 (the probability of observing this is 4. 3.... .

Perry 2004 . The Temple of Quantum Computing . with certain distances between them. Given a database table with N elements (it is best if we choose an N that is approximately 2n where n is the number of qubits) with an index i.1 The Travelling Salesman Problem An example of shortest route finding is the travelling salesman problem. . The most commonly given examples of search algorithms that can benefit from a quantum architecture are shortest route finding algorithms and algorithms to find specific elements in an unsorted database.c Riley T.4. element 1 element 2 element 3 N − 1 element N Suppose there are M solutions where 1 < M ≤ N .4 Grover’s Algorithm Grover’s algorithm gives us a quadratic speed up to a wide variety of classical search algorithms. Our table is shown below: 0 1 2 . 7.2006 . . Suppose we have M different solutions for k then the time complexity for Grover’s algorithm is O( M ).212 Grover’s Algorithm 7. Put simply.2 Quantum Searching For the purpose of explaining Grover type algorithms we’ll use an unsorted database table as an example. N 7.4. given a number of interconnected cities. Is there a route of less than k kilometres (or miles) for which the salesman can visit every city? With Grover’s algorithm it is possible to complete to search for a route of less √ than k kilometres in O( N ) steps rather than an average of N (which is O(N )) 2 steps for the classical case.

. ↑ |ψ4 ↑ |ψ5 ↑ |ψ6 G NM The steps for the algorithm for M = 1 are as follows: |ψ2 Initialise qubits states. Typically there are extra work qubits leading into the oracle that may behave as ancilla qubits. The oracles functions are very similar to the Deutsch Josza algorithm. |0 .Grover’s Algorithm 213 In a similar way to Deutsch’s algorithm we use an oracle to decide if a particular index.e.10) The function f (x) contains the logic for the type of search we are doing. This is called an oracle’s workspace (represented by w)..2006 . (7. . |q is a qubit and O is the oracle. The search algorithm can actually be made up of several oracles. x is a marked solution to the problem. f (x) = 0 otherwise. Perry 2004 .9) here |x is a register. The oracle circuit looks like this: |x |q /n Uf q ⊕ f (x) As with the Deutsch Josza algorithm if we set q to |1 and then put it through an H gate the answer appears in the |x register and |q appears the same after the calculation so we end up with: |x → O → (−1)f (x) |x . as shown below: |x |q → O → |q ⊕ f (x) (7.. .. The Temple of Quantum Computing . . i. f (x) = 1 if x is a solution.c Riley T. The circuit for Grover’s algorithm is shown below: |0 /n H ⊗n |0 |w / ↑ |ψ1 ↑ |ψ2 G |0 ↑ |ψ3 G .

214

Grover’s Algorithm

|u
T ¡ ! ¡

G3 |ψ
¡ ¡

G2 |ψ
       B ¨ ¨¨

¡   ¨ ¡   ¨¨ ¡ ¨ ¨¨   ¡

¡

¡ ¡

¡

¡

 

 

 

G1 |ψ

¨ ¨¨

¨

E |v

Figure 7.1: Visualising grover’s algorithm. |ψ2 We put |x into a superposition: 1 |x → √ N
N −1

|x .
x=0

|ψ3 → |ψ5 Each G is called a Grover iteration that performs the oracle and a conditional phase flip on |x which flips the sign on all qubits except for |0 (denoted by CPF below). This is done after collapsing the superposition on |x via H ⊗n . After the phase flip is completed the |x register is put back into a superposition. Each G looks like the following: |x |q |W / /n |x → (−1)f (x) |x H ⊗n CPF H ⊗n

√ For M = 1 we will need to apply G π 2n /4 times. |ψ6 Finally we measure, as we have M = 1 the register |x will contain the only solution. If we had M > 1 we would randomly measure one of the possible solutions.

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Grover’s Algorithm Visualising Grover’s Algorithm We can define the superposition of solutions to Grover’s algorithm as: 1 |u = √ M |x
=

215

(7.11)

and the superposition of values that are not solutions as: |v = √ 1 N −M |x .
=

(7.12)

The operation of Grover’s algorithm can be seen if figure 7.1 as a series of rotations of |Ψ from |v to |u . With each individual rotation being done by G, a grover iteration. A simple exmample follows: Example Suppose we have an index size of 4, which gives us N = 4. We

have only one solution so M = 1 and our function, f (x) has a marked solution at x = 0. This is like saying the element we are looking for is at index i = 0. These are the results returned by an oracle call: f (0) = 1, f (1) = 0, f (2) = 0, and f (3) = 0. The size of register |x is 2 qubits. We also have a workspace of 1 qubit (which we set to |1 ), which we put through an H gate at the same time as the qubits in |x initially go through their respective H gates (we’ll ignore oracle qubit q for this example). The steps for the algorithm are as follows: |ψ1 We initialise |x and |w , so |Ψ = |001 . |ψ2 |x and |w go through their H gates giving us |x = |10 + |11 ] and |w =
1 √ [|0 2 1 √ [|00 4

+ |01 +

− |1 ].

|ψ3 A single grover iteration is all we need to rotate |x to match |u (the marked solution) so we jump straight to |ψ5 . |ψ5 Now |x = |00 . |ψ6 Measuring register |x gives us a 0.

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Chapter 8 Using Quantum Mechanical Devices
8.1 Introduction
Today’s manufacturing methods can make chips (figure 8.1) with transistors a fraction of a micron wide. As they get smaller, chips also tend to get faster. Computer power doubles every few years (according to Moore’s law) and we’ll soon reach the threshold below which transistors will not work because of quantum effects. At tens of nanometres (which we are close to now) electrons can tunnel between parts of a circuit, so transistor technology may not be able to shrink much further [Benjamin, S. & Ekert, A. ? 2000]. In 1998 Neil Gershenfeld (MIT) built a three qubit device, then in 2000 Ray LaFlemme built a seven qubit quantum computer. Currently we are still limited to tens of qubits and hundreds of gates with implementations being slow and temperamental. The architectures of these machines vary, with scientists even talking about using cups of coffee and small amounts of chloroform to build a working quantum computer [Blume, H. 2000].

8.2 Physical Realisation
We’ll take a quick look at physical realisations here, but a warning for those expecting detail - this section is mainly here for completeness and is strictly an introduction. According to Nielsen and Chuang [Nielsen, M. A. & Chuang, I. L. 2000] there 217

218

Physical Realisation

Figure 8.1: A silicon chip [Benjamin, S. & Ekert, A. ? 2000]. are four basic requirements for the physical implementation of a quantum computer. They are: 1. Qubit implementation - The biggest problem facing quantum computing is the fickle nature of the minute components they work with. Qubits can be implemented in various ways, like the spin states of a particle, ground and excited states of atoms, and photon polarisation. There are several considerations for implementing qubits, one consideration is high decoherence times (low stability). E.g. 10−3 seconds for an electron’s spin, and 10−6 seconds for a quantum dot (a kind of artificial atom). Another consideration is speed, the stronger the qubit implementation can interact with the environment, the faster the computer. E.g. nuclear spins give us much slower ”clock speed” than electron spins, because of the nuclear spin’s weak interactions with the ”outside world”. There are two types of qubits, material qubits like the stationary ones described above and flying qubits (usually photons). Stationary qubits are most likely to be used to build quantum hardware, whereas flying qubits are most likely to be used for communication. 2. Control of unitary evolution - How we control of the evolution of the cirThe Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

all of which. The Temple of Quantum Computing .g. We need to do this in a way that does not disturb other parts of our quantum computer. ? 2000]. Initial state preparation (qubits) . photons do not interact well with the environment.R. We need to be able to initialise qubits to values like |000 . & Williams. 4.E. P.P. There remain other problems with single photon detection (which is very hard to do). Gates can be represented by beamsplitters. C. 8. . 2003] has suggested two more ”fundamental requirements”: 5. . • Optical photon computer . Perry 2004 . 219 3. David P. E.This is the easiest type of quantum computer to understand. which for example leaves the qubit in the state which can be used later for initialisation. This is not just for initial values of a circuit.Setting the values of initial qubits. at present suffer from poor scalability.c Riley T. One of the ways qubits can be represented is by the familiar polarisation method. Divenco [Divincenzo. Decoherence times need to be much longer than quantum gate times. so we have to consider ”copying” values of the output qubits and averaging the results. D. stable qubits.Physical Realisation cuits. In practice. Measurement is done by detecting individual photons and initial state preparation can be done by polarising photons.1 Implementation Technologies There are many theoretical ways to implement a quantum computer. .Measuring qubits. we also need to consider if the measurement is a non destructive measurement. D.2006 . quantum error correction needs a constant supply of pre-initialised. 6.J. We need a way of measuring the state of our qubits. Kuhn.2. Also. Another issue is that measurement techniques are less than perfect. and the fact that photons are hard to control as they move at the speed of light. Two of the important methods are listed below [Black. Measurement of the final state(s) . A universal set of quantum gates. although there are new methods that use entanglement to combat this problem.

220

Quantum Computer Languages

• Nuclear magnetic resonance - NMR uses the spin of an atomic nucleus to represent a qubit. Chemical bonds between spins are manipulated by a magnetic field to simulate gates. Spins are prepared by magnetising, and induced voltages are used for measurement. Currently it is thought that NMR will not scale to more than about twenty qubits. Several atomic spins can be combined chemically in a molecule. Each element resonates at a different frequency so we can manipulate different spins by producing a radio wave pulse at the correct frequency. This spin is ”rotated” by the radio pulse (the amount of which depends on the amplitude and direction). A computation is made up of a series of timed, and sized radio pulses. We are not limited to using atoms as they can be combined to form a macroscopic liquid with same state spins for all the component atoms. A seven qubit computer has been made from five fluorine atoms whose spins implement qubits. To explain these in detail is beyond the scope of this text and there are many more implementation technologies like ion traps (a number of ions, trapped in a row in a magnetic field), SQUIDS (superconducting quantum interference devices), electrons on liquid helium, optical lattices, and harmonic oscillators.

8.3 Quantum Computer Languages
Even though no quantum computer has been built that hasn’t stopped the proliferation of papers on various aspects of the subject. Many such papers have been written defining language specifications. Some quantum languages are listed below [Glendinning, I. 2004]. ¨ • QCL - (Bernhard Omer) C like syntax and very complete. Accessible at http: //tph.tuwien.ac.at/∼oemer/qcl.html . • qGCL - (Paolo Zuliani and others) Resembles a functional programming lan¨ guage and claims to be better than Bernhard Omer’s QCL because QCL does not include probabilism and nondeterminism, has no notion of program refinement, and only allows standard observation. Accessible via http://web.comlab.ox.ac.uk/oucl/work/paolo.zuliani/ . The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Encryption Devices

221

Figure 8.2: id Quantique’s QKD device. • Quantum C - (Stephen Blaha) Currently just a specification, with a notion of quantum assembler. Accessible at http://arxiv.org/abs/quant -ph/0201082 . • Conventions for Quantum Pseudo Code - (E. Knill) Not actually a language, but a nice way to represent quantum algorithms and operations. Accessible at www.eskimo.com/∼knill/cv/reprints/knill :qc1996e.ps . Question It seems odd that there is no implementation of quantum BASIC,

is there any existing work? Maybe just a specification?

8.4 Encryption Devices
The first encryption devices using the quantum properties discussed previously have been released. For example, a quantum key distribution unit developed by id Quantique (which can be found at http://www.idquantique. com/) is pictured in figure 8.2 and another encryption device was recently released by MagiQ. Whether or not they become commercial success may affect the future of the field as a whole.

The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Appendix A Complexity Classes
A.1 Classical

Here is a summary of some of the main complexity classes. Most of these definitions are copied verbatim from [cs.umbc.edu.edu 2003]: P - the set of languages accepted by deterministic Turing machines in polynomial time. NP - the set of languages accepted by nondeterministic Turing machines in polynomial time. NPI (NP intermediate) - the set of languages in NP but not in NP-complete. co-NP - the set of languages rejected by nondeterministic Turing machines in polynomial time. NP-complete - a decision problem in NP is NP-complete if all other problems in NP are reducible to it. EXP - the set of languages accepted by deterministic Turing machines in t(n) = 2cn time. NEXP - the set of languages accepted by nondeterministic Turing machines in t(n) = 2cn time. PEXP - the set of languages accepted by deterministic Turing machines in t(n) = 2p(n) time. 223

224

Classical

NPEXP - the set of languages accepted by nondeterministic Turing machines in t(n) = 2p(n) time. UP - the set of languages accepted by unambiguous nondeterministic Turing machines, that have at least one accepting computation on any input, in polynomial time. The next set of classes relate to space complexity - which is the amount of space (storage) required by the algorithm. LOGSPACE - the set of languages accepted by deterministic Turing machines in logarithmic space. PSPACE - the set of languages accepted by deterministic Turing machines in polynomial space. NPSPACE - the set of languages accepted by nondeterministic Turing machines in polynomial space. NLOGSPACE - the set of languages accepted by nondeterministic Turing machines. The final set of classes refer to probabilistic Turning machines: PP - the set of languages accepted by probabilistic polynomial-time Turing machines (not proved random = pseudo random). BPP - the set of languages accepted by bounded probabilistic polynomial-time Turing machines (balanced probability). RP - the set of languages accepted by random probabilistic polynomial-time Turing machines (one sided probability). co-RP - the set of languages accepted by RP machines with accept and reject probabilities reversed. ZPP - RP intersection co-RP, the set of languages accepted by zero probability of error polynomial-time Turing machines. Some of the main classes are related in the following way [Nielsen, M. A. & Chuang, I. L. 2000]: • L ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP. The Temple of Quantum Computing - c Riley T. Perry 2004 - 2006

Quantum • Factoring is thought to be in NPI and not proven to be in NP-complete. & Chuang. also BPP ⊆ BQP. 225 • Graph isomorphism is thought to be in NPI and not proven to be in NPcomplete. Z. I. The Temple of Quantum Computing . • It is thought that NP-complete problems cannot be solved by QTMs in polynomial time but NPI problems can.e. L.the problem can certainly be solved by a QTM in polynomial time at worst.the problem can be solved by a QTM in polynomial time at worst with 2 probability greater than 3 . A. with ZP ⊂ ZQP. 2002]: QP . Perry 2004 . These definitions are copied verbatim from [Meglicki. in 1 3 of cases the computer may return an erroneous result. A. • Space hierarchy theorem: SPACE(f (n)) ⊂ SPACE(f (n) log(f (n))). M. ZQP . BQP . I. 2000]: • It is known that polynomial quantum algorithms are in PSPACE.c Riley T.2 Quantum Some of the quantum complexity classes are listed below. • Time hierarchy theorem: TIME(f (n)) ⊂ TIME(f (n) log2 (f (n))). Some of the quantum complexity classes are related in the following way [Nielsen.the problem can be solved by a QTM without errors in polynomial time. with P ⊂ QP.2006 .

.

P.E. A Short Introduction to Quantum-Scale Computing.Bibliography Arizona. A. C. Kuhn.consciousness.htm [Accessed 5 December 2004] Baeyer. & Williams. Available: http://www.cse.Qubit. S. H.edu/quantum/Library/qmlecture1. Lecture 1 [Online]. ? 2000. Quantum Computing and Communication [Online]. Available: http://www.it/people/serafini/quantum-computing/seminars/20001006-slides. arizona. A Short Introduction to Quantum Computation [Online].org/library/ intros/comp/comp. New Scientist. & Ekert. ? 2004.R. 2000. 2000. A.J. February 17 Banerjee.nist. Reimagining the Cosmos.in/\∼suban/quantum/lectures/ lecture1. C. html [Accessed 4 July 2004] Bettelli. S. 2001. [Online]. Available: sra. Available: http://www. A.pdf [Accessed 7 December 2004] Blume. & Machiavello.edu 1999.ps [Accessed 5 December 2004] Black.gov/∼black/Papers/ quantumCom.ernet. D. itc. Available: http://www. ? 2000.iitd. A. In the Beginning was the Bit. Available: http://www. H. Introduction to Quantum Algorithms [Online]. [Online]. theatlantic. Ekert.qubit. 1996.com/unbound/digicult/dc2000-05-03.Lecture 1 [Online]. C.htm [Accessed 4 July 2004] 227 .org/library/intros/nano/nano. Quantum Computation and Information Theory . Sanpera. Available: http://hissa.html [Accessed 30 June 2004] Benjamin.pdf [Accessed 4 July 2004] Barenco. S.

Wiley Press. Available: http://www. Available: http://www. [Online].mass.indigosim.cl. Do I Invest in Quantum Communications Links For My Company? [Online].net/turing archive/pages/ReferenceArticles /WhatisaTuringMachine. 1998. Arvind.edu. 2000. S.ernet. Kumar.ualberta. Implementation of a Deutsch-like quantum algorithm utilising entanglement at the two-qubit level on an NMR quantuminformation processor [Online].2006 . Physics World.ic.J.htm Deutsch.edu/∼tevans/VonNeuma. John von Neumann and von Neumann Architecture for Computers [Online].com/tutorials/communication/t3s2. What is a Turing Machine? [Online].csee. & Ekert. alanturing. On Quantum Computing and AI (Notes for a Graduate Class). & Lo.edu 2003. L. Quantum Computation. 1997.umbc.shtml [Accessed 7 Decem- ber 2004] Dawar. 1st edn. H.edu/help/theory/classes.htm [Accessed 9 September 2004] Castro. A.cam.doc. ? 2000. 2002.228 BIBLIOGRAPHY Braunstein. March The Temple of Quantum Computing .umbc.salem. ?.iisc. Available: http://www.ac. Scalable Quantum Computers . J. 2000. Complexity Class Brief Definitions [Online].cs. M.pdf [Accessed 4 July 2004] Designing Encodings ? 2000. B. Available: http: //www. [Online]. A.Paving the Way to Realisation.html [Accessed 9 August 2004] cs. A.ac. Available: www. Available: http://www. Quantum Computing .c Riley T. K. 2004. V. Canada. D. Bulitko.uk/∼nd/surprise 97/journal/ vol1/mjc5/ [Accessed 4 July 2004] Copeland. pdf [Accessed 10 December 2004] Cabrera. Available: http: //www.uk/Teaching/current/QuantComp/ [Accessed 4 July 2004] Dorai. Designing Encodings [Online].in/archive /00000300/01/Deutsch.Lectures. 2001. Available: http://eprints.V. K. Perry 2004 .ca/∼bulitko/qc/schedule/qcss-notes.

Auckland.arizona. Forbes. J. ? 2003. merriampark. ? 2003.edu/∼jbm04747/courses/fall2001/cs10/lectures/Computation /Computation. ? Knill. Dalvit. vol. 1993. Big Square Roots [Online]. Available: http://pages. A.shtml [Accessed 4 July 2004] Hameroff. Morton. Lecture 6 [Online].at/∼ian/hotlist/qc/programming. M. The Physical Implementation of Quantum Computation. & Zurek. UK. & Conrad. quant-ph/0002077. E. 2001. ?. ? 2000. I. An Incomplete Education . S. New Scientist. M. Available: http://www.edu/Quantum/ [Accessed 30 June 2004] Hameroff. Skills in Mathematics Volumes 1 and 2.edu/Quantum/week6. Icon Books.htm [Accessed 9 September 2004] Glendinning. J. Consciousness at the Millennium: Quantum Approaches to Understanding the Mind. 2003. Barnum. 2nd edn. 13 April. Theory of Computation [Online]. and Rae. Gilleland. Consciousness at the Millennium: Quantum Approaches to Understanding the Mind. S. M. Quantum Programming Languages and Tools. 0. Gubernatis. Available: http://www.c Riley T. J. 2nd edn. The Temple of Quantum Computing .htm [Accessed 30 June 2004] Jones. [Online]. 2002. Rae H. H. Perry 2004 . Quantum Keys for Keeping Secrets. W. pomona. Ekert. D. ? edn. 2004.2006 . Introducing Quantum Theory. Wilson. 1995. & Zarate.consciousness.H. Viola. Jan 16 Forbes.html [Accessed 9 August 2004] McEvoy. Morton.BIBLIOGRAPHY 229 Divincenzo. D. 1991. Introduction to Quantum Information Processing Marshall.univie. Available: http:// www. Introductory Lectures [Online]. G. S.arizona. 2002.P. Dziarmaga. L. L.com/bigsqrt.ac. Available: http://www. Gurvits. J.P. Ortiz.vcpc. R. Laflamme. consciousness. W. J.

R.net/Synopsis/s26Goedel. M.A Primer [Online]. Available: http:// citeseer. A.indiana. 2002. Cambridge Press. Ask the Astronomer (Question) [Online]. 1996. 1997.cs.ist. & Chuang.ucs. A. pp.html [Accessed 30 June 2004] Rae. I.edu/shatkay95fourier. Goedel [Online].psu.230 BIBLIOGRAPHY Meglicki. M. Quantum Complexity and Quantum Algorithms [Online]. 20-25. Scientific American. S. Available: http: //www.html [Accessed 30 June 2004] Nielsen. L. A.net/qadir/q971. Available: http: //history.html Nielsen.html [Accessed 9 September 2004] Stay.auckland. Searle. The Fourier Transform .html [Accessed 29 April 2006] Shatkay. Cambridge Press. Quantum Physics: Illusion or Reality?.org/people/nielsen/qicss. Available: http://www.acusd.astronomycafe. Odenwald.edu/gen/recording/jacquard1. Available: http://cm. Available: http://www .html [Accessed 7 December 2004] Natural Theology 2004. Available: http://www. 2004.ac. M.nz/∼msta039/deutsch. Shannon.c Riley T. Quantum Computation and Quantum Information. Perry 2004 . Is the Brain’s Mind a Computer Program. 2000. UK. 1990. 3rd edn. H. 1948. Z. UK. Jacquard’s Punched Card [Online]. J. 2nd edn. Eight Introductory Lectures on Quantum Information Science [Online].bell-labs. January.2006 . 2002. 1995. A Mathematical Theory of Communication [Online]. E.qinfo.com/cm/ms/what/shannonday/paper. Available: http://beige.html [Accessed 10 December 2004] Smithsonian NMAH 1999.edu/B679/node27. Deutsch’s algorithm with a pair of sunglasses and some mirrors [Online]. C.naturaltheology.txt [AcThe Temple of Quantum Computing .

2006 .thefreedictionary. Rept.tu-freiberg.dcs.es/cursos/tco/ http://www-groups.dcs. 2002.ac. A. vol.berkeley. Quantum Computing. Complexity classes P and NP [Online]. 117173 TheFreeDictionary.1 http://www.html Figure 2.mathe.4 aima.com/groversalgorithm [Accessed 4 July 2004] TheFreeDictionary.BIBLIOGRAPHY cessed 4 July 2004] 231 Steane.ac. 1st edn.org/wiki/Complexity classes P and NP [Accessed 3 November 2004] Wolfram.cs.inzine.cs.sk/article.Phys.htm http://www.html Figure 2.2 http://www. Available: http:// en.de/∼dempe/schuelerpr neu/babbage.Prog.com 2004.st-and.c Riley T.edu/cover. Grover’s Algorithm [Online]. Perry 2004 . Wolfram Media.uk/∼history/Mathematicians /Turing.asp?art=8491 Figure 2.us. 1998. M.com/Probabilistic+Turing+machine [Accessed 3 December 2004] wikipedia.wikipedia.html The Temple of Quantum Computing .st-and. A New Kind of Science. Available: http:// encyclopedia. USA Image References Figure 2.3 http://www-groups. 61 pp.com 2004. Probabilistic Turing machine [Online]..uk/∼history/Mathematicians /Von Neumann.org 2004. Available: http://encyclopedia.thefreedictionary. S.

uk/∼history/PictDisplay/Helmholtz.ac.UGent.svarog.ac.jpg http://www.2 http://www-gap.html Figure 2.st-and.6 http://www-gap.c Riley T.st-and.edu/schools/hum sci/physics/whatis/biography /dalton.htm Figure 4.eat-online.ac.org/filozofija/graph/democritus.12 http://www.html Figure 4.st-and.5 BIBLIOGRAPHY http://www.uk/∼history/Mathematicians/Godel.phy.dcs.net/english/education/biographies/clausius\.elis.html http://www-gap.html http://www-gap.html http://www-groups.html The Temple of Quantum Computing .ac.ac.uk/∼history/PictDisplay/Fourier.html http://www.dcs.232 Figure 2.html Figure 4.uk/∼history/Mathematicians/Newton.st-and.ac.st-and.caltech.st-and.ac.2006 .html Figure 4.9 http://www-gap.dcs.ac.4 http://www-gap.dcs.be/ELISgroups/solar/projects/computer.9 http://pr.html Figure 4.1 http://www-gap.dcs.uk/∼history/PictDisplay/Galileo.dcs.uk/∼history/Mathematicians /Boltzmann.html http://www-gap.ac.bg.yu/web projects/giants/hilbert.st-and.html Figure 3.uk/∼history/Mathematicians/bohr.slcc.st-and.edu/events/caltech nobel/ Figure 2.dcs.uk/∼history/Mathematicians /Copernicus.st-and.3 http://www. Perry 2004 .ac.dcs.dcs.uk/∼history/Mathematicians/Maxwell.

st-and.uk/∼history/Mathematicians/Planck.dcs.mcs.html http://www-gap.html http://www.html http://www-gap.html Figure 8.ac.st-and.2006 .st-and.7 233 http://www-gap.uk/∼history/Mathematicians /Schrodinger.html Figure 4.html http://www-gap.st-and.dcs.st-and.8 http://www-gap.st-and.html Figure 4.14 http://www-groups.html Figure 4.html Figure 8.dcs.9 http://www.dcs.org/EducationalServices/chemach/ans/er.uk/history/PictDisplay /Shannon. Perry 2004 .st-and.c Riley T.uk/∼history/PictDisplay/Dirac.dcs.ac.2 http://www.dcs.15 http://www-gap.1 http://www-history.dcs.dcs.ac.html Figure 6.ac.dcs.chemheritage.1 http://www.st-and.ac.com/ The Temple of Quantum Computing .idquantique.uk/∼history/Mathematicians /Sommerfeld.dcs.org/MAZZAR/thinkquest/History/Thomson.ac.ac.uk/∼history/Mathematicians/Born.uk/∼history/PictDisplay/Einstein.uk/∼history/Mathematicians/Broglie.st-andrews.ac.13 http://www-gap.qubit.htm Figure 4.ac.html http://www-gap.uk/∼history/PictDisplay/Boole.BIBLIOGRAPHY Figure 4.ac.uk/∼history/PictDisplay/Balmer.ac.html Figure 4.st-and.html http://www-gap.html http://www-gap.dcs.trinityprep.uk/∼history/PictDisplay/Born.org/oldsite/intros/nano/nano.ac.uk/∼history/PictDisplay/Pauli.st-and.st-and.

.

32 Christmas pudding model. 32 Asymptotically equivalent. 28. 178 Bennet. 15 Classical wires.. Rudolf . 94 Caesar cipher. 98 Basis. 92 CNOT gate. 94 Boltzmann’s constant. 6 Church-Turing thesis. 57 BB84. 15 Angles in other quadrants. 171 Classical gates. 4 Ancilla bits. 187 Bright line spectra. 90 Classical redundancy and compression. 100 Church. 104 Bra. Niels.H. 91 Cavity. 6 Classical circuits.Index Absorbtion spectrum. 19 235 . 91 Artificial intelligence. 15 Clausius. 38 Anti-Commutator. 21 Atoms. 14 Classical information sources. 142 AND gate. G. 70 Characteristic polynomial. 4 Balmer. 162 Binary numbers. 95 Channel capacity. Alonzo. 60 Cause and effect. 14 Classical complexity classes. Charles. 120 Bohr. 138 Code wheel. 97 Adjoint. 156 Born. 160 Classical registers. 95 Black body radiation. 21 Big Θ notation. 29. Charles. 70 Chinese room. 28 Big Ω notation. 143 Bits. 191 Bell state circuit. Ludwig. 54 Commutative law of multiplication. 68 Analytical engine. 104 Boole. Johann Jakob. 56 Bra-ket notation. 157 Characteristic equation. C. 171 Bit swap Circuit. 6 Binary representation. 186 Classical error correction. 187 Bennett. 91 Automaton. 158 Classical physics. 9 Babbage. 8 Binary symmetric channels. 8 Black body. 171 Column notation. 186 Codewords. 60 Brassard. 97 Bubble sort. 128. 95 Bloch sphere.. 186 Cauchy-Schwartz inequality. 77 Aristotle. 223 Classical Cryptography. 21 Binary entropy. George. 144 Bell states. 156 Boolean algebra. 94 Boltzmann. 21 Big O notation. Max.

2006 . 18 Constant coefficients. 194 Deutsch. 91 Deterministic Turing machines. Perry 2004 . 169 The Temple of Quantum Computing . 149. 90 Copying circuit. 81 Full rank. 36 Formal languages.Church . 97 Ensemble point of view. 68 Complex conjugate. 208 Feynman. 111 Entropy. 25 Deutsch’s algorithm. 38 Copenhagen interpretation. 142 Conventions for quantum pseudo code. 223 Computational basis. 70 Eigenvalue. 76 Dirac. Jean Baptiste Joseph. Louis. Kurt. 81 Fredkin gate. 23 Decoherence. 70 Degrees. 82 Fourier transform. David. Paul. 50 Determinism. 43 Complexity classes. 185 CSS codes. 33 Democritus. 18 FANOUT. 92 Fluctuation. 38 Democritan. 41 Complex plane. 28 Control of unitary evolution. 18 Cryptology. 42 Complex number. 36 Continued fractions algorithm. 98 Emission spectrum. 103 Decision problem. 165 Entangled states. 81 Dot product. 169 Fourier series. 218 For all. 56 INDEX Four postulates of quantum mechanics. 59 ¨ Godel’s incompleteness theorem. 70 Einstein. 178 de Broglie. 205 Fast Factorisation algorithm. 141 Frequency domain.Turing principle. 91 Density matrix. Galileo. 97 Electromagnetism. Albert. 11 First law of thermodynamics. 116 Diagonalisable matrix.c Riley T. 198 Diagonal polarisation. 6 Galilei. 112. 6 ¨ Godel. 164. 24 Finite state automata. 53. 175 Excited state. 81 Fourier. 178 Error syndrome. 128. 143 CROSSOVER. 105 Copernicus. 219 Controlled U gate. 127 Entanglement. 105 Discrete fourier transform. 90 FANIN. 221 Converting between degrees and radians. 97 Control lines. 23 Deutsch . 208 Fast Factorisation circuit. Richard. 30. 50 Fundamental point of view. 90 Electron. 101 Exponential form. 111 EPR pair. 93 EPR. 18 Fast factorisation. 168 Completeness relation. 57 Computational Resources and Efficiency. 70 Eigenvector. 25 Deutsch-Josza algorithm.236 Commutator. 77 Completely mixed state. 164 Determinant. 45 Dual vector. 173 Degenerate. 207 Continuous spectrum. Nicolaus. 9 Eigenspace. 94 Flying qubits.

100 Grover workspace. Lov. 212 Grover. 16 Norm. 220 Local state. 4 New quantum theory. 160 Linear combination. 104 Helmholtz. 53. 193 Inverse matrix. 42 Moore’s law. 194 Gram Schmidt method. 8 Length of codes. 111 Logarithms. 26 Jacquard. 5 Moore.W. 90 Measurement of final states. 157 Message Source. 221 Identity matrix. 42 Normal operator. Rolf. 43 Independent and identically distributed. Joseph Marie. 26 Least significant digit. 37 Imaginary axis.c Riley T. 22 Nuclear Magnetic Resonance. 191 NAND gate. 163 Modulus. 73. 92 Hermitian operator. 23 Non-deterministic polynomial time. 36 237 The Temple of Quantum Computing . R. 80 Landauer’s principle. 158 Initial point. 219 Message Destination. 47 Matrix entries. 49 If and only if. Ada Augusta. 12 Heisenberg uncertainty principle.2006 . 113 Hadamard gate. 213 Grover’s algorithm. 95 Newton. 51. 149 Noisy channels. 28. 201 Invertible. 4 Kronecker product. 150 Matrices. 28 King. 22 NOR gate. Gordon. 4 Ket. 138 Mutual key generation. 27 Maxwell. 134 Haltig problem. 62 NOT gate. 64 Linearly independent. Jon Von. 51 Inner product. 22. Werner. 157 Message Receiver. 90 Newtonian mechanics. 15 NOT2 gate.INDEX Garbage bits. 49 Inverse quantum fourier transform. 142 Global phase. David. 48 Maxwell’s demon. 16 Neumann. 219 Non deterministic Turing machines. 107 Intractable. 26 Landauer. 59 Interference. 171 Non destructive measurement. 156 Mixed states. 221 Marked solution. 90 No programming theorem. 40 Logical symbols. 57 MagiQ. 64 Ground state. Issac. 6 id Quantique. 156 Message Transmitter. 60 Hilbert. 73 Normalise. 105 Heisenberg. 47 Matrix arithmetic. Perry 2004 . 56 Linear operator. 213 Markov process. James Clerk. 76 Hilbert space. 119 Keyes. 140 NP. 47 Matrix addition. 54. 118 Global properties of functions. 5 Multi qubit gates. Von.. 47 Matrix multiplication.

78 Polar form. 187 Quantum noise.c Riley T. 63 Outer product. 136 Pauli operators. 95 One-time PAD. 225 Quantum computer languages. 212 Quantum Turing machine. Perry 2004 . 22 Panexperientielism. 127. 187 Quantum dot. 89 Quantum money. 135 P. 102 Period. 200 Quantum fourier transform circuits. 123 Pauli exclusion principle. 15 Oracle. 194 Order. 114 Quantum C. 25 Qubit implementation. 42 Polarisation of photons. 221 Quantum circuits. 153 Principle of invariance. 206 Phase estimation. 129 Quantum complexity classes. 50 Rationalising and dividing complex numbers. 218 Quantum fourier transform. 224 Probabilistic Turing machine. 33 Public key encryption. 220 Quantised. 133 Photoelectric effect. 171 gate. 61 Orthonormal basis. 18 Probabilistic complexity classes. 33 Partial Measurement. 206 Orthogonal. 73. 168 Relative phase.238 Nuclear spins. 38 Rank. 22 Polynomially equivalent.2006 . 206 Phase gate. 219 OR gate. 218 Qubit initial state preparation. 58 Probability distribution. 76 POVMs. 163 Quantum key distribution. 37 QCL. 220 Quantum cryptography. 123 Partial measurement. 96 Polar coordinates. 130. 188 Quantum repetition code. 25 Polynomials. 110 Polynomial time. 66. 89 Quantum bits. 36 Positive operator. 151 Proto-conscious field. 189 Quantum logic gates. 219 Qubits. 103 Rectilinear polarisation. 44 Rayleigh-Jeans law. 127 Projectors. 65 Outer product notation. 101 Quantum packet sniffing. 205 Quantum information sources. 117 Repetition. 20 Radians. 133 Planck’s constant. 186 Pure states. 130 Quantum mechanics. Wolfgang. 206 Order finding. 173 Quantum searching. 24 Probability amplitudes. 96 π 8 INDEX Projective measurements. 158 Programmable quantum computer. 172 Quantum numbers. 74 Pauli. 220 qGCL. 43 Polar decomposition. 148 The Temple of Quantum Computing . 163 Pythagorean theorem. 114 Quick sort. 110 Observable. 127 Old quantum theory. 102 Pauli gates. 187 Optical photon computer. 116 Reduced density matrix.

205 Rutherford. 31 Reversible computation. Peter.2006 . 4 Von Neumann entropy. 36 Thermodynamics. 93 Steane code. 4 Universal Turning Machine. Claude E.. 178 State vector. 32 Strong Church-Turing thesis. 37 Trigonometry identities. 141 Total information. 32 Wheeler. 110 Unit vector. 102 Source of Noise. 47 Scalar multiplication by a matrix. 26 Right angled triangles. 92 Shannon Entropy. Arnold. 37 Rotation operators. 50 Trap door function. 55 239 Vector scalar multiplication and addition. 79 Spin. 187 Travelling salesman problem. 62 Unitary operator. Alan. 134 Stabiliser codes. 161 Shannon’s communication model. 137 RSA. 50 Socratic. 38 Trigonometry. 47 ¨ Schrodinger’s cat. Joseph J. 79. 51 There exists. Ernest. 146 Tensor product. John. 168 Superdense coding. 98 Time domain. 164 Searle. 200 Shor. 6 Turing test. 28 Reversibly. 172 Reversible circuits. 51 Visualising grover’s algorithm. 191 Wien’s law. 102 Square root of NOT gate. 155 Shor code. 78 Singular. 55 Vectors. 78 Single qubit gates. Erwin. 4 Uncertainty. 191 Trace. 130 The Temple of Quantum Computing . 98 Scalar. John Archibald . 100 Rydberg constant. 14 Turing Machine. 178 Strong AI. 32 Turing. 113 Shortest route finding. 212 Simultaneous diagonalisation theorem. 145 Superposition. 104 Schumacher compression. 116 Statistical correlation. 187 Wire. 212 Trigonometric inverses. 105 ¨ Schrodinger. 23 subsystem point of view. 169 Weak AI. 156 Spanning set. 40 Truth tables. 11 Vector addition. 164. 28 Reversible gates.c Riley T.. 32 Second law of thermodynamics. 177 Shor’s algorithm. 111 Statistical mechanics. 58. 71 Transpose matrix. 123 Terminal point. Perry 2004 . 103 Wiesner. 81 Toffoli gate. 170 Schumacher’s quantum noiseless coding theorem. 57 Spectral decomposition. 107 Teleportation circuit. 33 Sommerfeld. 186. 130 Single value decomposition. 156 Shannon’s noiseless coding theorem. 161 Shannon. 193. 215 Von Neumann architecture.INDEX Repetition codes. 91 Thomson. Stephen. 29. 73 Universal computer.

49 Zero memory information sources. 23 XOR gate. Perry 2004 . 191 Zero matrix.c Riley T. 16 Zellinger. 159 Zero vector. 55 INDEX The Temple of Quantum Computing .240 Witnesses. Anton.2006 .