Commit 0797d01
Feat/issue 7726 dftu pw nspin fixes (#7744)
* Fix(dftu-pw): correct Pauli-to-spin conversion signs and weight_eu for nspin=1
In cal_occ_pw():
- Swap the imaginary signs in the Pauli-to-spin conversion for nspin=4:
index[1] (spin down-up): -i*vu_tmp[2] -> +i*vu_tmp[2]
index[2] (spin up-down): +i*vu_tmp[2] -> -i*vu_tmp[2]
The DFT+U vu array convention requires opposite sign from deeq_nc.
- Fix weight_eu for nspin=1: 0.25 -> 1.0
nspin=1 has single occupancy, not the Pauli double-counting factor.
Verified with tests/17_DS_DFTU/08 and 09:
08: -6792.33351671617 (ref -6792.33351670950, diff 6.7e-9 eV)
09: -6364.26587638707 (ref -6364.26587639017, diff 3.1e-9 eV)
* Test: migrate PW DFT+U tests (08/09) from 17_DS_DFTU to 01_PW
815_PW_DFTU_S2_Z — nspin=2 DFT+U, matches ref -6792.33351671614
816_PW_DFTU_S4_XY — nspin=4 DFT+U, matches ref -6364.26587638708
* Test: disable migrated 08/09 in 17_DS_DFTU CASES_CPU, enabled in 01_PW
* Test: regenerate 099_PW_DJ_SO reference for nspin=4 DFT+U sign fix
The nspin=4 Pauli-to-spin sign swap in cal_occ_pw changes the output of
all nspin=4 DFT+U PW tests, including the pre-existing 099_PW_DJ_SO whose
result.ref was not updated. Regenerate its etot/force/stress references:
etot -5662.3881388456420609 -> -5662.3908859903258417
force 15.774740 -> 17.965510
stress 100840.559090 -> 100582.607209
Without this, the 01_PW integrate suite fails on 099_PW_DJ_SO
(etot dev 2.7e-3 eV, force dev -2.19, stress dev 258).
* fix: add explicit nspin=4 to 816_PW_DFTU_S4_XY test INPUT
Commit b95f433 on develop removed the automatic nspin=4 reset
when noncolin/lspinorb is enabled, instead requiring explicit nspin=4.
Since the PR does not touch read_input_item_elec_stru.cpp, the CI merge
uses develop's validation code, causing ABACUS to quit with:
nspin must be 4 when noncolin or lspinorb is enabled.
---------
Co-authored-by: dyzheng <zhengdy@bjaisi.com>1 parent d8ff3fb commit 0797d01
14 files changed
Lines changed: 128 additions & 9 deletions
File tree
- source/source_lcao/module_dftu
- tests
- 01_PW
- 099_PW_DJ_SO
- 815_PW_DFTU_S2_Z
- 816_PW_DFTU_S4_XY
- 17_DS_DFTU
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | | - | |
| 312 | + | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments