Commit 4c65f65
fix: preserve public k-point reader contracts and kvec_c_full after aa6fc43
- read_listed_kpoints (Cartesian/Direct) and interpolate_k_between are
public, independently-usable readers (KlistTest.ReadKpointsCartesian,
ReadKpointsLineCartesian) that must produce spin-doubled containers
immediately, without requiring a later set_kup_and_kdw() call; revert
their allocation back to nkstot*spin_mult. Only Monkhorst_Pack (which
triggered the original build_kstars crash and has no such contract)
keeps the deferred, undoubled allocation.
- set_kup_and_kdw() now resizes only kvec_c/kvec_d/wk/ngk/isk for the
down-spin copy it is about to append, instead of calling renew() (which
also resizes kvec_c_full). kvec_c_full must keep holding the original,
un-reduced full-BZ mesh for later consumers (e.g. Ewald_Vq); renew()
was truncating it to the symmetry-reduced, spin-doubled size.
Verified: MODULE_CELL_klist_test (34/34), MODULE_CELL_reciprocal_grid_test
(10/10), MODULE_CELL_qlist_test (16/16), MODULE_CELL_klist_test_para1
(2/2) all pass; 17_DS_DFTU/03_LCAO_DFTU_S2_Z with symmetry=1 still
produces the same energy as before this fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019omhQohPCePyJnLiWnG6Fa1 parent 156b725 commit 4c65f65
1 file changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
454 | 460 | | |
455 | 461 | | |
456 | 462 | | |
| |||
0 commit comments