Commit a3616d2
dyzheng
Fix(deltaspin): enable DeltaSpin constraint energy calculation for PW basis
- cal_escon(): replace is_Mi_converged gate with lambda_/Mi_ empty check
to prevent segfault when uninitialized
- elecstate_pw: add get_spin_constrain_energy() override so PW basis
computes DeltaSpin constraint energy (previously returned 0.0)
- elecstate_pw.h: declare get_spin_constrain_energy() override
Note: this fix enables escon computation for PW DeltaSpin but
lambda values from BFGS optimizer may differ from accel branch
due to energy functional convention differences. Full convergence
with accel requires lambda_loop.cpp migration.1 parent bb2cb4b commit a3616d2
3 files changed
Lines changed: 12 additions & 1 deletion
File tree
- source
- source_estate
- source_lcao/module_deltaspin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments