From 5f83d0fb3fbdd7f78006f989b90e4ae2f892b17d Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Thu, 25 Jan 2024 23:15:27 -0800 Subject: [PATCH] Control the memory footprint for rsdf_builder and rsjk_builder (issue #2017) --- pyscf/pbc/df/rsdf_builder.py | 2 +- pyscf/pbc/scf/rsjk.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyscf/pbc/df/rsdf_builder.py b/pyscf/pbc/df/rsdf_builder.py index 8512620076..4f7712e896 100644 --- a/pyscf/pbc/df/rsdf_builder.py +++ b/pyscf/pbc/df/rsdf_builder.py @@ -1338,7 +1338,7 @@ def _guess_omega(cell, kpts, mesh=None): if mesh is None: nkpts = len(kpts) - ke_cutoff = 20. * nkpts**(-1./3) + ke_cutoff = 20. * (cell.nao/25 * nkpts)**(-1./3) ke_cutoff = max(ke_cutoff, ke_min) mesh = cell.cutoff_to_mesh(ke_cutoff) else: diff --git a/pyscf/pbc/scf/rsjk.py b/pyscf/pbc/scf/rsjk.py index 604b941504..7329364114 100644 --- a/pyscf/pbc/scf/rsjk.py +++ b/pyscf/pbc/scf/rsjk.py @@ -1266,7 +1266,7 @@ def _guess_omega(cell, kpts, mesh=None): if mesh is None: omega_min = OMEGA_MIN ke_min = estimate_ke_cutoff_for_omega(cell, omega_min) - nk = nkpts**(1./3) + nk = (cell.nao/25 * nkpts)**(1./3) ke_cutoff = 50 / (.7+.25*nk+.05*nk**3) ke_cutoff = max(ke_cutoff, ke_min) mesh = cell.cutoff_to_mesh(ke_cutoff)