Skip to content
What Is a Hadamard Gate?

What Is a Hadamard Gate?

February 7, 2025

The Hadamard gate (usually written HH) is one of the most important single‑qubit gates. It is famous because it maps computational‑basis states to equal superpositions.

Matrix form

H=12(1111). H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.

What it does to 0\lvert 0\rangle and 1\lvert 1\rangle

Applying HH to the basis states gives:

H0=+=12(0+1), H\lvert 0\rangle = \lvert + \rangle = \frac{1}{\sqrt{2}}(\lvert 0\rangle + \lvert 1\rangle),

and

H1==12(01). H\lvert 1\rangle = \lvert - \rangle = \frac{1}{\sqrt{2}}(\lvert 0\rangle - \lvert 1\rangle).

So HH does not “randomize” a qubit; it creates a state where measurement in the computational basis yields 0 and 1 with equal probability (assuming an ideal system).

Applying Hadamard twice

The Hadamard gate is its own inverse:

H2=I. H^2 = I.

So applying HH twice in a row returns the qubit to its original state.

Circuit symbol

In circuit diagrams, a Hadamard gate is drawn as a square labeled H.

In Qiskit

In Qiskit, you apply it with:

from qiskit import QuantumCircuit

qc = QuantumCircuit(1)
qc.h(0)

Fun fact (name)

The gate is named after the French mathematician Jacques Hadamard.

Next