Skip to content

dq.squeeze

squeeze(dim: int, z: ArrayLike) -> Array

Returns the squeezing operator of complex squeezing amplitude \(z\).

It is defined by $$ S(z) = \exp\left(\frac{1}{2}\left(z^* a^2 - z a^{\dag 2}\right)\right), $$ where \(a\) and \(a^\dag\) are the annihilation and creation operators, respectively.

Parameters

  • dim –

    Dimension of the Hilbert space.

  • z (array_like of shape (...)) –

    Squeezing amplitude.

Returns

(array of shape (..., dim, dim)) Squeezing operator.

Examples

>>> dq.squeeze(4, 0.5)
Array([[ 0.938+0.j,  0.   +0.j,  0.346+0.j,  0.   +0.j],
       [ 0.   +0.j,  0.818+0.j,  0.   +0.j,  0.575+0.j],
       [-0.346+0.j,  0.   +0.j,  0.938+0.j,  0.   +0.j],
       [ 0.   +0.j, -0.575+0.j,  0.   +0.j,  0.818+0.j]], dtype=complex64)
>>> dq.squeeze(4, [0.1, 0.2]).shape
(2, 4, 4)