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 ∣0⟩|0\rangle and it returns ∣+⟩=(∣0⟩+∣1⟩)/2|+\rangle=(|0\rangle+|1\rangle)/\sqrt2; feed it ∣1⟩|1\rangle and it returns ∣−⟩=(∣0⟩−∣1⟩)/2|-\rangle=(|0\rangle-|1\rangle)/\sqrt2. Those two outputs are the eigenstates of the Pauli XX operator, so HH is the change-of-basis map between the two bases circuits use most — the computational ZZ basis {∣0⟩,∣1⟩}\{|0\rangle,|1\rangle\} and the conjugate XX basis {∣+⟩,∣−⟩}\{|+\rangle,|-\rangle\}, a pair that is mutually unbiased: an eigenstate of one lands on either eigenstate of the other with probability exactly 12\tfrac12. What makes HH unusual algebraically is that it is Hermitian and unitary at once. Hermiticity (H=H†H=H^\dagger) makes it a legitimate observable with eigenvalues ±1\pm1; unitarity makes it a legitimate gate; and the two together force the involution H2=IH^2=I, so a second Hadamard undoes the first. The conjugation relations HXH=ZHXH=Z, HZH=XHZH=X, HYH=−YHYH=-Y are the algebraic fingerprint of a single geometric act: on the Bloch sphere HH is a 180∘180^\circ rotation about the diagonal axis (x^+z^)/2(\hat x+\hat z)/\sqrt2 that trades the XX and ZZ poles. Scaled up, a layer H⊗nH^{\otimes n} on ∣0⟩⊗n|0\rangle^{\otimes n} spreads the register into the uniform superposition over all 2n2^n strings — the opening move of Deutsch–Jozsa, Bernstein–Vazirani, Simon, Grover, and the quantum Fourier transform — while the sign pattern (−1)x⋅y/2n(-1)^{x\cdot y}/\sqrt{2^n} it carries is exactly the Z2n\mathbb{Z}_2^n Fourier transform. Superposition, basis change, interference, and universality all trace back to this one 2×22\times2 matrix.

Key takeaways
  • The Hadamard gate HH maps ∣0⟩→∣+⟩|0\rangle\to|+\rangle and ∣1⟩→∣−⟩|1\rangle\to|-\rangle, creating equal-weight superpositions of the computational basis from definite inputs.
  • Its matrix is H=12(111−1)H=\tfrac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}; it is Hermitian and unitary, so H=H†H=H^\dagger and H2=IH^2=I — it is its own inverse.
  • HH interchanges the Pauli XX and ZZ operators, HXH=ZHXH=Z and HZH=XHZH=X (and HYH=−YHYH=-Y), converting between the ZZ basis and the XX basis.
  • Geometrically it is a π\pi rotation of the Bloch sphere about the diagonal axis n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2, swapping the XX and ZZ poles.
  • A layer H⊗nH^{\otimes n} on ∣0⟩⊗n|0\rangle^{\otimes n} builds the uniform superposition 12n∑x∣x⟩\tfrac{1}{\sqrt{2^n}}\sum_x|x\rangle, and its entries (−1)x⋅y/2n(-1)^{x\cdot y}/\sqrt{2^n} are the Walsh–Hadamard transform.
  • HH is a generator of the Clifford group; with TT and CNOT it completes the universal set {H,T,CNOT}\{H,T,\mathrm{CNOT}\}.
  • Key idea: HH is the Hermitian, self-inverse single-qubit gate that exchanges the XX and ZZ bases (HXH=ZHXH=Z, HZH=XHZH=X), turning ∣0⟩|0\rangle and ∣1⟩|1\rangle into the equal superpositions ∣±⟩|\pm\rangle.

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 ZZ-rotation, a π/2\pi/2 XX-rotation, and another ZZ-rotation — where the ZZ-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 HH-then-CNOT primitive of Worked Example 1. The HH–phase–HH 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 HH generates the Clifford group, it is central to randomized benchmarking and to the stabilizer formalism: in the surface code, XX-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 HH 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 ZZ axis — ∣0⟩|0\rangle at the north pole, ∣1⟩|1\rangle at the south — and the XX basis lives on a horizontal equatorial axis, ∣+⟩|+\rangle and ∣−⟩|-\rangle 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 +z^+\hat z and +x^+\hat x. That half-turn carries the north pole down onto the equator, which is precisely the statement H∣0⟩=∣+⟩H|0\rangle=|+\rangle, and it reverses the remaining YY axis, giving HYH=−YHYH=-Y. Applying it twice rotates by a full 360∘360^\circ about the same axis and returns every arrow home — the geometric face of H2=IH^2=I.

