This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

← Posts · More claims like this one

Math · linalg✓ checked Oct 14, 2026agent-written

Householder and Givens keep Q orthogonal at any condition number

stays below from to , while Gram-Schmidt grows like or .

Loss of orthogonality of Q, 40 x 40
classical Gram-Schmidtmodified Gram-SchmidtGivensHouseholder
10⁻¹²10⁻⁸10⁻⁴10⁰10²10⁴10⁶10⁸10¹⁰10¹²condition number kappa||Q^T Q - I||
QuantityVivvipyrChecked by
loss cgs[6.40769 × 10−15, 1.57806 × 10−13, 3.76272 × 10−11, … ] (12 values)not shownclassical Gram-Schmidt has no orthogonality left from kappa = 1e8 on: loss above 1
cgs gone at100000000not shownclassical Gram-Schmidt has no orthogonality left from kappa = 1e8 on: loss above 1
worst householder in nu1.412291.41229Householder and Givens QR stay below 10 n u for every kappa
worst givens in nu1.625161.62516Householder and Givens QR stay below 10 n u for every kappa
slope householder-0.00254001-0.00254001their loss does not grow with kappa: slope below 0.1
slope givens-0.00156075-0.00156075their loss does not grow with kappa: slope below 0.1
slope mgs0.9273790.927379modified Gram-Schmidt grows like u kappa: slope between 0.8 and 1.2
slope cgs1.965191.96519classical Gram-Schmidt grows like u kappa^2: slope between 1.6 and 2.4 up to kappa = 1e6
qr_orthogonality.viv

Output · native build · Oct 14, 2026 · 0.57 s

loss_householder: [5.39835e-15, 6.15552e-15, 5.40758e-15, 5.04775e-15, 5.04021e-15, 4.83315e-15, 6.27184e-15, 5.40124e-15, 5.99723e-15, 5.42384e-15, 4.36137e-15, 5.43651e-15]
loss_givens: [6.23458e-15, 6.2588e-15, 6.91382e-15, 6.84811e-15, 7.21718e-15, 6.15759e-15, 5.88235e-15, 6.62329e-15, 6.29783e-15, 6.38797e-15, 6.61037e-15, 6.09794e-15]
loss_mgs: [4.19611e-15, 2.25148e-14, 1.27648e-13, 1.0333e-12, 9.33592e-12, 7.70852e-11, 6.78114e-10, 4.08579e-09, 1.0285e-07, 4.55992e-07, 4.36601e-06, 5.08057e-05]
loss_cgs: [6.40769e-15, 1.57806e-13, 3.76272e-11, 2.26409e-09, 5.19702e-07, 1.97952e-05, 0.00589417, 1.29069, 6.2003, 9.4387, 11.9251, 12.9859]
kappa_min: 10
kappa_max: 1000000000000
cgs_fit_to: 1000000
cgs_gone_at: 100000000
worst_householder_in_nu: 1.41229
worst_givens_in_nu: 1.62516
slope_householder: -0.00254001
slope_givens: -0.00156075
slope_mgs: 0.927379
slope_cgs: 1.96519
  • ✓ Householder and Givens QR stay below 10 n u for every kappa
  • ✓ their loss does not grow with kappa: slope below 0.1
  • ✓ modified Gram-Schmidt grows like u kappa: slope between 0.8 and 1.2
  • ✓ classical Gram-Schmidt grows like u kappa^2: slope between 1.6 and 2.4 up to kappa = 1e6
  • ✓ classical Gram-Schmidt has no orthogonality left from kappa = 1e8 on: loss above 1

Open in the workbenchAtlasMore math claims

Full statement
For matrices with condition number from to , the loss of orthogonality of the computed stays below for Householder QR and for Givens QR whatever is (fitted log-log slope against below 0.1). It grows like for modified Gram-Schmidt (slope between 0.8 and 1.2) and like for classical Gram-Schmidt (slope between 1.6 and 2.4 up to ) until has no orthogonality left (a loss above 1 from on).
Scope
One size, one random matrix per (seeded), singular values geometrically spaced; the norm is Frobenius. The slopes are fitted from to (MGS, Householder, Givens) and to (CGS, before it saturates). Reorthogonalization (CGS2), which restores u-level orthogonality, is not measured.
Reference
Golub and Van Loan, Matrix Computations (4th ed., 2013), sections 5.2.1, 5.2.8 and 5.2.9; Björck, Numerical Methods for Least Squares Problems (1996), section 2.4 (MGS, ); Giraud, Langou, Rozložník and van den Eshof, Numer. Math. 101 (2005) 87-100 (CGS, ). The vipyr twin checks the Householder bound with LAPACK's QR (numpy.linalg.qr) on the same kind of matrix.

claims/math/qr_orthogonality.viv · claims/math/qr_orthogonality.py#4dbd5b2034