# sf.ops.Squeezed¶

class Squeezed(r=0.0, p=0.0)[source]

Bases: strawberryfields.ops.Preparation

Prepare a mode in a squeezed vacuum state.

Parameters
• r (float) – squeezing magnitude

• p (float) – squeezing angle $$\phi$$

Definition

The squeezed state $$\ket{z}$$, $$z=re^{i\phi}$$ is a squeezed vacuum state defined by

$\ket{z} = S(z)\ket{0}$

Tip

Available in Strawberry Fields as a NumPy array by strawberryfields.utils.squeezed_state()

A squeezed state is a minimum uncertainty state with unequal quadrature variances, and satisfies the following eigenstate equation:

$\left(\a\cosh(r)+\ad e^{i\phi}\sinh(r)\right)\ket{z} = 0$

In the Fock basis, it has the decomposition

$|z\rangle = \frac{1}{\sqrt{\cosh(r)}}\sum_{n=0}^\infty \frac{\sqrt{(2n)!}}{2^n n!}(-e^{i\phi}\tanh(r))^n|2n\rangle$

whilst in the Gaussian formulation, $$\bar{\mathbf{r}} = (0,0)$$, $$\mathbf{V} = \frac{\hbar}{2}R(\phi/2)\begin{bmatrix}e^{-2r} & 0 \\ 0 & e^{2r} \\\end{bmatrix}R(\phi/2)^T$$.

We can use the squeezed vacuum state to approximate the zero position and zero momentum eigenstates;

$\ket{0}_x \approx S(r)\ket{0}, ~~~~ \ket{0}_p \approx S(-r)\ket{0}$

where $$z=r$$ is sufficiently large.

 measurement_deps Extra dependencies due to parameters that depend on measurements. ns
measurement_deps

Extra dependencies due to parameters that depend on measurements.

Returns

dependencies

Return type

set[RegRef]

ns = 1
 apply(reg, backend, **kwargs) Ask a local backend to execute the operation on the current register state right away. decompose(reg, **kwargs) Decompose the operation into elementary operations supported by the backend API. merge(other) Merge the operation with another (acting on the exact same set of subsystems).
apply(reg, backend, **kwargs)

Ask a local backend to execute the operation on the current register state right away.

Takes care of parameter evaluations and any pending formal transformations (like dagger) and then calls Operation._apply().

Parameters
• reg (Sequence[RegRef]) – subsystem(s) the operation is acting on

• backend (BaseBackend) – backend to execute the operation

Returns

the result of self._apply

Return type

Any

decompose(reg, **kwargs)

Decompose the operation into elementary operations supported by the backend API.

See strawberryfields.backends.base.

Parameters

reg (Sequence[RegRef]) – subsystems the operation is acting on

Returns

decomposition as a list of operations acting on specific subsystems

Return type

list[Command]

merge(other)

Merge the operation with another (acting on the exact same set of subsystems).

Note

For subclass overrides: merge may return a newly created object, or self, or other, but it must never modify self or other because the same Operation objects may be also used elsewhere.

Parameters

other (Operation) – operation to merge this one with

Returns

other * self. The return value None represents the identity gate (doing nothing).

Return type

Operation, None

Raises

MergeFailure – if the two operations cannot be merged