T gate applies a 45° phase to the $|1\rangle$ state. Crucial for universal quantum computation and magic state distillation.
Matrix:
$$T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}$$
Action: $T|0\rangle = |0\rangle$, $T|1\rangle = e^{i\pi/4}|1\rangle$ (adds $\pi/4$ phase to $|1\rangle$).
$$T = R_Z(\pi/4) = e^{-i\pi Z/8}$$
$$S = T^2 = R_Z(\pi/2)$$
$$Z = T^4 = R_Z(\pi)$$