## Section 1: Introduction to complex numbers

The **complex numbers** are the numbers of the form

We can graph them as if they are on a Cartesian plane, showing the number $a+bi$ at coordinates $(a,b)$. The number $a$ is the **real part** and the number $b$ is the** complex part**. When we draw the points like this, it is called the **complex plane**.

The following Sage cell will plot the complex number a+bi on the plane. In Sage, the imaginary number I is the square root of -1. We can make a number a complex number by writing it as `a + b*I`. It’s ok for b to be zero. Try changing the points in the plot below, or adding some and see where they go.

The complex numbers have an addition operation. You add like this:

**Practice adding and subtracting**complex numbers by hand and then check your results in Sage using the following cell. Exercises:

- $(2+3i) + (4+i)$
- $(3+2i) + (7-2i)$
- $(3+2i) – (7-2i)$

In the following cell, you can set z and w as you please, and it will plot z and w in blue and z+w in red. What is happening, geometrically? What is the geometric meaning of addition in the complex numbers? **Do not move on until you have figured it out!**

The complex numbers have an multiplication operation. You multiply like this:

**Practice multiplying** complex numbers by hand and then check your results in Sage using the following cell. Exercises:

- $(2+3i)(4+i)$
- $(3+2i)(7-2i)$

In the following cell, you can set z and w as you please, and it will plot $z$ and $w$ in blue and $zw$ in red. You will actually prefer to play with this live app that does the same thing to get a real sense of the geometry. What is happening, geometrically? What is the geometric meaning of multiplication in the complex numbers? **Do not move on until you have figured it out!**

## Section 2: Complex numbers in polar coordinates

There’s a way to do complex numbers in `polar coordinates’ too. A complex number $a+bi$ has an **absolute value**, which is its length $\sqrt{a^2+b^2}$, and an **argument**, which is its angle in radians from the positive $x$-axis. Here’s how you can get these numbers:

Quick test: use the box above to find the argument and length of $1+i$.

If you want to specify a complex number by its argument $\theta$ and length $r$, then you write $re^{\theta i}$. In Sage, this looks like:

Quick test: figure out how to get $z = 1 + i$ by inputting a complex number in argument/length format. That is, modify the first line of the next cell so the output is $1+i$.

Quick test: what is $e^{i \pi}$?

We haven’t explained why we are using the exponential notation for this idea yet. That will come in a moment!

## Section 3: Domain Colouring

We can colour the complex plane, so black is at the origin, white is at infinity, and the rainbow circles the origin. This is a way of associating a colour to each complex number. This is called **domain colouring**.

Here’s a zoom out of the picture above. What looks different? Why?

Then, **a function can be plotted by putting the colour of the OUTPUT at each INPUT location**. To read this: black holes are zeroes, white areas are large in absolute value, red areas are positive real, turquoise is negative real.

Look at the following example (the function $f(x) = x+1$) and understand why it looks the way it does:

Quick test: Where does this function take the real line? Can you see this in the picture? Where does -1 go? How does the picture tell you the answer?

Here’s another example. Why does it look the way it does?

Quick test: how many zeroes does this function have? Where are they?

Here’s another example. Why does it look the way it does?

Quick test: Does any complex number go to infinity? What does that look like in the picture?

Here’s a more complicated example.

Exercise: try modifying the function above and `deciphering’ what the picture means. Pick experiments that help you learn. Explain them to your collaborator.

## Section 4: Revisiting the complex exponential

Now, here’s the **complex exponential function**.

Question: does this complex exponential function look like the usual exponential function on the real line?

Question: what does the complex exponential function do the imaginary axis?

The complex exponential function is useful because it has the following property:

Computation practice:

Simplify these expressions down to the shape $a + bi$:

- $e^{i \pi}$
- $2e^{0}$
- $e^{\pi/2}$
- $e^{\pi}e^{\pi}$

Write the following as an exponential:

- $1$
- $i$
- $1+i$
- $\cos \theta + i \sin \theta$ (the answer should no longer have any trig in it)

Here’s a blank Sage box to check your answers (if applicable):

## Section 5: Projective space over the complex numbers

We can now think about $\mathbb{P}^1_\mathbb{C}$, the projective `line’ of complex numbers, which is to say, vectors $[z,w]$ where $z,w \in \mathbb{C}$, where we identify two vectors if they are the same up to scaling by a non-zero complex number.

Quick quiz:

- Is $[1,0] = [i,0]$?
- Is $[0,1] = [1,0]$?
- Name some equivalent vectors to $[1,i]$.

Now, we are going to write our two basis vectors for $\mathbb{C}^2$ by the totally whacked out notation: $|0 \rangle$ and $|1 \rangle$. So instead of writing $[a,b]$, I’ll write $a|0\rangle + b|1 \rangle$. Now, the physicists get themselves all in knots to say “projective space” — that is, they say:

- $|a|^2 + |b|^2 = 1$, i.e. the vector is always normalized to have length $1$.
- a “global phase” $e^{i \theta}$ is physically unobservable as a constant multiple, so $a |0\rangle + b |1 \rangle$ is “equivalent” to $e^{i\theta}(a |0\rangle + b |1\rangle)$.

Quick quiz:

- Is $|0\rangle$ equivalent to $i|1\rangle$?
- Is $|1\rangle$ equivalent to $|0 \rangle$?
- Name some equivalent vectors to $|0\rangle + |1\rangle$.
- Notice that these problems are the exact same as the last set of quick quiz questions, in the new notation.

The possible combinations $a |0\rangle + b|1\rangle$ up to the rules above (i.e. scaling to length 1 and ignoring global phase) are the **possible states of a single qubit**. Since this is a copy of $\mathbb{P}^1_\mathbb{C}$, all that matters is $b/a$, i.e. the ratio of the two coefficients. That ratio could be anything in $\mathbb{C} \cup \{ \infty \}$. So the space of states for a single qubit is the complex plane, together with one extra “infinity point”. Six points on this space have special names:

- $|0\rangle= |0\rangle + 0 |1\rangle$ (complex number $b/a = 0$)
- $|1 \rangle= 0 |0\rangle + |1\rangle$ (complex number $b/a = \infty$)
- $|+\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle + |1\rangle\right)$ (complex number $b/a = 1$)
- $|-\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle – |1\rangle\right)$ (complex number $b/a = -1$)
- $|i\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle +i|1\rangle\right)$ (complex number $b/a = i$)
- $|-i\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle -i |1\rangle\right)$ (complex number $b/a = -i$)

By wrapping the complex plane around an orange (like the wrapped mandarins at christmas time), and tying it off with a bow at infinity, we get a `sphere’ of states, called the Bloch sphere. Here’s a picture:

Questions:

- Locate $\frac{1}{\sqrt{5}}\left( |0\rangle + 2|1 \rangle \right)$ on the plane and on the sphere. (Why do I have a normalization of $\frac{1}{\sqrt{5}}$ out front?)
- Locate $\frac{1}{\sqrt{2}}\left( |0\rangle + i|1 \rangle \right)$ on the plane and on the sphere.