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

Fix: various matrix elements calculations in orbital generation #3940

Merged
merged 21 commits into from
May 21, 2024

Conversation

jinzx10
Copy link
Collaborator

@jinzx10 jinzx10 commented Apr 9, 2024

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #3618
Resolve #3616

Unit Tests and/or Case Tests for my changes

  • A unit test for two-center integral <jY|jY> is added

What's changed?

  • The algorithm for computing <jY|jY> in orbital generation is switched from a summation in plane-wave basis to two-center integration. This change is expected to bring 2-3 more significant digits. A side effect of this change is that the previous code missed a factor of 2*pi/lat0 in several places, which resulted in an effective 10x weight for the gradient term in spillage. After this change, the same spillage optimization would need to manually set the weight to reproduce previous calculations.
  • a complex phase in the plane-wave explansion in the <mo|jY> calculation is corrected;
  • bugs in the polynomial interpolation in bessel_basis.cpp are fixed
  • removes the usage of ucell via GlobalC and simplifies several function interfaces in numerical_basis

Any changes of core modules? (ignore if not applicable)

No.

@jinzx10 jinzx10 requested a review from kirk0830 April 9, 2024 11:36
@jinzx10 jinzx10 changed the title Fix: Numerically more stable algorithm for jy-jy in orbital generation & unit fix Fix: More accurate algorithm for jy-jy in orbital generation Apr 9, 2024
@jinzx10 jinzx10 changed the title Fix: More accurate algorithm for jy-jy in orbital generation Fix: More accurate algorithm for <jY|jY> in orbital generation Apr 9, 2024
source/module_io/numerical_basis.cpp Outdated Show resolved Hide resolved
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
@jinzx10 jinzx10 requested a review from mohanchen April 10, 2024 09:29
@jinzx10 jinzx10 marked this pull request as draft April 10, 2024 09:34
@jinzx10
Copy link
Collaborator Author

jinzx10 commented Apr 10, 2024

This PR has been converted to a draft since its consequence to subsequent spillage optimization is not fully studied yet. It might be better to merge this PR after sufficient tests on the final orbitals. @kirk0830

@jinzx10 jinzx10 changed the title Fix: More accurate algorithm for <jY|jY> in orbital generation Fix: matrix elements calculations in orbital generation Apr 18, 2024
@jinzx10 jinzx10 changed the title Fix: matrix elements calculations in orbital generation Fix: various matrix elements calculations in orbital generation Apr 19, 2024
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
source/module_io/numerical_basis_jyjy.cpp Outdated Show resolved Hide resolved
source/module_io/test/numerical_basis_test.cpp Outdated Show resolved Hide resolved
source/module_io/test/numerical_basis_test.cpp Outdated Show resolved Hide resolved
@jinzx10 jinzx10 requested a review from mohanchen May 11, 2024 09:23
@jinzx10 jinzx10 marked this pull request as ready for review May 15, 2024 08:22
Copy link
Collaborator

@kirk0830 kirk0830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in bessel_basis is the key of this PR, previous polynomial interpolation is wrongly implemented

@mohanchen mohanchen merged commit 840f0d5 into deepmodeling:develop May 21, 2024
13 checks passed
@jinzx10 jinzx10 deleted the overlap_sq branch May 22, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants