The Most Important Gate in Quantum Computing
If you had to pick one gate to understand deeply before anything else in quantum computing, it's the Hadamard gate (H). It's the gateway to superposition, the engine behind quantum parallelism, and used in virtually every quantum algorithm ever designed.
What the Hadamard Gate Does
The H gate is defined by a simple matrix:
H = (1/√2) [[1, 1],
[1, -1]]
Applied to the |0⟩ state:
H|0⟩ = (1/√2)[1,1]ᵀ = (1/√2)|0⟩ + (1/√2)|1⟩ = |+⟩
Applied to the |1⟩ state:
H|1⟩ = (1/√2)[1,-1]ᵀ = (1/√2)|0⟩ - (1/√2)|1⟩ = |−⟩
H is its own inverse: Applying H twice brings you back to the original state: H(H|ψ⟩) = |ψ⟩. This makes H a self-adjoint (Hermitian) unitary — it's both unitary and its own inverse.
Visualizing on the Bloch Sphere
The Hadamard gate rotates the Bloch sphere by 180° around the diagonal axis (midway between X and Z):
Start at north (|0⟩, z=1) → after H → land at +X equator (|+⟩, x=1).
Apply H again → back to north.
Phase Matters: |+⟩ vs |−⟩
Both |+⟩ and |−⟩ give 50/50 measurement probabilities — you can't tell them apart from a single measurement. But phase is real and measurable with interference:
|+⟩ = (|0⟩ + |1⟩)/√2 → Bloch vector points +X
|−⟩ = (|0⟩ − |1⟩)/√2 → Bloch vector points −X
Apply H to each:
- H|+⟩ = |0⟩ (the two terms constructively interfere at |0⟩)
- H|−⟩ = |1⟩ (the two terms destructively interfere at |0⟩, constructively at |1⟩)
This is quantum interference — the computational heart of quantum speedups.
The Hadamard Transform
n Hadamard gates applied in parallel to n qubits creates a uniform superposition of all 2ⁿ basis states:
H⊗ⁿ|0...0⟩ = (1/√2ⁿ) Σₓ |x⟩
This is the starting point for Grover's search algorithm, Shor's factoring algorithm, and quantum Fourier transforms.
Real-world usage: Every time you see a quantum circuit diagram starting with a row of H gates, that's the Hadamard transform creating uniform superposition — the quantum "table-setter" before the actual computation begins.
Test Yourself
What does H|+⟩ equal?
After applying H to |0⟩, what is the probability of measuring |1⟩?
Why can't you distinguish |+⟩ from |−⟩ with a single measurement in the Z basis?
See It Live
Press H in the simulator and watch the Bloch vector swing from the north pole to the equator instantly.