qml.templates.embeddings.SqueezingEmbedding¶
-
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 iterable of at mostlen(wires)
floats. If there are fewer entries infeatures
than wires, the circuit does not apply the remaining squeezing gates.- Parameters
features (tensor_like) – Array of features of size (N,)
wires (Iterable or Wires) – Wires that the template acts on. Accepts an iterable of numbers or strings, or a Wires object.
method (str) –
'phase'
encodes the input into the phase of single-mode squeezing, while'amplitude'
uses the amplitudec (float) – value of the phase of all squeezing gates if
execution='amplitude'
, or the amplitude of all squeezing gates ifexecution='phase'
- Raises
ValueError – if inputs do not have the correct format
Contents
Using PennyLane
Development
API
Downloads