From b044b7ce67bd128ff12d0c5ba0118cc9fda01c0f Mon Sep 17 00:00:00 2001 From: Matthew R Hermes Date: Wed, 18 Sep 2024 11:08:24 -0500 Subject: [PATCH] Better overflow protection in csf_solver (#124) --- my_pyscf/fci/csf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/my_pyscf/fci/csf.py b/my_pyscf/fci/csf.py index dc65aa37..ab14c9d6 100644 --- a/my_pyscf/fci/csf.py +++ b/my_pyscf/fci/csf.py @@ -98,7 +98,7 @@ def make_hdiag_csf (h1e, eri, norb, nelec, transformer, hdiag_det=None, max_memo # calculation. mem_remaining = max_memory - lib.current_memory ()[0] safety_factor = 1.2 - nfloats = nconf*ndet*ndet + det_addr.size + nfloats = float(nconf)*ndet*ndet + float(det_addr.size) mem_floats = nfloats * np.dtype (float).itemsize / 1e6 mem_ints = det_addr.dtype.itemsize * det_addr.size * 3 / 1e6 mem = safety_factor * (mem_floats + mem_ints)