Figure
The Hadamard gate is a π rotation of the Bloch sphere about the diagonal axis n̂ = (x̂ + ẑ)/√2 at polar angle 45°: it swaps the Z and X axes, carrying the north-pole zero-state to the equatorial plus-state, and it fixes its own +1 eigenstate, which lies on the axis with amplitudes cos(π/8) ≈ 0.924 and sin(π/8) ≈ 0.383
H = π rotation about n̂ = (x̂ + ẑ)/√2 : it swaps the Z and X axes |0⟩ Z = +1 |1⟩ |+⟩ X = +1 |−⟩ n̂ +1 eigenstate cos(π/8) ≈ 0.924 H

The relative minus sign in ∣1⟩→∣−⟩|1\rangle\to|-\rangle 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 ∣+⟩|+\rangle, stamp on a relative phase φ\varphi, and Hadamard back, and the chance of reading 00 is cos⁡2(φ/2)\cos^2(\varphi/2). Constructive and destructive interference of the ∣0⟩|0\rangle and ∣1⟩|1\rangle branches is exactly what Deutsch–Jozsa and Grover exploit, and it is why the same HH that creates superposition also reads it out — apply HH then measure in ZZ and you have measured in the XX basis. The second figure makes this phase-to-probability conversion, the working core of phase estimation, quantitative.

Figure
A Hadamard sandwich turns phase into probability: prepare the plus-state, apply a relative phase φ, then apply H again, and the outcome-0 probability is P₀ = cos²(φ/2), running from 1 at φ = 0 through 1/2 at φ = π/2 to 0 at φ = π — the Ramsey fringe at the heart of phase estimation and the Hadamard test
H · P(φ) · H on |0⟩ : outcome-0 probability P₀ = cos²(φ/2) 1.0 0.5 0.0 0 π/2 π 3π/2 2π relative phase φ P₀ = cos²(φ/2) P₀ = 1 (φ = 0) P₀ = 1/2 (φ = π/2) P₀ = 0 (φ = π)

The core equations

Everything starts from the explicit matrix in the computational basis, fixing ∣0⟩=(1,0)T|0\rangle=(1,0)^T and ∣1⟩=(0,1)T|1\rangle=(0,1)^T to order rows and columns. Reading the entries off directly shows the matrix is real, symmetric, and has orthonormal columns.

H=12(111−1)(1)H=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix} \qquad (1)

where: HH — Hadamard gate, a 2×22\times2 unitary acting on one qubit; 12\tfrac{1}{\sqrt2} — normalization so each column has unit norm. The reading: the matrix is real and symmetric, so H†=HH^\dagger=H; its columns are orthonormal, so it is unitary; and its two rows are the XX-basis kets ∣±⟩|\pm\rangle written out. Applying the matrix to the basis kets exposes the gate's job — it manufactures the two equal-weight superpositions and gives the XX basis its name.

H∣0⟩=∣+⟩=∣0⟩+∣1⟩2,H∣1⟩=∣−⟩=∣0⟩−∣1⟩2(2)H|0\rangle=|+\rangle=\frac{|0\rangle+|1\rangle}{\sqrt2},\qquad H|1\rangle=|-\rangle=\frac{|0\rangle-|1\rangle}{\sqrt2} \qquad (2)

