Level 2, Tinkerer
S gate
The S gate leaves the amplitude for 0 alone and multiplies the amplitude for 1 by i, where i is the imaginary unit. On the Bloch sphere that rule is a quarter turn about the line through the poles, so the state with equal amplitudes and the same sign moves off the line of plus and minus, and the chances of 0 and 1 stay where they were.
Apply S a second time and the amplitude for 1 has been multiplied by minus one, which is the sign the Z gate writes in one press. A bare measurement still cannot see the quarter turn, but a later H can, as the example shows.
An example
Take a qubit with 0.8 for 0 and 0.6 for 1. Press S and the amplitude for 1 becomes 0.6i. The chances stay at 0.64 and 0.36, since |i|² = 1.
H shows the change. Before S, H gives a sum of 1.4 and a difference of 0.2. Square each and halve it, and the qubit reads 0 in 98 runs out of 100. After S, H gives 0.8 + 0.6i for 0 and 0.8 − 0.6i for 1, before the division by 1.41. Each has a squared size of 0.64 + 0.36 = 1, and halving gives a chance of 0.5 each. A near-certain 0 has become a fair toss.
Press S again. Now 0.6i × i = −0.6, so the qubit holds 0.8 and −0.6, which is what Z makes in one press. H now reads 1 in 98 runs out of 100. One press takes it halfway, and two take it all the way.
Two more presses give −0.6i and then 0.6. After four you are back at the start, since i × i × i × i = 1.
On the Bloch sphere S is a quarter turn about the z axis. It carries |+⟩ to the state 0.71 and 0.71i, a quarter of the way round the equator, anticlockwise seen from the north pole.
What it is not
S is not its own undo. X, Y, Z and H each undo themselves, but two presses of S give Z. To undo one S, press it three more times, or use a gate that multiplies the amplitude for 1 by −i, which is called S dagger and written S†.
It is not half a Z in the chances, either. Neither gate moves a plain reading. The half is in the angle.
Related words
Two presses make the Z gate, and the i is a complex number. S turns the relative phase by 90 degrees on the Bloch sphere. Try it on the qubit page, or name it in Which Gate.
Longer explanation: Quantum gates explained