Conjugate gradients take √κ iterations
Iterations grow like (slope 1.05); bad scaling stalls CG past 10,000 iterations, and Jacobi brings it back to 2 times the unscaled count.
proportional to sqrt(kappa)CG, n = 16 to 128
| Quantity | Viv | Checked by |
|---|---|---|
slope vs sqrt kappa | 1.05418 | iterations grow like sqrt(kappa): slope between 0.85 and 1.15 |
it scaled plain | 10000 | badly scaled, plain CG does not converge in 10,000 iterations at n = 64: more than 80 times the unscaled count |
scaled over unscaled | 84.0336 | badly scaled, plain CG does not converge in 10,000 iterations at n = 64: more than 80 times the unscaled count |
jacobi over unscaled | 1.98319 | the Jacobi preconditioner brings it to between 1.5 and 2.5 times the unscaled count |
cg_sqrt_kappa.viv
Output · native build · Oct 14, 2026 · 1.46 s
iterations: [28, 59, 119, 239] slope_vs_sqrt_kappa: 1.05418 it_unscaled: 119 it_scaled_plain: 10000 it_scaled_jacobi: 236 scaled_over_unscaled: 84.0336 jacobi_over_unscaled: 1.98319
- ✓ iterations grow like sqrt(kappa): slope between 0.85 and 1.15
- ✓ badly scaled, plain CG does not converge in 10,000 iterations at n = 64: more than 80 times the unscaled count
- ✓ the Jacobi preconditioner brings it to between 1.5 and 2.5 times the unscaled count
Open in the workbenchAtlasMore math claims
- Full statement
- Conjugate gradients on the 5-point Laplacian of an grid ( to 128) needs a number of iterations to cut the residual by that grows like the square root of the condition number (log-log slope between 0.85 and 1.15 against ). When the same matrix is badly scaled (rows and columns multiplied by factors spread over 1 to ), plain CG at does not reach the tolerance in 10,000 iterations (more than 80 times the unscaled count), and the Jacobi (diagonal) preconditioner brings it to between 1.5 and 2.5 times the unscaled count.
- Scope
- Right-hand side all ones, zero start, stopping on the 2-norm residual. The scaling factors are drawn log-uniformly with a fixed seed. In exact arithmetic Jacobi would recover the unscaled count exactly, since the scaling is diagonal; the gap comes from the stopping test, which measures the residual of the scaled system, and from rounding at a scale range of . Jacobi does not improve the Laplacian's own growth, which needs a multigrid or incomplete-factorization preconditioner.
- Reference
- The condition number from the Laplacian's exact eigenvalues ; the CG bound on the error in the energy norm (Saad, Iterative Methods for Sparse Linear Systems (2nd ed., 2003), section 6.11.3).
claims/math/cg_sqrt_kappa.viv#791a5f82e3