Negative and Complex Numbers
A negative number is an amount with a direction attached, which lets two amounts cancel to zero — and engineered cancellation is the trick every quantum algorithm runs on. The number i adds a brand-new direction, turning the number line into a plane of arrows called complex numbers.
What is a negative number, really?
Here are two fives that are not the same five: $5 in your pocket, and $5 you owe a friend. Same size. Opposite direction.
A negative number is exactly that: an amount with a direction attached. The $5 you owe is written -5, with a minus sign. A building does it too: floor 3 is three floors above the street, and parking level 3 is -3, three floors below.
Picture all numbers living on a number line: 0 in the middle, positive numbers stretching to the east (the right), negative numbers stretching to the west (the left). Every number is a position on this east-west road.
Adding becomes walking. To compute 7 + (-3): start at 0, walk 7 steps east, then 3 steps west. You are standing at 4. So 7 + (-3) = 4 — the same as 7 − 3. Adding a negative number just means walking the other way.
How can two amounts add up to nothing?
Earn $5 today and owe $5 from yesterday: your net worth moved not at all. 5 + (-5) = 0. Two real amounts, adding to nothing. This is called cancellation, and it only works because the amounts point in opposite directions.
Now, a fact about the probabilities from the last chapter: they can never do this. A probability is a fraction of many repeats, so it is never negative — there is no such thing as rain on −30 days out of 100. Piling up chances can only grow the total. Nothing cancels.
Quantum computers work one layer beneath probabilities. That layer is made of numbers called amplitudes — the numbers that get squared to produce probabilities. You already met one: 0.7071, whose square is 0.5. And amplitudes, unlike probabilities, are allowed to be negative.
Why does that matter? Because if two different routes lead to the same outcome, their amplitudes add — and an amplitude of +0.5 plus an amplitude of -0.5 makes exactly 0. The outcome becomes impossible. This is the entire secret of quantum computing, stated once and plainly: arrange the machine so that amplitudes for wrong answers cancel like matched debts, while amplitudes for right answers pile up. Everything else is engineering detail. By the end of this chapter you will watch a real circuit do it.
What number, times itself, gives −1?
Square any ordinary number and the answer refuses to be negative. 2 × 2 = 4. And (-2) × (-2) = +4 too. Why positive? Multiplying by a negative number means "reverse direction." Reverse twice and you face the way you started: (-1) × (-1) = +1.
So the question "what number squares to −1?" has no answer anywhere on the east-west line. Positive times positive is positive; negative times negative is positive. For centuries, mathematicians called the question impossible and moved on.
Then came one of the best ideas in the history of math: leave the line. Invent a new number that points north — a direction the line simply does not have — and give it a name: i. Define it by the one property we wanted: i × i = -1.
The number line has become a number plane — a flat map. East is +1, west is −1, north is i, south is -i. Every number is now a location on the map, not just a position on a road.
The letter i stands for "imaginary" — a name coined as an insult by mathematicians who distrusted the idea, and unfortunately it stuck. There is nothing imaginary about its usefulness: these numbers run electrical engineering, sound processing, and every quantum computer ever built.
What is a complex number?
A complex number is a walking recipe on that map: 0.6 + 0.8i means "walk 0.6 east, then 0.8 north." Draw an arrow from 0 to where you stopped. Every complex number is such an arrow, with a length and a direction.
The length comes from a rule about corner-shaped walks that you may remember as Pythagoras' theorem: square each leg of the walk, add, and take the square root. For 0.6 + 0.8i, digit by digit: 0.6 × 0.6 = 0.36. Then 0.8 × 0.8 = 0.64. Add: 0.36 + 0.64 = 1.00. Square root: √1 = 1. The arrow has length exactly 1. This is written |0.6 + 0.8i| = 1 — vertical bars mean "length of."
Once more with different numbers: |3 + 4i|. Squares: 3 × 3 = 9 and 4 × 4 = 16. Add: 9 + 16 = 25. Root: √25 = 5. An arrow 3 east and 4 north is exactly 5 long.
And multiplying by i? It turns the arrow a quarter turn counterclockwise. Check it against the definition: 1 × i = i — east becomes north, one quarter turn. Then i × i = −1 — north becomes west, another quarter turn. Two quarter turns are an about-face, and −1 is the about-face of +1. The mysterious equation i × i = -1 is just the sentence "turning twice reverses you," written in symbols.
Here is the payoff for quantum computing: every amplitude is one of these arrows. The probability of an outcome is the arrow's length, squared. And the arrow's direction — including the humble minus sign, which is just "pointing west" — is what makes cancellation possible.
Can a minus sign change what a machine prints out?
Let's build the smallest possible demonstration: one qubit, three gates. The gates are H (which you met as the coin-maker in chapter 2), then Z, then H again.
A single qubit carries exactly two amplitudes: the 0-part and the 1-part. Call them a and b — just labels, like names on two jars. The qubit starts with a = 1, b = 0: certain to read 0.
The two gate rules, stated plainly:
- H replaces the pair (
a,b) with: new 0-part =0.7071 × (a + b), new 1-part =0.7071 × (a - b). - Z flips the sign of the 1-part only: (
a,b) becomes (a,-b).
Now trace the circuit, four lines, nothing skipped:
- Start: 0-part = 1, 1-part = 0.
- After H: 0-part = 0.7071 × (1 + 0) = 0.7071; 1-part = 0.7071 × (1 − 0) = 0.7071. A fair coin, as in chapter 2.
- After Z: 0-part = 0.7071; 1-part = −0.7071. One sign flipped. Nothing measurable has changed yet: squaring kills the minus, so both readouts still have probability 0.5.
- After the final H: new 0-part = 0.7071 × 0.7071 + 0.7071 × (−0.7071) = 0.5 − 0.5 = 0, exactly. New 1-part = 0.7071 × 0.7071 − 0.7071 × (−0.7071) = 0.5 + 0.5 = 1.
Two honesty notes. First, 0.7071 is four-digit shorthand for 0.70710678..., whose square is exactly 0.5 — chapter 1 computed the four-digit square as 0.49999041, a rounding hair shy. Second, the zero needs no fine print at all: it is a number minus itself, and that is 0 to every digit there will ever be.
Read line 4 the way the machine does. The final H sends both jars partly toward "read 0" and partly toward "read 1." The two contributions to "read 0" arrive with opposite signs — matched debts — and cancel to nothing. The two contributions to "read 1" arrive with the same sign and reinforce. Probability of reading 0: 0 squared = 0. Probability of reading 1: 1 squared = 1.
Run it: watch the zeros cancel
Where will you use this?
You just watched the one trick that separates quantum computers from coin-flipping machines. Here is where it leads:
- Cancellation, at full scale, is the subject of Interference — the H-Z-H circuit you just ran is that chapter's seed, and Hadamard and superposition gives H its full introduction.
- Arrow directions beyond east and west — the full compass of complex amplitudes — power Phase gates and rotations, with amplitudes and phase as the quick-reference version.
- Squaring arrows into probabilities becomes official in Probability amplitudes.
- Measuring a direction as an angle is exactly what the next chapter, Angles, radians, and rotations, teaches — including the units quantum gates use for turning.
One last habit to take with you: whenever a histogram surprises you in the Lab, suspect a sign. A single west-pointing amplitude, somewhere in the middle of a circuit, can silence an outcome completely — you have now seen it happen.