Skip to content

Commit

Permalink
_ft2
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanvo committed Feb 23, 2024
1 parent ad668e0 commit 66cfd97
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pyscf/pbc/mp/kmp2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def kernel(mp, mo_energy, mo_coeff, verbose=logger.NOTE, with_t2=WITH_T2):

if with_t2:
if mem_usage > mem_avail:
ft2 = lib.H5TmpFile()
t2 = ft2.create_dataset('t2', (nkpts, nkpts, nkpts, nocc, nocc, nvir, nvir), dtype=complex)
mp._ft2 = lib.H5TmpFile()
t2 = mp._ft2.create_dataset('t2', (nkpts, nkpts, nkpts, nocc, nocc, nvir, nvir), dtype=complex)
# raise MemoryError('Insufficient memory! MP2 memory usage %d MB (currently available %d MB)'
# % (mem_usage, mem_avail))
else:
Expand Down Expand Up @@ -147,10 +147,7 @@ def kernel(mp, mo_energy, mo_coeff, verbose=logger.NOTE, with_t2=WITH_T2):

emp2 /= nkpts

if mem_usage > mem_avail:
return emp2, t2, ft2
else:
return emp2, t2
return emp2, t2


def _init_mp_df_eris(mp):
Expand Down Expand Up @@ -722,6 +719,7 @@ def __init__(self, mf, frozen=None, mo_coeff=None, mo_occ=None):
self.e_corr = None
self.e_hf = None
self.t2 = None
self._ft2 = None
self._keys = set(self.__dict__.keys())

get_nocc = get_nocc
Expand Down

0 comments on commit 66cfd97

Please sign in to comment.