Skip to content

Fix: Add a threshold to avoid E_gap(k)=0 for insulators#6802

Merged
mohanchen merged 1 commit intodeepmodeling:developfrom
LKFEIYI:develop
Dec 23, 2025
Merged

Fix: Add a threshold to avoid E_gap(k)=0 for insulators#6802
mohanchen merged 1 commit intodeepmodeling:developfrom
LKFEIYI:develop

Conversation

@LKFEIYI
Copy link

@LKFEIYI LKFEIYI commented Dec 23, 2025

This PR is trying to fix an issue in cal_bandgap and cal_bandgap_updw where the bandgap of insulators (e.g., NaCl) was calculated as 0.0 eV. The threshold of 1e-5 is the value implemented in the old method in ABACUS-LTS.

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 #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

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 ...

This PR fixes a logic issue in cal_bandgap and cal_bandgap_updw where the bandgap of insulators (e.g., NaCl) was calculated as 0.0 eV.
@mohanchen mohanchen added Refactor Refactor ABACUS codes Input&Output Suitable for coders without knowing too many DFT details labels Dec 23, 2025
@mohanchen
Copy link
Collaborator

Thanks for your contribution. The PR LGTM.

@mohanchen mohanchen merged commit a1f2685 into deepmodeling:develop Dec 23, 2025
14 checks passed
@Cstandardlib Cstandardlib mentioned this pull request Jan 27, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants