Learn · 03

Interference, or how amplitudes cancel

A sheet of white dots rippled by two sources. Dark lines fan out where the waves cancel.

A quantum computer changes a qubit’s amplitudes with operations called gates. A gate takes the current amplitudes, adds and subtracts them in a fixed way, and produces new ones. Because amplitudes can be negative, adding them can make them cancel. That’s interference.

Noise-cancelling headphones run on the same idea. A microphone picks up the noise around you, and the headphones play the same sound wave turned upside down. Where the noise pushes, the copy pulls, and the two add up to almost nothing. Amplitudes cancel the same way: +0.5 and −0.5 add up to 0.

The clearest example needs one qubit and one gate, called Mix here. (Its proper name is the Hadamard gate, and every quantum computer has one.) Mix follows two rules:

  • new amplitude for 0 = (amplitude for 0 + amplitude for 1) ÷ 1.41
  • new amplitude for 1 = (amplitude for 0 − amplitude for 1) ÷ 1.41

The 1.41 is the square root of 2. Dividing by it keeps the arrow at length 1. In the simulation, Mix sends a share of each row’s dots to both rows, and a dot (+0.1) that lands in the same row as a ring (−0.1) cancels with it.

Mix once. A qubit starting at 0 has amplitudes 1 and 0. Both rules give 1 ÷ 1.41 = 0.71. The qubit is now an even blend, and measuring it gives 0 or 1 with equal odds.

Mix twice. Now both amplitudes are 0.71. The first rule gives (0.71 + 0.71) ÷ 1.41 = 1. The second gives (0.71 − 0.71) ÷ 1.41 = 0. The two shares arriving in row 1 have opposite signs and cancel exactly, and the qubit is back at 0 with certainty.

Ordinary chance can’t do this. Shuffle a deck twice and it’s still shuffled. Chances are never negative, so combining them only spreads them out. Amplitudes can be negative, so combining them can also concentrate them.

Mix, Flip, Mix. Flip changes the sign of the amplitude for 1. After Mix and Flip, the amplitudes are 0.71 and −0.71. A measurement still gives 50/50, because squaring hides the sign. But the second Mix now gives (0.71 − 0.71) ÷ 1.41 = 0 for 0 and (0.71 + 0.71) ÷ 1.41 = 1 for 1. This time the shares arriving in row 0 cancel, and the qubit ends at 1 with certainty.

Two blends that no measurement can tell apart lead to opposite results after the same gate. The difference is entirely in the signs. Try both sequences, and measure each a few times:

● is +0.1 of amplitude. ○ is −0.1.

Embed

Paste this into any web page to show this simulation there.

A quantum algorithm is a long sequence of gates like these, applied to many qubits at once. The gates are chosen so that, by the end, the shares heading to wrong answers cancel and the shares heading to the right answer add up. Nothing makes that happen by default. For each problem, someone has to find a sequence of gates that does it, and for most problems no such sequence is known. One that does work is Grover’s search.