Repository navigation
Fix(gint): remove extra conjugation in noncollinear Hamiltonian assembly #8183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mohanchen
merged 4 commits into
deepmodeling:develop
from
zjdai:fix/8121-noncollinear-gint
Oct 23, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f290f28
Fix(gint): remove extra conjugation in noncollinear Hamiltonian assembly
zjdai c085dde
Test(lcao): add compact O2 nspin4 Hamiltonian regressions
zjdai 3e557ee
test: withdraw platform-sensitive O2 Hamiltonian fixtures
zjdai d0442d4
test(lcao): add compact reproducible O2 spinor Hamiltonian cases
zjdai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,3 +69,5 @@ get_pchg_k | |
| get_s | ||
| scf_deltaspin2 | ||
| scf_deltaspin4 | ||
| scf_nspin4_nsoc_hr | ||
| scf_nspin4_soc_hr | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| INPUT_PARAMETERS | ||
| suffix autotest | ||
| calculation scf | ||
| symmetry 0 | ||
| pseudo_dir ../../PP_ORB | ||
| orbital_dir ../../PP_ORB | ||
| gamma_only 0 | ||
| ecutwfc 15 | ||
| scf_thr 1e-7 | ||
| scf_nmax 50 | ||
| noncolin 1 | ||
| nspin 4 | ||
| lspinorb 0 | ||
| basis_type lcao | ||
| ks_solver scalapack_gvx | ||
| dft_functional pbe | ||
| smearing_method gauss | ||
| smearing_sigma 0.02 | ||
| mixing_type pulay | ||
| mixing_beta 0.4 | ||
| mixing_gg0 3.0 | ||
| out_hsr 1 12 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| K_POINTS | ||
| 0 | ||
| Gamma | ||
| 1 1 1 0 0 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Self-consistent nspin=4 O2 H(R)/S(R) regression, without SOC. | ||
| O-O distance 2.3 bohr in an 18-bohr cubic cell; existing O FR PP and minimal 6-bohr 1s1p orbitals. | ||
| PBE/LCAO, 15 Ry, Gamma 1x1x1; initial moments (1/sqrt(2),1/sqrt(2),0) muB per atom. | ||
| Full SCF uses scf_thr=1e-7, scf_nmax=50, Pulay 0.4 and mixing_gg0=3; no DeltaSpin. | ||
| References are complete raw 16x16 complex matrices with only R=0 and finite y magnetization. | ||
| Repeated local GNU/Intel runs pass the unchanged matrix comparator; the unfixed parent fails H. | ||
| These compact parameters test the assembly regression rather than material-property convergence. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ATOMIC_SPECIES | ||
| O 15.999 O_ONCV_PBE_FR-1.0.upf | ||
|
|
||
| NUMERICAL_ORBITAL | ||
| O_gga_6au_60Ry_1s1p.orb | ||
|
|
||
| LATTICE_CONSTANT | ||
| 18 | ||
|
|
||
| LATTICE_VECTORS | ||
| 1 0 0 | ||
| 0 1 0 | ||
| 0 0 1 | ||
|
|
||
| ATOMIC_POSITIONS | ||
| Direct | ||
|
|
||
| O | ||
| 0.0 | ||
| 2 | ||
| 0.5 0.5 0.43611111111111112 0 0 0 mag 0.7071067811865475 0.7071067811865475 0 | ||
| 0.5 0.5 0.56388888888888888 0 0 0 mag 0.7071067811865475 0.7071067811865475 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- Ionic Step 1 --- | ||
| # print H matrix in real space H(R) | ||
| 1 # number of spin directions | ||
| 1 # spin index, E_Fermi = -6.68506 eV | ||
| 16 # number of localized basis | ||
| 1 # number of Bravais lattice vector R | ||
|
|
||
| user_defined_lattice | ||
| 9.52519 | ||
| 1 0 0 | ||
| 0 1 0 | ||
| 0 0 1 | ||
| O | ||
| 2 | ||
| Direct | ||
| 0.5 0.5 0.436111111110222 | ||
| 0.5 0.5 0.563888888889778 | ||
|
|
||
| #----------------------------------------------------------------------# | ||
| # CSR Format # | ||
| # The outer loop corresponds to the number of Bravais lattice vectors. # | ||
| # The first line contains the index of the Bravais lattice vector # | ||
| # (Rx, Ry, Rz), followed by the number of non-zero elements. # | ||
| # The subsequent lines consist of three blocks of data, which are # | ||
| # values, column indices, row pointers. # | ||
| #----------------------------------------------------------------------# | ||
|
|
||
| 0 0 0 96 | ||
| # CSR values | ||
| (-2.004383330761e+00,0.000000000000e+00) (-4.378766338937e-02,4.378766338938e-02) (-4.154791598051e-01,0.000000000000e+00) (9.594409771163e-04,-9.594409771162e-04) (-1.004647828998e+00,0.000000000000e+00) (-8.828573496782e-03,8.828573496782e-03) | ||
| (1.093397372134e+00,0.000000000000e+00) (9.833707841451e-03,-9.833707841451e-03) (-4.378766338937e-02,-4.378766338938e-02) (-2.004383330761e+00,0.000000000000e+00) (9.594409771163e-04,9.594409771162e-04) (-4.154791598051e-01,0.000000000000e+00) | ||
| (-8.828573496782e-03,-8.828573496782e-03) (-1.004647828998e+00,0.000000000000e+00) (9.833707841451e-03,9.833707841451e-03) (1.093397372134e+00,0.000000000000e+00) (-4.154791598051e-01,0.000000000000e+00) (9.594409771163e-04,-9.594409771162e-04) | ||
| (-1.157395052414e+00,0.000000000000e+00) (-1.903117650352e-02,1.903117650352e-02) (-1.093397372134e+00,0.000000000000e+00) (-9.833707841514e-03,9.833707841515e-03) (8.102031397564e-01,0.000000000000e+00) (1.899269201656e-03,-1.899269201656e-03) | ||
| (9.594409771163e-04,9.594409771162e-04) (-4.154791598051e-01,0.000000000000e+00) (-1.903117650352e-02,-1.903117650352e-02) (-1.157395052414e+00,0.000000000000e+00) (-9.833707841514e-03,-9.833707841515e-03) (-1.093397372134e+00,0.000000000000e+00) | ||
| (1.899269201656e-03,1.899269201656e-03) (8.102031397564e-01,0.000000000000e+00) (-7.974273329164e-01,0.000000000000e+00) (-5.630637244357e-02,5.630637244358e-02) (-4.148020119102e-01,0.000000000000e+00) (-6.023892705908e-03,6.023892705908e-03) | ||
| (-5.630637244357e-02,-5.630637244358e-02) (-7.974273329164e-01,0.000000000000e+00) (-6.023892705908e-03,-6.023892705908e-03) (-4.148020119102e-01,0.000000000000e+00) (-7.974273329164e-01,0.000000000000e+00) (-5.630637244357e-02,5.630637244358e-02) | ||
| (-4.148020119102e-01,0.000000000000e+00) (-6.023892705908e-03,6.023892705908e-03) (-5.630637244357e-02,-5.630637244358e-02) (-7.974273329164e-01,0.000000000000e+00) (-6.023892705908e-03,-6.023892705908e-03) (-4.148020119102e-01,0.000000000000e+00) | ||
| (-1.004647828998e+00,0.000000000000e+00) (-8.828573496782e-03,8.828573496782e-03) (-1.093397372134e+00,0.000000000000e+00) (-9.833707841514e-03,9.833707841515e-03) (-2.004383330761e+00,0.000000000000e+00) (-4.378766338969e-02,4.378766338969e-02) | ||
| (4.154791598051e-01,0.000000000000e+00) (-9.594409771072e-04,9.594409771072e-04) (-8.828573496782e-03,-8.828573496782e-03) (-1.004647828998e+00,0.000000000000e+00) (-9.833707841514e-03,-9.833707841515e-03) (-1.093397372134e+00,0.000000000000e+00) | ||
| (-4.378766338969e-02,-4.378766338969e-02) (-2.004383330761e+00,0.000000000000e+00) (-9.594409771072e-04,-9.594409771072e-04) (4.154791598051e-01,0.000000000000e+00) (1.093397372134e+00,0.000000000000e+00) (9.833707841451e-03,-9.833707841451e-03) | ||
| (8.102031397564e-01,0.000000000000e+00) (1.899269201656e-03,-1.899269201656e-03) (4.154791598051e-01,0.000000000000e+00) (-9.594409771072e-04,9.594409771072e-04) (-1.157395052414e+00,0.000000000000e+00) (-1.903117650366e-02,1.903117650366e-02) | ||
| (9.833707841451e-03,9.833707841451e-03) (1.093397372134e+00,0.000000000000e+00) (1.899269201656e-03,1.899269201656e-03) (8.102031397564e-01,0.000000000000e+00) (-9.594409771072e-04,-9.594409771072e-04) (4.154791598051e-01,0.000000000000e+00) | ||
| (-1.903117650366e-02,-1.903117650366e-02) (-1.157395052414e+00,0.000000000000e+00) (-4.148020119102e-01,0.000000000000e+00) (-6.023892705908e-03,6.023892705908e-03) (-7.974273329162e-01,0.000000000000e+00) (-5.630637244396e-02,5.630637244396e-02) | ||
| (-6.023892705908e-03,-6.023892705908e-03) (-4.148020119102e-01,0.000000000000e+00) (-5.630637244396e-02,-5.630637244396e-02) (-7.974273329162e-01,0.000000000000e+00) (-4.148020119102e-01,0.000000000000e+00) (-6.023892705908e-03,6.023892705908e-03) | ||
| (-7.974273329162e-01,0.000000000000e+00) (-5.630637244396e-02,5.630637244396e-02) (-6.023892705908e-03,-6.023892705908e-03) (-4.148020119102e-01,0.000000000000e+00) (-5.630637244396e-02,-5.630637244396e-02) (-7.974273329162e-01,0.000000000000e+00) | ||
| # CSR column indices | ||
| 0 1 2 3 8 9 10 11 0 1 2 3 8 9 10 11 | ||
| 0 1 2 3 8 9 10 11 0 1 2 3 8 9 10 11 | ||
| 4 5 12 13 4 5 12 13 6 7 14 15 6 7 14 15 | ||
| 0 1 2 3 8 9 10 11 0 1 2 3 8 9 10 11 | ||
| 0 1 2 3 8 9 10 11 0 1 2 3 8 9 10 11 | ||
| 4 5 12 13 4 5 12 13 6 7 14 15 6 7 14 15 | ||
| # CSR row pointers | ||
| 0 8 16 24 32 36 40 44 48 56 64 72 80 84 88 92 | ||
| 96 | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| etotref -861.8592868019903 | ||
| etotperatomref -430.9296434010 | ||
| CompareHR_pass 0 | ||
| CompareSR_pass 0 | ||
| totaltimeref 1.52 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- Ionic Step 1 --- | ||
| # print S matrix in real space S(R) | ||
| 1 # number of spin directions | ||
| 1 # spin index | ||
| 16 # number of localized basis | ||
| 1 # number of Bravais lattice vector R | ||
|
|
||
| user_defined_lattice | ||
| 9.52519 | ||
| 1 0 0 | ||
| 0 1 0 | ||
| 0 0 1 | ||
| O | ||
| 2 | ||
| Direct | ||
| 0.5 0.5 0.436111111110222 | ||
| 0.5 0.5 0.563888888889778 | ||
|
|
||
| #----------------------------------------------------------------------# | ||
| # CSR Format # | ||
| # The outer loop corresponds to the number of Bravais lattice vectors. # | ||
| # The first line contains the index of the Bravais lattice vector # | ||
| # (Rx, Ry, Rz), followed by the number of non-zero elements. # | ||
| # The subsequent lines consist of three blocks of data, which are # | ||
| # values, column indices, row pointers. # | ||
| #----------------------------------------------------------------------# | ||
|
|
||
| 0 0 0 40 | ||
| # CSR values | ||
| (1.000000000000e+00,0.000000000000e+00) (3.122772551440e-01,0.000000000000e+00) (-3.769119232454e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (3.122772551440e-01,0.000000000000e+00) (-3.769119232454e-01,0.000000000000e+00) | ||
| (1.000000000000e+00,0.000000000000e+00) (3.769119232454e-01,0.000000000000e+00) (-2.556149750289e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (3.769119232454e-01,0.000000000000e+00) (-2.556149750289e-01,0.000000000000e+00) | ||
| (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) | ||
| (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (3.122772551440e-01,0.000000000000e+00) (3.769119232454e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (3.122772551440e-01,0.000000000000e+00) | ||
| (3.769119232454e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (-3.769119232454e-01,0.000000000000e+00) (-2.556149750289e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (-3.769119232454e-01,0.000000000000e+00) | ||
| (-2.556149750289e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) | ||
| (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) (2.212660810968e-01,0.000000000000e+00) (1.000000000000e+00,0.000000000000e+00) | ||
| # CSR column indices | ||
| 0 8 10 1 9 11 2 8 10 3 9 11 4 12 5 13 | ||
| 6 14 7 15 0 2 8 1 3 9 0 2 10 1 3 11 | ||
| 4 12 5 13 6 14 7 15 | ||
| # CSR row pointers | ||
| 0 3 6 9 12 14 16 18 20 23 26 29 32 34 36 38 | ||
| 40 | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| INPUT_PARAMETERS | ||
| suffix autotest | ||
| calculation scf | ||
| symmetry 0 | ||
| pseudo_dir ../../PP_ORB | ||
| orbital_dir ../../PP_ORB | ||
| gamma_only 0 | ||
| ecutwfc 15 | ||
| scf_thr 1e-7 | ||
| scf_nmax 50 | ||
| noncolin 1 | ||
| nspin 4 | ||
| lspinorb 1 | ||
| basis_type lcao | ||
| ks_solver scalapack_gvx | ||
| dft_functional pbe | ||
| smearing_method gauss | ||
| smearing_sigma 0.02 | ||
| mixing_type pulay | ||
| mixing_beta 0.4 | ||
| mixing_gg0 3.0 | ||
| out_hsr 1 12 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| K_POINTS | ||
| 0 | ||
| Gamma | ||
| 1 1 1 0 0 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Self-consistent nspin=4 O2 H(R)/S(R) regression, with SOC. | ||
| O-O distance 2.3 bohr in an 18-bohr cubic cell; existing O FR PP and minimal 6-bohr 1s1p orbitals. | ||
| PBE/LCAO, 15 Ry, Gamma 1x1x1; initial moments (1/sqrt(2),1/sqrt(2),0) muB per atom. | ||
| Full SCF uses scf_thr=1e-7, scf_nmax=50, Pulay 0.4 and mixing_gg0=3; no DeltaSpin. | ||
| References are complete raw 16x16 complex matrices with only R=0 and finite y magnetization. | ||
| Repeated local GNU/Intel runs pass the unchanged matrix comparator; the unfixed parent fails H. | ||
| These compact parameters test the assembly regression rather than material-property convergence. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ATOMIC_SPECIES | ||
| O 15.999 O_ONCV_PBE_FR-1.0.upf | ||
|
|
||
| NUMERICAL_ORBITAL | ||
| O_gga_6au_60Ry_1s1p.orb | ||
|
|
||
| LATTICE_CONSTANT | ||
| 18 | ||
|
|
||
| LATTICE_VECTORS | ||
| 1 0 0 | ||
| 0 1 0 | ||
| 0 0 1 | ||
|
|
||
| ATOMIC_POSITIONS | ||
| Direct | ||
|
|
||
| O | ||
| 0.0 | ||
| 2 | ||
| 0.5 0.5 0.43611111111111112 0 0 0 mag 0.7071067811865475 0.7071067811865475 0 | ||
| 0.5 0.5 0.56388888888888888 0 0 0 mag 0.7071067811865475 0.7071067811865475 0 |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.