Skip to content

Fix: revert #7664 $m_y$ convention - #7832

Merged
mohanchen merged 7 commits into
deepmodeling:developfrom
maki49:develop
Sep 1, 2026
Merged

mohanchen merged 7 commits into
deepmodeling:developfrom
maki49:develop

Conversation

@maki49

@maki49 maki49 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Fix #7831 induced by #7664.
The fix in #7804 works for NiO (z-collinear AFM) but not work for Mn3Sn (in-plane 120° AFM). It is also reverted in this PR.

@maki49
maki49 requested review from dyzheng and a lite review from Copilot August 18, 2026 06:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the $m_y$ (spin-density y component) convention change introduced in #7664 to fix the regression reported in #7831, restoring correct behavior for in-plane non-collinear magnetic moments (e.g., Mn3Sn 120° AFM) while removing the downstream symmetrization workaround that was added to match the prior convention.

Changes:

  • Flip the extracted rho_y sign in DensityMatrix_Tools::func_xyz_to_updown specializations to account for the conjugated DM storage layout.
  • Remove the y-channel handedness workaround (yflip) in nspin=4 spin-density symmetrization so spin_so3() is applied directly again.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
source/source_estate/module_dm/density_matrix.cpp Reverts the rho_y extraction sign in Pauli decomposition to match conjugated DM storage and fix non-collinear magnetization regressions.
source/source_estate/module_charge/symm_rhog.cpp Removes the yflip compensation so spin-density symmetrization uses the physical pseudovector rotation (spin_so3) directly.
Suppressed comments (1)

source/source_estate/module_dm/density_matrix.cpp:664

  • The trailing formula comment is misleading: this line computes Im(tmp[ud]) - Im(tmp[du]) for the stored block (which your comment says is conj(P)). In terms of the physical 1-RDM P, that corresponds to -Im(P_ud) + Im(P_du), not Im(P_ud) - Im(P_du). Please adjust the comment to match the actual convention (and clarify whether tmp is DM=conj(P) vs P).
    target_DMR_mat[icol + step_trace[2]] = tmp[1].imag() - tmp[2].imag();  // rho_y = Im(P_updown) - Im(P_downup)
    target_DMR_mat[icol + step_trace[3]] = tmp[0].real() - tmp[3].real();  // rho_z = (rho_upup - rho_downdown).real()

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread source/source_estate/module_dm/density_matrix.cpp Outdated
Comment thread source/source_estate/module_dm/density_matrix.cpp
@dyzheng

dyzheng commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

1. Summary

The PR reverts the rho_y (m_y) sign flip that PR #7664 introduced in the
spinor-to-Pauli density-matrix conversion (func_xyz_to_updown), removes the
compensating yflip conjugation patch that PR #7804 added to the SOC grid
symmetrization (symm_rhog.cpp), restores three nspin=4 reference results to
their pre-#7664 values, and adds a magnetization round-trip unit test.

The core diagnosis is correct and well supported. cal_dm_psi.cpp stores
the complex conjugate of the physical 1-RDM

// cal_dm_psi.cpp: dm(iw1,iw2) = sum_ib wfc(ib,iw1).T * wg * wfc(ib,iw2).conj()
//                i.e. DMK(μ,ν) = Σ wg C*_{μ,ib} C_{ν,ib} = (C f C†)^T = conj(P)

For a stored block D = conj(P) the magnetization components are

m_x = Re(D_ud) + Re(D_du)             (conjugation-invariant)
m_y = Im(D_ud) - Im(D_du)             (bare formula, correct)
m_z = Re(D_uu) - Re(D_dd)             (conjugation-invariant)

The "bare" formula is the only one that recovers the true m_y of the spinor;
the #7664 formula -Im(D_ud)+Im(D_du) returns -m_y for every spinor.
m_x and m_z read only real parts and are unaffected — which is why only the
transverse (y) channel is broken. I verified this numerically on concrete
spinors (pure +y/−y, in-plane 120°-like, and generic 3D directions) using the
exact cal_dm_psi storage convention; the result agrees with the new
round-trip test.

