Skip to content
ImagineWorld

Complex Numbers

node_idnode-book_essential-mathematics-for-quantum-computing_chapter-06-complex-numbers
node_typechapter_node
schema_profileworld.chapter_node.v1
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
statusactive
chapter_num6
chapter_titleComplex Numbers
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

“What is unpleasant here, and indeed directly to be objected to, is the use of complex numbers. Ψ is surely fundamentally a real function.”

– Letter from Schrödinger to Lorentz. June 6, 1926.

Even the great physicist Erwin Schrödinger was perplexed by the occurrence of complex numbers in quantum mechanics. Yet, complex numbers have been found to be inherent to quantum mechanics and, hence, quantum computing. Up until now, we have concentrated on the real numbers to make concepts easier to get across. It is time now to cross the Rubicon and make our way into the complex plane. You have probably come across complex numbers before, but we will go into great depths about them in this chapter. I think it is unfortunate that René Descartes named i an imaginary number, as it makes it seem that this topic should be otherworldly. But so was the number 0 when it was introduced, and the same with negative numbers. No one gives them a second thought today and you should treat complex numbers the same way. They are just another set of numbers.

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

  • Three forms, one number
  • Cartesian form
  • Polar form
  • The most beautiful equation in mathematics
  • Exponential form
  • Bloch sphere

There are three main ways of representing a complex number:

  • Cartesian form (aka the general form)
  • Polar form
  • Exponential form

Each one has its advantages and disadvantages, depending on what we are trying to do. These will become evident as we go through them.

A complex number is a number that can be expressed in the following way:

z=a+biz = a + bi

(1)

where a and b are real numbers and i is the imaginary unit. The imaginary unit is defined as:

i2=−1i^2 = -1

It follows from this that there are two square roots of -1, i and -i.

The real part of a complex number is denoted by Re(z) and the imaginary part is denoted by Im(z). For our complex number, z, defined in Equation (1), Re(z) = a and Im(z) = b. Two complex numbers, z and w, are equal if, and only if, Re(z) = Re(w) and Im(z) = Im(w).

It is important to remember that the set of real numbers ℝ is a subset of ℂ. Hence, if Im(z) = 0 for a complex number z, then z is also a real number.

Let’s quickly look at some examples of complex numbers:

z=3+2iz = 3 + 2i w=−4.3−23iw = -4.3 - \frac{2}{3}i x=6x = 6 y=4iy = 4i

Now, let’s move on to describing the three forms of complex numbers.

We used the Cartesian form to define a complex number. To see why it is called Cartesian, notice we can also use an ordered pair of real numbers to represent the complex number z. The first number of the ordered pair will be the real part of the complex number, and the second number will be the imaginary part:

z=a+bi=(a,b)z = a + bi = (a,b)

Given this, we can represent complex numbers on a Cartesian coordinate system since a and b are just real numbers. We will need to make a couple of modifications though.

We will replace the x axis with an axis for the real part of a complex number ( Re(z) ), and the y axis with an axis for the imaginary part of a complex number ( Im(z) ), like so:

Figure 6.1 – The complex plane

This is called the complex plane. Here is an example involving actual complex numbers:

Figure 6.2 – Complex numbers on the complex plane

Keep this in mind as we go through the basic operations of complex numbers as we can think of them both algebraically and geometrically, as we did in Chapter 2, Superposition with Euclid.

Addition is rather easy for complex numbers; just add Re(z) and Im(z) of the two numbers together to get the sum. We will be using the following two complex numbers in our following definitions:

z1=a1+b1iz_1 = a_1 + b_1i z2=a2+b2iz_2 = a_2 + b_2i

Here is the definition:

z1+z2=(a1+a2)+(b1+b2)iz_1 + z_2 = (a_1 + a_2) + (b_1 + b_2)i

Subtraction is defined as:

z1−z2=(a1−a2)+(b1−b2)iz_1 - z_2 = (a_1 - a_2) + (b_1 - b_2)i

Here are some examples:

(5+4i)+(7+2i)=12+6i(−6+3i)+(5+i)=−1+4ii+(−5+6i)=−5+7i\begin{aligned} (5 + 4i) + (7 + 2i) &= 12 + 6i \\ (-6 + 3i) + (5 + i) &= -1 + 4i \\ i + (-5 + 6i) &= -5 + 7i \end{aligned}

