skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
h-gate
This page is read only. You can view the source, but not change it.
# Hadamard gate **Hadamard gate** (or **H gate**) is a single-qubit gate that maps the computational basis states $\lvert 0\rangle$ and $\lvert 1\rangle$ to equal superpositions. It is the most commonly used gate for creating superposition and appears at the start of most quantum algorithms. $$H = \frac{1}{\sqrt{2}}\begin{pmatrix}1 & 1\\ 1 & -1\end{pmatrix}$$ The gate maps the computational basis to the Hadamard basis and back: $$H\lvert 0\rangle = \frac{\lvert 0\rangle + \lvert 1\rangle}{\sqrt{2}} = \lvert +\rangle \qquad H\lvert 1\rangle = \frac{\lvert 0\rangle - \lvert 1\rangle}{\sqrt{2}} = \lvert -\rangle$$ The Hadamard gate is its own inverse: $H^2 = I$, so $H = H^\dagger = H^{-1}$. On the [Bloch sphere](/bloch-sphere), $H$ is a $\pi$ rotation about the axis halfway between $x$ and $z$, which swaps the $z$-axis with the $x$-axis. ## Creating superposition over $n$ qubits Applying $H$ to each of $n$ qubits initialized to $\lvert 0\rangle$ creates an equal superposition over all $2^n$ computational basis states: $$H^{\otimes n}\lvert 0\rangle^{\otimes n} = \frac{1}{\sqrt{2^n}}\sum_{x=0}^{2^n - 1}\lvert x\rangle$$ This is the standard initialization step for Deutsch's algorithm, the Deutsch-Jozsa algorithm, [Grover's algorithm](/grover), and the [quantum Fourier transform](/qft). ## List of code implementations - [Hadamard gate (Qiskit)](/h-gate-qiskit) - [Hadamard gate (cuStateVec)](/h-gate-custatevec) - [Hadamard gate (CUDA-Q)](/h-gate-cudaq)
Page Tools
Show pagesource
Backlinks
Back to top