The X gate swaps the two amplitudes of a single qubit. Exact arithmetic here means exact results for the stated model inputs; measured inputs still carry uncertainty and significant-figure limits.

highlighted = computed this step

The X gate swaps amplitudes

The input amplitudes are 3/5 and 4/5. The checked X output swaps them.

X[3545]=[4535]X\begin{bmatrix}\frac{3}{5}\\\frac{4}{5}\end{bmatrix}=\begin{bmatrix}\frac{4}{5}\\\frac{3}{5}\end{bmatrix}
X gateThe output ket is computed by the X gate.state3/5 zero4/5 onestate4/5 zero3/5 oneXgate

The probabilities swap too

The output probabilities are 16/25 for zero and 9/25 for one.

Pzero,out=1625,Pone,out=925P_{\text{zero,out}} = \frac{16}{25},\quad P_{\text{one,out}} = \frac{9}{25}
X gateSwapped amplitudes give swapped probabilities.state3/5 zero4/5 onestate4/5 zero3/5 oneXgate

Applying X twice returns the input

The swap is reversible. A second X swaps the amplitudes back to the original order.

X2[3545]=[3545]X^2\begin{bmatrix}\frac{3}{5}\\\frac{4}{5}\end{bmatrix}=\begin{bmatrix}\frac{3}{5}\\\frac{4}{5}\end{bmatrix}
X gateThe same checked gate map is reversible.state3/5 zero4/5 onestate4/5 zero3/5 oneXgate