CRZ

Module: pennylane

class CRZ(phi, wires)[source]

The controlled-RZ operator

\[\begin{split}CR_z(\phi) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0\\ 0 & 0 & e^{-i\phi/2} & 0\\ 0 & 0 & 0 & e^{i\phi/2} \end{bmatrix}.\end{split}\]

Note

The first wire provided corresponds to the control qubit.

Details:

  • Number of wires: 2
  • Number of parameters: 1
  • Gradient recipe: \(\frac{d}{d\phi}f(CR_z(\phi)) = \frac{1}{2}\left[f(CR_z(\phi+\pi/2)) - f(CR_z(\phi-\pi/2))\right]\) where \(f\) is an expectation value depending on \(CR_z(\phi)\).
Parameters:
  • phi (float) – rotation angle \(\phi\)
  • wires (Sequence[int] or int) – the wire the operation acts on