Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Essential Mathematics for Quantum Computing
Essential Mathematics for Quantum Computing

Essential Mathematics for Quantum Computing: A beginner's guide to just the math you need without needless complexities

eBook
Can$53.99
Print
Can$66.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon AI Assistant (beta) to help accelerate your learning
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now
Table of content icon View table of contents Preview book icon Preview Book

Essential Mathematics for Quantum Computing

Chapter 1: Superposition with Euclid

Mathematics is the language of physics and the foundation of computer science. Since quantum computing evolved from these two disciplines, it is essential to understand the mathematics behind it. The math you need is linear in nature, and that is where we will start. By the time we are done, you will have the mathematical foundation to fundamentally understand quantum computing. Let's get started!

In this chapter, we are going to cover the following main topics:

  • Vectors
  • Linear combinations
  • Superposition

Vectors

A long time ago in a country far, far away, there lived an ancient Greek mathematician named Euclid. He wrote a book that defined space using only three dimensions. We will use his vector space to define superposition in quantum computing. Don't be fooled—vector spaces have evolved tremendously since Euclid's days, and our definition of them will evolve too as the book progresses. But for now, we will stick to real numbers, and we'll actually only need two out of the three dimensions Euclid proposed.

To start, we will define a Euclidean vector as being a line segment with a length or magnitude and pointing in a certain direction, as shown in the following screenshot:

Figure 1.1 – Euclidean vector

Figure 1.1 – Euclidean vector

Two vectors are equal if they have the same length and direction, so the following vectors are all equal:

Figure 1.2 – Equal vectors

Figure 1.2 – Equal vectors

Vectors can be represented algebraically by their components. The simplest way to do this is to have them start at the origin (the point (0,0)) and use their x and y coordinates, as shown in the following screenshot:

Figure 1.3 – Vectors represented geometrically and algebraically

Figure 1.3 – Vectors represented geometrically and algebraically

You should note that I am using a special notation to label the vectors. It is called bra-ket notation. The appendix has more information on this notation, but for now, we will use a vertical bar or pipe, |, followed by the variable name for the vector and then an angle bracket, , to denote a vector (for example, |a). The coordinates of our vectors will be enclosed in brackets [ ]. The x coordinate will be on top and the y coordinate on the bottom. Vectors are also called "kets" in this notation—for example, ket a, but for now, we will stick with the name vector.

Vector addition

So, it ends up that we can add vectors together both geometrically and algebraically, as shown in the following screenshot:

Figure 1.4 – Vector addition

Figure 1.4 – Vector addition

As you can see, we can take vectors and move them in the XY-plane as long as we preserve their length and direction. We have taken the vector |b from our first graph and moved its start position to the end of vector |a. Once we do that, we can draw a third vector |c that connects the start of |a and the end of |b to form their sum. If we look at the coordinates of |c, it is four units in the x direction and zero units in the y direction. This corresponds to the answer we see on the right of Figure 1.4.

We can also do this addition without the help of a graph, as shown on the right of Figure 1.4. Just adding the first components (3 and 1) gives 4, and adding the second components of the vectors (2 and -2) gives 0. Thus, vector addition works both geometrically and algebraically in two dimensions. So, let's look at an example.

Example

What is the sum of |m and |n here?

The solution is:

Exercise 1

Now, you try. The answers are at the end of this chapter:

  • What is |m - |n?
  • What is |n - |m?
  • Solve the following expression (notice we use three-dimensional (3D) vectors, but everything works the same):

Scalar multiplication

We can also multiply our vectors by numbers or scalars. They are called scalars because they "scale" a vector, as we will see. The following screenshot shows a vector that is multiplied by a number on the left and the same thing algebraically on the right:

Figure 1.5 – Scalar multiplication

Figure 1.5 – Scalar multiplication

The vector |b is doubled or multiplied by two. Geometrically, we take the vector |b and scale its length by two while preserving its direction. Algebraically, we can just multiply the components of the vector by the number or scalar two.

Example

What is triple the vector |x shown here?

The solution is:

Exercise 2

  • What is 4|x?
  • What is -2|x?

Linear combinations

Once we have established that we can add our vectors and multiply them by scalars, we can start to talk about linear combinations. Linear combinations are just the scaling and addition of vectors to form new vectors. Let's start with our two vectors we have been working with the whole time, |a and |b. I want to scale my vector |a by two to get a new vector |c, as shown in the following screenshot:

Figure 1.6 – |a⟩ scaled by two to produce |c⟩

