Repository navigation
Refactor DFT+U onsite Hamiltonian assembly - #8195
Merged
mohanchen merged 3 commits intoOct 22, 2026
Merged
Conversation
Collaborator
Author
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
Static review of eb03771c, including an independent pass, found no new correctness defects in this extraction. One non-blocking memory-lifetime suggestion is inline. Static governance and whitespace checks passed; builds, numerical/MPI tests, and CI were not independently verified.
mohanchen
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
No linked issue: this is a behavior-preserving maintainability refactor prompted by the code-quality report for
dftu_nao_op.cpp.Unit Tests and/or Case Tests for my changes
cmake --build build --target MODULE_DFTU_op abacus_basic_para -j2OMP_NUM_THREADS=1 ctest --test-dir build --output-on-failure -R '^MODULE_DFTU_op$'OMP_NUM_THREADS=1 ../integrate/Autotest.sh -a <new-binary> -f /tmp/dftu_refactor_cases.txt -n 4 -o 1 -j 1python3 tools/03_code_analysis/code_quality_score.py --format json source/source_lcao/module_dftu/dftu_nao_op.cpppython3 tools/03_code_analysis/agent_governance_check.py --stagedgit diff --checkabacus_basic_paraexecutable compiled successfully.MODULE_DFTU_oppassed (1/1).symmetry=1,kpar=4A/B cases:03_LCAO_DFTU_S2_Z:-6771.69033022 eVwith both binaries.04_LCAO_DFTU_S4_XY:-6763.40685034 eVwith both binaries.CASES_CPU.txtfor convergence/numerical-stability reasons. The A/B comparison confirms this refactor introduces no numerical change.pre-commitwas unavailable in the local environment (pre-commit: command not found). Equivalent staged governance and whitespace checks were run directly.What's changed?
DFTU_onsite::contributeHR()into focused helpers for symmetry decisions, rotation setup, full-BZ k-vector construction, Hubbard-atom accumulation, and spin post-processing.newallocation.Governance Notes