Commit 7125ec9
committed
DeltaP PW: fix multi-k segfault — use Gamma mesh + pw_rho
Two fixes for multi-k Berry phase during SCF:
1. Use Gamma mesh (not Monkhorst-Pack) — Monkhorst-Pack
causes segfault for isolated molecules in large boxes.
Gamma 1x1x2 works correctly.
2. Pass pw_rho (smooth density grid) instead of pw_rhod
(dense USPP grid) as rhopw to compute_total_gamma_pw().
unkdotp_G0 uses rhopw->recip2real which requires
the smooth FFT grid.
Multi-k verified (H2O, Gamma 1x1x2):
gamma_total = -0.2302 rad (same as Gamma-only -0.2298)
per-atom: O=-0.1512, H=-0.0398 (stable across iterations)
E_tot = -417.089 eV (vs -417.169 eV Gamma-only)
BN LCAO regression passes.1 parent 478b972 commit 7125ec9
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
0 commit comments