Repository navigation
Fix PW spinor DFT+U occupation-matrix mixing - #8326
Merged
mohanchen merged 4 commits intoNov 24, 2026
Merged
Conversation
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
The copy extent now matches the allocated SOC blocks and the existing saved/restore paths. I found no implementation defect in the inspected diff; one nonblocking cleanup is noted below.
Static review only: no build, runtime tests or CI verification. The reported tests and three-step reproduction were not independently verified.
lanshuyue
marked this pull request as ready for review
November 23, 2026 18:30
mohanchen
approved these changes
Nov 24, 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
Fix #8325
Unit Tests and/or Case Tests for my changes
cmake --build build --target abacus_basic_para -j 4— passed withENABLE_ELPA=OFFbefore this scope adjustment.cmake --build build --target MODULE_ESTATE_occ_matrix MODULE_ESTATE_occ_mixer -j 4— passed.ctest --test-dir build --output-on-failure -R '^MODULE_ESTATE_occ_(mixer|matrix)$'— 2/2 passed after removing the integration case.python3 tools/03_code_analysis/agent_governance_check.py --staged— no findings.git diff --cached --check— passed.python3 tools/03_code_analysis/code_quality_score.py source/source_estate/occ_matrix.cpp source/source_estate/unittests/test_occ_mixer.cpp— 2/2 files passed before this scope adjustment.Manual reproduction for the linked issue: before the fix, a two-Fe PW SOC +U calculation with
mixing_dftu 1produced exactly zero d-shell local moments and zero spin-off-diagonal occupation blocks for both Fe atoms after three SCF steps. With the fix, both local moments were nonzero. These three-step calculations were not converged and are evidence of the mixing-path defect, not converged physical results. No integration case is included in this PR.What's changed?
nspin=4, npol=2, l=2, this is 100 values per correlated atom rather than 25.OccMatMixer::collect() -> write_back()unit regression that checks every position of both 100-value spinor blocks.Governance Notes
mixing_dftualready exists. This PR corrects behavior for an existing option, so no generated INPUT documentation update is needed.OccupationMatrix::write_to_flat()now uses the matrix's allocatednr * nclength. PW mixing receives all Pauli blocks; collinear dimensions are unchanged. LCAO's directmix_plain()path is unchanged.