Skip to content

Quantum Gates

This table fixes common quantum-information gate conventions. It is a matrix lookup, not a circuit-design guide.

One-qubit matrices use the computational basis ∣0⟩,∣1⟩\lvert0\rangle,\lvert1\rangle. Two-qubit matrices use the basis order

∣00⟩, ∣01⟩, ∣10⟩, ∣11⟩.\lvert00\rangle,\ \lvert01\rangle,\ \lvert10\rangle,\ \lvert11\rangle.

Gates act on state column vectors from the left.

GateMatrixAction
II(1001)\begin{pmatrix}1&0\\0&1\end{pmatrix}identity
XX(0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}bit flip
YY(0−ii0)\begin{pmatrix}0&-i\\i&0\end{pmatrix}bit and phase flip
ZZ(100−1)\begin{pmatrix}1&0\\0&-1\end{pmatrix}phase flip
HH12(111−1)\frac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}Hadamard basis change
SS(100i)\begin{pmatrix}1&0\\0&i\end{pmatrix}phase gate, S2=ZS^2=Z
TT(100eiπ/4)\begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix}π/8\pi/8 phase gate
GateMatrix or ActionNote
CNOT∣a,b⟩↦∣a,b⊕a⟩\lvert a,b\rangle\mapsto\lvert a,b\oplus a\ranglefirst qubit controls second
CZdiag⁡(1,1,1,−1)\operatorname{diag}(1,1,1,-1)symmetric controlled phase
SWAP∣a,b⟩↦∣b,a⟩\lvert a,b\rangle\mapsto\lvert b,a\rangleexchanges tensor factors

In the stated basis, CNOT is

CNOT=(1000010000010010).\mathrm{CNOT} = \begin{pmatrix} 1&0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{pmatrix}.
  • Reversing qubit order between matrix convention and circuit diagram.
  • Treating a global phase as a distinct physical gate on a closed state.
  • Forgetting that YY differs by phases from a simple bit flip.
  • Comparing CNOT matrices from sources that use opposite control-target ordering.
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press, 2010.
  • J. Watrous, The Theory of Quantum Information, Cambridge University Press, 2018.
  • M. M. Wilde, Quantum Information Theory, 2nd ed., Cambridge University Press, 2017.