The Hadamard Gate
Master the most important gate in quantum computing—the gateway to superposition and quantum advantage.
About this module
In this module you will:
- Understand why the Hadamard gate is fundamental to quantum computing
- Learn how H creates equal superposition from basis states
- Discover the H-H identity (H is self-inverse)
- Visualize H on the Bloch sphere
- Explore measurement statistics after H gate
Prerequisites: Lessons 1-4. Understanding of qubits, superposition, and the X gate.
5.1 What Makes Hadamard Special?
The Hadamard gate (H) is the most important gate in quantum computing. Unlike the X gate which deterministically flips states, the H gate creates superposition—the quintessentially quantum phenomenon.
When you apply H to |0⟩, you get |+⟩ = (1/√2)|0⟩ + (1/√2)|1⟩—a state with equal probability of measuring 0 or 1. This is not randomness; it's a coherent quantum superposition that enables quantum algorithms.
Key Concept: Creating Superposition
H|0⟩ = |+⟩ = (1/√2)|0⟩ + (1/√2)|1⟩
H|1⟩ = |−⟩ = (1/√2)|0⟩ − (1/√2)|1⟩
Both create equal superposition, but with different phase. The minus sign matters for quantum interference!
Interactive: H Gate Creates Superposition
Apply H to |0⟩ or |1⟩ and measure multiple times. Watch the 50/50 pattern emerge.
Notice: ~50% zeros, ~50% ones. H creates genuine quantum superposition!
5.2 The H-H Identity: Self-Inverse
Here's something remarkable: apply the Hadamard gate twice and you return to the original state. H · H = I (identity matrix). This demonstrates reversibility and the special mathematical structure of quantum gates.
Start with |0⟩, apply H to get superposition |+⟩, then apply H again—you're back to |0⟩. Every time. No randomness in this double application!
Interactive: Double Hadamard
See what happens when you apply H twice to different starting states.
Pattern: H-H always returns to original state. You should see 100% of the starting state!
Why H-H = I Matters
This property is crucial for quantum algorithms. Many algorithms use H to "enter" superposition at the start and H again to "exit" superposition at the end, extracting the answer through quantum interference.
5.3 Visualizing H on the Bloch Sphere
The Bloch sphere is a 3D representation of single-qubit states. |0⟩ is at the north pole, |1⟩ at the south pole, and superposition states like |+⟩ and |−⟩ are on the equator.
The H gate performs a specific rotation: it moves states from the poles to the equator (creating superposition) or from the equator back to the poles (destroying superposition).
Interactive: H Gate on Bloch Sphere
Watch how the H gate moves the quantum state on the Bloch sphere. Click the gate buttons on the right to apply quantum gates!
The H gate rotates from poles (definite states) to equator (superposition). Try X, Y, Z, H, S, and T gates! Click Reset to return to |0⟩.
Advanced: Explore Any Quantum State
Use the θ (theta) and φ (phi) sliders to explore any single-qubit quantum state on the Bloch sphere!
Tip: θ controls the polar angle (up/down from |0⟩ to |1⟩), while φ controls the azimuthal angle (rotation around the equator). Play with both to see all possible quantum states!
5.4 Combining H with Other Gates
The real power comes from combining H with other gates. Try different circuits and see how H interacts with X.
Experiment: H and X Combinations
Test different gate sequences and observe the measurement statistics.
Test Your Understanding
Question 1: What does the H gate do to |0⟩?
Question 2: What is the result of applying H twice to |0⟩?
Question 3: Why is the H gate considered the most important gate in quantum computing?
Question 4: On the Bloch sphere, where does the H gate move |0⟩?
Question 5: What's the difference between H|0⟩ and H|1⟩?