Remember that you can view complex numbers as vectors on the complex plane, so addition, scalar multiplication, and subtraction can be viewed graphically as well, as in the following:

Figure 6.3 – Vector addition and scalar multiplication [1]

Alright, let’s move on to multiplication.

I will show you another way to do complex multiplication later in this chapter, but you should know how to do it with the Cartesian form of a complex number. Hopefully, you remember the FOIL method from high school algebra. If you do, you can skip the next section. If not, here’s a quick refresher:

The FOIL method is used to multiply two binomials together. It stands for:

  • First terms
  • Outer terms
  • Inner terms
  • Last terms

You add these all up, and there you are! This figure should jog your memory:

Figure 6.4 – FOIL method illustrated [2]

Now that we’ve jogged your memory, on to the defintion of multiplication for complex numbers.

Here is the definition of the multiplication of two complex numbers in Cartesian form. It is:

z1⋅z2=(a1+b1i)(a2+b2i)=a1a2+a1b2i+a2b1i+b1b2i2=a1a2+a1b2i+a2b1i−b1b2=(a1a2−b1b2)+(a1b2+a2b1)i\begin{aligned} z_1 \cdot z_2 &= (a_1 + b_1i)(a_2 + b_2i) \\ &= a_1a_2 + a_1b_2i + a_2b_1i + b_1b_2i^2 \\ &= a_1a_2 + a_1b_2i + a_2b_1i - b_1b_2 \\ &= (a_1a_2 - b_1b_2) + (a_1b_2 + a_2b_1)i \end{aligned}

As always, here is an example for your viewing pleasure:

(3−4i)(4+5i)=3⋅4+3⋅5i−4i⋅4−4i⋅5iUse FOIL Method.=12+15i−16i−20i2Substitute i2=−1.=12+15i−16i−20(−1)=12−i+20=32−i\begin{aligned} (3 - 4i)(4 + 5i) &= 3 \cdot 4 + 3 \cdot 5i - 4i \cdot 4 - 4i \cdot 5i && \text{Use FOIL Method.} \\ &= 12 + 15i - 16i - 20i^2 && \text{Substitute } i^2 = -1. \\ &= 12 + 15i - 16i - 20(-1) \\ &= 12 - i + 20 \\ &= 32 - i \end{aligned}

Now it’s your turn.

What is:

(2−3i)(5+i)(2 - 3i)(5 + i) (1−i)(2+i)(1 - i)(2 + i) (−2+3i)(−4−i)(-2 + 3i)(-4 - i)

Now for a new concept that doesn’t exist for real numbers.

While the definition of the complex conjugate is very simple, store it somewhere safe in your brain as it will become very important to us as we move forward. The complex conjugate of a complex number a + bi is a – bi. That’s it! It is written as z* for a complex number z. Here it is again, just to drill it into your skull :)

z=a+biz∗=a−bi\begin{aligned} z &= a + bi \\ z^* &= a - bi \end{aligned}

It is interesting to view complex conjugation on the complex plane as it is just a reflection of the real axis, as you can see in the following figure:

Figure 6.5 – Complex vector reflected on the real axis

Now we’ll use the complex conjugate to get the absolute value of a complex number.

Again, simple, but very important. The absolute value or modulus of a complex number z, denoted |z|, is the square root of z multiplied by its conjugate, z*:

∣z∣=z⋅z∗|z| = \sqrt{z \cdot z^*}

It can also be defined thus for a complex number z = x+ iy:

∣z∣=[Re(z)]2+[Im(z)]2=x2+y2|z| = \sqrt{[Re(z)]^2 + [Im(z)]^2} = \sqrt{x^2 + y^2}

Here’s an example:

∣5+6i∣=52+62|5 + 6i| = \sqrt{5^2 + 6^2} =25+36= \sqrt{25 + 36} =61= \sqrt{61}

Compute the following absolute values:

∣3−2i∣|3 - 2i| ∣i∣|i| ∣6+3i∣|6 + 3i|

