Full Chapter Quantum Computing Fundamentals From Basic Linear Algebra To Quantum Programming 1St Edition Easttom Ii PDF
Full Chapter Quantum Computing Fundamentals From Basic Linear Algebra To Quantum Programming 1St Edition Easttom Ii PDF
Full Chapter Quantum Computing Fundamentals From Basic Linear Algebra To Quantum Programming 1St Edition Easttom Ii PDF
https://textbookfull.com/product/basic-linear-algebra-jurgen-
muller/
https://textbookfull.com/product/quantum-mechanics-for-beginners-
with-applications-to-quantum-communication-and-quantum-
computing-1st-edition-m-suhail-zubairy/
https://textbookfull.com/product/quantum-computing-solutions-
solving-real-world-problems-using-quantum-computing-and-
algorithms-1st-edition-bhagvan-kommadi/
Quantum computing since democritus Aaronson
https://textbookfull.com/product/quantum-computing-since-
democritus-aaronson/
https://textbookfull.com/product/foundations-of-quantum-
programming-1st-edition-ying/
https://textbookfull.com/product/quantum-information-processing-
quantum-computing-and-quantum-error-correction-an-engineering-
approach-2nd-edition-ivan-b-djordjevic/
https://textbookfull.com/product/fundamentals-of-linear-algebra-
and-optimization-gallier-j/
https://textbookfull.com/product/from-classical-to-quantum-
fields-1st-edition-laurent-baulieu/
Quantum Computing
Fundamentals
Editorial Assistant
Cindy Teeters
Designer
Chuti Prasertsith
Compositor
codeMantra
Credits
Cover ZinetroN/Shutterstock
Dedication
As always, I dedicate my work to my wonderful wife Teresa. A quote
from my favorite movie is how I usually thank her: “What truly is
logic? Who decides reason? My quest has taken me to the physical, the
metaphysical, the delusional, and back. I have made the most important
discovery of my career—the most important discovery of my life. It is
only in the mysterious equations of love that any logic or reasons can
be found. I am only here tonight because of you. You are the only reason
I am. You are all my reasons.”
Table of Contents ix
x Table of Contents
Table of Contents xi
Table of Contents xv
Preface
Writing a book is always a challenging project. But with a topic like quantum computing, it is much
more so. If you cover too much, the reader will be overwhelmed and will not gain much from the book.
If you cover too little, you will gloss over critical details. With quantum computing, particularly a book
written for the novice, it is important to provide enough information without overwhelming. It is my
sincere hope that I have accomplished this.
Clearly some readers will have a more robust mathematical background than others. Some of you
will probably have some experience in quantum computing; however, for those of you lacking some
element in your background, don’t be concerned. The book is designed to give you enough information
to proceed forward. Now this means that every single chapter could be much larger and go much
deeper. In fact, I cannot really think of a single chapter that could not be a separate book!
When you are reading a section that is a new concept to you, particularly one you struggle with, don’t
be concerned. This is common with difficult topics. And if you are not familiar with linear algebra,
Chapter 1, “Introduction to Essential Linear Algebra,” will start right off with new concepts for you—
concepts that some find challenging. I often tell students to not be too hard on themselves. When you
are struggling with a concept and you see someone else (perhaps the professor, or in this case the
author) seem to have an easy mastery of the topic, it is easy to get discouraged. You might think you are
not suited for this field. If you were, would you not understand it as readily as others? The secret that
no one tells you is that all of those “others,” the ones who are now experts, struggled in the beginning,
too. Your struggle is entirely natural. Don’t be concerned. You might have to read some sections more
than once. You might even finish the book with a solid general understanding, but with some “fuzz-
iness” on specific details. That is not something to be concerned about. This is a difficult topic.
For those readers with a robust mathematical and/or physics background, you are likely to find some
point where you feel I covered something too deeply, or not deeply enough. And you might be correct.
It is quite difficult when writing a book on a topic such as this, for a novice audience, to find the proper
level at which to cover a given topic. I trust you won’t be too harsh in your judgment should you
disagree with the level at which I cover a topic.
Most importantly, this book should be the beginning of an exciting journey for you. This is the cutting
edge of computer science. Whether you have a strong background and easily master the topics in this
book (and perhaps knew some already) or you struggle with every page, the end result is the same. You
will be open to a bold, new world. You will see the essentials of quantum mechanics, understand the
quantum computing revolution, and perhaps even be introduced to some new mathematics. So please
don’t get too bogged down in the struggle to master concepts. Remember to relish the journey!
Register your copy of Quantum Computing Fundamentals on the InformIT site for convenient access
to updates and/or corrections as they become available. To start the registration process, go to informit.
com/register and log in or create an account. Enter the product ISBN (9780136793816) and click
Submit. Look on the Registered Products tab for an Access Bonus Content link next to this product, and
follow that link to access any available bonus materials. If you would like to be notified of exclusive
offers on new editions and updates, please check the box to receive email from us.
Acknowledgments
There are so many people who made this book possible. Let me start with Professor Izzat Alsmadi
(Texas A&M–San Antonio) and Professor Renita Murimi (University of Dallas) who were gracious
enough to provide technical review of each and every chapter. Chris Cleveland was the lead editor, and
I must confess, I am not the easiest person to edit. His patience and careful eye for detail were essential
to this book. I also want to thank Bart Reed for his work in copy editing. All the people working on this
book have done an extremely good job helping me create a book that can be clear and accurate for the
reader to learn this challenging topic.
Chapter Objectives
After reading this chapter and completing the review questions you will
be able to do the following:
■■ Understand basic algebraic concepts
■■ Calculate dot products and vector norms
■■ Be able to use vectors and vector spaces
■■ Be able to work with essential linear algebra
■■ Perform basic mathematical operations on matrices and vectors
One cannot really have even a fundamental understanding of quantum physics and quantum computing
without at least a working knowledge of linear algebra. Clearly, a single chapter of a book cannot make
you a master of any topic, including linear algebra. That is not the goal of this book or this chapter.
Rather, the purpose of this chapter is to provide you with a working knowledge of linear algebra suffi-
cient to facilitate understanding quantum computing. With that goal in mind, this chapter will endeavor
to fully explain concepts, without assuming any prior knowledge at all. That is a departure from many
books on mathematics, which always seem to assume some level of prior knowledge. Furthermore, this
chapter will not explore mathematical proofs. These are, of course, quite important to mathematicians,
but you can certainly proceed with your exploration of quantum computing without the proofs. It also
happens that such proofs tend to be daunting for the mathematical novice.
Linear algebra is so important to quantum computing and quantum physics because this is how
quantum states are represented. Quantum states of a particle such as a photon are represented by
vectors. Quantum logic gates are represented by matrices. Both vectors and matrices will be explored
in this chapter. This is not to say that no other math is required. Certainly, fields such as calculus and
number theory are related to quantum physics and quantum computing. However, linear algebra is the
most critical mathematical skill for you to have.
It should also be noted that if you have a background in linear algebra, this chapter will be a review—
and frankly, it might seem a bit pedantic at times. The purpose is to aid the reader with no prior
knowledge in gaining an adequate baseline to proceed through this book. If instead you are that reader
with no prior knowledge of linear algebra, it is quite important that you fully grasp the topics in this
chapter before you proceed. You may wish to read portions of the chapter more than once, and there are
exercises at the end of the chapter you should probably do. Particularly if you are new to linear algebra,
it is highly recommended that you do those exercises.
First, let us define what a linear equation is. A linear equation is just an equation with all factors having
exponents of 1, which is usually represented as no exponent at all. So, you will not see any x2 or y3
in this chapter. This might seem like an inauspicious beginning for a topic that seems so promising. I
assure you that linear algebra is critical for many topics. In addition to quantum computing, it is also
important to machine learning. In this chapter you will gain a working knowledge of the basics of
linear algebra. Our focus in this chapter and in this book will be the application of linear algebra to
quantum computing, but the skills you gain (or review) in this chapter can be applied to other areas.
a + b = 20
2x + 4 = 54
2x + 3y − z = 21
2x2 + 3 = 10
4y2 + 2x + 3 = 8
The first three equations have all elements to the first power (often with a number such as x1, the 1 is
simply assumed and not written). However, in the second set of equations, at least one element is raised
to some higher power. Thus, they are not linear.
One of the earliest books on the topic of linear algebra was Theory of Extension, written in 1844 by
Hermann Grassman. The book included other topics, but also had some fundamental concepts of linear
algebra. In 1856, Arthur Cayley introduced matrix multiplication, which we will explore later in this
chapter. In 1888, Giuseppe Peano gave a precise definition of a vector space, which is another topic
that will be prominent in this chapter and throughout this book. We will explore vectors and vector
spaces later in this chapter. As you can see, the modern subject of linear algebra evolved over time.
Basically, matrices are the focus. If you consider this for just a moment, a matrix can be thought of as
a special type of number. Now this might sound a bit odd, but it might help to start with some basic
algebra. After all, linear algebra is a type of algebra.
1. https://www.britannica.com/science/algebra
2. https://www.mathworksheetscenter.com/mathtips/whatisalgebra.html
sometimes actual numbers (integers, real numbers, etc.) and sometimes abstract symbols that represent
a broad concept. Consider this simple equation:
a2 = a * a
This use of abstract symbols allows us to contemplate the concept of what it means to square a number,
without troubling ourselves with any actual numbers. While this is a terribly simple equation, it illus-
trates the usefulness of studying concepts apart from concrete applications. That is one use of algebra.
Of course, it can be used for concrete problems and frequently is.
You can derive a number system based on different properties. Elementary algebra taught to youth is
only one possible algebra. Table 1.1 outlines some basic properties that might or might not exist in a
given number system.
Axiom Signification
Associativity of addition u + (v + w) = (u + v) + w
Commutativity of addition u+v=v+u
Associativity of multiplication u (v * w) = (u * v) w
Commutativity of multiplication u*w=w*u
Distributivity of scalar multiplication with respect to vector addition a(u + v) = au + av
Distributivity of scalar multiplication with respect to field addition (a + b)v = av + bv
While Table 1.1 summarizes some basic properties, a bit more explanation might be in order. What we
are saying with the associativity property of addition is that it really does not matter how you group
the numbers, the sum or the product will be the same. Commutativity is saying that changing the order
does not change the sum or product. An interesting point is that when dealing with matrices, this does
not hold. We will explore that later in this chapter. Distributivity means that the value outside the
parentheses is distributed throughout the parentheses.
You are undoubtably accustomed to various types of numbers, such as integers, rational numbers, real
numbers, etc. These are all infinite; however, these are not the only possible groupings of numbers. Your
understanding of algebra will be enhanced by examining some elementary concepts from abstract algebra.
Before we continue forward, we should ensure that you are indeed comfortable with integers, rational
numbers, etc. A good starting point is with the natural numbers. These are so called because they come
naturally. That is to say that this is how children first learn to think of numbers. These are often also called
counting numbers. Various sources count only the positive integers (1, 2, 3, 4, …) without including zero.
Other sources include zero. In either case, these are the numbers that correspond to counting. If you count
how many pages are in this book, you can use natural numbers to accomplish this task.
The next step is the integers. While negative numbers may seem perfectly normal to you, they were
unheard of in ancient times. Negative numbers first appeared in a book from the Han Dynasty in China.
Then in India, negative numbers first appeared in the fourth century C.E. and were routinely used to
represent debts in financial matters by the seventh century C.E. Now we know the integers as all whole
numbers, positive or negative, along with zero: −3, −2, −1, 0, 1, 2, 3, ….
After the integers, the next type of number is the rational numbers. Rational numbers were first noticed
as the result of division. A mathematical definition of rational numbers is “any number that can be
expressed as the quotient of two integers.” However, one will quickly find that division of numbers
leads to results that cannot be expressed as the quotient of two integers. The classic example comes
from geometry. If you try to express the ratio of a circle’s circumference to its radius, the result is an
infinite number. It is often approximated as 3.14159, but the decimals continue on with no repeating
pattern. Irrational numbers are sometimes repeating, but they need not be. As long as a number is a real
number that cannot be expressed as the quotient of two integers, it is classified as an irrational number.
Real numbers are the superset of all rational numbers and all irrational numbers. It is likely that all the
numbers you encounter on a regular basis are real numbers, unless of course you work in certain fields
3 5
of mathematics or physics. For example, −1, 0, 5, , and π are all real numbers.
17
Imaginary numbers developed as a response to a rather specific problem. The problem begins with
the essential rules of multiplications. If you multiple a negative with a negative, you get a positive
number. For example, −2 * −2 = 4. This becomes a problem if you contemplate the square root of
a negative number. Clearly the square root of a positive number is also positive: √4 = 2, √1 = 1, etc.
But what is the √−1? If you answer that it is −1, that won’t work, because −1 * −1 yields positive 1.
This problem led to the development of imaginary numbers. Imaginary numbers are defined as follows:
i2 = −1 (or, conversely, √−1 = i). Thus, the square root of any negative number can be expressed as
some integer multiplied by i. A real number combined with an imaginary number is referred to as a
complex number. Chapter 2, “Complex Numbers,” addresses this concept in more detail.
will always be a real number. What about the inverse of those two operations? You can subtract two
real numbers, and the answer will always be a real number. You can divide two real numbers, and the
answer will always be a real number. Now at this point, you might think all of this is absurdly obvious;
you might even think it odd I would spend a paragraph discussing it. However, there are operations
wherein the answer won’t always be a real number. Consider the square root operation. The square root
of any positive number is a real number, but what about the square root of −1? That is an imaginary
number (which we will be exploring in some detail in Chapter 2). The answer to the problem −1
is not a real number. Your answer is outside the set of numbers you were contemplating. This is one
example of operations that might lead to numbers that are not in your set.
Think about the set of all integers. That is certainly an infinite set, just like the set of real numbers.
You can certainly add any two integers, and the sum will be another integer. You can multiply any two
integers, and the product will still be an integer. So far this sounds just like the set of real numbers.
Now consider the inverse operations. You can certainly subtract any integer from another integer and
the answer is still an integer, but what about division? There are infinitely many scenarios where you
cannot divide one integer by another and still have the answer be an integer. Certainly dividing 6 by 2
gives you an integer, as would dividing 10 by 5, and 21 by 3, and infinitely more examples. However,
what if I divide 5 by 2? The answer is not an integer; it is instead a rational number. Also, if I divide 20
by 3, the answer is not an integer, and there are infinitely many other examples wherein I cannot divide
and still get an integer. Therefore, if I wish to limit myself only to integers, I cannot use division as an
operation.
Imagine for a moment that you wish to limit your mathematics to an artificial world in which only
integers exists. Set aside, for now, any considerations of why you might do this and just focus on
this thought experiment for just a moment. As we have already demonstrated, in this artificial world
you have created, the addition operation exists and functions as it always has. So does the inverse of
addition, subtraction. The multiplication operation behaves in the same fashion you have always seen
it. However, in this imaginary world, the division operation simply does not exist because it has the
very real possibility of producing non-integer answers—and such answers do not exist in your imag-
inary world of “only integers.”
Before continuing on with more specific examples from the world of abstract algebra, consider one
more hypothetical situation that should help clarify these basic points. What if you have limited yourself
to only natural numbers, or counting numbers. Certainly, you can add any two counting numbers and
the answer will always be a natural number. You can also multiply any two natural numbers and you
can rest assured that the product will indeed be another natural number. But what of the inverse of
these operations? You can certainly subtract some natural numbers and have an answer that is still a
natural number, but there are infinitely many cases where this is not true. For example, if you attempt
to subtract 7 from 5, the answer is a negative number, which is not a natural number. In fact, any time
you attempt to subtract a larger natural number from a smaller natural number, the result will not be a
natural number. Furthermore, division is just as tricky with natural numbers as it is with integers. There
are infinitely many cases where the answer will not be a natural number. So, in this imaginary world of
only natural numbers, addition and multiplication work exactly as you would expect them to; however,
their inverse operations, subtraction and division, simply do not exist.
Abstract algebra concerns itself with structures just like this. These structures (groups, rings, fields,
etc.) have a set of numbers and certain operations that can be performed on those numbers. The only
allowed operations in a given structure are those whose result would still be within the prescribed set
of numbers. This discussion of algebraic groups will be applied in the discussion of vector spaces in
section 1.4 later in the chapter.
Don’t be overly concerned with the term abstract algebra. There are certainly practical applications
of abstract algebra. In fact, some sources prefer to call this modern algebra; however, because it dates
back a few centuries, even that might be a misnomer. So, let us now examine some of these structures.
1.2.1.1 Groups
A group is an algebraic system consisting of a set, an identity element, one operation, and its inverse
operation. Let us begin with explaining what an identity element is. An identity element is simply some
number within a set that you can use to apply some operation to any other number in the set, and the
other number will still be the same. Put more mathematically,
a*I=a
where * is any operation that we might specify, not necessarily multiplication. An example would be
with respect to the addition operation, zero is the identity element. You can add zero to any member
of any given group, and you will still have that same number. With respect to multiplication, 1 is the
identity element. Any number multiplied by 1 is still the same number.
There are four properties any group must satisfy:
■■ Closure: Closure is the simplest of these properties. It simply means that an operation per-
formed on a member of the set will result in a member of the set. This is what was discussed
a bit earlier in this section. It is important that any operations allowed on a particular set will
result in an answer that is also a member of the set.
■■ Associativity: The associative property just means that you can rearrange the elements of a par-
ticular set of values in an operation without changing the outcome. For example, (2 + 2) + 3 = 7.
Even if I change the order and instead write 2 + ( 2 + 3), the answer is still 7. This is an example of
the associative property.
■■ Identity: The identity element was already discussed.
■■ Invertibility: The invertibility property simply means that a given operation on a set can be
inverted. As we previously discussed, subtraction is the inversion of addition; division is the
inversion of multiplication.
Think back to the example of the set of integers. Integers constitute a group. First, there is an identity
element, zero. There is also one operation (addition) and its inverse (subtraction). Furthermore, you
have closure. Any element of the group (any integer) added to any other element of the group (any
other integer) still produces a member of the group (the answer is still an integer).
4+2=2+4
Therefore, the set of integers with the operation of addition is an abelian group. As you can see, abelian
groups are a subset of groups. They are groups with an additional restriction: the commutative property.
Of course, the other requirements for a group, discussed previously, would still apply to a cyclic group.
It must be a set of numbers, with an operation, and its inverse. The basic element x is considered to
be the generator of the group, because all other members of the group are derived from it. It is also
referred to as a primitive element of the group. Integers could be considered a cyclic group with 1 being
the primitive element (i.e., generator). All integers can be expressed as a power of 1. This might seem
like a rather trivial example, but it is also one that is easy to understand.
1.2.1.4 Rings
A ring is an algebraic system consisting of a set, an identity element, two operations, and the inverse
operation of the first operation. That is the formal definition of a ring, but it might seem a bit awkward
to you at first read and therefore warrants a bit more explanation.
A ring is essentially just an abelian group that has a second operation. Previously, you learned that the
set of integers with the addition operation form a group, and furthermore they form an abelian group.
If you add the multiplication operation, then the set of integers with both the addition and the multipli-
cation operations form a ring.
Note that you only have to have the inverse of the first operation. Therefore, if we consider the set of
integers with addition as the first operation and multiplication as the second operation, we do have a ring.
As an example, 4 + 5 = 9, which is still an integer (still in the ring). However, so is 4 − 5 = −1. The answer
is still an integer, thus still in the ring. With multiplication, we don’t need the inverse (division) to always
yield an integer, but any two integers multiplied together, such as 4 * 5 = 20, will always yield an integer.
1.2.1.5 Fields
A field is an algebraic system consisting of a set, an identity element for each operation, two opera-
tions, and their respective inverse operations. You can think of a field as a group that has two operations
rather than one, and it has an inverse for both of those operations. It is also the case that every field is
a ring, but not every ring will necessarily be a field. For example, the set of integers is a ring, but not
a field, if you consider the operations of addition and multiplication. The inverse of multiplication,
division, won’t always yield an integer.
A classic example of a field is the field of rational numbers. Each number can be written as a ratio
(i.e., a fraction), such as x/y (x and y could be any integers you like), and the additive inverse is simply
−x/y. The multiplicative inverse is just y/x. Fields are often used in cryptography, and you will see them
again in Chapter 11, “Current Asymmetric Algorithms,” Chapter 13, “Lattice-Based Cryptography,”
and Chapter 15, “Other Approaches to Post-Quantum Cryptography.”
1 2
2 0
3 1
A matrix is just an array that is arranged in columns and rows. Vectors are simply matrices that have
one column or one row. The examples in this section focus on 2 × 2 matrices, but a matrix can be of
any number of rows and columns; it need not be a square. A vector can be considered a 1 × m matrix.
A vector that is vertical is called a column vector, and one that is horizontal is called a row vector.
Matrices are usually labeled based on column and row:
a ij a ij
a ij a ij
The letter i represents the row, and the letter j represents the column. A more concrete example is
shown here:
a11 a12
a 21 a 22
This notation is commonly used for matrices including row and column vectors.
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.