The Pauli-X gate
Pauli-X is the quantum NOT gate. It turns into and into , 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.
The matrix
Column 0 is , so X sends to ; column 1 sends to . On any state, X swaps the amplitudes:
As a rotation
The factor in front is a global phase: it changes the matrix but not what any measurement sees, so X and turn the sphere the same way. See rotation gates.
What it does to the six key states
| Before | After X | On the sphere |
|---|---|---|
| +z → −z | ||
| −z → +z | ||
| stays put | ||
| stays put | ||
| +y → −y | ||
| −y → +y |
A factor in front of a result, such as a minus sign or , is a global phase: the arrow lands on the named state all the same.
States on its axis don't move
and lie on the x axis, X's own axis, so X leaves them where they are: , and , 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 to .
Twice is nothing
Two half turns make a full turn, so X followed by X does nothing: . 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:
After one √X, is at , on the equator, where a measurement gives 0 or 1 at random. After the second, it's at , 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 ½.