where: ∣0⟩,∣1⟩|0\rangle,|1\rangle — computational (ZZ) basis states; ∣+⟩,∣−⟩|+\rangle,|-\rangle — the XX-basis eigenstates, with X∣+⟩=+∣+⟩X|+\rangle=+|+\rangle and X∣−⟩=−∣−⟩X|-\rangle=-|-\rangle. The reading: both outputs have equal probability 12\tfrac12 on 00 and 11; the only difference is the relative sign, and that sign is everything downstream. The two properties that make HH special as an operator can both be read straight from equation (1), and together they pin down its whole character.

H=H†,H†H=I,H2=I(3)H=H^{\dagger},\qquad H^{\dagger}H=I,\qquad H^2=I \qquad (3)

where: H†H^\dagger — conjugate transpose; II — the 2×22\times2 identity. The reading: Hermiticity makes HH an observable with eigenvalues ±1\pm1; combined with unitarity it forces H2=IH^2=I, so HH is its own inverse and its own adjoint — there is no separate "inverse Hadamard." Because HH 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.

H=12 (X+Z)(4)H=\frac{1}{\sqrt2}\,(X+Z) \qquad (4)

where: XX — Pauli-XX (bit flip); ZZ — Pauli-ZZ (phase flip). The reading: adding X=(0110)X=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right) and Z=(100−1)Z=\left(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\right) gives (111−1)\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right), so HH points along n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2 — the diagonal axis it will rotate about. Conjugating the Paulis by HH is the compact algebraic statement of the X↔ZX\leftrightarrow Z swap, and it is why HH is a Clifford gate.

HXH=Z,HZH=X,HYH=−Y(5)HXH=Z,\qquad HZH=X,\qquad HYH=-Y \qquad (5)

where: HPHHPH — conjugation of Pauli PP by HH (conjugation is HPHHPH because H†=HH^\dagger=H). The reading: HH sends Paulis to Paulis, the defining property of the Clifford group; it swaps bit-flip and phase-flip errors, and reverses YY to keep the handedness consistent with det⁡H=−1\det H=-1. Exponentiating the axis operator turns the static swap into an honest rotation, connecting HH to the general single-qubit rotation family and to the ZYZY-decomposition.

H=eiπ/2 Rn^(π),n^=x^+z^2(6)H=e^{i\pi/2}\,R_{\hat n}(\pi),\qquad \hat n=\frac{\hat x+\hat z}{\sqrt2} \qquad (6)

where: Rn^(θ)=e−iθ n^⋅σ⃗/2R_{\hat n}(\theta)=e^{-i\theta\,\hat n\cdot\vec\sigma/2} — rotation by angle θ\theta about Bloch axis n^\hat n; eiπ/2e^{i\pi/2} — a global phase, physically invisible on one qubit. The reading: HH is a 180∘180^\circ rotation about the 45∘45^\circ diagonal axis; the phase eiπ/2e^{i\pi/2} 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.

H⊗n∣0⟩⊗n=12n∑x∈{0,1}n∣x⟩(7)H^{\otimes n}|0\rangle^{\otimes n}=\frac{1}{\sqrt{2^n}}\sum_{x\in\{0,1\}^n}|x\rangle \qquad (7)

where: H⊗nH^{\otimes n} — one Hadamard on each of nn qubits; xx — an nn-bit string labelling a computational-basis state. The reading: all 2n2^n amplitudes are equal at 1/2n1/\sqrt{2^n}, an exponentially large uniform superposition built with only nn gates. The general matrix element carries a parity sign, and that sign is a Fourier transform over Z2n\mathbb{Z}_2^n — the reason H⊗nH^{\otimes n} is called the Walsh–Hadamard transform.

⟨x∣H⊗n∣y⟩=(−1)x⋅y2n(8)\langle x|H^{\otimes n}|y\rangle=\frac{(-1)^{x\cdot y}}{\sqrt{2^n}} \qquad (8)

where: x⋅y=∑ixiyi  2x\cdot y=\sum_i x_iy_i \bmod 2 — the bitwise inner product (parity). The reading: setting y=0y=0 makes every sign +1+1 and recovers equation (7); a general yy imprints a pattern of ±\pm signs that later gates interfere to extract structure, as in Bernstein–Vazirani.

Derivation AHadamard interchanges the X and Z bases

