Repository navigation
Conversation
16 tasks
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
force-pushed
the
fix/8121-noncollinear-gint
branch
from
October 20, 2026 05:31
72e3fc2 to
f290f28
Compare
mohanchen
reviewed
Oct 21, 2026
Collaborator
There was a problem hiding this comment.
Thanks for your fix! However, we should have a test! Either unittest or integrate test is OK.
mohanchen
reviewed
Oct 21, 2026
| basis_type lcao | ||
| ks_solver scalapack_gvx | ||
| dft_functional pbe | ||
| ecutwfc 60 |
Collaborator
There was a problem hiding this comment.
maybe consider lowering the ecut
zjdai
force-pushed
the
fix/8121-noncollinear-gint
branch
from
October 21, 2026 06:05
20e3910 to
f290f28
Compare
Author
|
Added the reviewed compact O2 cases in c085dde:
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. |
This branch has not been deployed
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.
Noncollinear states with a transverse y component can converge while the completed full Hamiltonian is non-Hermitian. This PR removes the extra conjugation in reverse spatial-block assembly and adds two compact O2 regression cases with complete raw H(R)/S(R) references.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.Linked Issue
Fixes #8121
What's changed?
In
ModuleGint::merge_hr_part_to_hR, exchanging spatial indices while keeping spin indices fixed requires a spatial transpose at the opposite translation. Full spinor Hermiticity also exchanges spin indices;Bx - i ByandBx + i Byalready supply the conjugate relationship. Applying an additionalstd::conjwithin a fixed spin block incorrectly reverses the imaginary sign.The production change remains one assignment and its explanatory comment. It corrects Hamiltonian assembly, including exported H(R). There are no INPUT interface, output-format, dependency or global-state changes.
The two new flat cases are registered in
tests/03_NAO_multik/CASES_CPU.txt:scf_nspin4_nsoc_hrscf_nspin4_soc_hrBoth use an O2 molecule in a 20-bohr cubic cell, a 2.3-bohr bond, the existing fully relativistic O pseudopotential and minimal 1s1p orbital file, PBE/LCAO, 20 Ry, Gamma 1x1x1,
gamma_only 0,nspin 4, initial moments(1/sqrt(2),1/sqrt(2),0)per atom, Pulay mixing 0.4 andmixing_gg0 3.0. They perform full SCF withscf_thr 1e-6andscf_nmax 50; no DeltaSpin constraint is enabled.lspinorbdistinguishes the two cases.The existing full-matrix comparison machinery is unchanged. References are the original complex 16x16 CSR outputs, with no Hermitian projection, symmetry averaging, rotation, energy alignment or numerical truncation beyond ABACUS output precision. Only R=0 is present; these cases do not test intercell Bloch phases. Pseudopotential and orbital files are reused from
tests/PP_ORB.Verification
At production commit
f290f285(four MPI ranks,OMP_NUM_THREADS=1):(1.41421,1.41421,0)and(1.41411,1.41411,0)muB per cell.6.3e-15eV. H+S references total 26,287 bytes across both cases.ffc4d0d3converges but fails H comparison, with maximum raw H differences of 0.265885/0.268983 eV; S is unchanged. A fresh collector check using the final case names reproduced these outcomes without changing comparison tolerances.blank-at-eofexcluded passes.Exact local commands included:
The
reports/commands are local validation records, not additional files in this PR. No new C++ build was required for this fixture-only commit; the numerical runs used the already-built fix and parent executables. Upstream CI is separate from these local results.Additional covariance evidence and limitation
Separate local diagnostics checked each structure's finite magnetic group (16 operations for z moments, 8 for xy moments, including antiunitary operations) and the appropriate rotation relations.
1.95e-7eV after the fix versus0.268983eV before it. A spin-only z-to-xy rotation of the unchanged molecule is not a SOC symmetry.7.48e-11eV after the fix versus0.294177eV before it. These are fixed-density NSCF diagnostics, not additional SCF convergence claims.6.51e-4eV atscf_thr=1e-6, and0.02414eV in a separate1e-9diagnostic. Final densities and final effective potentials rotate consistently; the discrepancy lies between the retained last-diagonalization H and H rebuilt from the final density, primarily in the xy run. The last input potential was not directly sampled, so a specific threshold mechanism is not established. The reconstruction does not replace the original SCF references or count this residual as a pass.9.67e-5eV difference remains in the affected reverse opposite-spin block. Nonzero local transverse magnetization persists even when its cell integral vanishes.The compact cases protect the assembly regression; this PR does not claim that every SCF endpoint covariance check or every material is certified.
Downloadable case package
Download
pr8183_o2_hr_tests.zip(10,257 bytes; 15 entries: the two cases and the case-list snapshot).SHA256:
0fb04adc290246a3cea07ee658f781e092c4fcab6bfc95039eb9e8f4ba60951f.The archive is also tracked beside the cases for review convenience; it is not registered as a test. It contains exactly the reviewed files and no program binaries, logs, duplicated PP/orbital resources, or diagnostic cube files.
Governance Notes