Hadamard and Superposition
Hadamard adds and subtracts amplitudes, each divided by √2: it turns |0⟩ into an even superposition and is its own inverse. A phase inserted between two H gates decides the final outcome — H is a phase detector, not a randomiser.
What does Hadamard actually compute?
The Hadamard gate H is an add-and-subtract machine. Acting on amplitudes (α, β), it outputs a new pair: the |0⟩ amplitude becomes (α + β)/√2 and the |1⟩ amplitude becomes (α − β)/√2.
From |0⟩ — amplitudes (1, 0) — it gives ((1 + 0)/√2, (1 − 0)/√2) = (0.7071, 0.7071): the state |+⟩, an even superposition, meaning a state with more than one non-zero amplitude.
From |1⟩ — amplitudes (0, 1) — it gives ((0 + 1)/√2, (0 − 1)/√2) = (0.7071, −0.7071): the state |−⟩. Same histogram, opposite sign.
You’ve read the opening of chapter 7 — 6 more sections follow, with worked examples and circuits you can run on the page. A free account unlocks every chapter of every course (paid plans aren’t live yet — early readers get everything free).