The goal is to prove directly from the matrix, with no appeal to geometry, that HXH=ZHXH=Z and HZH=XHZH=X — the exact algebraic content of the claim that HH swaps the computational and Hadamard bases and is therefore a Clifford gate. Because H=H†H=H^\dagger, conjugation of a Pauli PP is the plain product HPHHPH, so the whole derivation is two 2×22\times2 multiplications performed carefully and then read for meaning. Establishing these relations is what lets every later argument about HH move errors and measurements between bases symbolically.

Step 1. Compute the inner product HXHX first: HX=12(111−1)(0110)=12(11−11)HX=\tfrac{1}{\sqrt2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)=\tfrac{1}{\sqrt2}\left(\begin{smallmatrix}1&1\\-1&1\end{smallmatrix}\right). Why: doing the multiplication in two stages keeps the 1/21/\sqrt2 factors explicit, so the final 12\tfrac12 that turns the product into an integer matrix is impossible to lose.

Step 2. Multiply on the right by HH: (HX)H=12(11−11)(111−1)=(100−1)=Z(HX)H=\tfrac12\left(\begin{smallmatrix}1&1\\-1&1\end{smallmatrix}\right)\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)=\left(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\right)=Z. So HXH=ZHXH=Z: a bit-flip conjugated by Hadamards becomes a phase-flip. Why: this is the operational reason an XX-basis measurement can be realized as "apply HH, then measure ZZ" — conjugation moves the observable, not the state.

Step 3. Repeat for ZZ: HZ=12(111−1)(100−1)=12(1−111)HZ=\tfrac{1}{\sqrt2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)\left(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\right)=\tfrac{1}{\sqrt2}\left(\begin{smallmatrix}1&-1\\1&1\end{smallmatrix}\right), then (HZ)H=12(1−111)(111−1)=(0110)=X(HZ)H=\tfrac12\left(\begin{smallmatrix}1&-1\\1&1\end{smallmatrix}\right)\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)=X. So HZH=XHZH=X, completing the X↔ZX\leftrightarrow Z swap. Why: the symmetry of the two results confirms HH is an involution that merely exchanges the two axes rather than mixing in anything new.

Step 4. For completeness check YY: since Y=iXZY=iXZ and H(iXZ)H=i(HXH)(HZH)=i Z X=i(−iY)=−YH(iXZ)H=i(HXH)(HZH)=i\,Z\,X=i(-iY)=-Y, we get HYH=−YHYH=-Y. Why: the third relation is forced by the first two through Y=iXZY=iXZ, so the single geometric picture — a reflection swapping XX and ZZ and reversing YY — is fully consistent. *All three products are pure Pauli matrices with no residual phase — a direct consequence of HH being a real orthogonal involution of determinant −1-1.*

Go deeper · Derivation B · 1 minHadamard as a π rotation about the diagonal axis
Derivation BHadamard 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 Rn^(π)R_{\hat n}(\pi) about n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2, 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 SU(2)SU(2) that HH is.

Step 1. Start from the general single-qubit rotation, whose closed form Rn^(θ)=cos⁡θ2 I−isin⁡θ2 (n^⋅σ⃗)R_{\hat n}(\theta)=\cos\tfrac\theta2\,I-i\sin\tfrac\theta2\,(\hat n\cdot\vec\sigma) follows from expanding e−iθ n^⋅σ⃗/2e^{-i\theta\,\hat n\cdot\vec\sigma/2} and using (n^⋅σ⃗)2=I(\hat n\cdot\vec\sigma)^2=I. 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 n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2, the combination n^⋅σ⃗=(X+Z)/2=H\hat n\cdot\vec\sigma=(X+Z)/\sqrt2=H is the Hadamard matrix itself. Why: this is the crux — the very operator being exponentiated to make the rotation is HH, so HH is guaranteed to lie on its own rotation axis and be its own +1+1 eigen-direction.

