示例#1
0
    def build(self):
        log = logger.Logger(self.stdout, self.verbose)
        mol = self.mol
        auxmol = self.auxmol = addons.make_auxmol(self.mol, self.auxbasis)
        n2c = mol.nao_2c()
        naux = auxmol.nao_nr()
        nao_pair = n2c * (n2c + 1) // 2

        max_memory = (self.max_memory - lib.current_memory()[0]) * .8
        mem_incore = nao_pair * naux * 3 * 16 / 1e6 * 2
        mem_now = lib.current_memory()[0]
        if mem_incore < max_memory:
            self._cderi = (r_incore.cholesky_eri(mol,
                                                 auxmol=auxmol,
                                                 aosym='s1',
                                                 int3c='int3c2e_spinor',
                                                 verbose=log),
                           r_incore.cholesky_eri(mol,
                                                 auxmol=auxmol,
                                                 aosym='s1',
                                                 int3c='int3c2e_spsp1_spinor',
                                                 verbose=log))
        else:
            raise NotImplementedError("Outcore not available, requested :",
                                      mem_incore)
        return self
示例#2
0
文件: df.py 项目: chrinide/pyscf
    def build(self):
        log = logger.Logger(self.stdout, self.verbose)
        mol = self.mol
        auxmol = self.auxmol = addons.make_auxmol(self.mol, self.auxbasis)
        n2c = mol.nao_2c()
        naux = auxmol.nao_nr()
        nao_pair = n2c*(n2c+1)//2

        max_memory = (self.max_memory - lib.current_memory()[0]) * .8
        if nao_pair*naux*3*16/1e6*2 < max_memory:
            self._cderi =(r_incore.cholesky_eri(mol, auxmol=auxmol, aosym='s2',
                                                int3c='int3c2e_spinor', verbose=log),
                          r_incore.cholesky_eri(mol, auxmol=auxmol, aosym='s2',
                                                int3c='int3c2e_spsp1_spinor', verbose=log))
        else:
            raise NotImplementedError
        return self
示例#3
0
    def build(self):
        t0 = (time.clock(), time.time())
        log = logger.Logger(self.stdout, self.verbose)
        mol = self.mol
        auxmol = self.auxmol = incore.format_aux_basis(self.mol, self.auxbasis)
        n2c = mol.nao_2c()
        naux = auxmol.nao_nr()
        nao_pair = n2c * (n2c + 1) // 2

        max_memory = (self.max_memory - lib.current_memory()[0]) * .8
        if nao_pair * naux * 3 * 16 / 1e6 * 2 < max_memory:
            self._cderi = (r_incore.cholesky_eri(mol,
                                                 auxmol=auxmol,
                                                 aosym='s2',
                                                 int3c='int3c2e_spinor',
                                                 verbose=log),
                           r_incore.cholesky_eri(mol,
                                                 auxmol=auxmol,
                                                 aosym='s2',
                                                 int3c='int3c2e_spsp1_spinor',
                                                 verbose=log))
        else:
            raise NotImplementedError
        return self
示例#4
0
文件: df.py 项目: eronca/pyscf
    def build(self):
        t0 = (time.clock(), time.time())
        log = logger.Logger(self.stdout, self.verbose)
        mol = self.mol
        auxmol = self.auxmol = incore.format_aux_basis(self.mol, self.auxbasis)
        n2c = mol.nao_2c()
        naux = auxmol.nao_nr()
        nao_pair = n2c*(n2c+1)//2

        max_memory = (self.max_memory - lib.current_memory()[0]) * .8
        if nao_pair*naux*3*16/1e6*2 < max_memory:
            self._cderi = r_incore.cholesky_eri(mol, auxbasis=self.auxbasis,
                                                aosym='s2', verbose=log)
        else:
            raise NotImplementedError
            self._cderifile = self._cderi
            self._cderi = r_outcore.cholesky_eri(mol, self._cderi.name,
                                                 auxbasis=self.auxbasis,
                                                 verbose=log)
        return self
示例#5
0
mol = gto.Mole()
mol.basis = 'unc-dzp-dk'
mol.atom = '''
O      0.000000      0.000000      0.118351
H      0.000000      0.761187     -0.469725
H      0.000000     -0.761187     -0.469725
'''
mol.charge = 0
mol.spin = 0
mol.symmetry = 0
mol.verbose = 4
mol.build()

t = time.time()
cderi = r_incore.cholesky_eri(mol, int3c='int3c2e_spinor', verbose=4)


def fjk2c(mol, dm, *args, **kwargs):
    n2c = dm.shape[0]
    cderi_ll = cderi.reshape(-1, n2c, n2c)
    vj = numpy.zeros((n2c, n2c), dtype=dm.dtype)
    vk = numpy.zeros((n2c, n2c), dtype=dm.dtype)
    rho = (numpy.dot(cderi, dm.T.reshape(-1)))
    vj = numpy.dot(rho, cderi).reshape(n2c, n2c)
    v1 = lib.einsum('pij,jk->pik', cderi_ll, dm)
    vk = lib.einsum('pik,pkj->ij', v1, cderi_ll)
    return vj, vk


mf = x2c.UHF(mol)
示例#6
0
文件: df2c.py 项目: chrinide/pyaim
mol = gto.Mole()
mol.basis = 'unc-dzp-dk'
mol.atom = '''
O      0.000000      0.000000      0.118351
H      0.000000      0.761187     -0.469725
H      0.000000     -0.761187     -0.469725
'''
mol.charge = 0
mol.spin = 0
mol.symmetry = 0
mol.verbose = 4
mol.build()

t = time.time()
cderi = r_incore.cholesky_eri(mol,
                              int3c='int3c2e_spinor',
                              auxbasis='def2-svp-jkfit',
                              verbose=4)


def fjk2c(mol, dm, *args, **kwargs):
    n2c = dm.shape[0]
    cderi_ll = cderi.reshape(-1, n2c, n2c)
    vj = numpy.zeros((n2c, n2c), dtype=dm.dtype)
    vk = numpy.zeros((n2c, n2c), dtype=dm.dtype)
    rho = numpy.dot(cderi, dm.T.reshape(-1))
    vj = numpy.dot(rho, cderi).reshape(n2c, n2c)
    v1 = lib.einsum('pij,jk->pik', cderi_ll, dm)
    vk = lib.einsum('pik,pkj->ij', v1, cderi_ll)
    return vj, vk