PhaseShift

Module: pennylane

class PhaseShift(phi, wires)[source]

Arbitrary single qubit local phase shift

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

Details:

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