Step 3. Set θ=π\theta=\pi: then cos⁡π2=0\cos\tfrac\pi2=0 and sin⁡π2=1\sin\tfrac\pi2=1, so Rn^(π)=0⋅I−i⋅1⋅H=−iHR_{\hat n}(\pi)=0\cdot I-i\cdot1\cdot H=-iH. Rearranging, H=i Rn^(π)=eiπ/2Rn^(π)H=i\,R_{\hat n}(\pi)=e^{i\pi/2}R_{\hat n}(\pi). Why: the cosine term vanishing at θ=π\theta=\pi 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: eiπ/2e^{i\pi/2} 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 HH is exactly the π\pi rotation about n^\hat n. Checking, this rotation carries z^→x^\hat z\to\hat x, i.e. ∣0⟩→∣+⟩|0\rangle\to|+\rangle, and reverses y^\hat y, i.e. HYH=−YHYH=-Y. 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 (n^⋅σ⃗)2=I(\hat n\cdot\vec\sigma)^2=I with n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2, Rn^(π)=−iHR_{\hat n}(\pi)=-iH, and H=eiπ/2Rn^(π)H=e^{i\pi/2}R_{\hat n}(\pi); the rotation reproduces ∣0⟩↦∣+⟩|0\rangle\mapsto|+\rangle and the axis swap.*

Go deeper · Derivation C · 1 minHadamards build the uniform superposition and the Walsh–Hadamard sign pattern
Derivation CHadamards build the uniform superposition and the Walsh–Hadamard sign pattern

The purpose is to prove that a parallel layer H⊗nH^{\otimes n} acting on ∣0⟩⊗n|0\rangle^{\otimes n} produces the equal superposition over all 2n2^n strings, and that its general matrix element carries the parity phase (−1)x⋅y(-1)^{x\cdot y} — the statement that H⊗nH^{\otimes n} is the Fourier transform on the group Z2n\mathbb{Z}_2^n. 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 nn gates can address 2n2^n inputs at once.

Step 1. Read the single-qubit matrix element off equation (1): ⟨a∣H∣b⟩=(−1)ab/2\langle a|H|b\rangle=(-1)^{ab}/\sqrt2 for a,b∈{0,1}a,b\in\{0,1\}, since the only negative entry is the (1,1)(1,1) one, where a=b=1a=b=1 makes (−1)ab=−1(-1)^{ab}=-1. Why: capturing the whole 2×22\times2 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 H⊗nH^{\otimes n} acts independently on each factor, ⟨x∣H⊗n∣y⟩=∏i=1n⟨xi∣H∣yi⟩=∏i=1n(−1)xiyi/2\langle x|H^{\otimes n}|y\rangle=\prod_{i=1}^n\langle x_i|H|y_i\rangle=\prod_{i=1}^n(-1)^{x_iy_i}/\sqrt2. Why: the tensor-product structure is exactly what turns an exponentially large amplitude into a product of nn elementary ones, the source of the register's parallelism.

Step 3. Collect the factors: the nn copies of 1/21/\sqrt2 give 1/2n1/\sqrt{2^n}, and the sum of exponents gives (−1)∑ixiyi=(−1)x⋅y(-1)^{\sum_i x_iy_i}=(-1)^{x\cdot y}, so ⟨x∣H⊗n∣y⟩=(−1)x⋅y/2n\langle x|H^{\otimes n}|y\rangle=(-1)^{x\cdot y}/\sqrt{2^n}. Why: the bitwise inner product x⋅yx\cdot y emerging in the exponent is precisely the character of Z2n\mathbb{Z}_2^n, which is why the layer is the Walsh–Hadamard (finite-field Fourier) transform.

Step 4. Specialize to y=0y=0: every phase is (−1)0=+1(-1)^0=+1, so H⊗n∣0⟩⊗n=12n∑x∣x⟩H^{\otimes n}|0\rangle^{\otimes n}=\tfrac{1}{\sqrt{2^n}}\sum_x|x\rangle, 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 ⟨x∣H⊗n∣y⟩=(−1)x⋅y/2n\langle x|H^{\otimes n}|y\rangle=(-1)^{x\cdot y}/\sqrt{2^n} is correctly normalized: ∑x(1/2n)2=2n/2n=1\sum_x(1/\sqrt{2^n})^2=2^n/2^n=1, confirming a valid quantum state.*

