abacus-develop icon indicating copy to clipboard operation
abacus-develop copied to clipboard

Something wrong with reading charge density file in nscf calculations

Open ErjieWu opened this issue 3 months ago • 2 comments

Describe the bug

When I set calculation=nscf, even if the ABACUS-CHARGE-DENSITY.restart file exist in OUT.ABACUS, the programme cannot read it and throw a warning:

Image

There must be something wrong here.

Expected behavior

No response

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • [ ] Verify the issue is not a duplicate.
  • [ ] Describe the bug.
  • [ ] Steps to reproduce.
  • [ ] Expected behavior.
  • [ ] Error message.
  • [ ] Environment details.
  • [ ] Additional context.
  • [ ] Assign a priority level (low, medium, high, urgent).
  • [ ] Assign the issue to a team member.
  • [ ] Label the issue with relevant tags.
  • [ ] Identify possible related issues.
  • [ ] Create a unit test or automated test to reproduce the bug (if applicable).
  • [ ] Fix the bug.
  • [ ] Test the fix.
  • [ ] Update documentation (if necessary).
  • [ ] Close the issue and inform the reporter (if applicable).

ErjieWu avatar Oct 30 '25 09:10 ErjieWu

I found that this will happens when setting different gamma_only value settings. (Running scf first to generate ABACUS-CHARGE-DENSITY.restart file and then nscf, K point is set to gamma for gamma_only=0)

Image

And it is caused by code in source/source_io/rhog_io.cpp line 52-58:

Image

ErjieWu avatar Oct 31 '25 08:10 ErjieWu

Yes, as far as I know, this is a known problem of the function read_rhog. This would be triggered as long as a gamma-only calculation is queried.

kirk0830 avatar Nov 06 '25 01:11 kirk0830