Skip to content

Commit 45f97fc

Browse files
authored
Adjust tolerance in compute_lambda_thc_test.py test (#1208)
After updating dependency versions, one of the tests in `compute_lambda_thc_test.py` fails. This seems to be due to some numerical drift introduced by these version updates: * `pyscf` updated from 2.9.0 to 2.12.1 * `numpy` updated from 1.26.4 to 2.2.6 The test involves a small electronic structure calculation followed by a BFGS optimization (perform_bfgs_opt=True with bfgs_maxiter=10 in kpoint_thc_via_isdf). Even small changes in the floating-point operations from newer numpy/scipy versions or updates to pyscf's integral evaluations can cause these sorts of minor deviations in the final output after optimization iterations.
1 parent a40fea6 commit 45f97fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openfermion/resource_estimates/pbc/thc/compute_lambda_thc_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ def test_kpoint_thc_lambda():
7878
)
7979
helper = KPTHCDoubleTranslation(kpt_thc.chi, kpt_thc.zeta, mf)
8080
lambda_data = compute_lambda(hcore_mo, helper)
81-
assert np.isclose(lambda_data.lambda_total, 93.84613761765415)
81+
assert np.isclose(lambda_data.lambda_total, 93.8478, atol=2e-3)

0 commit comments

Comments
 (0)