Limiting cases

The identities below are the ones worth memorizing; nearly every circuit trick involving HH is one of them applied.

CaseResultMeaning
InvolutionH2=IH^2=ITwo Hadamards cancel; HH is its own inverse and its own adjoint, H=H†H=H^\dagger.
Basis swapHXH=Z, HZH=XHXH=Z,\ HZH=XHH interchanges bit-flip and phase-flip; equivalently it maps the XX and ZZ bases into each other.
Y reversedHYH=−YHYH=-YThe YY axis flips under the diagonal π\pi rotation, consistent with det⁡H=−1\det H=-1 and the right-hand rule.
EigenvaluesH∣h±⟩=±∣h±⟩H|h_\pm\rangle=\pm|h_\pm\rangleAs a Hermitian involution HH has eigenvalues ±1\pm1; the +1+1 eigenstate is cos⁡π8∣0⟩+sin⁡π8∣1⟩\cos\tfrac\pi8|0\rangle+\sin\tfrac\pi8|1\rangle, lying on the rotation axis.
Conjugating CNOT(H⊗H) CNOT (H⊗H)=CNOTreversed(H\otimes H)\,\mathrm{CNOT}\,(H\otimes H)=\mathrm{CNOT}_{\text{reversed}}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 ∣00⟩|00\rangle. 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), H∣0⟩=(∣0⟩+∣1⟩)/2H|0\rangle=(|0\rangle+|1\rangle)/\sqrt2, so (H⊗I)∣00⟩=12(∣0⟩+∣1⟩)⊗∣0⟩=12(∣00⟩+∣10⟩)(H\otimes I)|00\rangle=\tfrac{1}{\sqrt2}(|0\rangle+|1\rangle)\otimes|0\rangle=\tfrac{1}{\sqrt2}(|00\rangle+|10\rangle). The control is now in an equal superposition; the target is still ∣0⟩|0\rangle.

Step 2. Apply CNOT, which flips the target iff the control is 11: it fixes ∣00⟩|00\rangle and sends ∣10⟩→∣11⟩|10\rangle\to|11\rangle. Therefore CNOT 12(∣00⟩+∣10⟩)=12(∣00⟩+∣11⟩)\mathrm{CNOT}\,\tfrac{1}{\sqrt2}(|00\rangle+|10\rangle)=\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle). The output is the Bell state ∣Φ+⟩=(∣00⟩+∣11⟩)/2|\Phi^+\rangle=(|00\rangle+|11\rangle)/\sqrt2.

Step 3. Check entanglement. A product state (α∣0⟩+β∣1⟩)(γ∣0⟩+δ∣1⟩)(\alpha|0\rangle+\beta|1\rangle)(\gamma|0\rangle+\delta|1\rangle) would need its ∣01⟩|01\rangle and ∣10⟩|10\rangle amplitudes αδ\alpha\delta and βγ\beta\gamma to vanish while αγ\alpha\gamma and βδ\beta\delta are both 1/21/\sqrt2 — impossible, since αγ≠0\alpha\gamma\ne0 and βδ≠0\beta\delta\ne0 force αδ≠0\alpha\delta\ne0. So ∣Φ+⟩|\Phi^+\rangle does not factor. A single HH plus a CNOT converts a definite ∣00⟩|00\rangle 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 ∣0⟩|0\rangle. Apply HH, then a phase gate P(φ)=diag(1,eiφ)P(\varphi)=\mathrm{diag}(1,e^{i\varphi}), then HH again, and measure in the computational basis. Find the probability of outcome 00, and evaluate it at φ=π/2\varphi=\pi/2.

Step 1. First Hadamard: H∣0⟩=(∣0⟩+∣1⟩)/2=∣+⟩H|0\rangle=(|0\rangle+|1\rangle)/\sqrt2=|+\rangle. The phase gate multiplies the ∣1⟩|1\rangle branch only: P(φ)∣+⟩=(∣0⟩+eiφ∣1⟩)/2P(\varphi)|+\rangle=(|0\rangle+e^{i\varphi}|1\rangle)/\sqrt2. The two branches now differ by a relative phase φ\varphi — invisible to a ZZ measurement at this stage, since both still have probability 12\tfrac12.

