def get_pair_specific_indices(self, pair_info: str=None, include_singles: bool=True, general_excitations: bool=True) -> list:
    '\n        Assuming a pair-specific model, create a pair-specific index list\n        to be used in make_upccgsd_ansatz(indices = ... )\n        Excite from a set of references (i) to any pair coming from (i),\n        i.e. any (i,j)/(j,i). If general excitations are allowed, also\n        allow excitations from pairs to appendant pairs and reference.\n\n        Parameters\n        ----------\n        pair_info\n            file or list including information about pair structure\n            references single number, pair double\n            example: as file: "0,1,11,11,00,10" (hand over file name)\n                     in file, skip first row assuming some text with information\n                     as list:[\'0\',\'1`\',\'11\',\'11\',\'00\',\'10\']\n                     ~> two reference orbitals 0 and 1,\n                     then two orbitals from pair 11, one from 00, one mixed 10\n        include_singles\n            include single excitations\n        general_excitations\n            allow general excitations\n       Returns\n        -------\n            list of indices with pair-specific ansatz\n        '
    if (pair_info is None):
        raise TequilaException('Need to provide some pair information.')
    if isinstance(pair_info, str):
        pairs = numpy.loadtxt(pair_info, dtype=str, delimiter=',', skiprows=1)
    elif isinstance(pair_info, list):
        pairs = pair_info
    elif (not isinstance(pair_info, list)):
        raise TequilaException('Pair information needs to be contained in a list or filename.')
    connect = ([[]] * len(pairs))
    generalized = 0
    for (idx, p) in enumerate(pairs):
        if (len(p) == 1):
            connect[idx] = [i for i in range(len(pairs)) if ((len(pairs[i]) == 2) and (str(idx) in pairs[i]))]
        elif ((len(p) == 2) and general_excitations):
            connect[idx] = [i for i in range(len(pairs)) if (((p[0] in pairs[i]) or (p[1] in pairs[i]) or (str(i) in p)) and (not (i == idx)))]
        elif (len(p) > 2):
            raise TequilaException('Invalid reference of pair id.')
    indices = []
    for (i, to) in enumerate(connect):
        for a in to:
            indices.append((((2 * i), (2 * a)), (((2 * i) + 1), ((2 * a) + 1))))
            if include_singles:
                indices.append(((2 * i), (2 * a)))
                indices.append((((2 * i) + 1), ((2 * a) + 1)))
    return indices
Assuming a pair-specific model, create a pair-specific index list
 to be used in make_upccgsd_ansatz(indices = ... )
 Excite from a set of references (i) to any pair coming from (i),
 i.e. any (i,j)/(j,i). If general excitations are allowed, also
 allow excitations from pairs to appendant pairs and reference.

 Parameters
 ----------
 pair_info
     file or list including information about pair structure
     references single number, pair double
     example: as file: "0,1,11,11,00,10" (hand over file name)
              in file, skip first row assuming some text with information
              as list:['0','1`','11','11','00','10']
              ~> two reference orbitals 0 and 1,
              then two orbitals from pair 11, one from 00, one mixed 10
 include_singles
     include single excitations
 general_excitations
     allow general excitations
Returns
 -------
     list of indices with pair-specific ansatz
def get_pair_specific_indices(self, pair_info: str=None, include_singles: bool=True, general_excitations: bool=True) -> list:
    '\n        Assuming a pair-specific model, create a pair-specific index list\n        to be used in make_upccgsd_ansatz(indices = ... )\n        Excite from a set of references (i) to any pair coming from (i),\n        i.e. any (i,j)/(j,i). If general excitations are allowed, also\n        allow excitations from pairs to appendant pairs and reference.\n\n        Parameters\n        ----------\n        pair_info\n            file or list including information about pair structure\n            references single number, pair double\n            example: as file: "0,1,11,11,00,10" (hand over file name)\n                     in file, skip first row assuming some text with information\n                     as list:[\'0\',\'1`\',\'11\',\'11\',\'00\',\'10\']\n                     ~> two reference orbitals 0 and 1,\n                     then two orbitals from pair 11, one from 00, one mixed 10\n        include_singles\n            include single excitations\n        general_excitations\n            allow general excitations\n       Returns\n        -------\n            list of indices with pair-specific ansatz\n        '
    if (pair_info is None):
        raise TequilaException('Need to provide some pair information.')
    if isinstance(pair_info, str):
        pairs = numpy.loadtxt(pair_info, dtype=str, delimiter=',', skiprows=1)
    elif isinstance(pair_info, list):
        pairs = pair_info
    elif (not isinstance(pair_info, list)):
        raise TequilaException('Pair information needs to be contained in a list or filename.')
    connect = ([[]] * len(pairs))
    generalized = 0
    for (idx, p) in enumerate(pairs):
        if (len(p) == 1):
            connect[idx] = [i for i in range(len(pairs)) if ((len(pairs[i]) == 2) and (str(idx) in pairs[i]))]
        elif ((len(p) == 2) and general_excitations):
            connect[idx] = [i for i in range(len(pairs)) if (((p[0] in pairs[i]) or (p[1] in pairs[i]) or (str(i) in p)) and (not (i == idx)))]
        elif (len(p) > 2):
            raise TequilaException('Invalid reference of pair id.')
    indices = []
    for (i, to) in enumerate(connect):
        for a in to:
            indices.append((((2 * i), (2 * a)), (((2 * i) + 1), ((2 * a) + 1))))
            if include_singles:
                indices.append(((2 * i), (2 * a)))
                indices.append((((2 * i) + 1), ((2 * a) + 1)))
    return indices