Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Replace nlm_save in DeePKS by HContainer object phialpha. #5766

Merged
merged 10 commits into from
Dec 26, 2024

Conversation

ErjieWu
Copy link
Collaborator

@ErjieWu ErjieWu commented Dec 25, 2024

Linked Issue

Fix #5744 , set_size() is defined in BaseMatrix now and will be called when set_size() is called in AtomPair.

Unit Tests and/or Case Tests for my changes

  • Change two reference results of integrate test in DeePKS for stress alignment. Before this update, the stress calculation in the DeePKS part was processed using a lower triangular matrix for gamma-only condition. In the new code, it has been changed to an upper triangular matrix to be consistent with other stress calculation codes within ABACUS. There are certain numerical differences in the results after the change, so the result.ref file has been updated here.
  • Change the name of psialpha into phialpha in integrate test.

What's changed?

  • Use Hcontainer to build a new variable phialpha in LCAO_Deepks to replace nlm_save and nlm_save_k, overlap between projected orbitals and basis are now saved in same form for both gamma-only case and multi-k case.
  • Add set_size() function in hamilt::BaseMatrix and call it in AtomPair to avoid wrong results.
  • Add cal_stress value check for deepks_out_unittest=1.
  • Change contributeHR() in deepks_lcao into template.
  • Change all the name psi in DeePKS into phi since they are actually NAO basis.

Notice

  • The output file deepks_psialpha.npy is also changed into deepks_phialpha.npy, this may cause error for reading files when using deepks-kit (deepks-kit should be changed later as well, or users may need to change the file name into old version by hand).

@mohanchen mohanchen added The Absolute Zero Reduce the "entropy" of the code to 0 DeePKS Issues related to the DeePKS labels Dec 26, 2024
@mohanchen mohanchen merged commit 28df43d into deepmodeling:develop Dec 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeePKS Issues related to the DeePKS The Absolute Zero Reduce the "entropy" of the code to 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Irreasonable results when setting size of BaseMatrix size of AtomPair in HContainer.
2 participants