A decisive cross-check: the PW path builds rho[2] directly from the spinor
wavefunctions (elecstate_op.cpp):

rho[2][ir] += w1 * 2.0 * (up.real()*dn.imag() - dn.real()*up.imag());  // = +m_y

i.e. the PW path always uses the bare/physical sign. Pre-#7664 the LCAO path
agreed with the PW path; post-#7664 they disagree for identical spinors. This
LCAO-vs-PW inconsistency is unambiguous and is fixed by this PR.

The PR is nevertheless incomplete. It reverts only the DM/charge-density
leg of #7664. Other #7664 changes that encode the same wrong convention remain
in the tree (DeltaSpin pauli_to_moment / cal_coeff_lambda and the unit test
that pins them), a pre-existing Mulliken M_y bug is left in place, and the
#7804 symmetry unit test is not reconciled with the revert. These are detailed
in Section 4.

2. What the PR changes

File Change
source/source_estate/module_dm/density_matrix.cpp Both func_xyz_to_updown specializations: rho_y back to the bare formula (Im(ud)-Im(du) / -i*(ud-du)); comment documents the conj(P) storage invariant (issue #7831).
source/source_estate/module_charge/symm_rhog.cpp Removes the #7804 yflip (S=diag(1,-1,1) conjugation) from psymmg_soc; wspin is again the plain spin_so3(gmatc).
source/source_estate/module_dm/test/test_soc_magnetization_roundtrip.cpp New unit test: builds the 4-element spinor DM block exactly as cal_dm_psi does (conj(c_a)*c_b) and asserts that func_xyz_to_updown recovers the physical (m_x,m_y,m_z) for five directions with nonzero transverse components, including pure ±y.
source/source_estate/module_dm/test/CMakeLists.txt Registers MODULE_ESTATE_dm_soc_magnetization_roundtrip_test.
tests/03_NAO_multik/scf_angle_spin4/result.ref Restored to pre-#7664: etot -6267.4651896196382950, force 0.000000, stress 3912.920437.
tests/03_NAO_multik/scf_out_dos_spin4/result.ref Restored to pre-#7664: etot -1964.0663947982770878, force 0.162158, stress 1877.059089.
tests/03_NAO_multik/scf_u_spin4/result.ref Restored to pre-#7664: etot -6789.2816406266510967, force 11.331534, stress 4697.832232.

3. What the PR correctly keeps (do NOT revert)

4. What still needs to be changed

4.1 DeltaSpin still uses the #7664 (wrong) y-convention — must be fixed

4.2 Mulliken output M_y is a pre-existing bug (separate, but track it)

4.3 The #7804 symmetry unit test is not reconciled

4.4 References: regenerated vs. reverted

4.5 Test coverage gaps

  • The round-trip test covers only the <double> specialization; the
    <complex> (multi-k) specialization is changed identically but untested.
    Extend the test to the complex case.
  • There is no integration regression test for the actual #7664 destroys the y-component of magnetic moment #7831 scenario
    (in-plane non-collinear AFM with symmetry enabled). The unit test pins the
    extraction but not the symmetry path; a case with nonzero in-plane moments
    (Mn3Sn-like) would directly pin the yflip removal.
  • The test comment references ref/MSG/2026-08-#7664-..., which does not exist
    in the repository — either add the design note or drop the reference.

4.6 Restart / DM I/O compatibility (minor)

5. Suggested follow-up checklist

  1. Revert DeltaSpin pauli_to_moment, cal_coeff_lambda, and
    deltaspin_core_test.cpp to the bare convention; add an nspin=4 DeltaSpin
    regression test with a nonzero m_y target.
  2. Update symmetry_rho_soc_test.cpp to the bare convention and make it
    exercise the real functions.
  3. Fix the Mulliken M_y sign (separate PR or included) and add a unit test.
  4. Regenerate/verify the three nspin=4 references plus 099_PW_DJ_SO and
    report the exact test output in the PR body.
  5. Extend the round-trip test to the <complex> specialization and add an
    in-plane non-collinear symmetry regression test.
  6. Resolve the dangling doc reference and the DMR restart-compatibility
    question.

6. Verdict

Directionally correct and worth merging as a partial fix, but recommend
"changes requested" until at least §4.1 (DeltaSpin) and §4.3 (symmetry test)
are addressed in this PR or a directly linked follow-up. As-is, the PR fixes
the LCAO↔PW rho_y inconsistency that #7664 introduced but leaves the
DeltaSpin path and the Mulliken output on the opposite (wrong) sign, so the
codebase would still be internally inconsistent in the transverse channel.

maki49 added a commit to maki49/abacus-develop that referenced this pull request Aug 18, 2026
Follow-up to deepmodeling#7832 (revert deepmodeling#7664 m_y convention) addressing review feedback.

DeltaSpin (was left in the deepmodeling#7664 y-convention while the DM was reverted):
- dspin_lcao.cpp cal_coeff_lambda: revert to lambda_ud = lambda_x + i*lambda_y.
  pauli_to_moment already reads the bare +Im (via deepmodeling#7748) and measures the
  physical +m_y from the conj-first occupation; deepmodeling#7664 flipped both the
  measurement and this drive (y-mirror), deepmodeling#7748 reverted only the measurement,
  so the constraint loop was driving the y-mirror of the target. Restoring the
  pre-deepmodeling#7664 drive re-pairs it with the (correct) measurement.
- spin_constrain.h/.cpp: fix stale comments (occ is conj-first; My=+Im).
- deltaspin_core_test.cpp: local re-impl and GeneralCase pinned My=-0.4
  (deepmodeling#7664); corrected to the bare +0.4 so it stops enshrining the wrong sign.

Tests:
- test_soc_magnetization_roundtrip: add the <complex> (multi-k) specialization
  case; drop the dangling ref/MSG doc path from the comment.
- symm_rho_soc_test: relabel SpinConventionCoupling — it validates spin_so3 in
  the PHYSICAL-rho frame, not the runtime conj-first DM path; note it does not
  pin the DM convention.

Mulliken:
- output_mulliken.cpp: comment flagging that M_y (pre-existing, since 3.7.0)
  likely reports -m_y from the conj-first DM and must not be used as an oracle
  for the DM convention; real fix + unit test deferred to a separate PR.

Not covered here (need integration runs / separate PR): regenerate & report
the nspin=4 reference values from post-PR code; nspin=4 DeltaSpin regression
with nonzero m_y target; in-plane non-collinear symmetry integration test;
nspin=4 DMR restart compatibility with deepmodeling#7664-era files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maki49

maki49 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

@dyzheng Thanks for the suggestions. I've fixed the $m_y$ convention in DeltaSpin and updated the symmetry test to call the real function.

@mohanchen mohanchen added collinear/non-collinear/SOC/delta-spin Issues related to SOC Refactor Refactor ABACUS codes labels Aug 19, 2026
maki49 and others added 5 commits August 27, 2026 07:13
Fix comment

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
These nspin=4 LCAO references were updated by deepmodeling#7664 (1457e26) to match its
m_y sign convention in func_xyz_to_updown, which sign-flips the transverse
magnetization (the stored DM block is conj(P); m_y reads Im so it flips).
Commit fa8492f reverts that convention and restores the correct pre-deepmodeling#7664
physics (verified: Mn3Sn recovers the 120-deg AFM ground state, lower energy).

scf_u_spin4 (mag[111]+U): force 14.360->11.332, stress 4334.0->4697.8,
etot -6789.142->-6789.282 (the deepmodeling#7664 bug raised the energy by ~0.14 eV).
scf_out_dos_spin4 / scf_angle_spin4: tiny (1e-4) reverts, near-collinear.
099_PW_DJ_SO left unchanged (PW path, not affected by the LCAO fix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Guards the func_xyz_to_updown m_y convention against the deepmodeling#7664 regression.
Asserts the physical invariant: the magnetization <sigma> encoded in a DM
spinor block (built with cal_dm_psi's convention DM=conj(P)) is recovered
with the correct sign in ALL THREE components by func_xyz_to_updown. The
m_y channel (Im) is the sensitive one; m_x/m_z (Re) are conj-invariant.
Fails on the deepmodeling#7664 convention (m_y sign-flipped), passes after the fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up to deepmodeling#7832 (revert deepmodeling#7664 m_y convention) addressing review feedback.

DeltaSpin (was left in the deepmodeling#7664 y-convention while the DM was reverted):
- dspin_lcao.cpp cal_coeff_lambda: revert to lambda_ud = lambda_x + i*lambda_y.
  pauli_to_moment already reads the bare +Im (via deepmodeling#7748) and measures the
  physical +m_y from the conj-first occupation; deepmodeling#7664 flipped both the
  measurement and this drive (y-mirror), deepmodeling#7748 reverted only the measurement,
  so the constraint loop was driving the y-mirror of the target. Restoring the
  pre-deepmodeling#7664 drive re-pairs it with the (correct) measurement.
- spin_constrain.h/.cpp: fix stale comments (occ is conj-first; My=+Im).
- deltaspin_core_test.cpp: local re-impl and GeneralCase pinned My=-0.4
  (deepmodeling#7664); corrected to the bare +0.4 so it stops enshrining the wrong sign.

Tests:
- test_soc_magnetization_roundtrip: add the <complex> (multi-k) specialization
  case; drop the dangling ref/MSG doc path from the comment.
- symm_rho_soc_test: relabel SpinConventionCoupling — it validates spin_so3 in
  the PHYSICAL-rho frame, not the runtime conj-first DM path; note it does not
  pin the DM convention.

Mulliken:
- output_mulliken.cpp: comment flagging that M_y (pre-existing, since 3.7.0)
  likely reports -m_y from the conj-first DM and must not be used as an oracle
  for the DM convention; real fix + unit test deferred to a separate PR.

Not covered here (need integration runs / separate PR): regenerate & report
the nspin=4 reference values from post-PR code; nspin=4 DeltaSpin regression
with nonzero m_y target; in-plane non-collinear symmetry integration test;
nspin=4 DMR restart compatibility with deepmodeling#7664-era files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…updown

Replaces the local Pauli re-implementation with the actual
elecstate::DensityMatrix_Tools::func_xyz_to_updown, fed the conj-first stored
DM block (DM=conj(P)) exactly as the runtime does, and asserts (a) it recovers
the physical magnetization and (b) spin_so3 (the rotation psymmg_soc applies to
the grid) agrees with the SU(2) block rotation + real extraction. The two
conventions can no longer drift apart silently; the test fails on the deepmodeling#7664
m_y flip. Links density_matrix.cpp only (no io/mocks needed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mohanchen
mohanchen merged commit f29968d into deepmodeling:develop Sep 1, 2026
17 checks passed
aboys-cb pushed a commit to MagTheoryLab/abacus-develop that referenced this pull request Sep 1, 2026
Follow-up to deepmodeling#7832 (revert deepmodeling#7664 m_y convention) addressing review feedback.

DeltaSpin (was left in the deepmodeling#7664 y-convention while the DM was reverted):
- dspin_lcao.cpp cal_coeff_lambda: revert to lambda_ud = lambda_x + i*lambda_y.
  pauli_to_moment already reads the bare +Im (via deepmodeling#7748) and measures the
  physical +m_y from the conj-first occupation; deepmodeling#7664 flipped both the
  measurement and this drive (y-mirror), deepmodeling#7748 reverted only the measurement,
  so the constraint loop was driving the y-mirror of the target. Restoring the
  pre-deepmodeling#7664 drive re-pairs it with the (correct) measurement.
- spin_constrain.h/.cpp: fix stale comments (occ is conj-first; My=+Im).
- deltaspin_core_test.cpp: local re-impl and GeneralCase pinned My=-0.4
  (deepmodeling#7664); corrected to the bare +0.4 so it stops enshrining the wrong sign.

Tests:
- test_soc_magnetization_roundtrip: add the <complex> (multi-k) specialization
  case; drop the dangling ref/MSG doc path from the comment.
- symm_rho_soc_test: relabel SpinConventionCoupling — it validates spin_so3 in
  the PHYSICAL-rho frame, not the runtime conj-first DM path; note it does not
  pin the DM convention.

Mulliken:
- output_mulliken.cpp: comment flagging that M_y (pre-existing, since 3.7.0)
  likely reports -m_y from the conj-first DM and must not be used as an oracle
  for the DM convention; real fix + unit test deferred to a separate PR.

Not covered here (need integration runs / separate PR): regenerate & report
the nspin=4 reference values from post-PR code; nspin=4 DeltaSpin regression
with nonzero m_y target; in-plane non-collinear symmetry integration test;
nspin=4 DMR restart compatibility with deepmodeling#7664-era files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dyzheng pushed a commit to dyzheng/abacus-develop that referenced this pull request Sep 20, 2026
- Regenerate 240_NO_KP_15_SO_FD, 260_NO_DJ_PK_PU_SO_4K, 260_NO_DJ_PK_PU_AFM_URAMPING_MUL and 05_rtTDDFT/18_NO_hyb_TDDFT under the reverted (correct) convention.
- 260_NO_DJ_PK_PU_SO_4K: smearing_sigma 0.01 -> 0.05 and scf_nmax 50 -> 100 so the Fe DFT+U+SOC SCF converges (0.01 was a limit cycle).
- Remove 260_NO_DJ_PK_PU_SO_4K_MUL (T6): its m_y check uses the Mulliken M_y as an oracle, which output_mulliken.cpp (deepmodeling#7832) documents as suspect ("likely yields -m_y"); it only passed under the wrong sign, where both the rho-cell and Mulliken m_y were -m_y.
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request Sep 24, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request Sep 26, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request Sep 27, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request Sep 27, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking pushed a commit to AroundPeking/abacus-develop that referenced this pull request Sep 29, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking added a commit to AroundPeking/abacus-develop that referenced this pull request Sep 29, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
AroundPeking added a commit to AroundPeking/abacus-develop that referenced this pull request Sep 30, 2026
Port deepmodeling/abacus-develop PR deepmodeling#7832 (f29968d)
onto the magnetic LibRPA producer baseline. Correct both density-extraction
templates and the DeltaSpin driving field. Include the prerequisite deepmodeling#7748
pauli_to_moment sign correction absent from this older baseline.

Preserve the existing cubic and hexagonal spin-rotation tests and LibRPA
exports. Adapt the upstream physical-spinor tests to the legacy filenames;
make the DeltaSpin unit test call the production measurement helper.
The old baseline has no deepmodeling#7804 yflip rotation compensation to remove.

Validation on dongfang: release MPI build, 84 C++ cases in 14 CTest targets,
12 ABF Python tests, and all three deepmodeling#7832 integration references passed with
unchanged acceptance thresholds. Separate material comparisons are retained
in workspace/symmetry/runs/20260919-abacus-msg-upstream-r1 in the GW topic.

(cherry picked from commit f29968d)
(cherry picked from commit 07d0470b1610eb44b7b6cb4a8009229f3b8b6e0f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

collinear/non-collinear/SOC/delta-spin Issues related to SOC Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#7664 destroys the y-component of magnetic moment

4 participants