System displacement can cause force calculation errors
Describe the bug
During my tests on the CO molecule, I found that if the entire molecule undergoes a displacement, the resulting force differs significantly. This seems absurd to me. Molecular structure (before and after displacement):
Forces in MD_dump(before and after displacement)
Since CO is a linear molecule aligned along the z-axis, no forces should be generated in the xy directions. Clearly, the latter results contain errors.
Expected behavior
No response
To Reproduce
Use my input files to reproduce
ABACUS version: commit f16364d (latest version for now)
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).
I used a vacuum layer significantly larger than the orbital cutoff radius, which should effectively prevent any interactions between atoms in neighboring unit cells.