Skip to content

dq.coherent

coherent(dim: int | tuple[int, ...], alpha: ArrayLike) -> Array

Returns the ket of a coherent state, or the ket of a tensor product of coherent states.

Parameters

  • dim (int or tuple of ints)

    Dimension of the Hilbert space of each mode.

  • alpha (array_like)

    Coherent state amplitude of each mode.

Returns

(array of shape (n, 1)) Ket of the coherent state.

Examples

>>> dq.coherent(4, 0.5)
Array([[0.882+0.j],
       [0.441+0.j],
       [0.156+0.j],
       [0.047+0.j]], dtype=complex64)
>>> dq.coherent((2, 3), (0.5, 0.5j))
Array([[ 0.775+0.j   ],
       [ 0.   +0.386j],
       [-0.146+0.j   ],
       [ 0.423+0.j   ],
       [ 0.   +0.211j],
       [-0.08 +0.j   ]], dtype=complex64)