DeepPractise
DeepPractise
Quantum Gates & Circuits

Hadamard Gate

Beginner 14 min 1 prerequisite

Hadamard Gate

Overview

The Hadamard gate (H) is one of the most important single-qubit gates. It is the cleanest way to:

  • create superposition from a basis state,
  • undo that superposition, and
  • switch between measurement bases (Z-basis ↔ X-basis).

Even when we avoid circuits, H is central because it teaches the core idea behind quantum behavior:

  • probabilities come from amplitudes, and amplitudes can interfere.

Intuition

On the Bloch sphere:

  • the Z-basis states ∣0⟩|0\rangle and ∣1⟩|1\rangle are the north and south poles (+zz and −zz).
  • the X-basis states are ∣+⟩=12(∣0⟩+∣1⟩),∣−⟩=12(∣0⟩−∣1⟩).|+\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle),\qquad | - \rangle = \tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle). These lie on the equator at +xx and −xx.

The Hadamard gate maps poles to equator points:

  • ∣0⟩↦∣+⟩|0\rangle \mapsto |+\rangle
  • ∣1⟩↦∣−⟩|1\rangle \mapsto | - \rangle

So H is a geometric “tilt” that changes which basis looks like “up/down.”

One more crucial intuition:

  • Applying H twice gets you back to where you started.

So H is its own inverse. That “do it again to undo it” property makes H a natural tool for creating and then later removing superposition.

Formal Description

Action on basis states

The defining behavior is

H∣0⟩=∣+⟩=12(∣0⟩+∣1⟩),H|0\rangle = |+\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle), H∣1⟩=∣−⟩=12(∣0⟩−∣1⟩).H|1\rangle = | - \rangle = \tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle).

This already tells you what H does to any superposition by linearity.

Matrix form (with meaning)

In the computational basis, H is represented by

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

Let’s interpret the entries rather than “dumping a matrix”:

  • The factor 12\tfrac{1}{\sqrt{2}} keeps the output normalized.
  • The first column describes what happens to ∣0⟩|0\rangle.
  • The second column describes what happens to ∣1⟩|1\rangle.

You can check this by multiplying:

  • ∣0⟩≡(10)|0\rangle \equiv \begin{pmatrix}1\\0\end{pmatrix} gives the first column: H∣0⟩=12(11)=12(∣0⟩+∣1⟩)=∣+⟩.H|0\rangle = \tfrac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix} = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) = |+\rangle.
  • ∣1⟩≡(01)|1\rangle \equiv \begin{pmatrix}0\\1\end{pmatrix} gives the second column: H∣1⟩=12(1−1)=12(∣0⟩−∣1⟩)=∣−⟩.H|1\rangle = \tfrac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\end{pmatrix} = \tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle) = | - \rangle.

A key identity (stated conceptually) is:

H2=I.H^2 = I.

Meaning: applying H twice returns the original state.

Worked Example

Start with ∣0⟩|0\rangle.

  1. Apply H:
∣0⟩→  H  ∣+⟩=12(∣0⟩+∣1⟩).|0\rangle \xrightarrow{\;H\;} |+\rangle = \tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle).

Geometrically: north pole (+zz) moves to +xx on the equator.

  1. Apply H again:
∣+⟩→  H  ∣0⟩.|+\rangle \xrightarrow{\;H\;} |0\rangle.

So H both creates and undoes superposition.

Interpretation:

  • H is a basis change between the Z and X viewpoints.
  • “Superposition” is not mystical; it is often just “a basis state in a different basis.”

Turtle Tip

Turtle Tip

If you ever feel lost, translate H into one sentence: H converts ‘definitely 0/1 in Z’ into ‘definitely +/− in X’, and vice versa.

Common Pitfalls

Common Pitfalls
  • Don’t say “H makes a random bit.” H makes a deterministic state with two amplitudes; randomness appears only after measurement.
  • Don’t forget that ∣+⟩|+\rangle and ∣−⟩| - \rangle are as “definite” as ∣0⟩|0\rangle and ∣1⟩|1\rangle—just in a different basis.

Quick Check

Quick Check
  1. What are H∣0⟩H|0\rangle and H∣1⟩H|1\rangle?
  2. What does H2=IH^2 = I mean in plain language?

What’s Next

H makes superposition and changes basis. Next we study gates that mainly change phase rather than probabilities: the phase gates S and T, which rotate around the zz axis by smaller angles than Z.