Describe the bug
While performing band-decomposed (partial) charge density calculations using the PW basis set, I've observed that the charge density integrals are not normalized and are incrementally increasing across bands (using a simple script written by Python attached below). This trend suggests that there might be an issue with array reinitialization in the subsequent computational steps:
$ python3 grid_integral.py
电荷密度积分:band1.cube 1.9999983547907862
电荷密度积分:band2.cube 3.999996709581772
电荷密度积分:band3.cube 5.999995064372504
电荷密度积分:band4.cube 7.999993419163174
电荷密度积分:band5.cube 9.999991773953775
电荷密度积分:band6.cube 11.999990128744749
电荷密度积分:band7.cube 13.999988483535311
电荷密度积分:band8.cube 15.999986838326754
Expected behavior
- For LCAO (one might have to add additional INPUT parameters such as
calculation=get_pchg), the integral values should remain consistent and close to 2. Here's one of my results:
电荷密度积分:BAND1_SPIN0_CHG.cube 1.9999983010347646
电荷密度积分:BAND2_SPIN0_CHG.cube 1.9999983636754213
电荷密度积分:BAND3_SPIN0_CHG.cube 1.9999982713382998
电荷密度积分:BAND4_SPIN0_CHG.cube 1.9999982579638917
- For PW, note the increasing trend in the integral values across bands, which is unexpected and indicates a possible bug.
To Reproduce
Environment Setup
- Input Files: Provided in the attachments, including
INPUT, STRU, and a Python script grid_integral.py.
- Script Functionality:
grid_integral.py is designed to compute the total space integral of charge density from .cube files. A result close to 2 is expected when nspin=1.
Steps to Reproduce
- Run ABACUS using the provided
INPUT and STRU files.
- Execute the
grid_integral.py script to calculate the charge density integrals.
Input files.zip
Environment
No response
Additional Context
I suspect that this bug was introduced in PR #3501. I plan to fix it along with PR #3934.
Task list for Issue attackers (only for developers)
Describe the bug
While performing band-decomposed (partial) charge density calculations using the PW basis set, I've observed that the charge density integrals are not normalized and are incrementally increasing across bands (using a simple script written by Python attached below). This trend suggests that there might be an issue with array reinitialization in the subsequent computational steps:
Expected behavior
calculation=get_pchg), the integral values should remain consistent and close to2. Here's one of my results:To Reproduce
Environment Setup
INPUT,STRU, and a Python scriptgrid_integral.py.grid_integral.pyis designed to compute the total space integral of charge density from.cubefiles. A result close to2is expected whennspin=1.Steps to Reproduce
INPUTandSTRUfiles.grid_integral.pyscript to calculate the charge density integrals.Input files.zip
Environment
No response
Additional Context
I suspect that this bug was introduced in PR #3501. I plan to fix it along with PR #3934.
Task list for Issue attackers (only for developers)