GateBeginnerSingle-qubit gates

X Pauli-X Gate (NOT)

Pauli-X Gate (NOT)

The Pauli-X gate is the quantum NOT: it swaps |0⟩ and |1⟩ and is a π rotation about the x axis of the Bloch sphere.

The unitary matrix

Computing the matrix with the simulation engine…

Computed by the same engine that runs the circuits. Multi-qubit gates are shown in textbook order (control qubit first).

Its effect on the basis states

InputOutput
$|0\rangle$$|1\rangle$
$|1\rangle$$|0\rangle$
$|+\rangle$$|+\rangle$
$|-\rangle$$-|-\rangle$

Useful identities

  • $X^2=I$
  • $HXH=Z$
  • $R_X(\pi)=-iX$

On the Bloch sphere: rotation by π about the x axis

$$X=\begin{pmatrix}0&1\\1&0\end{pmatrix}$$

The Pauli-X GatePauli-X Gate: The Pauli X gate is the quantum counterpart of the NOT gate: it swaps 0⟩ and 1⟩, and represents a rotation by π about the x axis of the Bloch sphere. is also called the “quantum NOT gate” or the “Bit-flip gate”. Its effect on the basis states: $X|0\rangle=|1\rangle$ and $X|1\rangle=|0\rangle$; and on a superposition: $X(\alpha|0\rangle+\beta|1\rangle)=\beta|0\rangle+\alpha|1\rangle$, i.e. it swaps the two amplitudes.

Geometrically, on the Bloch sphereBloch Sphere: The Bloch sphere is a geometric representation of single-qubit states: pure states are points on the surface of a unit sphere, mixed states are points inside it, and sin…, the gate rotates the state by $\pi$ about the $x$ axis: the north pole $|0\rangle$ moves to the south pole $|1\rangle$, while $|+\rangle$ and $|-\rangle$ (which lie on the $x$ axis) stay fixed, although $|-\rangle$ acquires a global phase: $X|-\rangle=-|-\rangle$. So $|\pm\rangle$ are the eigenvectors of $X$ with eigenvalues $\pm1$.

Uses: initialising a qubitQubit: The qubit is the unit of quantum information: a two-level system whose state is a unit vector α0⟩+β1⟩ in ℂ^2. in $|1\rangle$; preparing the ancilla qubit in $|-\rangle=HX|0\rangle$ in the Deutsch and Bernstein–Vazirani algorithms; building the Oracle in Grover by flipping the qubits whose value is 0 before and after a multi-controlled Z gate; and encoding bit $b_0$ in superdense codingSuperdense Coding: Superdense coding sends two classical bits by transmitting a single qubit, provided an entangled pair was shared in advance; it is the logical "counterpart" of teleporta….

Important relations: $X^2=I$, $HXH=Z$, and $R_X(\pi)=-iX$, i.e. $X$ equals the rotation $R_X(\pi)$ up to a global phase.

Example

Let $|\psi\rangle=\sqrt{0.8}\,|0\rangle+\sqrt{0.2}\,|1\rangle$. Then
$$X|\psi\rangle=\sqrt{0.2}\,|0\rangle+\sqrt{0.8}\,|1\rangle.$$
Before the gate: $P(0)=0.8$ and $P(1)=0.2$; after it: $P(0)=0.2$ and $P(1)=0.8$. The probabilities swapped because the two amplitudes swapped places.

Live simulation

Loading the simulator…

In code

Qiskit
qc.x(0)
OpenQASM 2
x q[0];

Related topics

References

  1. Michael A. Nielsen; Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press doi:10.1017/CBO9780511976667The standard reference for quantum computing; the Crossref record gives 2012 for the Cambridge Core online edition.
  2. IBM Quantum (2025). Qiskit SDK API documentation. IBM Quantum Documentation quantum.cloud.ibm.com
  3. Microsoft (2025). Pauli Measurements in Quantum Computing. Azure Quantum documentation learn.microsoft.com