QuantumSimulator
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
Menu
physics
Interactive Course
Interactive chapters from intuition to mastery
Structured Lessons
Eight modules with formulas and self-checks
Quantum Brain
Navigate lessons, laws, gates, devices, and tools
Guided Experiments
Hands-on circuits that teach one idea each
simulator
Circuit Lab
Build circuits, run them, and see the results
Gate Reference
Quick reference for all quantum gates
wiringStudio
Cryostat Studio
3D cryostat design and simulation
Component Catalog
Browse all cryostat components
System Checks
Check your design for errors
Home/Quantum Physics/Lessons/Hadamard Gate
H

Hadamard Gate

BasicSingle-qubitsuperposition

Puts a qubit into an equal superposition of ∣0⟩ and ∣1⟩.

Intuition

The Hadamard gate takes a qubit that is definitely ∣0⟩ or ∣1⟩ and splits it into an equal superposition of both. A superposition means the qubit's state is a weighted combination of ∣0⟩ and ∣1⟩ at the same time, with each branch carrying a number called an amplitude. Measuring a superposition gives 0 or 1 with probabilities determined by those amplitudes. Before Hadamard, your qubit is locked into one value. After Hadamard, both values exist as amplitudes, and interference between them is what gives quantum algorithms their power.

Matrix representation
2​1​(11​1−1​)
Action on states
∣0⟩→2​∣0⟩+∣1⟩​,∣1⟩→2​∣0⟩−∣1⟩​
Bloch sphere
|0⟩
→
|+⟩
Circuit
Open in simulator →
q0H
▶ Try it in the simulator
State comparison
Before Hadamard
|0⟩
|0\u27E9
100%
|1\u27E9
0%
Bloch: (0.00, 0.00, 1.00)
→
After Hadamard
|+⟩
|0\u27E9
50%
|1\u27E9
50%
Bloch: (1.00, 0.00, 0.00)
Full technical statement

Hadamard is unitary (it preserves total probability), Hermitian (it equals its own conjugate transpose, so it is also a valid measurement observable), and involutory (applying it twice gives the identity: H² = I). It maps the computational basis states to the diagonal basis: ∣0⟩ → ∣+⟩=(∣0⟩+∣1⟩)/2​ and ∣1⟩ → |−⟩ = (∣0⟩ − ∣1⟩/2​. On the Bloch sphere (a 3D representation where every single-qubit state maps to a point on a unit sphere), Hadamard is a 180° rotation around the axis halfway between X and Z. The states ∣+⟩ and |−⟩ differ only in their relative phase (the sign between the ∣0⟩ and ∣1⟩ terms). That sign is invisible when you measure in the computational basis, because both states give 50/50 outcomes. But the sign carries information that a later Hadamard or interference step can extract.

What changes in measurements

Measurement outcomes spread to roughly 50/50 when starting from ∣0⟩ or ∣1⟩.

What stays hidden until later

The relative phase (± sign between the ∣0⟩ and ∣1⟩ amplitudes) encodes information that a later Hadamard or interference step can reveal.

Bloch sphere

Rotates the Bloch vector 180° around the axis halfway between X and Z. The north pole (∣0⟩) moves to the +X equator (∣+⟩). The south pole (∣1⟩) moves to the −X equator (|−⟩).

Step-by-step example

Creating and undoing superposition

  1. 1Start with ∣0⟩. On the Bloch sphere, this is the north pole.
  2. 2Apply H. The state becomes (∣0⟩+∣1⟩)/2​. Measuring now gives 0 or 1 each with 50% probability.
  3. 3Apply H again. Because H is involutory (H² = I), the state returns to ∣0⟩. Measuring now gives 0 with certainty.
  4. 4This round-trip confirms that Hadamard perfectly undoes itself.
Where this gate appears
  • Creating superposition at the start of nearly every quantum algorithm
  • Switching between the computational basis (|0⟩, |1⟩) and the diagonal basis (|+⟩, |−⟩)
  • Building interference circuits such as H–Z–H = X
  • Preparing the input register in Deutsch’s and Deutsch–Jozsa algorithms
  • Generating uniform superpositions for Grover’s search
Connected gates
  • H² = I — applying Hadamard twice returns the qubit to its original state, because Hadamard is its own inverse
  • HZH = X — sandwiching a Z (phase flip) between two Hadamards turns it into an X (bit flip), because Hadamard converts between the computational and diagonal bases
  • HXH = Z — the reverse also holds: a bit flip becomes a phase flip when viewed from the diagonal basis
  • H is equivalent to RY(π/2) followed by a phase correction
Tempting but wrong

It is tempting to think Hadamard makes a qubit "both 0 and 1 at once" in a classical sense. That sounds plausible because measurement gives either outcome. What actually happens is that the qubit enters a superposition where both outcomes have well-defined amplitudes, but each individual measurement still produces a single definite result.

Why this gate matters for what comes next

Without Hadamard, quantum circuits would just shuffle definite states around, no differently from classical logic. Hadamard opens the door to superposition, and superposition enables interference, which is the mechanism behind every known quantum speedup.

Test your understanding

You apply H to |0⟩ and then apply H again. What state do you get?

▶ Try it in the simulatorQuick reference →↗ Nielsen and Chuang, Quantum Computation and Quantum Information↗ MIT OCW 8.06: quantum computing notes
←
Previous
Z Gate
Next
CNOT
→
← Back to all lessons