def compute_num_cosets(n):
    """
    Returns the number of different cosets for the symplectic group S(n) over the 2-element finite field.

    Code from "How to efficiently select an arbitrary Clifford group element"
    by Robert Koenig and John A. Smolin.

    Parameters
    ----------
    n : int
        S(n) group parameter.

    Returns
    -------
    int
    """
    x = 2**int(2 * n - 1) * ((2**int(2 * n)) - 1)
    return x