oimeitei / quemb

QuEmb is an open-source tool for efficient quantum chemistry simulation of large molecules and solids (1D and 2D periodic systems) via bootstrap embedding technique.
Apache License 2.0
4 stars 6 forks source link

Enable an automatic installation of the libdmet dependency + account for fixed bug in get_emb_eri_fast_gdf #51

Closed mcocdawc closed 2 weeks ago

mcocdawc commented 3 weeks ago
mcocdawc commented 3 weeks ago

The problem leads to

================================================================================== short test summary info ===================================================================================
FAILED tests/chem_dm_kBE_test.py::Test_kBE_Full::test_kc2_sto3g_be1_chempot - AssertionError: -74.64695833012868 != -74.62798837 within 0.0001 delta (0.018969960128686125 difference) : kBE Correlation Energy for C2 (kBE1) does not match the expected correlation e...
FAILED tests/chem_dm_kBE_test.py::Test_kBE_Full::test_kc4_sto3g_be2_density - AssertionError: -149.4085332249809 != -149.37047888 within 0.0001 delta (0.03805434498090676 difference) : kBE Correlation Energy for C4 (kBE2) does not match the expected correlation e...
===================================================================================== 2 failed in 59.59s =====================================================================================

i.e. errors of up to 18 mEh.

shall I just recreate the tests with the new (now-assumed-to-be-correct) numbers @oimeitei ? Adding you @ShaunWeatherly because I just saw that you created the original test.

oimeitei commented 2 weeks ago

@mcocdawc I just looked into this (didn't have time the past few days!) but why are the test energies different? I think the question is @ShaunWeatherly did you use the libdmet_preview (linked earlier) or were you using the correct one from kbe_devel or an earlier version of libdmet_preview? I would think that with the one linked_earlier (https://github.com/oimeitei/libdmet_preview) QuEmb shouldn't run for periodic version.

If the earlier test numbers were from the correct libdmet_preview, then, something is wrong here.

mcocdawc commented 2 weeks ago

but why are the test energies different?

One set of tests uses (code A):

C_ao_emb = C_ao_emb[np.newaxis]/(nkpts*(0.75))

the other one uses (code B):

C_ao_emb = C_ao_emb[np.newaxis] / (nkpts**(0.75))

I confirmed that the use of code A did give exactly the previous numbers and code B gives the new numbers. If additionally @ShaunWeatherly can confirm that he created the tests using https://github.com/oimeitei/libdmet_preview, then I think the difference is fully explained. (i.e. the multiplication stems from here )

ShaunWeatherly commented 2 weeks ago

Yep, @mcocdawc it's exactly as you described originally:

I've checked and my environment was indeed pointing to a version of libdmet with this issue.

oimeitei commented 2 weeks ago

Ok great, thanks for confirming.