Figure 1.6 – |a scaled by two to produce |c

As we have said, we can do this algebraically as well, as the following equation shows:

Then, I want to take my vector |b and scale it by two to get a new vector, |d, as shown in the following screenshot:

Figure 1.7 – |b⟩ scaled by two to produce |d⟩

Figure 1.7 – |b scaled by two to produce |d

So, now, we have a vector |c that is two times |a, and a vector |d that is two times |b:

Can I add these two new vectors, |c and |d? Certainly! I will do that, but I will express |e as a linear combination of |a and |b in the following way:

Vector |e is a linear combination of vectors |a and |b! Now, I can show this all geometrically, as follows:

Figure 1.8 – Linear combination

Figure 1.8 – Linear combination

This can also be represented in the following equation:

So, we now have a firm grasp on Euclidean vectors, the algebra you can perform with them, and the concept of a linear combination. We will use that in this next section to describe a quantum phenomenon called superposition.

Superposition

Superposition can be a very imposing term, so before we delve into it, let's take a step back and talk about the computers we use today. In quantum computing, we call these computers "classical computers" to distinguish them from quantum computers. Classical computers use binary digits—or bits, for short—to store ones and zeros. These ones and zeros can represent anything, from truth values to characters to pixel values on a screen! They are physically implemented using any two-state device such as an electrical switch that is either on or off.

A quantum bit, or qubit for short, is the analogous building block of quantum computers. They are implemented by anything that demonstrates quantum phenomena, which means they are very, very small. In the following screenshot, we show how a property of an electron—namely spin—can be used to represent a one or zero of a qubit:

Figure 1.9 – Pair of electrons with a spin labeled 1 and 0

Figure 1.9 – Pair of electrons with a spin labeled 1 and 0

Physicists use mathematics to model quantum phenomena, and guess what they use to model the state of a quantum particle? That's right! Vectors! Quantum computer scientists have taken two of these states and labeled them as the canonical one and zero for qubits. They are shown in the following screenshot:

Figure 1.10 – Zero and one states

Figure 1.10 – Zero and one states

As you can see, the zero and one states are just vectors on the x and y axes with a length of one unit each. When you combine a lot of ones and zeros in classical computing, wonderful, complex things can be done. The same is true of the zero and one state of qubits in quantum computing.

Greek Letters

Mathematicians and physicists love Greek letters, and they have found their way into quantum computing in several places. The Greek letter "Psi", ψ, is often used to represent the state of a qubit. The Greek letters "alpha", α, and "beta", β, are used to represent numbers or scalars.

While qubits can represent a one or a zero, they have a superpower in that they can represent a combination of a zero and one as well! "How?" you might ask. Well, this is where superposition comes in. Understanding it is actually quite simple from a mathematical standpoint. In fact, you already know what it is! It's just a fancy way of saying that a qubit is in a linear combination of states.

If you recall, we defined the vector |e as a linear combination of the aforementioned |a and |b, like so:

Figure 1.11 – Definition of |e⟩

Figure 1.11 – Definition of |e

If we replace those letters and numbers with the Greek letters and the zero and one states we just introduced, we get an equation like this:

Figure 1.12 – Greek letters being transposed onto a linear combination equation

Figure 1.12 – Greek letters being transposed onto a linear combination equation

The bottom equation represents a qubit in the state |ψ, which is a superposition of the states zero and one! You now know what superposition is mathematically! This, by the way, is the only way that counts because math is the language of physics and, therefore, quantum computing.

Measurement

But wait—there's more! With only the simple mathematics you have acquired so far, you also get a look at the weird act of measuring qubits. The scalars α and β shown previously play a crucial role when measuring qubits. In fact, if we were to set this qubit up in the state |ψ an infinite number of times, when we measured it for a zero or a one, |α|2 would give us the probability of getting a zero, and |β|2 would give us the probability of getting a one. Pretty cool, eh!?!

So, here is a question. For the qubit state |ψ in the following equation, what is the probability of getting a zero or a one when we measure it?

Well, if we said |α|2 gives us the probability of getting a zero, then the answer would look like this:

This tells us that one half or 50% of the time when we measure for a zero or a one, we will get a zero. We can do the same exact math for β and derive that the other half of the time when we measure, we will get a one. The state |ψ shown previously represents the proverbial coin being flipped into the air and landing heads for a one and tails for a zero.

Summary

