def ix(dot,orb,spin):
    """
    Converts indices to a single index

    Parameters
    ----------
    dot : int
        Dot number
    orb : int
        Orbital number (0 for p- and 1 for p+)
    spin : int
        0 for spin down, 1 for spin up.

    Returns
    -------
    int

    """
    return 4*dot+2*orb+spin