Skip to content

Fix: Initialize LCAO LDOS DMR independently - #7874

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
AsTonyshment:fix/out_ldos
Aug 28, 2026
Merged

Fix: Initialize LCAO LDOS DMR independently#7874
mohanchen merged 1 commit into
deepmodeling:developfrom
AsTonyshment:fix/out_ldos

Conversation

@AsTonyshment

Copy link
Copy Markdown
Collaborator

What's changed?

  • Initialize the temporary LCAO LDOS DMR directly from Grid_Driver and UnitCell, removing its dependency on the main density matrix DMR lifecycle.
  • Prevent crashes when LDOS is requested after get_pchg or get_wf, where the main DMR is not initialized.
  • Add defensive DensityMatrix::get_DMR_pointer() checks that throw standard exceptions for invalid spin indices or uninitialized DMR storage. (Be aware of "dyzheng play"!!!)

@AsTonyshment
AsTonyshment requested a review from mohanchen August 28, 2026 09:38
@mohanchen mohanchen added Refactor Refactor ABACUS codes Bugs Bugs that only solvable with sufficient knowledge of DFT labels Aug 28, 2026
@mohanchen
mohanchen merged commit 1b3baf0 into deepmodeling:develop Aug 28, 2026
17 checks passed
@AsTonyshment
AsTonyshment deleted the fix/out_ldos branch August 28, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants