Module: pennylane

class Rot(phi, theta, omega, wires)[source]

Arbitrary single qubit rotation

\[\begin{split}R(\phi,\theta,\omega) = RZ(\omega)RY(\theta)RZ(\phi)= \begin{bmatrix} e^{-i(\phi+\omega)/2}\cos(\theta/2) & -e^{i(\phi-\omega)/2}\sin(\theta/2) \\ e^{-i(\phi-\omega)/2}\sin(\theta/2) & e^{i(\phi+\omega)/2}\cos(\theta/2) \end{bmatrix}.\end{split}\]


  • Number of wires: 1
  • Number of parameters: 3
  • Gradient recipe: \(\frac{d}{d\phi}f(R(\phi, \theta, \omega)) = \frac{1}{2}\left[f(R(\phi+\pi/2, \theta, \omega)) - f(R(\phi-\pi/2, \theta, \omega))\right]\) where \(f\) is an expectation value depending on \(R(\phi, \theta, \omega)\). This gradient recipe applies for each angle argument \(\{\phi, \theta, \omega\}\).
  • phi (float) – rotation angle \(\phi\)
  • theta (float) – rotation angle \(\theta\)
  • omega (float) – rotation angle \(\omega\)
  • wires (Sequence[int] or int) – the wire the operation acts on