Level 2, Tinkerer
X gate
The X gate swaps the amplitude for 0 with the amplitude for 1. On a state certain to read 0 or 1, that swap is an ordinary bit flip, the quantum NOT.
On the |+⟩ state, X leaves the state as it stands. On the |−⟩ state, X multiplies the whole state by a minus, and no measurement can see a minus that sits on every amplitude at once, so the button looks idle precisely when a newcomer expects drama.
An example
Take a qubit with 0.28 for 0 and 0.96 for 1. The chances are the squares, 0.0784 and 0.9216, so it reads 1 in about 92 runs out of 100.
Press X and the two numbers trade places. The qubit now holds 0.96 for 0 and 0.28 for 1, and it reads 0 in about 92 runs out of 100. A sign travels with its number, so 0.28 and −0.96 become −0.96 and 0.28.
You can also build X from other gates. Press H, then Z, then H, and keep the division by 1.41 aside until the end. H gives a sum of 1.24 and a difference of 0.28 − 0.96 = −0.68. Z flips the second sign, giving 1.24 and 0.68. H again gives a sum of 1.92 and a difference of 0.56. Two divisions by 1.41 make one division by 2, so you finish with 0.96 and 0.28. That is the swap.
On the Bloch sphere X is a half turn about the x axis, which runs through |+⟩ and |−⟩. It carries the north pole to the south pole. Points on the axis stay put, which is why |+⟩ does not move and |−⟩ only gains an overall minus.
What it is not
X is not a button that sends every qubit to its opposite. It does that for |0⟩ and |1⟩. The opposite of |+⟩ on the globe is |−⟩, yet X leaves |+⟩ alone. No gate can send every point on the globe to the point across from it. X swaps the amplitudes for 0 and 1, and that is the whole of its NOT.
It is not random, either. The same input always gives the same output, and nothing is measured. Keith pressed it on |+⟩ for an hour, waiting for a change. The qubit was more patient than he was.
Related words
X with a condition in front is the controlled NOT, and on a plain bit it is the ordinary flip. The sum above uses the Hadamard gate and the Z gate. The note The left-hand gate runs first tries X before H and then after it, and Which Gate asks you to spot it.
Used in
Longer explanation: Quantum gates explained