Skip to content

Fix(gint): remove extra conjugation in noncollinear Hamiltonian assembly - #8183

Merged
mohanchen merged 4 commits into
deepmodeling:developfrom
zjdai:fix/8121-noncollinear-gint
Oct 23, 2026
Merged

mohanchen merged 4 commits into
deepmodeling:developfrom
zjdai:fix/8121-noncollinear-gint

Conversation

@zjdai

@zjdai zjdai commented Oct 20, 2026 •

Copy link
Copy Markdown

Noncollinear states with a transverse y component can converge while reverse spatial-block assembly violates full spinor Hermiticity. The production fix removes the extra conjugation in ModuleGint::merge_hr_part_to_hR.

Linked Issue

Fixes #8121

What's changed?

Retain the one-assignment Gint correction and add two compact O2 SCF regressions, scf_nspin4_nsoc_hr and scf_nspin4_soc_hr. Both use the existing O fully relativistic pseudopotential and minimal 1s1p orbitals, an 18-bohr cell, a 2.3-bohr bond, Gamma 1x1x1, PBE/LCAO, 15 Ry, scf_thr=1e-7, scf_nmax=50, xy initial moments and no DeltaSpin constraint.

Each case includes complete raw 16x16 H(R)/S(R) references at R=0 and uses the existing matrix comparator without changing its tolerances. Only the two case directories and their CASES_CPU.txt entries are added; no archive or duplicated PP/orbital data is included.

Unit Tests and/or Case Tests for my changes

Fresh runs with the GNU 11.4 and IntelLLVM 2025.3 builds exercised both final cases twice, using four MPI ranks and one OpenMP thread. All eight SCF calculations converged in 34/35 steps and passed the existing H/S comparisons. Cross-build maximum H differences are about 1.00e-13 Ry; the sparse positions match. Program calculation time is 1.05-1.65 s per case locally, or 4.18-5.03 s including MPI and other external overhead.

The unfixed parent converges for both inputs but fails both H comparisons, with errors about 1.97e-2 Ry; S comparisons pass. References are byte copies of the corrected build's raw converged SCF outputs, without projections, averaging or truncation.

The GitHub OpenMPI/OpenBLAS CPU integration and unit-test job also passed for commit d0442d4. Both new cases executed with four MPI ranks and one OpenMP thread and passed the existing H(R), S(R), total-energy and energy-per-atom comparisons: NSOC took 4.137 s and SOC took 4.202 s. CPU CI log.

Governance Notes

I have read AGENTS.md and docs/developers_guide/agent_governance.md. No documentation update required: INPUT interfaces and output formats are unchanged, and each fixture has a short README. These compact parameters protect the assembly regression; they do not certify material-property convergence or all SCF endpoint covariance relations.

Transpose the reverse atom-pair block without conjugating its coefficients
while the spin indices are fixed. The opposite spin block already carries
the conjugate Pauli coefficients. The extra conjugation reverses the By
contribution and breaks full spinor Hermiticity.

Correct the adjacent comment to distinguish the spatial transpose from the
Hermitian adjoint of the full spinor matrix.

Fixes deepmodeling#8121
@zjdai
zjdai force-pushed the fix/8121-noncollinear-gint branch from 72e3fc2 to f290f28 Compare October 20, 2026 05:31

@mohanchen mohanchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your fix!

Comment thread source/source_hamilt/module_gint/gint_common.cpp
@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes labels Oct 21, 2026
Comment thread tests/03_NAO_multik/gint_noncollinear_covariance/cases/xy_nosoc/hrs1_nao.csr.ref Outdated
Comment thread tests/03_NAO_multik/gint_noncollinear_covariance/cases/xy_nosoc/INPUT Outdated
@zjdai
zjdai force-pushed the fix/8121-noncollinear-gint branch from 20e3910 to f290f28 Compare October 21, 2026 06:05
@zjdai

zjdai commented Oct 21, 2026

Copy link
Copy Markdown
Author

Added the reviewed compact O2 cases in c085dde:

  • tests/03_NAO_multik/scf_nspin4_nsoc_hr
  • tests/03_NAO_multik/scf_nspin4_soc_hr

Download the exact reviewed ZIP (10,257 bytes). The archive is included in the commit; PP/orbital resources are reused from the repository.

The existing collector passes both fixed-build H/S references and detects the pre-fix H errors. The PR description now records the rotation diagnostics and the remaining difference between the NSOC last-SCF Hamiltonian and the Hamiltonian rebuilt from the final converged density; it does not claim that all SCF endpoint covariance checks passed.

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Static review of 3e557eef16a3 supports the spatial-transpose correction in merge_hr_part_to_hR; independent direct-quadrature checks reproduce the old B_y Hermiticity error.

Non-blocking follow-up to the existing test discussion: please include the focused replacement regression, or demonstrate a retained case that fails with the old conjugation, with exact commands/results.

No ABACUS build, MPI/GPU runtime, or SCF validation was performed.

@mohanchen mohanchen added Collinear/non-collinear/SOC/delta-spin Issues related to SOC Tests/Examples Issues/PR related to unit tests and integrate tests labels Oct 23, 2026
@mohanchen
mohanchen merged commit 31dfdd9 into deepmodeling:develop Oct 23, 2026
20 checks passed
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 Collinear/non-collinear/SOC/delta-spin Issues related to SOC Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-Hermitian and non-covariant H(R) output in ABACUS v3.11.0-beta10

3 participants