In a short amount of time, we have developed enough mathematics to explain superposition and its effects on measurement. We did this by introducing Euclidean vectors and the operations of addition and scalar multiplication upon them. Putting these operations together, we were able to get a definition for a linear combination and then apply that definition to what is termed superposition. In the end, we could use all of this to predict the probability of getting a zero or one when measuring a qubit.

In the next chapter, we will introduce the concept of a matrix and use it to manipulate qubits!

History (Optional)

Euclidean vectors are named after the Greek mathematician Euclid circa 300 BC. In his book, The Elements, he puts together postulates and theories from other Greek mathematicians, including Pythagoras, that defined Euclidean geometry. The book was a required textbook for math students for over 2,000 years.

Figure 1.13 – Euclid with other Greek mathematicians in Raphael's School of Athens

Figure 1.13 – Euclid with other Greek mathematicians in Raphael's School of Athens

Answers to exercises

Exercise 1

a)

b)

c)

Exercise 2

a)

b)

Left arrow icon Right arrow icon

Key benefits

  • Build a solid mathematical foundation to get started with developing powerful quantum solutions
  • Understand linear algebra, calculus, matrices, complex numbers, vector spaces, and other concepts essential for quantum computing
  • Learn the math needed to understand how quantum algorithms function

Description

Quantum computing is an exciting subject that offers hope to solve the world’s most complex problems at a quicker pace. It is being used quite widely in different spheres of technology, including cybersecurity, finance, and many more, but its concepts, such as superposition, are often misunderstood because engineers may not know the math to understand them. This book will teach the requisite math concepts in an intuitive way and connect them to principles in quantum computing. Starting with the most basic of concepts, 2D vectors that are just line segments in space, you'll move on to tackle matrix multiplication using an instinctive method. Linearity is the major theme throughout the book and since quantum mechanics is a linear theory, you'll see how they go hand in hand. As you advance, you'll understand intrinsically what a vector is and how to transform vectors with matrices and operators. You'll also see how complex numbers make their voices heard and understand the probability behind it all. It’s all here, in writing you can understand. This is not a stuffy math book with definitions, axioms, theorems, and so on. This book meets you where you’re at and guides you to where you need to be for quantum computing. Already know some of this stuff? No problem! The book is componentized, so you can learn just the parts you want. And with tons of exercises and their answers, you'll get all the practice you need.

What you will learn

Operate on vectors (qubits) with matrices (gates) Define linear combinations and linear independence Understand vector spaces and their basis sets Rotate, reflect, and project vectors with matrices Realize the connection between complex numbers and the Bloch sphere Determine whether a matrix is invertible and find its eigenvalues Probabilistically determine the measurement of a qubit Tie it all together with bra-ket notation

Product Details

Country selected

Publication date : Apr 22, 2022
Length 252 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781801073141
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon AI Assistant (beta) to help accelerate your learning
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Apr 22, 2022
Length 252 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781801073141
Category :

Table of Contents

20 Chapters
Preface Chevron down icon Chevron up icon
1. Section 1: Introduction Chevron down icon Chevron up icon
2. Chapter 1: Superposition with Euclid Chevron down icon Chevron up icon
3. Chapter 2: The Matrix Chevron down icon Chevron up icon
4. Section 2: Elementary Linear Algebra Chevron down icon Chevron up icon
5. Chapter 3: Foundations Chevron down icon Chevron up icon
6. Chapter 4: Vector Spaces Chevron down icon Chevron up icon
7. Chapter 5: Using Matrices to Transform Space Chevron down icon Chevron up icon
8. Section 3: Adding Complexity Chevron down icon Chevron up icon
9. Chapter 6: Complex Numbers Chevron down icon Chevron up icon
10. Chapter 7: EigenStuff Chevron down icon Chevron up icon
11. Chapter 8: Our Space in the Universe Chevron down icon Chevron up icon
12. Chapter 9: Advanced Concepts Chevron down icon Chevron up icon
13. Section 4: Appendices Chevron down icon Chevron up icon
14. Other Books You May Enjoy Chevron down icon Chevron up icon
Appendix 1: Bra–ket Notation Chevron down icon Chevron up icon
1. Appendix 2: Sigma Notation Chevron down icon Chevron up icon
2. Appendix 3: Trigonometry Chevron down icon Chevron up icon
3. Appendix 4: Probability Chevron down icon Chevron up icon
4. Appendix 5: References Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by


THEODOROS ZAFEIRIDIS May 20, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
perfect
Feefo Verified review Feefo image
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.