Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Essential Mathematics for Quantum Computing

You're reading from   Essential Mathematics for Quantum Computing A beginner's guide to just the math you need without needless complexities

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781801073141
Length 252 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Leonard S. Woody III Leonard S. Woody III
Author Profile Icon Leonard S. Woody III
Leonard S. Woody III
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

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

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?
You have been reading a chapter from
Essential Mathematics for Quantum Computing
Published in: Apr 2022
Publisher: Packt
ISBN-13: 9781801073141
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image