From 12338613f7b5ad6b6796ed6eaff3556919edcc9e Mon Sep 17 00:00:00 2001 From: Xiaojie Wu Date: Thu, 16 Jan 2025 15:35:23 -0800 Subject: [PATCH] Resolve compatibility issue with pyscf 2.8 (#306) * be compatible with pyscf 2.8 * remove an example * check convergence * max_memory = 32000 --- gpu4pyscf/dft/tests/test_libxc.py | 2 +- gpu4pyscf/mp/mp2.py | 2 ++ gpu4pyscf/mp/tests/test_mp2.py | 1 + setup.py | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gpu4pyscf/dft/tests/test_libxc.py b/gpu4pyscf/dft/tests/test_libxc.py index 99df03ce..c13dba13 100644 --- a/gpu4pyscf/dft/tests/test_libxc.py +++ b/gpu4pyscf/dft/tests/test_libxc.py @@ -92,7 +92,7 @@ def test_u_LDA(self): def test_u_GGA(self): # large errors found in B88 for the spin polarized case - self._check_xc('HYB_GGA_XC_B3LYP', spin=1, fxc_tol=1e-3) + self._check_xc('HYB_GGA_XC_B3LYP', spin=1, fxc_tol=1e-2) self._check_xc('GGA_X_B88', spin=1, fxc_tol=1e-1) self._check_xc('GGA_C_PBE', spin=1, fxc_tol=1e-4) diff --git a/gpu4pyscf/mp/mp2.py b/gpu4pyscf/mp/mp2.py index c7fe059a..c12d68e4 100644 --- a/gpu4pyscf/mp/mp2.py +++ b/gpu4pyscf/mp/mp2.py @@ -349,6 +349,8 @@ def init_amps(self, mo_energy=None, mo_coeff=None, eris=None, with_t2=WITH_T2): # to_cpu can be reused only when __init__ still takes mf def to_cpu(self): mf = self._scf.to_cpu() + if mf.converged: + mf.kernel() # create intermediate variables if converged from importlib import import_module mod = import_module(self.__module__.replace('gpu4pyscf', 'pyscf')) cls = getattr(mod, self.__class__.__name__) diff --git a/gpu4pyscf/mp/tests/test_mp2.py b/gpu4pyscf/mp/tests/test_mp2.py index 1570dd27..b5127816 100644 --- a/gpu4pyscf/mp/tests/test_mp2.py +++ b/gpu4pyscf/mp/tests/test_mp2.py @@ -37,6 +37,7 @@ def setUpModule(): 'O': 'cc-pvdz',} mol.build() mol.incore_anyway = True + mol.max_memory = 32000 mf = scf.RHF(mol) mf.conv_tol = 1e-12 mf.scf() diff --git a/setup.py b/setup.py index edbe56c1..c0aa6f5c 100755 --- a/setup.py +++ b/setup.py @@ -134,7 +134,7 @@ def initialize_with_default_plat_name(self): ], cmdclass={'build_py': CMakeBuildPy}, install_requires=[ - 'pyscf~=2.7.0', + 'pyscf~=2.8.0', 'pyscf-dispersion', f'cupy-cuda{CUDA_VERSION}>=13.0', # Due to expm in cupyx.scipy.linalg and cutensor 2.0 'geometric',