Ejemplo n.º 1
0
def format_aux_basis(mol, auxbasis='weigend+etb'):
    '''Generate a fake Mole object which uses the density fitting auxbasis as
    the basis sets
    '''
    pmol = copy.copy(mol)  # just need shallow copy

    if auxbasis == 'weigend+etb':
        pmol._basis = pmol.format_basis(addons.aug_etb_for_dfbasis(mol))
    elif isinstance(auxbasis, str):
        uniq_atoms = set([a[0] for a in mol._atom])
        pmol._basis = pmol.format_basis(
            dict([(a, auxbasis) for a in uniq_atoms]))
    else:
        pmol._basis = pmol.format_basis(auxbasis)
    pmol._atm, pmol._bas, pmol._env = \
            pmol.make_env(mol._atom, pmol._basis, mol._env[:gto.PTR_ENV_START])
    pmol._built = True
    logger.debug(mol, 'aux basis %s, num shells = %d, num cGTO = %d', auxbasis,
                 pmol.nbas, pmol.nao_nr())
    return pmol
Ejemplo n.º 2
0
def format_aux_basis(mol, auxbasis='weigend+etb'):
    '''Generate a fake Mole object which uses the density fitting auxbasis as
    the basis sets
    '''
    pmol = copy.copy(mol)  # just need shallow copy

    if auxbasis == 'weigend+etb':
        pmol._basis = pmol.format_basis(addons.aug_etb_for_dfbasis(mol))
    elif isinstance(auxbasis, str):
        uniq_atoms = set([a[0] for a in mol._atom])
        pmol._basis = pmol.format_basis(dict([(a, auxbasis)
                                              for a in uniq_atoms]))
    else:
        pmol._basis = pmol.format_basis(auxbasis)
    pmol._atm, pmol._bas, pmol._env = \
            pmol.make_env(mol._atom, pmol._basis, mol._env[:gto.PTR_ENV_START])
    pmol._built = True
    logger.debug(mol, 'aux basis %s, num shells = %d, num cGTOs = %d',
                 auxbasis, pmol.nbas, pmol.nao_nr())
    return pmol
Ejemplo n.º 3
0
 def mix_density_fit(self, auxbasis=None, with_df=None):
     from pyscf.df.addons import aug_etb_for_dfbasis
     from pyscf.pbc.df import mdf_jk
     if auxbasis is None:
         auxbasis = aug_etb_for_dfbasis(self.cell, beta=1.8, start_at=0)
     return mdf_jk.density_fit(self, auxbasis, with_df)