The way to compute the division of two complex numbers is unfortunately much harder than multiplication. However, there is a process named “rationalizing the denominator,” which makes it easier.

Let’s define our two complex numbers as:

c+dia+bi\frac{c + di}{a + bi}

where both a and b ≠ 0. First, we multiply the numerator and denominator by the complex conjugate of the denominator:

(c+di)(a+bi)⋅(a−bi)(a−bi)=(c+di)(a−bi)(a+bi)(a−bi)\frac{(c + di)}{(a + bi)} \cdot \frac{(a - bi)}{(a - bi)} = \frac{(c + di)(a - bi)}{(a + bi)(a - bi)}

Then we use the FOIL method:

=ca−cbi+adi−bdi2a2−abi+abi−b2i2= \frac{ca - cbi + adi - bdi^2}{a^2 - abi + abi - b^2i^2}

Finally, we substitute the terms that have i^2 with -1:

=ca−cbi+adi−bd(−1)a2−abi+abi−b2(−1)=(ca+bd)+(ad−cb)ia2+b2\begin{aligned} &= \frac{ca - cbi + adi - bd(-1)}{a^2 - abi + abi - b^2(-1)} \\ &= \frac{(ca + bd) + (ad - cb)i}{a^2 + b^2} \end{aligned}

Hopefully, that wasn’t too bad. Let’s look at an example for this quotient:

(2+5i)(4−i)\frac{(2 + 5i)}{(4 - i)}

From there, let’s solve it together:

(2+5i)(4−i)⋅(4+i)(4+i)=8+2i+20i+5i216+4i−4i−i2=8+2i+20i+5(−1)16+4i−4i−(−1)Because i2=−1=3+22i17=317+2217iSeparate real and imaginary parts.\begin{aligned} \frac{(2 + 5i)}{(4 - i)} \cdot \frac{(4 + i)}{(4 + i)} &= \frac{8 + 2i + 20i + 5i^2}{16 + 4i - 4i - i^2} \\ &= \frac{8 + 2i + 20i + 5(-1)}{16 + 4i - 4i - (-1)} \qquad \text{Because } i^2 = -1 \\ &= \frac{3 + 22i}{17} \\ &= \frac{3}{17} + \frac{22}{17}i \qquad \text{Separate real and imaginary parts.} \end{aligned}

As you can see, it’s a little more than division in the real numbers.

I wanted to make sure that you could calculate the powers of i in your complex number toolkit. The positive powers of i follow this pattern:

i0=1i1=ii2=−1i3=i2⋅i=−ii4=i3⋅i=1i5=i4⋅i=ii6=i5⋅i=−1i7=i6⋅i=−i\begin{aligned} i^0 &= 1 \\ i^1 &= i \\ i^2 &= -1 \\ i^3 &= i^2 \cdot i = -i \\ i^4 &= i^3 \cdot i = 1 \\ i^5 &= i^4 \cdot i = i \\ i^6 &= i^5 \cdot i = -1 \\ i^7 &= i^6 \cdot i = -i \end{aligned}

The negative powers of i follow a very similar pattern:

i0=1i−1=−ii−2=−1i−3=ii−4=1i−5=−ii−6=−1i−7=i\begin{aligned} i^0 &= 1 \\ i^{-1} &= -i \\ i^{-2} &= -1 \\ i^{-3} &= i \\ i^{-4} &= 1 \\ i^{-5} &= -i \\ i^{-6} &= -1 \\ i^{-7} &= i \end{aligned}

Hopefully, you see the patterns here and can derive any power of i. Alright, off to the next form of complex numbers – polar!

The polar form is based on polar coordinates, which you may or may not be used to. If not, the next section goes through these, otherwise, you can skip it. Also, the rest of the chapter is heavy on trigonometry and we use radians for all angles. If you require a quick refresher on these, please consult the Appendix.

Polar coordinates are another way of representing points in ℝ2. We are very familiar with the Cartesian coordinate system and its points, such as (x,y). Now we will represent a point with two coordinates called r and θ. The following diagram is very helpful in terms of putting this all together:

Figure 6.6 – Polar coordinates on a graph

As you can see, r is the hypotenuse of a right triangle with the other two sides being the Cartesian coordinates x and y. Because of this, it is easy to derive the equation to find r given the Cartesian coordinates using the Pythagorean theorem:

