# Complex Numbers — In Class Worksheet

## Section 1:  Introduction to complex numbers

The complex numbers are the numbers of the form

$\mathbb{C} := \left\{ a + bi : a, b \in \mathbb{R} \right\}$
where $i$ is the square root of $-1$.

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.

$(a + bi) + (c+di) = (a+c) + (b+d)i$
Practice adding and subtracting complex numbers by hand and then check your results in Sage using the following cell. Exercises:

1. $(2+3i) + (4+i)$
2. $(3+2i) + (7-2i)$
3. $(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:

$(a + bi) (c+di) = ac + bci + adi + bd i^2 = (ac – bd) + (bc+ad)i$
Don’t memorize this as a formula. Do it out yourself using FOIL and then using the fact that $i^2 = -1$ to simplify back down to a real and imaginary part.

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

1. $(2+3i)(4+i)$
2. $(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:

$e^{a+b} = e^{a}e^{b}$
In other words, it changes addition into multiplication. If you require this nice property, then you are essentially forced to get the function we’ve graphed above. So you can use your usual exponent rules with the exponential function notation for complex numbers.

Computation practice:

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

1. $e^{i \pi}$
2. $2e^{0}$
3. $e^{\pi/2}$
4. $e^{\pi}e^{\pi}$

Write the following as an exponential:

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

## 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:

1. Is $[1,0] = [i,0]$?
2. Is $[0,1] = [1,0]$?
3. 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:

1. $|a|^2 + |b|^2 = 1$, i.e. the vector is always normalized to have length $1$.
2. 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:

1. Is $|0\rangle$ equivalent to $i|1\rangle$?
2. Is $|1\rangle$ equivalent to $|0 \rangle$?
3. Name some equivalent vectors to $|0\rangle + |1\rangle$.
4. 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:

1. $|0\rangle= |0\rangle + 0 |1\rangle$ (complex number $b/a = 0$)
2. $|1 \rangle= 0 |0\rangle + |1\rangle$ (complex number $b/a = \infty$)
3. $|+\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle + |1\rangle\right)$ (complex number $b/a = 1$)
4. $|-\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle – |1\rangle\right)$ (complex number $b/a = -1$)
5. $|i\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle +i|1\rangle\right)$ (complex number $b/a = i$)
6. $|-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:

1. 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?)
2. Locate $\frac{1}{\sqrt{2}}\left( |0\rangle + i|1 \rangle \right)$ on the plane and on the sphere.

With what time remains, please review for the test.