← Quantum Computing
Quantum Computing

Hadamard Gate

The Hadamard gate transforms any basis state into equal superposition, placing a qubit exactly halfway between 0 and 1

Source: mortalapps.com
TL;DR
  • The Hadamard gate (H) is the primary tool for creating quantum superpositions.
  • Its matrix representation is [[1, 1], [1, -1]] multiplied by 1/sqrt(2).
  • It maps |0⟩ to |+⟩ and |1⟩ to |-⟩.
  • Geometrically, it is a 180-degree rotation around the diagonal X+Z axis of the Bloch sphere.
  • It is self-inverse, meaning applying it twice returns the qubit to its original state (H^2 = I).
  • It is the foundational first step in almost all major quantum algorithms.

Why This Matters

The Hadamard Gate, denoted as $H$, is perhaps the most iconic and frequently used gate in quantum computing. It is the primary gateway to quantum superposition. When applied to a definite classical state like $|0\rangle$ or $|1\rangle$, the Hadamard gate transforms it into an equal superposition of both states. This allows a quantum computer to process multiple possibilities simultaneously, forming the foundation of almost every quantum algorithm, from search to factorization.

Core Intuition

Imagine a coin lying flat on a table, showing heads ($|0\rangle$). If you flip the coin over, it shows tails ($|1\rangle$); this is like the X gate. But what if you spin the coin on its edge? While it is spinning, it is in a blur of both heads and tails at the same time, a superposition. The Hadamard gate is the physical flick of the finger that sets the coin spinning. If you apply the Hadamard gate again to the spinning coin, it is like catching the coin flat on the table, returning it to a definite heads or tails state depending on how you caught it.

Visualization

Open interactive version ↗

Hadamard Gate Bloch Sphere Rotation Shows that H gate is a 180° rotation around the diagonal X+Z axis.

Technical Explanation

The Hadamard Gate is represented by the unitary matrix: $H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$. When applied to the computational basis states, we get: $H|0\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{|0\rangle + |1\rangle}{\sqrt{2}} = |+\rangle$, and $H|1\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix} = \frac{|0\rangle - |1\rangle}{\sqrt{2}} = |-\rangle$. Geometrically, the Hadamard gate corresponds to a rotation of $\pi$ radians (180 degrees) around the diagonal axis $(X+Z)/\sqrt{2}$ of the Bloch sphere. This rotation maps the North Pole ($|0\rangle$) to the positive X-axis ($|+\rangle$) and the South Pole ($|1\rangle$) to the negative X-axis ($|-\rangle$). Like the Pauli gates, the Hadamard gate is self-inverse, meaning $H^2 = I$. Applying $H$ to a superposition state $|+\rangle$ returns it to $|0\rangle$, and applying it to $|-\rangle$ returns it to $|1\rangle$.

Key Takeaways

The Hadamard gate (H) is the primary tool for creating quantum superpositions.
Its matrix representation is [[1, 1], [1, -1]] multiplied by 1/sqrt(2).
It maps |0⟩ to |+⟩ and |1⟩ to |-⟩.
Geometrically, it is a 180-degree rotation around the diagonal X+Z axis of the Bloch sphere.
It is self-inverse, meaning applying it twice returns the qubit to its original state (H^2 = I).
It is the foundational first step in almost all major quantum algorithms.