Repository navigation
test: cover nonzero Mx My Mz in spin4 Mulliken integration - #8284
Merged
Merged
Conversation
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
The signed Mulliken comparison is sensitive to a My sign reversal with these nonzero components.
Non-blocking: Please add the exact test command and source revisions or binary identities for the corrected and pre-fix runs so the reported comparison can be reproduced.
Static review of 35c27ffb; no builds or tests were run.
mohanchen
approved these changes
Nov 5, 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 new issue is required. This PR adds regression coverage for the noncollinear Mulliken
Mysign correction in #8250.Unit Tests and/or Case Tests for my changes
Test case:
tests/03_NAO_multik/scf_out_mul_spin4Verification: The updated integration test was evaluated using both corrected and pre-fix CPU ABACUS binaries (4 MPI ranks, 1 OpenMP thread).
Runner invocation pattern:
Autotest.sh -a ${ABACUS_BIN_PATH} -n 4 -j auto(the integration-test runner; exact executed command lines and resolved binary paths from the original runs were not retained in the available test record). The source commit and binary identity for each of the two runs still need to be recorded for exact reproduction. The test-only change in this PR is commit35c27ffb70398da1f60c8a2f2df27f08475087a3; the production fix is tracked in #8250. These are not substitutes for the two tested binary revisions.Myreference mismatch (exit code 1)Both versions converged in SCF, but only the corrected version reproduced the expected Mulliken magnetization components. This confirms that the updated test detects the original
Mysign error, rather than merely checking SCF convergence.The existing test is already registered in both
CASES_CPU.txtandCASES_GPU.txt; no case-list changes are required.What's changed?
Background
The noncollinear (
nspin=4) Mulliken magnetization contains three Cartesian components:Mx,My, andMz.The previous
Mysign error arose from the density-matrix convention used in the Mulliken magnetization calculation and was corrected in #8250.However, the existing
scf_out_mul_spin4integration test initialized Fe magnetic moments along opposite x directions. Consequently,Mywas approximately zero, making the test insensitive to a sign reversal of the y component. The test could pass even if the original bug were reintroduced.Changes
This PR strengthens the existing integration test by rotating the initial Fe magnetic moments from opposite [100] directions to opposite [111] directions. The updated reference Mulliken moments have nonzero components along all three axes:
(+0.6911, +0.6911, +0.6911) μB(-0.6911, -0.6911, -0.6911) μBThree existing test files are updated:
tests/03_NAO_multik/scf_out_mul_spin4/STRU: change the initial magnetic-moment orientations while preserving the existing calculation setup.tests/03_NAO_multik/scf_out_mul_spin4/mulliken.txt.ref: update reference Mulliken outputs for nonzeroMx,My, andMz.tests/03_NAO_multik/scf_out_mul_spin4/result.ref: update the magnetic point-group reference fromC_4htoS_6for the rotated configuration. Known test-runner limitation: the currentAutotest.sh::check_outnumeric comparison does not enforce string equality for this label. TheS_6reference documents the expected output but should not be considered a verified string assertion. The signed Mulliken component checks are separate and do detect the originalMyregression.No new test directory, INPUT parameters, production source code, or CI configuration changes are introduced.
Regression Validation
The corrected implementation converges and passes the reference checks. The pre-fix implementation also converges, but fails the
Mycomparison due to the incorrect sign.Thus, the test provides regression coverage for the previously fixed
Mybug while retaining checks onMxandMz.Governance Notes