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: Support pseudopotential with dense grid #3678

Merged
merged 8 commits into from
Mar 8, 2024

Conversation

sunliang98
Copy link
Collaborator

@sunliang98 sunliang98 commented Mar 4, 2024

Reminder

  • Have you linked an issue with this 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 #3677

What's changed?

When the radial grid of pseudopotential is too dense, such as 1e-3 in al_lps.cpi, the rhoatm[0] = pow((rhoatm[2] / rhoatm[1]), 1. / (atom->ncpp.r[2] - atom->ncpp.r[1])); (line 362 of module_elecstate/module_charge/charge.cpp) will result in zero, so that the following rhoatm[0] = rhoatm[1] / rhoatm[0] results in infinite.

I have fixed this issue by

  1. combine the line 362 and line 364 of module_elecstate/module_charge/charge.cpp to avoid above issue.
  2. Add a check to rho[0].
  3. Add two integrate tests for LPS (101_PW_lps_pseudopots and 907_OF_LPS).

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

  • Example: I have added a new virtual function in the esolver base class in order to ...

@sunliang98 sunliang98 changed the title Support pseudopotential with dense grid Fix: Support pseudopotential with dense grid Mar 4, 2024
Copy link
Collaborator

@dyzheng dyzheng left a comment

Choose a reason for hiding this comment

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

LGTM

@WHUweiqingzhou
Copy link
Collaborator

@Qianruipku, do you have more comments about this PR?

@Qianruipku Qianruipku merged commit 544dc05 into deepmodeling:develop Mar 8, 2024
11 checks passed
@sunliang98 sunliang98 deleted the lps branch April 11, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Error: xhegvd failed!" when running KSDFT with LPS
4 participants