Module: pennylane

class QuadOperator(phi, wires)[source]

The generalized quadrature observable \(\x_\phi = \x cos\phi+\p\sin\phi\).

When used with the expval() function, the expectation value \(\braket{\hat{\x_\phi}}\) is returned. This corresponds to the mean displacement in the phase space along axis at angle \(\phi\).


  • Number of wires: 1

  • Number of parameters: 1

  • Observable order: 1st order in the quadrature operators

  • Heisenberg representation:

    \[d = [0, \cos\phi, \sin\phi]\]
  • phi (float) – axis in the phase space at which to calculate the generalized quadrature observable
  • wires (Sequence[int] or int) – the wire the operation acts on