squeeze_operator

Graph.squeeze_operator(zeta, dimension, offset=0, *, name=None)

Create a squeeze operator (or a batch of them).

Parameters
  • zeta (number or list[number] or np.ndarray) – A number \(\zeta\) that characterizes the squeeze operator. You can also pass a list or 1D array of numbers to generate a batch of squeeze operators.

  • dimension (int) – The size of the truncated Fock space. By default, the Fock space is truncated as [0, dimension). If non-zero offset is passed, the space is then truncated at [offset, dimension + offset).

  • offset (int, optional) – The lowest Fock state. Defaults to 0.

  • name (str, optional) – The name of the node.

Returns

A tensor representing the squeeze operator. The shape is 2D if there is no batch in zeta, otherwise 3D where the first axis is the batch dimension.

Return type

Tensor

See also

annihilation_operator

Create an annihilation operator in the truncated Fock space.

coherent_state

Create a coherent state (or a batch of them).

creation_operator

Create a creation operator in the truncated Fock space.

displacement_operator

Create a displacement operator (or a batch of them) in the truncated Fock space.

fock_state

Create a Fock state (or a batch of them).

number_operator

Create a number operator in the truncated Fock space.

Notes

The squeeze operator is defined as:

\[S(\zeta) = \exp\left( \frac{\zeta^\ast \hat{a}^2 - \zeta \hat{a}^{\dagger2}}{2} \right)\]

where \(\hat{a}\) and \(\hat{a}^\dagger\) are the annihilation and creation operators respectively.

For more information about the squeeze operator, see Squeeze operator on Wikipedia.

Examples

Create a squeeze operator.

>>> graph.squeeze_operator(1j, 3, name="squeeze")
<Tensor: name="squeeze", operation_name="squeeze_operator", shape=(3, 3)>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["squeeze"])
>>> result.output["squeeze"]["value"]
array([[0.7602446+0.j        , 0.       +0.j        ,0.       -0.64963694j],
       [0.       +0.j        , 1.       +0.j        ,0.       +0.j        ],
       [0.       -0.64963694j, 0.       +0.j        ,0.7602446+0.j        ]])

Create a batch of squeeze operators.

>>> graph.squeeze_operator([1j, 3], 3, name="squeeze_batch")
<Tensor: name="squeeze_batch", operation_name="squeeze_operator", shape=(2, 3, 3)>
>>> result = qctrl.functions.calculate_graph(
...     graph=graph, output_node_names=["squeeze_batch"]
... )
>>> result.output["squeeze_batch"]["value"]
array([[[ 0.7602446 +0.j        ,  0.        +0.j        ,0.        -0.64963694j],
        [ 0.        +0.j        ,  1.        +0.j        ,0.        +0.j        ],
        [ 0.        -0.64963694j,  0.        +0.j        ,0.7602446 +0.j        ]],
       [[-0.19569944+0.j        ,  0.        +0.j        ,0.98066392+0.j        ],
        [ 0.        +0.j        ,  1.        +0.j        ,0.        +0.j        ],
        [-0.98066392-0.j        ,  0.        -0.j        ,-0.19569944-0.j        ]]])