Commit 8c838a2
dyzheng
Fix(deltaspin): propagate current_spin through operator chain in init()
In HamiltLCAO::updateHk, current_spin is set on the root operator
via set_current_spin(isk[ik]), but was never propagated to child
operators in the chain. Each operator independently managed its own
current_spin via toggling (DFTU, Veff, DeePKS). DeltaSpin did not
toggle, so its current_spin was always 0, using the wrong sign for
spin-down contributions (+lambda_z instead of -lambda_z).
Fix: propagate current_spin to the next operator in init() before
processing this node's contributeHR, matching the existing hr_done
propagation pattern. This ensures all operators share the same spin
state set by the k-point loop.1 parent edbf29c commit 8c838a2
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
| |||
0 commit comments