Stabilize RI RPA/EXX and Ewald EXX method merge on develop#7019
Stabilize RI RPA/EXX and Ewald EXX method merge on develop#7019AroundPeking wants to merge 17 commits intodeepmodeling:developfrom
Conversation
- integrate the RI/RPA post-SCF workflow with develop - restore Coulomb/input-output handling and sparse matrix precision - fix nspin=2 and TRS symmetry output regressions
The default was accidentally changed to "none", causing all tests without explicit latname to fail at STRU parsing with "do not use LATTICE_VECTORS along with explicit specification of lattice type".
The previous merge accidentally changed exx_singularity_correction reset logic (lc_pbe etc from "spencer" to "massidda") and removed metadata, causing 08_EXX integration tests to fail. Restore the develop version and append new RI parameters (shrink_abfs_pca_thr, shrink_lu_inv_thr, exx_coul_moment, exx_rotate_abfs, exx_multip_moments_threshold, out_unshrinked_v).
The removal of filter_empty_orbs calls caused empty orbital shells to be retained in lcaos and abfs vectors, altering RI exchange integrals for all EXX calculations including standard HF used by LR-TDDFT.
The PR removed the filter_empty_orbs function from Construct_Orbs and inlined its logic into change_orbs() for lcaos. The previous commit incorrectly called the now-deleted function. This commit inlines the same filtering logic directly for abfs to restore the empty orbital shell removal without depending on the deleted function.
…formula - Restore LRI_CV, Matrix_Orbs11/21/22, exx_abfs-construct_orbs, exx_opt_orb, ABFs_Construct-PCA to develop versions to minimize diff - Fix spencer Rcut: use get_nkstot_full() without /nspin0 division (nkstot_full already excludes spin doubling) - Fix shared_ptr<ORB_gaunt_table> usage in Exx_LRI, RPA_LRI - Fix ewald_Vq compilation errors - Fix exx_opt_orb-print.cpp to match develop API
The spencer Rcut formula was corrected to not divide by nspin0 (get_nkstot_full() already excludes spin doubling), which changes the excitation energy result from 6.050430 to 2.574437.
The previous ref (2.574437) was from fisherd which lacks LibXC, producing different results. Use CI environment's actual value.
|
Thanks for your PR, which extends the functionality of ABACUS. I noticed you have introduced several new input parameters. I would suggest adding corresponding unit or integration tests to ensure your results are not affected by future refactoring work from others in ABACUS. |
e643d5c to
9e6b5a5
Compare
Done. I added integration coverage for the new RPA-related workflow to reduce the risk of future refactoring changing these outputs silently. The PR now includes:
One follow-up fix was also needed for CI: these RPA files are now compared by absolute value, because the ABF / shrink basis eigenvectors have an arbitrary overall sign, which can flip the sign of The test additions were added in commit |
|
I have some suggestions on the output format of the integration test files in this PR: |
Thanks for the suggestions. For the output format / filename cleanup: I agree this can be improved, but I did not change it in this PR. These RPA output files are part of the current interface used by LibRPA, and the naming/layout is also kept consistent with the existing FHI-aims-style workflow. Changing filenames, indices, or file formatting here would require coordinated downstream changes and is broader than the functional scope of this PR. I would prefer to handle that cleanup in a follow-up PR. For the integration test size issue, I updated the solid shrink RPA test in this PR. The previous case produced very large reference files, so I replaced it with a much smaller two-atom H 1x1x2 solid case while still checking the same set of RPA-related outputs:
This keeps the file coverage unchanged but reduces the reference size substantially (from about 224k lines total to 128 lines total). |
There was a problem hiding this comment.
this file is strange, you delete 562 lines and add exactly 562 lines, could you double check why?
There was a problem hiding this comment.
You are right — these were no-op line-ending / formatting changes from the merge, not real code changes.
I checked the whole PR for the same issue.
Besides the two LRI_CV_Tools files, there was one more no-op formatting / line-ending change in source/source_lcao/module_ri/Inverse_Matrix.h. I removed that as well in commit c33c8d7e1.
I then re-checked the full PR diff against develop, and there are no remaining whitespace-only / line-ending-only file changes.
OK, that sounds reasonable to me. |



Summary
This PR consolidates the RI RPA/EXX merge work onto current
developand resolves the main regressions found during validation.Main changes
developnspin=2RI / overlap-matrix output inconsistenciessymrot_koutput to avoid symmetry-related crashesValidation
Checked against the regression cases discussed during debugging, including:
cut/matoutput consistencynspin=2LibRPA-related workflow consistencyprint_symrot_info_k()Notes