The Pauli-X gate

Pauli-X is the quantum NOT gate. It turns ∣0⟩|{0}\rangle into ∣1⟩|{1}\rangle and ∣1⟩|{1}\rangle into ∣0⟩|{0}\rangle, just as NOT flips a bit. On a superposition, it swaps the two amplitudes.

On the Bloch sphere, X turns the whole sphere 180° about x.

A Bloch sphere: X turns the arrow 180° about x, from where it starts (dashed) along the arc to where it ends.|0⟩|1⟩|+⟩|−⟩|+i⟩|−i⟩
X turns ∣0⟩|{0}\rangle (dashed) half a turn about the x axis, over to ∣1⟩|{1}\rangle.

The matrix

X=[0110]X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}

Column 0 is (0,1)(0, 1), so X sends ∣0⟩|{0}\rangle to ∣1⟩|{1}\rangle; column 1 sends ∣1⟩|{1}\rangle to ∣0⟩|{0}\rangle. On any state, X swaps the amplitudes:

X (α∣0⟩+β∣1⟩)=β∣0⟩+α∣1⟩X\,(\alpha|0\rangle + \beta|1\rangle) = \beta|0\rangle + \alpha|1\rangle

As a rotation

X=i Rx(180∘)X = i\,R_x(180^\circ)

The factor ii in front is a global phase: it changes the matrix but not what any measurement sees, so X and Rx(180∘)R_x(180^\circ) turn the sphere the same way. See rotation gates.

What it does to the six key states

BeforeAfter XOn the sphere
∣0⟩|{0}\rangle∣1⟩|{1}\rangle+z → −z
∣1⟩|{1}\rangle∣0⟩|{0}\rangle−z → +z
∣+⟩|{+}\rangle∣+⟩|{+}\ranglestays put
∣−⟩|{-}\rangle−∣−⟩-|{-}\ranglestays put
∣+i⟩|{+i}\ranglei∣−i⟩i|{-i}\rangle+y → −y
∣−i⟩|{-i}\rangle−i∣+i⟩-i|{+i}\rangle−y → +y

A factor in front of a result, such as a minus sign or ii, is a global phase: the arrow lands on the named state all the same.

States on its axis don't move

∣+⟩|{+}\rangle and ∣−⟩|{-}\rangle lie on the x axis, X's own axis, so X leaves them where they are: X∣+⟩=∣+⟩X|{+}\rangle = |{+}\rangle, and X∣−⟩=−∣−⟩X|{-}\rangle = -|{-}\rangle, where the minus sign is only a global phase. Swapping equal amplitudes changes nothing, which is the same fact in algebra. The NOT only flips states along z.

Any other state turns half a turn about x: its tip goes from (x,y,z)(x, y, z) to (x,−y,−z)(x, -y, -z).

Twice is nothing

Two half turns make a full turn, so X followed by X does nothing: X X=IX\,X = I. X is its own inverse, like NOT.

The name comes from Wolfgang Pauli: X, Y and Z are the three Pauli matrices, the half turns about the three axes.

A square root of NOT

A puzzle: find a gate that, applied twice, is NOT. For an ordinary bit there isn't one. A gate on one bit can only keep the bit, flip it, or set it to 0 or to 1, and doing any of those twice keeps the bit or sets it, never flips it.

For a qubit it's easy. X is a half turn about x, so a quarter turn about x, done twice, is X. That quarter turn is the square root of X, written √X:

X=[12 eiπ/412 e−iπ/412 e−iπ/412 eiπ/4]\sqrt{X} = {\def\arraystretch{1.5}\begin{bmatrix} \tfrac{1}{\sqrt{2}}\,e^{i\pi/4} & \tfrac{1}{\sqrt{2}}\,e^{-i\pi/4} \\ \tfrac{1}{\sqrt{2}}\,e^{-i\pi/4} & \tfrac{1}{\sqrt{2}}\,e^{i\pi/4} \end{bmatrix}}

After one √X, ∣0⟩|{0}\rangle is at ∣−i⟩|{-i}\rangle, on the equator, where a measurement gives 0 or 1 at random. After the second, it's at ∣1⟩|{1}\rangle, every time. Two steps that each look like a coin toss add up to a certain flip, because their amplitudes interfere: see Interference. To build √X yourself, put X on the Gate Lab's bench and choose Fraction ½.

Try it

See also: Pauli-Y · Pauli-Z · All gates