Skip to content

dq.fock

fock(dim: int | tuple[int, ...], number: int | tuple[int, ...]) -> Array

Returns the ket of a Fock state or the ket of a tensor product of Fock states.

Parameters

  • dim (int or tuple of ints)

    Dimension of the Hilbert space of each mode.

  • number (int or tuple of ints)

    Fock state number of each mode.

Returns

(array of shape (n, 1)) Ket of the Fock state or tensor product of Fock states.

Examples

>>> dq.fock(3, 1)
Array([[0.+0.j],
       [1.+0.j],
       [0.+0.j]], dtype=complex64)
>>> dq.fock((3, 2), (1, 0))
Array([[0.+0.j],
       [0.+0.j],
       [1.+0.j],
       [0.+0.j],
       [0.+0.j],
       [0.+0.j]], dtype=complex64)