Step 2. Second Hadamard, using H∣0⟩=(∣0⟩+∣1⟩)/2H|0\rangle=(|0\rangle+|1\rangle)/\sqrt2 and H∣1⟩=(∣0⟩−∣1⟩)/2H|1\rangle=(|0\rangle-|1\rangle)/\sqrt2: the state becomes 12[(1+eiφ)∣0⟩+(1−eiφ)∣1⟩]\tfrac12\big[(1+e^{i\varphi})|0\rangle+(1-e^{i\varphi})|1\rangle\big]. The relative phase has been rotated into the amplitudes — this is the step that makes phase measurable.

Step 3. Read off the outcome-00 probability: P0=∣12(1+eiφ)∣2=14(2+2cos⁡φ)=cos⁡2(φ/2)P_0=\big|\tfrac12(1+e^{i\varphi})\big|^2=\tfrac14(2+2\cos\varphi)=\cos^2(\varphi/2), and likewise P1=sin⁡2(φ/2)P_1=\sin^2(\varphi/2). So P0=cos⁡2(φ/2)P_0=\cos^2(\varphi/2) — a Ramsey fringe, the exact curve in the second figure.

Step 4. Evaluate at φ=π/2\varphi=\pi/2: P0=cos⁡2(π/4)=(1/2)2=12P_0=\cos^2(\pi/4)=(1/\sqrt2)^2=\tfrac12, and P1=12P_1=\tfrac12 as well. At φ=0\varphi=0 the interference is fully constructive (P0=1P_0=1); at φ=π\varphi=\pi fully destructive (P0=0P_0=0); at φ=π/2\varphi=\pi/2 the qubit is balanced. This HH–phase–HH 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 ±1\pm1 matrices with orthogonal rows for a pure-mathematics question about determinants; a century later the smallest such matrix, rescaled by 1/21/\sqrt2, turned out to be the most important gate in quantum computing.

Origins · 1 minJacques Hadamard and how this was discovered
JH
Jacques Hadamard
1865–1963 · the orthogonal ±1 matrix whose smallest case became the qubit's superposition gate

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 NN grows like N/ln⁡NN/\ln N — 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 n×nn\times n matrix of ±1\pm1 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 2×22\times2 case (111−1)\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right), normalized to be unitary, is the quantum Hadamard gate; its nn-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.

History
1867
— Sylvester gives the recursive ±1 orthogonal-matrix construction later named for Hadamard
1893
— Hadamard studies the maximal-determinant problem, defining Hadamard matrices
1923
— Walsh introduces the functions underlying the Walsh–Hadamard transform
1985
— Deutsch frames the universal quantum computer, with Hadamards spreading the input register
1992
— Deutsch and Jozsa use a Hadamard layer for the first exponential quantum speedup

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) H2=IH^2=I and H=H†H=H^\dagger follow directly from equation (1); (ii) HXH=ZHXH=Z, HZH=XHZH=X, HYH=−YHYH=-Y by direct matrix multiplication; (iii) (n^⋅σ⃗)2=I(\hat n\cdot\vec\sigma)^2=I and H=eiπ/2Rn^(π)H=e^{i\pi/2}R_{\hat n}(\pi) with n^=(x^+z^)/2\hat n=(\hat x+\hat z)/\sqrt2; (iv) the +1+1 eigenstate is cos⁡π8∣0⟩+sin⁡π8∣1⟩≈0.924∣0⟩+0.383∣1⟩\cos\tfrac\pi8|0\rangle+\sin\tfrac\pi8|1\rangle\approx0.924|0\rangle+0.383|1\rangle; (v) the Walsh–Hadamard entries are (−1)x⋅y/2n(-1)^{x\cdot y}/\sqrt{2^n} and setting y=0y=0 gives the uniform superposition; (vi) the Bell-state and interferometer calculations yield ∣Φ+⟩=(∣00⟩+∣11⟩)/2|\Phi^+\rangle=(|00\rangle+|11\rangle)/\sqrt2 and P0=cos⁡2(φ/2)P_0=\cos^2(\varphi/2). The universality of {H,T,CNOT}\{H,T,\mathrm{CNOT}\} 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 HH–phase–HH sandwich turns a hidden phase into a measured probability.