r2=x2+y2r^2 = x^2 + y^2

(2)

We can use the trigonometric function tangent to derive θ:

tan⁡θ=yx\tan\theta = \frac{y}{x} θ=arctan⁡(yx)=tan⁡−1(yx)\theta = \arctan\left(\frac{y}{x}\right) = \tan^{-1}\left(\frac{y}{x}\right)

(3)

Let’s look at an example. Let’s say we have the point (3,4), as shown in the following figure:

Figure 6.7 – The point (3,4)

Now we need to convert from Cartesian coordinates to polar coordinates using our formulas. So, using Equation (2), r would be:

r2=x2+y2r2=32+42r2=9+16r2=25r=5\begin{aligned} r^2 &= x^2 + y^2 \\ r^2 &= 3^2 + 4^2 \\ r^2 &= 9 + 16 \\ \sqrt{r^2} &= \sqrt{25} \\ r &= 5 \end{aligned}

Now that we’ve found r, we need θ. Again, we’ll use our formula from Equation (3):

tan⁡θ=43\tan\theta = \frac{4}{3} θ=tan⁡−1(43)≈0.9273 rad\theta = \tan^{-1}\left(\frac{4}{3}\right) \approx 0.9273 \text{ rad}

There you go! We have found that (3, 4) in Cartesian coordinates is (5, .9273) in polar coordinates. Now it is your turn.

Convert the following into polar coordinates:

(-3,3)

(4, 1)

(-2, π)

Since we can use Cartesian coordinates with complex numbers, we can also use polar coordinates with complex numbers. Here is Figure 6.6 from the last section again, but this time using the complex plane:

Figure 6.8 – Polar coordinates of the complex number z

Several things have changed in the graph. The real and imaginary axes have replaced the x and y axes, along with the x coordinate being Re(z) and the y coordinate being Im(z) now.

The r in the hypotenuse represents the modulus of our complex number, z. This makes sense if we remember that for a complex number, z = a + bi:

r=∣z∣=[Re(z)]2+[Im(z)]2=a2+b2.r = |z| = \sqrt{[Re(z)]^2 + [Im(z)]^2} = \sqrt{a^2 + b^2}.

The Greek letter Θ (pronounced “theta”) is called the argument of the complex number z by mathematicians, but in quantum computing, it is often called the “phase.” We denote this in math as follows:

θ=arg⁡(z)\theta = \arg(z)

From the graph, we can derive the following:

cos⁡θ=Re(z)∣z∣sin⁡θ=Im(z)∣z∣tan⁡θ=Im(z)Re(z)For z=a+ib, where r=∣z∣a=rcos⁡θb=rsin⁡θ\begin{aligned} \cos\theta &= \frac{Re(z)}{|z|} \qquad \sin\theta = \frac{Im(z)}{|z|} \qquad \tan\theta = \frac{Im(z)}{Re(z)} \\[1em] \text{For } z &= a + ib, \text{ where } r = |z| \\ a &= r\cos\theta \qquad b = r\sin\theta \end{aligned}

Putting this all together, we can say that for a complex number, z, it can be represented in polar form as:

Polar Form of a Complex Number

z=r(cos⁡θ+isin⁡θ)z = r(\cos\theta + i\sin\theta)

Let’s explore some more concepts of complex numbers in polar form.

Okay, let’s put this into an example. Let’s find the polar form of z = -4 + 4i. First, we need to find the value of r:

z=−4+4iz = -4 + 4i r=(−4)2+42r=16+16r=32=42\begin{aligned} r &= \sqrt{(-4)^2 + 4^2} \\ r &= \sqrt{16 + 16} \\ r &= \sqrt{32} = 4\sqrt{2} \end{aligned}

Now we have to find θ:

tan⁡θ=Im(z)Re(z)=4−4=−1tan⁡−1(−1)=3π4θ=3π4\begin{aligned} \tan\theta &= \frac{Im(z)}{Re(z)} = \frac{4}{-4} = -1 \\ \tan^{-1}(-1) &= \frac{3\pi}{4} \\ \theta &= \frac{3\pi}{4} \end{aligned}

