QuadraticPhase

Module: pennylane

class QuadraticPhase(s, wires)[source]

Quadratic phase shift.

\[P(s) = e^{i \frac{s}{2} \hat{x}^2/\hbar}.\]

Details:

  • Number of wires: 1

  • Number of parameters: 1

  • Gradient recipe: \(\frac{d}{ds}f(P(s)) = \frac{1}{2 a} \left[f(P(s+a)) - f(P(s-a))\right]\), where \(a\) is an arbitrary real number (\(0.1\) by default) and \(f\) is an expectation value depending on \(P(s)\).

  • Heisenberg representation:

    \[\begin{split}M = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & s & 1 \\ \end{bmatrix}\end{split}\]
Parameters:
  • s (float) – parameter
  • wires (Sequence[int] or int) – the wire the operation acts on