Module: pennylane.templates.embeddings

SqueezingEmbedding(features, wires, method='amplitude', c=0.1)[source]

Encodes \(N\) features into the squeezing amplitudes \(r \geq 0\) or phases \(\phi \in [0, 2\pi)\) of \(M\) modes, where \(N\leq M\).

The mathematical definition of the squeezing gate is given by the operator

\[S(z) = \exp\left(\frac{r}{2}\left(e^{-i\phi}\a^2 -e^{i\phi}{\ad}^{2} \right) \right),\]

where \(\a\) and \(\ad\) are the bosonic creation and annihilation operators.

features has to be an array of at most len(wires) floats. If there are fewer entries in features than wires, the circuit does not apply the remaining squeezing gates.

  • features (array) – Array of features of size (N,)
  • wires (Sequence[int]) – sequence of mode indices that the template acts on
Keyword Arguments:
  • method (str) – 'phase' encodes the input into the phase of single-mode squeezing, while 'amplitude' uses the amplitude
  • c (float) – value of the phase of all squeezing gates if execution='amplitude', or the amplitude of all squeezing gates if execution='phase'