def ao2mo(self, mo_coeff=None): nmoa, nmob = self.get_nmo() nao = self.mo_coeff[0].shape[0] nmo_pair = nmoa * (nmoa+1) // 2 nao_pair = nao * (nao+1) // 2 mem_incore = (max(nao_pair**2, nmoa**4) + nmo_pair**2) * 8/1e6 mem_now = lib.current_memory()[0] if (self._scf._eri is not None and (mem_incore+mem_now < self.max_memory) or self.mol.incore_anyway): return uccsd._make_eris_incore(self, mo_coeff) elif getattr(self._scf, 'with_df', None): raise NotImplementedError else: return uccsd._make_eris_outcore(self, mo_coeff)
def ao2mo(self, mo_coeff=None): nmoa, nmob = self.get_nmo() nao = self.mo_coeff[0].shape[0] nmo_pair = nmoa * (nmoa+1) // 2 nao_pair = nao * (nao+1) // 2 mem_incore = (max(nao_pair**2, nmoa**4) + nmo_pair**2) * 8/1e6 mem_now = lib.current_memory()[0] if (self._scf._eri is not None and (mem_incore+mem_now < self.max_memory) or self.mol.incore_anyway): return uccsd._make_eris_incore(self, mo_coeff) elif getattr(self._scf, 'with_df', None): raise NotImplementedError else: return uccsd._make_eris_outcore(self, mo_coeff)
def ao2mo(self, mo_coeff=None): from pyscf.pbc import tools ao2mofn = mp.mp2._gen_ao2mofn(self._scf) # _scf.exxdiv affects eris.fock. HF exchange correction should be # excluded from the Fock matrix. with lib.temporary_env(self._scf, exxdiv=None): eris = uccsd._make_eris_incore(self, mo_coeff, ao2mofn=ao2mofn) if mo_coeff is self._scf.mo_coeff: idxa, idxb = self.get_frozen_mask() mo_e_a, mo_e_b = self._scf.mo_energy eris.mo_energy = (mo_e_a[idxa], mo_e_b[idxb]) else: nocca, noccb = eris.nocc madelung = tools.madelung(self._scf.cell, self._scf.kpt) eris.mo_energy = (_adjust_occ(eris.mo_energy[0], nocca, -madelung), _adjust_occ(eris.mo_energy[1], noccb, -madelung)) return eris
def ao2mo(self, mo_coeff=None): from pyscf.pbc import tools ao2mofn = mp.mp2._gen_ao2mofn(self._scf) # _scf.exxdiv affects eris.fock. HF exchange correction should be # excluded from the Fock matrix. with lib.temporary_env(self._scf, exxdiv=None): eris = uccsd._make_eris_incore(self, mo_coeff, ao2mofn=ao2mofn) #if mo_coeff is self._scf.mo_coeff: # idxa, idxb = self.get_frozen_mask() # mo_e_a, mo_e_b = self._scf.mo_energy # eris.mo_energy = (mo_e_a[idxa], mo_e_b[idxb]) #else: nocca, noccb = eris.nocc madelung = tools.madelung(self._scf.cell, self._scf.kpt) eris.mo_energy = (_adjust_occ(eris.mo_energy[0], nocca, -madelung), _adjust_occ(eris.mo_energy[1], noccb, -madelung)) return eris
def ao2mo(self, mo_coeff=None): ao2mofn = mp.mp2._gen_ao2mofn(self._scf) return uccsd._make_eris_incore(self, mo_coeff, ao2mofn=ao2mofn)