Skip to content

hilbert_dimension

qoptcraft.basis.hilbert_dimension

hilbert_dim(modes, photons)

Dimension of the Hilbert space with m modes and n photons.

Parameters:

Name Type Description Default
modes int

number of modes.

required
photons int

number of photons.

required

Returns:

Name Type Description
int int

dimension.

Source code in qoptcraft/basis/hilbert_dimension.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
def hilbert_dim(modes: int, photons: int) -> int:
    """Dimension of the Hilbert space with m modes and n photons.

    Args:
        modes (int): number of modes.
        photons (int): number of photons.

    Returns:
        int: dimension.
    """
    return int(comb(modes + photons - 1, photons))