Now that we have r and θ, we can express z in polar form:

z=42(cos⁡3π4+isin⁡3π4)z = 4\sqrt{2}\left(\cos\frac{3\pi}{4} + i\sin\frac{3\pi}{4}\right)

Let’s now explore some more concepts of complex numbers in polar form.

While the polar form is not recommended for addition and subtraction, it is recommended for multiplication and division. It is much easier to perform these operations, as you will quickly realize.

Given the two complex numbers below:

z1=r1(cos⁡θ1+isin⁡θ1) and z2=r2(cos⁡θ2+isin⁡θ2)z_1 = r_1(\cos\theta_1 + i\sin\theta_1) \text{ and } z_2 = r_2(\cos\theta_2 + i\sin\theta_2)

The product of these two numbers is:

z1z2=r1r2[cos⁡(θ1+θ2)+isin⁡(θ1+θ2)]z_1z_2 = r_1r_2[\cos(\theta_1 + \theta_2) + i\sin(\theta_1 + \theta_2)]

(4)

Notice that all we had to do was add the angles and multiply the moduli. Pretty easy, right!?!

Dividing the two complex numbers is similarly easy. It is defined as:

z1z2=r1r2[cos⁡(θ1−θ2)+isin⁡(θ1−θ2)],z2≠0\frac{z_1}{z_2} = \frac{r_1}{r_2}[\cos(\theta_1 - \theta_2) + i\sin(\theta_1 - \theta_2)], z_2 \ne 0

Here, all you have to do is subtract the angles and divide the moduli.

Say we have two complex numbers:

z1=2+2iz_1 = 2 + 2i z2=3−iz_2 = \sqrt{3} - i

Converting to polar form, we have:

2+2i=22(cos⁡π4+isin⁡π4)3−i=2[cos⁡(−π6)+isin⁡(−π6)]\begin{aligned} 2 + 2i &= 2\sqrt{2}\left(\cos\frac{\pi}{4} + i\sin\frac{\pi}{4}\right) \\ \sqrt{3} - i &= 2\left[\cos\left(-\frac{\pi}{6}\right) + i\sin\left(-\frac{\pi}{6}\right)\right] \end{aligned}

Applying our formula to the product of the two complex numbers in Equation (4), we get the following for the product:

(2+2i)(3−i)=42[cos⁡(π4−π6)+isin⁡(π4−π6)]=42(cos⁡π12+isin⁡π12)\begin{aligned} (2 + 2i)(\sqrt{3} - i) &= 4\sqrt{2}\left[\cos\left(\frac{\pi}{4} - \frac{\pi}{6}\right) + i\sin\left(\frac{\pi}{4} - \frac{\pi}{6}\right)\right] \\ &= 4\sqrt{2}\left(\cos\frac{\pi}{12} + i\sin\frac{\pi}{12}\right) \end{aligned}

If we use Equation (4) to repeatedly multiply one complex number by itself, we get:

z=r(cos⁡θ+isin⁡θ)z2=r2(cos⁡2θ+isin⁡2θ)z3=zz2=r3(cos⁡3θ+isin⁡3θ)\begin{aligned} z &= r(\cos\theta + i\sin\theta) \\ z^2 &= r^2(\cos2\theta + i\sin2\theta) \\ z^3 &= zz^2 = r^3(\cos3\theta + i\sin3\theta) \end{aligned}

You should see a pattern whereby, in order to get a power of a complex number, we take the power of the modulus and multiply the angles by the power. This is known as de Moivre’s theorem. It states that:

If z = r(cos θ + i sin θ) and n is a positive integer, then:

zn=[r(cos⁡θ+isin⁡θ)]n=rn(cos⁡nθ+isin⁡nθ)z^n = [r(\cos\theta + i\sin\theta)]^n = r^n(\cos n\theta + i\sin n\theta)

Make sure to tuck this away somewhere. Let’s now move on to the most beautiful equation in mathematics!

The most beautiful equation in mathematics

Section titled “The most beautiful equation in mathematics”

In 1748, Leonhard Euler (pronounced “oy-lr”) published his most famous formula, aptly called Euler’s Formula:

eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta

This is true for any real number θ. Substituting θ = π into this equation gives the most beautiful equation in math, called Euler’s identity:

