Hadamard Gate
The Hadamard gate is the single most-used one-qubit gate in all of quantum computing, and it earns that place by doing the one thing a classical bit can never do: it turns a definite answer into a genuine superposition. Feed it and it returns ; feed it and it returns . Those two outputs are the eigenstates of the Pauli operator, so is the change-of-basis map between the two bases circuits use most — the computational basis and the conjugate basis , a pair that is mutually unbiased: an eigenstate of one lands on either eigenstate of the other with probability exactly . What makes unusual algebraically is that it is Hermitian and unitary at once. Hermiticity () makes it a legitimate observable with eigenvalues ; unitarity makes it a legitimate gate; and the two together force the involution , so a second Hadamard undoes the first. The conjugation relations , , are the algebraic fingerprint of a single geometric act: on the Bloch sphere is a rotation about the diagonal axis that trades the and poles. Scaled up, a layer on spreads the register into the uniform superposition over all strings — the opening move of Deutsch–Jozsa, Bernstein–Vazirani, Simon, Grover, and the quantum Fourier transform — while the sign pattern it carries is exactly the Fourier transform. Superposition, basis change, interference, and universality all trace back to this one matrix.
- The Hadamard gate maps and , creating equal-weight superpositions of the computational basis from definite inputs.
- Its matrix is ; it is Hermitian and unitary, so and — it is its own inverse.
- interchanges the Pauli and operators, and (and ), converting between the basis and the basis.
- Geometrically it is a rotation of the Bloch sphere about the diagonal axis , swapping the and poles.
- A layer on builds the uniform superposition , and its entries are the Walsh–Hadamard transform.
- is a generator of the Clifford group; with and CNOT it completes the universal set .
- Key idea: is the Hermitian, self-inverse single-qubit gate that exchanges the and bases (, ), turning and into the equal superpositions .
Where this lives today
The Hadamard is the workhorse of every quantum processor now running. On superconducting and trapped-ion hardware it is rarely a native pulse: it is compiled from calibrated primitives — for example a -rotation, a -rotation, and another -rotation — where the -parts are often virtual, zero-time frame relabellings, so a logical Hadamard costs essentially one physical pulse. Every entanglement demonstration, from tabletop Bell tests to the entangling gates inside Google's and IBM's chips, opens with the -then-CNOT primitive of Worked Example 1. The –phase– interferometer of Worked Example 2 is the beating heart of quantum phase estimation, the Hadamard test used to estimate expectation values in variational algorithms, and the Ramsey sequences that calibrate qubit frequencies and coherence times. Because generates the Clifford group, it is central to randomized benchmarking and to the stabilizer formalism: in the surface code, -type stabilizers are measured by Hadamard-conjugating the readout, and the logical Hadamard is realized by a transversal layer plus a lattice fold. The open frontier — driving error rates below the fault-tolerance threshold and decoding syndromes in real time — is stated entirely in the Clifford algebra that helps generate.
The physical picture
Picture a qubit's state as a unit arrow on the Bloch sphere. The computational basis lives on the vertical axis — at the north pole, at the south — and the basis lives on a horizontal equatorial axis, and at opposite equator points. The Hadamard gate is the single rigid motion that swaps these two axes: a half-turn about the diagonal line sitting exactly halfway between and . That half-turn carries the north pole down onto the equator, which is precisely the statement , and it reverses the remaining axis, giving . Applying it twice rotates by a full about the same axis and returns every arrow home — the geometric face of .
The relative minus sign in is not decoration — it is the seed of every quantum interference the gate later produces. Sandwich a phase between two Hadamards and the machine converts that phase into a measurable probability: prepare , stamp on a relative phase , and Hadamard back, and the chance of reading is . Constructive and destructive interference of the and branches is exactly what Deutsch–Jozsa and Grover exploit, and it is why the same that creates superposition also reads it out — apply then measure in and you have measured in the basis. The second figure makes this phase-to-probability conversion, the working core of phase estimation, quantitative.
The core equations
Everything starts from the explicit matrix in the computational basis, fixing and to order rows and columns. Reading the entries off directly shows the matrix is real, symmetric, and has orthonormal columns.
where: — Hadamard gate, a unitary acting on one qubit; — normalization so each column has unit norm. The reading: the matrix is real and symmetric, so ; its columns are orthonormal, so it is unitary; and its two rows are the -basis kets written out. Applying the matrix to the basis kets exposes the gate's job — it manufactures the two equal-weight superpositions and gives the basis its name.
where: — computational () basis states; — the -basis eigenstates, with and . The reading: both outputs have equal probability on and ; the only difference is the relative sign, and that sign is everything downstream. The two properties that make special as an operator can both be read straight from equation (1), and together they pin down its whole character.
where: — conjugate transpose; — the identity. The reading: Hermiticity makes an observable with eigenvalues ; combined with unitarity it forces , so is its own inverse and its own adjoint — there is no separate "inverse Hadamard." Because is the normalized sum of two Pauli matrices, its rotation axis is visible before any geometry is done. This single line is the bridge from the matrix to the Bloch sphere.
where: — Pauli- (bit flip); — Pauli- (phase flip). The reading: adding and gives , so points along — the diagonal axis it will rotate about. Conjugating the Paulis by is the compact algebraic statement of the swap, and it is why is a Clifford gate.
where: — conjugation of Pauli by (conjugation is because ). The reading: sends Paulis to Paulis, the defining property of the Clifford group; it swaps bit-flip and phase-flip errors, and reverses to keep the handedness consistent with . Exponentiating the axis operator turns the static swap into an honest rotation, connecting to the general single-qubit rotation family and to the -decomposition.
where: — rotation by angle about Bloch axis ; — a global phase, physically invisible on one qubit. The reading: is a rotation about the diagonal axis; the phase is bookkeeping that never affects a measurement. Applied in parallel to a fresh register, Hadamards manufacture the flat superposition that opens nearly every quantum algorithm.
where: — one Hadamard on each of qubits; — an -bit string labelling a computational-basis state. The reading: all amplitudes are equal at , an exponentially large uniform superposition built with only gates. The general matrix element carries a parity sign, and that sign is a Fourier transform over — the reason is called the Walsh–Hadamard transform.
where: — the bitwise inner product (parity). The reading: setting makes every sign and recovers equation (7); a general imprints a pattern of signs that later gates interfere to extract structure, as in Bernstein–Vazirani.
The goal is to prove directly from the matrix, with no appeal to geometry, that and — the exact algebraic content of the claim that swaps the computational and Hadamard bases and is therefore a Clifford gate. Because , conjugation of a Pauli is the plain product , so the whole derivation is two multiplications performed carefully and then read for meaning. Establishing these relations is what lets every later argument about move errors and measurements between bases symbolically.
Step 1. Compute the inner product first: . Why: doing the multiplication in two stages keeps the factors explicit, so the final that turns the product into an integer matrix is impossible to lose.
Step 2. Multiply on the right by : . So : a bit-flip conjugated by Hadamards becomes a phase-flip. Why: this is the operational reason an -basis measurement can be realized as "apply , then measure " — conjugation moves the observable, not the state.
Step 3. Repeat for : , then . So , completing the swap. Why: the symmetry of the two results confirms is an involution that merely exchanges the two axes rather than mixing in anything new.
Step 4. For completeness check : since and , we get . Why: the third relation is forced by the first two through , so the single geometric picture — a reflection swapping and and reversing — is fully consistent. *All three products are pure Pauli matrices with no residual phase — a direct consequence of being a real orthogonal involution of determinant .*
Go deeper · Derivation B · 1 minHadamard as a π rotation about the diagonal axis
The aim is to show that the abstract gate of equation (1) is, up to an unobservable global phase, the concrete rotation about , and to see exactly where each ingredient — the cosine, the sine, the vanishing of one term — comes from. The one fact that drives the whole computation is that a unit Pauli vector squares to the identity, so the rotation exponential closes into a two-term cosine-plus-sine formula rather than an infinite series. This is the derivation that upgrades "swap the axes" from a slogan into the specific element of that is.
Step 1. Start from the general single-qubit rotation, whose closed form follows from expanding and using . Why: this identity is imported from the Pauli-operator and Bloch-sphere articles; it is the single tool that makes exponentiating a Pauli tractable in closed form.
Step 2. Identify the axis operator using equation (4): with , the combination is the Hadamard matrix itself. Why: this is the crux — the very operator being exponentiated to make the rotation is , so is guaranteed to lie on its own rotation axis and be its own eigen-direction.
Step 3. Set : then and , so . Rearranging, . Why: the cosine term vanishing at is what makes the rotation a pure axis-swap with no leftover identity component — a genuine half-turn, not a partial tilt.
Step 4. Interpret the phase: is a global phase, which multiplies the whole state and cannot be detected by any measurement on a single qubit, so as a physical operation is exactly the rotation about . Checking, this rotation carries , i.e. , and reverses , i.e. . Why: discarding the global phase is legitimate here and reproduces both the basis-state action and the Pauli-conjugation relations derived independently above. *These results confirm with , , and ; the rotation reproduces and the axis swap.*
Go deeper · Derivation C · 1 minHadamards build the uniform superposition and the Walsh–Hadamard sign pattern
The purpose is to prove that a parallel layer acting on produces the equal superposition over all strings, and that its general matrix element carries the parity phase — the statement that is the Fourier transform on the group . The strategy is to solve a single qubit exactly, note that the amplitude factorizes across qubits because the gate is a tensor product, and then reassemble the pieces so that the sum of per-qubit exponents becomes a bitwise inner product. This is the calculation behind why gates can address inputs at once.
Step 1. Read the single-qubit matrix element off equation (1): for , since the only negative entry is the one, where makes . Why: capturing the whole matrix in one formula lets the tensor product be handled algebraically instead of by tracking four entries per qubit.
Step 2. Factorize over qubits: because acts independently on each factor, . Why: the tensor-product structure is exactly what turns an exponentially large amplitude into a product of elementary ones, the source of the register's parallelism.
Step 3. Collect the factors: the copies of give , and the sum of exponents gives , so . Why: the bitwise inner product emerging in the exponent is precisely the character of , which is why the layer is the Walsh–Hadamard (finite-field Fourier) transform.
Step 4. Specialize to : every phase is , so , the uniform superposition. Why: with all signs positive the state is a flat average over the whole basis — the exposure-to-all-inputs step that opens Deutsch–Jozsa, Grover, and the QFT. *The matrix element is correctly normalized: , confirming a valid quantum state.*
Limiting cases
The identities below are the ones worth memorizing; nearly every circuit trick involving is one of them applied.
| Case | Result | Meaning |
|---|---|---|
| Involution | Two Hadamards cancel; is its own inverse and its own adjoint, . | |
| Basis swap | interchanges bit-flip and phase-flip; equivalently it maps the and bases into each other. | |
| Y reversed | The axis flips under the diagonal rotation, consistent with and the right-hand rule. | |
| Eigenvalues | As a Hermitian involution has eigenvalues ; the eigenstate is , lying on the rotation axis. | |
| Conjugating CNOT | Surrounding a CNOT by Hadamards swaps control and target — a key two-qubit circuit identity. |
Worked examples
1 · Creating a Bell state with H and CNOT (fully worked)
Two qubits start in . Apply a Hadamard to the first (control) qubit, then a CNOT with qubit 1 as control and qubit 2 as target. Find the output state and confirm it is entangled.
Step 1. Hadamard the control. Using equation (2), , so . The control is now in an equal superposition; the target is still .
Step 2. Apply CNOT, which flips the target iff the control is : it fixes and sends . Therefore . The output is the Bell state .
Step 3. Check entanglement. A product state would need its and amplitudes and to vanish while and are both — impossible, since and force . So does not factor. A single plus a CNOT converts a definite into a maximally entangled pair — the entanglement primitive behind teleportation and superdense coding.
2 · The Hadamard interferometer turns phase into probability (fully worked)
A qubit begins in . Apply , then a phase gate , then again, and measure in the computational basis. Find the probability of outcome , and evaluate it at .
Step 1. First Hadamard: . The phase gate multiplies the branch only: . The two branches now differ by a relative phase — invisible to a measurement at this stage, since both still have probability .
Step 2. Second Hadamard, using and : the state becomes . The relative phase has been rotated into the amplitudes — this is the step that makes phase measurable.
Step 3. Read off the outcome- probability: , and likewise . So — a Ramsey fringe, the exact curve in the second figure.
Step 4. Evaluate at : , and as well. At the interference is fully constructive (); at fully destructive (); at the qubit is balanced. This –phase– sandwich is the elementary cell of quantum phase estimation and the Hadamard test.
Physics of the portrait
The Hadamard gate carries the name of a mathematician who died before the first qubit was ever proposed. Jacques Hadamard studied matrices with orthogonal rows for a pure-mathematics question about determinants; a century later the smallest such matrix, rescaled by , turned out to be the most important gate in quantum computing.
Origins · 1 minJacques Hadamard and how this was discovered
Jacques Hadamard was one of the towering French mathematicians of his era, whose work reached from number theory to the foundations of chaos. In 1896 he proved the prime number theorem — that the count of primes below grows like — independently of de la Vallée Poussin, settling a conjecture of Gauss. His name attaches to a remarkable spread of objects: Hadamard's inequality bounding a determinant by the product of its column norms; the three-circle theorem in complex analysis; his notion of a well-posed problem, still the organizing idea of partial differential equations; and his study of geodesics on negatively curved surfaces, an early glimpse of chaos theory. The matrices named for him arose in 1893 from asking how large a determinant an matrix of entries can have: the maximum is hit exactly by matrices with mutually orthogonal rows — the Hadamard matrices — and the recursive power-of-two construction had already appeared in Sylvester's 1867 work. The case , normalized to be unitary, is the quantum Hadamard gate; its -fold tensor power is the Walsh–Hadamard transform. Hadamard, who lived to 97, never encountered quantum computation — the gate is a posthumous tribute from a field his mathematics helped make possible.
Going further
Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §1.3.1 (basic gates) and §4.2 (single-qubit operations and rotations) · Preskill, Lecture Notes for Physics 219, Ch. 5–6 · Watrous, The Theory of Quantum Information, §2 · Wilde, Quantum Information Theory, Ch. 3 · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, §8 · Mermin, Quantum Computer Science, Ch. 1–2. Key results to keep in mind: (i) and follow directly from equation (1); (ii) , , by direct matrix multiplication; (iii) and with ; (iv) the eigenstate is ; (v) the Walsh–Hadamard entries are and setting gives the uniform superposition; (vi) the Bell-state and interferometer calculations yield and . The universality of and the Gottesman–Knill simulability of Clifford circuits are standard results in quantum computation.
Prerequisites. The Quantum Circuit Model · Pauli Gates (X, Y, Z) · Bloch-Sphere Representation of Gates. Leads to. Phase Gates (S and T) · The CNOT Gate · Universal Gate Sets · Z–Y Decomposition of Single-Qubit Gates.
Ask the tutor: ask me to run any circuit through a Hadamard, build a Bell state step by step, or show how the –phase– sandwich turns a hidden phase into a measured probability.
Why is the Hadamard gate its own inverse?
Because , which you can read straight off the matrix: . Physically, applying two Hadamards in a row returns any state to its start — for instance . This is unusual: most gates need a distinct inverse (the inverse of is , of is ). needs none, because it is a Hermitian involution, both its own adjoint and its own inverse. In a circuit this means a Hadamard placed before and after some operation can be cheaply removed if that operation commutes through it.
How is the Hadamard gate different from the Pauli X gate — don't both flip the qubit?
They do very different things. Pauli is the bit-flip: it swaps , keeping the qubit in a definite basis state. Hadamard instead sends and , creating a superposition that is neither nor . On the Bloch sphere is a rotation about the -axis, while is a rotation about the diagonal axis that swaps the and directions. They are related — — but moves you between definite answers while moves you between definite and superposed. Only manufactures the interference that quantum algorithms need.
What does it mean that H swaps the X and Z bases, and why is that useful?
It means and : conjugating one Pauli by Hadamards turns it into the other. The practical payoff is measurement. Real hardware can usually only measure in the computational () basis, reading whether a qubit is or . To measure in the basis instead — to ask whether a qubit is or — you apply first, which rotates and , then do the ordinary measurement. This "rotate then read" trick underlies stabilizer-code syndrome extraction, Bell-state analysis, and any protocol that needs measurements in complementary bases.
Why does a layer of Hadamards give exactly the uniform superposition and nothing lopsided?
Because each qubit is treated identically and independently. A single sends to , an exactly balanced two-way split. When you apply to each of qubits starting from , the amplitudes multiply: every one of the output strings gets the same factor , with all signs positive because never triggers the lone minus entry of the matrix. The result is perfectly flat — equal amplitude on all strings. If you started from a state other than all-zeros, some of those signs would flip (that is the pattern), giving a superposition that is still uniform in magnitude but carries a sign structure algorithms can exploit.
Where does the crucial minus sign in H|1⟩ = |−⟩ actually matter?
Everywhere interference happens. The states and have identical measurement statistics in the basis — both give and with probability — so the sign seems invisible. It becomes decisive the moment you apply a second gate. Hadamard and you get ; Hadamard and you get : the same input probabilities, opposite outputs, entirely because of that sign. In the interferometer of Worked Example 2, the relative phase riding on the branch is what the second Hadamard converts into a measurable probability . Drop the sign and you have destroyed the very phase information that makes quantum computation more than randomized classical computation.
Is the Hadamard gate enough on its own to build any quantum computation?
No — and this is a deep point. is a Clifford gate: it maps Paulis to Paulis under conjugation. By the Gottesman–Knill theorem, any circuit built only from Clifford gates (, phase gate , and CNOT) can be simulated efficiently on a classical computer, so such circuits offer no advantage by themselves, despite freely creating superposition and entanglement. To reach universal quantum computation you must add one non-Clifford gate — canonically . The set is then universal, approximating any unitary to arbitrary precision. So supplies superposition and basis change, while supplies the "magic" that lifts the circuit beyond classical reach.