Commit c95ee79
committed
DeltaP: fix inner loop re-entry + add gating/cleanup
- Add deltap_inner_loop_done_ flag to prevent BFGS re-running
after first convergence (was running every SCF iteration)
- Reset flag in deltap_init for fresh calculations
- Remove debug prints
- Inner loop correctly runs once when drho drops below threshold
Tested on BN with targets (4.2, 3.3):
γ=(4.190, 3.295) → close to targets ✓
λ=(5.8e-4, -9.4e-4) Ry → non-zero ✓
E_eff=3.0 mV/Å → physical field ✓1 parent 7ba3faf commit c95ee79
2 files changed
Lines changed: 10 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
| 1026 | + | |
1026 | 1027 | | |
1027 | 1028 | | |
1028 | 1029 | | |
| |||
1063 | 1064 | | |
1064 | 1065 | | |
1065 | 1066 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
| 1067 | + | |
1071 | 1068 | | |
1072 | 1069 | | |
1073 | 1070 | | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
| 1071 | + | |
1079 | 1072 | | |
1080 | 1073 | | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
| 1074 | + | |
1085 | 1075 | | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1093 | 1080 | | |
1094 | 1081 | | |
1095 | 1082 | | |
| |||
1231 | 1218 | | |
1232 | 1219 | | |
1233 | 1220 | | |
| 1221 | + | |
1234 | 1222 | | |
1235 | 1223 | | |
1236 | 1224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
0 commit comments