eiπ+1=0e^{i\pi} + 1 = 0

It is hard to overstate the beauty of this equation. It combines in one equation what are arguably the most important symbols and operations in mathematics. Along with the operations of addition, multiplication, and exponentiation, you have 0, the additive identity, 1, the multiplicative identity, i, the imaginary unit, and two of the most important mathematical constants, e and π. This equation is also integral to quantum computing. You will see e^{iθ} all over the place in quantum computing, so you better get used to it!

So, how does this equation help us in quantum computing? You’re about to find out, but first, we need to use it to express complex numbers in exponential form.

Complex numbers written in terms of e^{iθ} are said to be in the exponential form, as opposed to the polar or Cartesian form we have seen earlier. Using Euler’s formula, we can express a complex number, z, as:

z=r(cos⁡θ+isin⁡θ)=reiθz = r(\cos\theta + i\sin\theta) = re^{i\theta}

So

z=reiθin which r=∣z∣ and θ=arg⁡(z)z = re^{i\theta} \quad \text{in which } r = |z| \text{ and } \theta = \arg(z)

As you can see, the exponential form is very close to polar form, but now you have θ in one place instead of two!

Express the following complex numbers in exponential form:

z=1−iz = 1 - i z=2+3iz = 2 + 3i z=−6z = -6

As we have seen, the conjugation of a complex number is represented as a reflection around the real axis. For complex numbers in exponential form, this means we just change the sign of the angle to get the complex conjugate:

If z=r(cos⁡θ+isin⁡θ)=reiθ,\text{If } z = r(\cos\theta + i\sin\theta) = re^{i\theta}, then z∗=r(cos⁡θ−isin⁡θ)=r(cos⁡(−θ)+isin⁡(−θ))=re−iθ\text{then } z^* = r(\cos\theta - i\sin\theta) = r(\cos(-\theta) + i\sin(-\theta)) = re^{-i\theta} Note that cos⁡θ=cos⁡(−θ) and −sin⁡θ=sin⁡(−θ)\text{Note that } \cos\theta = \cos(-\theta) \text{ and } -\sin\theta = \sin(-\theta)

Multiplication and division are even easier in exponential form and are one of the reasons why it is so preferred to work with. We can take our steps for multiplication from the polar form and easily restate them in exponential form.

Given the two complex numbers below:

z1=r1(cos⁡θ1+isin⁡θ1) and z2=r2(cos⁡θ2+isin⁡θ2)z_1 = r_1(\cos\theta_1 + i\sin\theta_1) \text{ and } z_2 = r_2(\cos\theta_2 + i\sin\theta_2)

In exponential form, they are represented as:

z1=r1eiθ1 and z2=r2eiθ2z_1 = r_1e^{i\theta_1} \text{ and } z_2 = r_2e^{i\theta_2}

The product of these two numbers in polar form is then:

z1z2=r1r2[cos⁡(θ1+θ2)+isin⁡(θ1+θ2)]z_1z_2 = r_1r_2[\cos(\theta_1 + \theta_2) + i\sin(\theta_1 + \theta_2)]

Their product in exponential form is then:

z1z2=r1r2ei(θ1+θ2)z_1z_2 = r_1r_2e^{i(\theta_1 + \theta_2)}

Without going through all that, I will simply state that for division:

z1z2=r1r2ei(θ1−θ2),z2≠0\frac{z_1}{z_2} = \frac{r_1}{r_2}e^{i(\theta_1 - \theta_2)}, \quad z_2 \ne 0

Let’s reuse our example from the section on the polar form, but do it in the exponential form!

z1=2+2iz_1 = 2 + 2i z2=3−iz_2 = \sqrt{3} - i

Going from the Cartesian form to the polar form and then the exponential form, we get:

2+2i=22(cos⁡π4+isin⁡π4)=22eiπ43−i=2[cos⁡(−π6)+isin⁡(−π6)]=2e−iπ6\begin{aligned} 2 + 2i &= 2\sqrt{2}\left(\cos\frac{\pi}{4} + i\sin\frac{\pi}{4}\right) = 2\sqrt{2}e^{\frac{i\pi}{4}} \\ \sqrt{3} - i &= 2\left[\cos\left(-\frac{\pi}{6}\right) + i\sin\left(-\frac{\pi}{6}\right)\right] = 2e^{\frac{-i\pi}{6}} \end{aligned}

