Pauli-X gate (quantum NOT)

Swaps the amplitudes of |0⟩ and |1⟩, the quantum version of NOT.

Bit flip · 1 qubit · reviewed November 2026

Matrix

[ 0  1 ]
[ 1  0 ]

What it does

|0⟩→|1⟩
|1⟩→|0⟩

In plain words

On a definite state X is exactly a classical NOT. On a superposition it swaps the two amplitudes. On the Bloch sphere it is a half-turn about the X axis.

Identities

  • X·X = I
  • X = H·Z·H
  • X = RX(π) up to a global phase

Where it is used

  • Setting a register to a starting value
  • Flipping controls so a gate acts on 0 instead of 1
  • Building oracles

Code

# Qiskit
qc.x(0)

// OpenQASM 2.0
x q[0];

Qiskit prints qubit 0 on the right of a bitstring. The builder prints it on the left.

See it in an example

Related gates

Questions

Is X the same as NOT?

On computational basis states yes. On superpositions it also acts, swapping the two amplitudes.

Try the X gate in the Circuit Builder →