GateIntermediateRotation and phase gates

RX RX Rotation Gate

RX Rotation Gate

RX(θ) = e^{−iθX/2} rotates the Bloch vector by θ about the x axis; a basic parameterized gate in variational circuits.

The unitary matrix

Computing the matrix with the simulation engine…

Computed by the same engine that runs the circuits, with π/2 for the parameters. Multi-qubit gates are shown in textbook order (control qubit first).

Its effect on the basis states

InputOutput
$|0\rangle$$\cos\frac\theta2|0\rangle-i\sin\frac\theta2|1\rangle$
$|1\rangle$$-i\sin\frac\theta2|0\rangle+\cos\frac\theta2|1\rangle$

Useful identities

  • $R_X(\pi)=-iX$
  • $HR_X(\theta)H=R_Z(\theta)$
  • $R_X(\alpha)R_X(\beta)=R_X(\alpha+\beta)$

On the Bloch sphere: rotation by θ about the x axis

$$R_X(\theta)=e^{-i\theta X/2}=\begin{pmatrix}\cos\frac\theta2&-i\sin\frac\theta2\\-i\sin\frac\theta2&\cos\frac\theta2\end{pmatrix}$$

The RX Rotation gateRX Rotation Gate: The gate R_X(θ)=e^-iθ X/2 rotates the Bloch vector by θ about the x axis; it is a basic parameterised gate in variational circuits. is defined by $R_X(\theta)=e^{-i\theta X/2}=\cos\frac\theta2\,I-i\sin\frac\theta2\,X$. It rotates the Bloch vector by an angle $\theta$ about the $x$ axis; note that the exponent contains $\theta/2$ because the rotation angle on the sphere is twice the angle in state space.

On the basis states: $R_X(\theta)|0\rangle=\cos\frac\theta2|0\rangle-i\sin\frac\theta2|1\rangle$, so the probability of measuring 1 is $\sin^2\frac\theta2$. Special cases: $R_X(\pi)=-iX$ (i.e. $X$ up to a global phase), $R_X(\pi/2)$ is $\sqrt X$ up to a global phase, and $R_X(2\pi)=-I$; so a full turn on the sphere gives a global phase of $-1$, and $4\pi$ is needed to return to the same matrix.

Uses: in QAOA the Mixer layer is applied as $R_X(2\beta)$ on each qubitQubit: The qubit is the unit of quantum information: a two-level system whose state is a unit vector α0⟩+β1⟩ in ℂ^2., because $e^{-i\beta X}=R_X(2\beta)$; in Angle EncodingAngle Encoding: Angle encoding sets each real feature as the angle of a single-qubit rotation, such as RY(xᵢ), producing a separable product state with constant depth that needs one qub… the value of a feature $x$ is loaded through $R_X(x)$ or $R_Y(x)$; and in variational circuits $\theta$ is a trainable parameter, to which the Parameter-shift RuleParameter-Shift Rule: The parameter-shift rule computes the exact derivative of an expectation value with respect to the angle of a gate e^-iθ P/2 from two evaluations of the same circuit at… applies because its generator $X/2$ has the two eigenvalues $\pm\tfrac12$.

The change-of-basis relation: $HR_X(\theta)H=R_Z(\theta)$.

Example

Take $\theta=\pi/3$ and the state $|0\rangle$:
$$R_X(\pi/3)|0\rangle=\cos\tfrac{\pi}{6}|0\rangle-i\sin\tfrac{\pi}{6}|1\rangle=\tfrac{\sqrt3}{2}|0\rangle-\tfrac{i}{2}|1\rangle.$$
Probabilities: $P(0)=\tfrac34$ and $P(1)=\tfrac14$. Bloch vector: $(0,-\sin\frac\pi3,\cos\frac\pi3)\approx(0,-0.866,0.5)$; the state rotated in the $yz$ plane towards $-y$, as expected from a positive rotation about $x$.

Live simulation

Loading the simulator…

In code

Qiskit
qc.rx(theta, 0)
OpenQASM 2
rx(theta) q[0];

Related topics

References

  1. Michael A. Nielsen; Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press doi:10.1017/CBO9780511976667The standard reference for quantum computing; the Crossref record gives 2012 for the Cambridge Core online edition.
  2. IBM Quantum (2025). Qiskit SDK API documentation. IBM Quantum Documentation quantum.cloud.ibm.com
  3. Edward Farhi; Jeffrey Goldstone; Sam Gutmann (2014). A Quantum Approximate Optimization Algorithm. arXiv:1411.4028 doi:10.48550/arXiv.1411.4028