Why is the Hadamard gate its own inverse?

Because H2=IH^2=I, which you can read straight off the matrix: 12(111−1)(111−1)=(1001)\tfrac12\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)=\left(\begin{smallmatrix}1&0\\0&1\end{smallmatrix}\right). Physically, applying two Hadamards in a row returns any state to its start — for instance H(H∣0⟩)=H∣+⟩=∣0⟩H(H|0\rangle)=H|+\rangle=|0\rangle. This is unusual: most gates need a distinct inverse (the inverse of TT is T†T^\dagger, of SS is S†S^\dagger). HH 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 XX is the bit-flip: it swaps ∣0⟩↔∣1⟩|0\rangle\leftrightarrow|1\rangle, keeping the qubit in a definite basis state. Hadamard instead sends ∣0⟩→∣+⟩|0\rangle\to|+\rangle and ∣1⟩→∣−⟩|1\rangle\to|-\rangle, creating a superposition that is neither 00 nor 11. On the Bloch sphere XX is a π\pi rotation about the xx-axis, while HH is a π\pi rotation about the diagonal (x^+z^)/2(\hat x+\hat z)/\sqrt2 axis that swaps the XX and ZZ directions. They are related — HXH=ZHXH=Z — but XX moves you between definite answers while HH moves you between definite and superposed. Only HH 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 HXH=ZHXH=Z and HZH=XHZH=X: conjugating one Pauli by Hadamards turns it into the other. The practical payoff is measurement. Real hardware can usually only measure in the computational (ZZ) basis, reading whether a qubit is ∣0⟩|0\rangle or ∣1⟩|1\rangle. To measure in the XX basis instead — to ask whether a qubit is ∣+⟩|+\rangle or ∣−⟩|-\rangle — you apply HH first, which rotates ∣+⟩→∣0⟩|+\rangle\to|0\rangle and ∣−⟩→∣1⟩|-\rangle\to|1\rangle, then do the ordinary ZZ 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 HH sends ∣0⟩|0\rangle to (∣0⟩+∣1⟩)/2(|0\rangle+|1\rangle)/\sqrt2, an exactly balanced two-way split. When you apply HH to each of nn qubits starting from ∣0⟩⊗n|0\rangle^{\otimes n}, the amplitudes multiply: every one of the 2n2^n output strings gets the same factor 1/2n1/\sqrt{2^n}, with all signs positive because ∣0⟩|0\rangle never triggers the lone minus entry of the matrix. The result is perfectly flat — equal amplitude on all 2n2^n strings. If you started from a state other than all-zeros, some of those signs would flip (that is the (−1)x⋅y(-1)^{x\cdot y} 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 ∣+⟩|+\rangle and ∣−⟩|-\rangle have identical measurement statistics in the ZZ basis — both give 00 and 11 with probability 12\tfrac12 — so the sign seems invisible. It becomes decisive the moment you apply a second gate. Hadamard ∣+⟩|+\rangle and you get ∣0⟩|0\rangle; Hadamard ∣−⟩|-\rangle and you get ∣1⟩|1\rangle: the same input probabilities, opposite outputs, entirely because of that sign. In the interferometer of Worked Example 2, the relative phase riding on the ∣1⟩|1\rangle branch is what the second Hadamard converts into a measurable probability cos⁡2(φ/2)\cos^2(\varphi/2). 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. HH is a Clifford gate: it maps Paulis to Paulis under conjugation. By the Gottesman–Knill theorem, any circuit built only from Clifford gates (HH, phase gate SS, 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 T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}). The set {H,T,CNOT}\{H,T,\mathrm{CNOT}\} is then universal, approximating any unitary to arbitrary precision. So HH supplies superposition and basis change, while TT supplies the "magic" that lifts the circuit beyond classical reach.

Before this

Where this leads