Level 2, Tinkerer

Hadamard gate

From the state certain to read 0, one H writes two equal amplitudes of about +0.71. A second H returns the state certain to read 0, because the routes to a reading of 1 cancel.

The Hadamard gate, written H, turns the state certain to read 0 into the |+⟩ state, with equal amplitudes of the same sign. It turns the state certain to read 1 into the |−⟩ state, with equal amplitudes of opposite sign. A second H returns any qubit to the state it started from, because the extra routes cancel in pairs.

Keith’s sticker says “fair split” and covers only the first press of the button. Malcolm will tolerate the sticker if it also says that the second press undoes the first, which is the part the sticker usually omits.

An example

The rule fits on one line. Add the two amplitudes to get the new amplitude for 0. Take the amplitude for 1 away from the amplitude for 0 to get the new amplitude for 1. Divide both by the square root of 2, about 1.41.

Try it on 0.6 for 0 and −0.8 for 1. The sum is −0.2 and the difference is 1.4. Divide by 1.41 and you get about −0.14 and 0.99. The squares are 0.02 and 0.98, so the qubit now reads 1 in about 98 runs out of 100.

Press H again, and keep the 1.41 aside for a moment. The sum of −0.2 and 1.4 is 1.2, and the difference is −0.2 − 1.4 = −1.6. Two divisions by 1.41 make one division by 2, so the result is 0.6 and −0.8. That is where you started.

What it is not

H is not a coin toss. Nothing random happens when you press it. It is a fixed rule, and the same input always gives the same output. A coin tossed twice is still random, while H pressed twice gives back exactly what you had.

H does not always make an even split, either. On the |+⟩ state it gives the state certain to read 0, with no chance of a 1. It turns an even split into a certainty as readily as the other way round. On the Bloch sphere it is a half turn that swaps the north pole with |+⟩ and the south pole with |−⟩.

From a plain 0 or 1, H makes a superposition, and two presses in a row show interference. H, then the Z gate, then H acts like the X gate. The note The sign is what cancels uses H on every line. Try it on the qubit page, name it in Which Gate, or write it as a table of numbers in Which Matrix.

Used in

Longer explanation: What is the Hadamard gate?

All the words