Ejemplo n.º 1
0
def UAGF2(mf,
          nmom=(None, 0),
          frozen=None,
          mo_energy=None,
          mo_coeff=None,
          mo_occ=None):
    if nmom != (None, 0):  # redundant
        if nmom[1] == 0 and nmom[0] != 0:
            nmom = (None, 0)

    if nmom != (None, 0) and getattr(mf, 'with_df', None) is not None:
        raise RuntimeError('AGF2 with custom moment orders does not '
                           'density fitting.')

    elif nmom != (None, 0):
        lib.logger.warn(
            mf, 'AGF2 called with custom moment orders - '
            'falling back on _slow implementations.')
        return uagf2_slow.UAGF2(mf, nmom, frozen, mo_energy, mo_coeff, mo_occ)

    elif getattr(mf, 'with_df', None) is not None:
        return dfuagf2.DFUAGF2(mf, frozen, mo_energy, mo_coeff, mo_occ)

    else:
        return uagf2.UAGF2(mf, frozen, mo_energy, mo_coeff, mo_occ)
Ejemplo n.º 2
0
    def dump_flags(self, verbose=None):
        uagf2.UAGF2.dump_flags(self, verbose=verbose)
        logger.info(self, 'nmom = %s', repr(self.nmom))
        return self

    def run_diis(self, se, diis=None):
        return se


class _ChemistsERIs(uagf2._ChemistsERIs):
    pass

_make_qmo_eris_incore = uagf2._make_qmo_eris_incore



if __name__ == '__main__':
    from pyscf import gto, scf, mp

    mol = gto.M(atom='O 0 0 0; H 0 0 1; H 0 1 0', basis='cc-pvdz', charge=-1, spin=1, verbose=3)
    uhf = scf.UHF(mol)
    uhf.conv_tol = 1e-11
    uhf.run()

    agf2 = UAGF2(uhf)
    agf2.run()

    agf2 = uagf2.UAGF2(uhf)
    agf2.run()