Finally, using our definition of multiplication in the exponential form from before, we get:

(2+2i)(3−i)=42eiπ4e−iπ6=42eiπ12(2 + 2i)(\sqrt{3} - i) = 4\sqrt{2}e^{\frac{i\pi}{4}}e^{\frac{-i\pi}{6}} = 4\sqrt{2}e^{\frac{i\pi}{12}}

Since we now have the definition of the complex conjugate of a number, I’d like to quickly go over the conjugate transpose of a matrix as we will use this later in the book. The conjugate transpose is exactly as it sounds. It combines the notions of complex conjugates and the transposition of a matrix into one operation. If you remember from Chapter 2, The Matrix, we defined the transpose to be:

If A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn], then AT=[a11a21⋯am1a12a22⋯am2⋮⋮⋱⋮a1na2n⋯amn]\text{If } A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} ,\text{ then } A^T = \begin{bmatrix} a_{11} & a_{21} & \cdots & a_{m1} \\ a_{12} & a_{22} & \cdots & a_{m2} \\ \vdots & \vdots & \ddots & \vdots \\ a_{1n} & a_{2n} & \cdots & a_{mn} \end{bmatrix}

This is where we essentially convert the rows into columns and the columns into rows.

The conjugate of a matrix is just the conjugation of every entry:

If A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn], then A∗=[a11∗a12∗⋯a1n∗a21∗a22∗⋯a2n∗⋮⋮⋱⋮am1∗am2∗⋯amn∗]\text{If } A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} ,\text{ then } A^* = \begin{bmatrix} a_{11}^* & a_{12}^* & \cdots & a_{1n}^* \\ a_{21}^* & a_{22}^* & \cdots & a_{2n}^* \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1}^* & a_{m2}^* & \cdots & a_{mn}^* \end{bmatrix}

For example, if the matrix M equals

[1+2i4eiπ2−i]\begin{bmatrix} 1 + 2i & 4 \\ e^{\frac{i\pi}{2}} & -i \end{bmatrix}

then M* equals

[1−2i4e−iπ2i]\begin{bmatrix} 1 - 2i & 4 \\ e^{\frac{-i\pi}{2}} & i \end{bmatrix}

So here is the big payoff. The conjugate transpose of a matrix A is defined to be:

A†=(A∗)TA^\dagger = (A^*)^T

The cross symbol at the top right of A is pronounced “dagger,” and therefore when you hear “A dagger,” the conjugate transpose of A is being referred to.

A quick example should get this all sorted. Let’s use our matrix M from before. The conjugate transpose of M would be:

M=[1+2i4eiπ2−i]M†=[1−2ie−iπ24i]M = \begin{bmatrix} 1 + 2i & 4 \\ e^{\frac{i\pi}{2}} & -i \end{bmatrix} \qquad M^\dagger = \begin{bmatrix} 1 - 2i & e^{\frac{-i\pi}{2}} \\ 4 & i \end{bmatrix}

Please note that the conjugate transpose of a matrix also goes under the names Hermitian conjugate and adjoint matrix.

Okay, with all that squared away, we can get to some cool quantum computing stuff called the Bloch sphere!

This is the big payoff of the chapter, understanding the Bloch sphere! The Bloch sphere, named after Felix Bloch, is a way to visualize a single qubit. From Chapter 1, Superposition with Euclid, we know that a qubit can be represented in the following way:

∣ψ⟩=α∣0⟩+β∣1⟩|\psi\rangle = \alpha|0\rangle + \beta|1\rangle

We did not say this before, but now that we have introduced complex numbers, we can say that α and β are actually complex numbers.

Now we know that complex numbers take two real numbers to represent, it looks as though we will need four real numbers to characterize a qubit state. This is very hard to graph as we cannot visualize 4D space. Let’s see whether we can decrease the number of real numbers required to represent a qubit state.

First, let’s replace α and β with their exponential form to get:

