Commit 187c1f0
committed
fix: use subspace diagonalization for CG non-RR eigenvalues; re-enable use_p
Three changes to make both PPCG strategies correctly converge with rr_step=4:
1. CG non-RR path: After orth_cholesky, solve the nband x nband subspace
generalized eigenvalue problem instead of using diagonal Rayleigh quotients.
The upper-triangular U^{-1} from Cholesky mixes high-energy components into
low-energy bands, making diagonal RQs overestimate the eigenvalues. The
subspace solve gives correct Ritz values without rotating the states,
preserving Polak-Ribiere conjugate-direction accumulators.
2. BLOCK_SUBSPACE: Re-enable use_p=true (3-block [psi, w, p] subspace).
The Krylov fallback (replace p with H·w when p ~ w) was already in place
but dead because use_p was hardcoded to false. Now it activates on the
first iteration (p is zero-initialized) and whenever p becomes collinear
with w after update_one_block.
3. CG test: Change rr_step from 1 back to 4 so the non-RR Cholesky path
is exercised, validating the true Polak-Ribiere CG mechanism.1 parent f7a1ea0 commit 187c1f0
2 files changed
Lines changed: 51 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1168 | 1168 | | |
1169 | 1169 | | |
1170 | 1170 | | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1179 | 1178 | | |
1180 | 1179 | | |
1181 | 1180 | | |
| |||
1384 | 1383 | | |
1385 | 1384 | | |
1386 | 1385 | | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1393 | 1429 | | |
1394 | 1430 | | |
1395 | 1431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
0 commit comments