Module: pennylane

class DisplacedSqueezedState(a, phi_a, r, phi_r, wires)[source]

Prepares a displaced squeezed vacuum state.

A displaced squeezed state is prepared by squeezing a vacuum state, and then applying a displacement operator,

\[\ket{\alpha,z} = D(\alpha)\ket{0,z} = D(\alpha)S(z)\ket{0},\]

with the displacement parameter \(\alpha=ae^{i\phi_a}\) and the squeezing parameter \(z=re^{i\phi_r}\).


  • Number of wires: 1
  • Number of parameters: 4
  • Gradient recipe: None (uses finite difference)
  • a (float) – displacement magnitude \(a=|\alpha|\)
  • phi_a (float) – displacement angle \(\phi_a\)
  • r (float) – squeezing magnitude \(r=|z|\)
  • phi_r (float) – squeezing angle \(\phi_r\)
  • wires (Sequence[int] or int) – the wire the operation acts on