∣ψ⟩=rαeiϕα∣0⟩+rβeiϕβ∣1⟩|\psi\rangle = r_\alpha e^{i\phi_\alpha}|0\rangle + r_\beta e^{i\phi_\beta}|1\rangle

Now, let’s rearrange the right side of the equation by taking out eiϕαe^{i\phi_\alpha} and distributing it. Notice that I need to subtract the phase of eiϕαe^{i\phi_\alpha} from the second term:

∣ψ⟩=eiϕα(rα∣0⟩+rβei(ϕβ−ϕα)∣1⟩)|\psi\rangle = e^{i\phi_\alpha}\left(r_\alpha|0\rangle + r_\beta e^{i(\phi_\beta - \phi_\alpha)}|1\rangle\right)

(5)

It ends up that quantum mechanics (QM) calls eiϕαe^{i\phi_\alpha} the “global phase” in Equation (5) and that it has no measurable effect on the qubit state. Therefore, QM lets us drop it. So now we have:

∣ψ⟩=rα∣0⟩+rβei(ϕβ−ϕα)∣1⟩|\psi\rangle = r_\alpha|0\rangle + r_\beta e^{i(\phi_\beta - \phi_\alpha)}|1\rangle

The (φβ - φα) in the second term is called the “relative phase.” We will replace it with just one φ and also restrict it to go from 0 to 2π radians. Here is the new equation:

∣ψ⟩=rα∣0⟩+rβeiϕ∣1⟩|\psi\rangle = r_\alpha|0\rangle + r_\beta e^{i\phi}|1\rangle

Okay, hopefully, you’re keeping up. If you’re keeping score at home, with all this mathematical contortion, we are now down from four dimensions to three dimensions to describe the qubit state. Can we get down to two dimensions? Let’s try!

Another constraint we know is that α and β represent probability measurements and all probabilities must add up to one, so:

∣α∣2+∣β∣2=1|\alpha|^2 + |\beta|^2 = 1

Because of this, the following must also be true:

rα2+rβ2=1r_\alpha^2 + r_\beta^2 = 1

We can represent this on the first quarter of a unit circle like so:

Figure 6.9 – Unit circle with a right triangle showing the parameters of our qubit

You may have noticed that we use θ/2 rather than just θ. The reason for this goes into very deep physics and math that are beyond the scope of this book. If you are very interested in why this is the case, please consult https://physics.stackexchange.com/questions/174562/why-is-theta-over-2-used-for-a-bloch-sphere-instead-of-theta.

Now we can represent our two coefficients for r as:

rα=cos⁡(θ2)r_\alpha = \cos\left(\frac{\theta}{2}\right) rβ=sin⁡(θ2)r_\beta = \sin\left(\frac{\theta}{2}\right) 0≤θ<π0 \le \theta < \pi

Okay, here’s the big payoff!

∣ψ⟩=cos⁡(θ2)∣0⟩+sin⁡(θ2)eiϕ∣1⟩|\psi\rangle = \cos\left(\frac{\theta}{2}\right)|0\rangle + \sin\left(\frac{\theta}{2}\right)e^{i\phi}|1\rangle

We’re down to only two dimensions (θ and φ). Using these two angles, we can represent the qubit state on a unit sphere like so:

Figure 6.10 – Bloch sphere [3]

Θ is like the latitude on a map, but it goes from zero on the north pole, represented by the zero state, to π/2 on the equator and π on the south pole, which represents the one state. I was only able to show you how to get to the sphere mathematically, which is still a lot! For more information on why we need the Bloch sphere, please consult Packt’s other great book, Dancing with Qubits, by Robert Sutor. For a cool, interactive visualization of the Bloch sphere, please go to https://www.st-andrews.ac.uk/physics/quvis/simulations_html5/sims/blochsphere/blochsphere.html.

Well, we’ve come a long way in a few pages. We’ve now seen how complex numbers can be expressed in the three forms of Cartesian, polar, and exponential. We’ve also seen which forms are better for different operations. You’ve learned how to multiply, divide, add, and subtract complex numbers. Finally, we’ve put it all together to mathematically derive the Bloch sphere. Bravo!

In the next chapter, we will explore the world of eigenvalues, eigenvectors, and all kinds of eigenstuff. Get ready!