# Rotation gates **Rotation gates** $R_x(\theta)$, $R_y(\theta)$, $R_z(\theta)$ are single-qubit gates that rotate the [[bloch-sphere|Bloch vector]] by angle $\theta$ about the $x$-, $y$-, and $z$-axes respectively. They are defined via the matrix exponential of the corresponding [[pauli-gates|Pauli matrices]]: $$R_x(\theta) = e^{-i\theta X/2} \qquad R_y(\theta) = e^{-i\theta Y/2} \qquad R_z(\theta) = e^{-i\theta Z/2}$$ ## Matrix form Using $e^{-i\theta P/2} = \cos(\theta/2)I - i\sin(\theta/2)P$ (which follows from $P^2 = I$ for any Pauli $P$): $$R_x(\theta) = \begin{pmatrix}\cos\frac{\theta}{2} & -i\sin\frac{\theta}{2}\\[4pt] -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix} \qquad R_y(\theta) = \begin{pmatrix}\cos\frac{\theta}{2} & -\sin\frac{\theta}{2}\\[4pt] \sin\frac{\theta}{2} & \cos\frac{\theta}{2}\end{pmatrix} \qquad R_z(\theta) = \begin{pmatrix}e^{-i\theta/2} & 0\\[4pt] 0 & e^{i\theta/2}\end{pmatrix}$$ ## Special cases and universality The [[pauli-gates|Pauli gates]] are $\pi$ rotations: $X = iR_x(\pi)$, $Y = iR_y(\pi)$, $Z = iR_z(\pi)$. The [[h-gate|Hadamard gate]] is (up to global phase) $H = R_y(\pi/2)R_z(\pi)$. Any single-qubit unitary (up to global phase) can be written as a composition of rotation gates via the Euler angle decomposition $U = R_z(\alpha)R_y(\beta)R_z(\gamma)$. This makes the rotation gates the natural building blocks for single-qubit control and the foundation of the [[u-gate|U gate]] parameterization. ## Individual gates - [[rx-gate|$R_x(\theta)$]] - [[ry-gate|$R_y(\theta)$]] - [[rz-gate|$R_z(\theta)$]] ## List of code implementations - [[r-gate-qiskit|Rotation gates (Qiskit)]] - [[r-gate-custatevec|Rotation gates (cuStateVec)]] - [[r-gate-cudaq|Rotation gates (CUDA-Q)]]