Complex numbers without fear
Numbers that point in any direction, and how they let chances cancel out.
Lesson 4 of 5 about 11 min
Numbers that sounded impossible
A few hundred years ago, many mathematicians said negative numbers were nonsense. How can you have less than nothing? Today you see them everywhere: −5 °C on a cold morning, or a bank balance below zero.
Complex numbers are the same story. They sound impossible, right up until you see a picture of them. So let's start with a picture of something you already know.
On a number line, multiplying by −1 turns a number around: 3 becomes −3. Here's a new way to see that. Multiplying by −1 is a half turn.
The quarter turn
If multiplying by −1 is a half turn, what would a quarter turn be? It would be a number that, done twice, gives −1. A number that, times itself, equals −1.
No number on the line can do that, because a quarter turn points straight up, off the line. So mathematicians simply gave that number a name: i. Multiplying by i means “turn a quarter turn to the left”.
Your turn
A number is a point on a map
Once numbers can turn, they can point anywhere, not just along a line. So now numbers live on a flat map. The number 3 + 2i means: 3 steps right (the ordinary part), then 2 steps up (the i part).
These are called complex numbers. “Complex” here means “made of two parts”, not “complicated”. The ordinary part is also called the real part, and the i part the imaginary part. That's an old name: these numbers are as real as any other.
Look familiar? A complex number is just an arrow, like the vectors from two lessons ago.
Adding is walking
Since complex numbers are arrows, you add them just like arrows: the ordinary parts together, and the i parts together.
Your turn
Multiplying turns
Multiplying is where complex numbers get their superpower. You've seen that multiplying by i turns an arrow a quarter turn. In fact, multiplying by any complex number of size 1 (any point on the circle) turns an arrow, by that number's angle.
2 × 0.71 + 0.71i = 1.41 + 1.41i
The pink number is turned 45°, so the answer is the 2, turned 45°.
Your turn
Size, and the chance it gives
Every complex number has a size: the length of its arrow. You already know how to find it, from Pythagoras: the size of a + bi is √(a² + b²).
Here's why that matters. In a quantum computer, each possible result gets a complex number called an amplitude. The chance of seeing that result is its size, squared.
0.6 + 0.3isize
0.67chance = size²
0.45 (45%)
Your turn
Chances can't cancel. Amplitudes can.
So why do quantum computers bother with complex numbers at all? Here's the reason, and it's a beautiful one.
Chances are never negative, so when you add them they can only pile up. But amplitudes are arrows, and two arrows pointing opposite ways add up to nothing.
In a quantum computer there can be two routes to the same result. Each route brings its own amplitude, and the two amplitudes add like arrows. Only then do you square the total to get the chance.
total size 0.87 → chance = 0.87² = 0.75
Your turn
What you now know
- Multiplying by −1 is a half turn. Multiplying by i is a quarter turn, so i × i = −1.
- A complex number a + bi is a point (or an arrow) on a flat map: a right, b up.
- Add them like arrows. Multiplying by a number of size 1 turns them.
- Each result in a quantum computer has an amplitude, and its chance is the amplitude's size squared.
- Amplitudes can cancel out. That's interference, the engine of quantum algorithms.
That's every piece of maths you need to understand a qubit. One last stop before you meet one: a quick checkpoint to lock it all in.