Givens QR of a Hessenberg matrix costs O(n²)
About operations against Householder's ; at Householder does more than 100 times the work.
Householder, about 4/3 n^3Givens, about 3 n^2
| Quantity | Viv | Checked by |
|---|---|---|
slope givens | 1.99215 | Givens on a Hessenberg matrix: about 3 n^2 operations, slope between 1.9 and 2.1 |
slope householder | 2.98768 | Householder ignoring the zeros: about 4/3 n^3, slope between 2.8 and 3.1 |
work ratio at 400 | 178.002 | at n = 400 Householder does more than 100 times the work |
givens in n2 | 3.00746 | Givens on a Hessenberg matrix: about 3 n^2 operations, slope between 1.9 and 2.1 |
householder in n3 | 1.33834 | Householder ignoring the zeros: about 4/3 n^3, slope between 2.8 and 3.1 |
r diff | 1.78485 × 10−13 | the two give the same R up to row signs, to 1e-12 |
givens_hessenberg.viv
Output · native build · Oct 14, 2026 · 1.83 s
flops_givens: [7644, 30294, 120594, 481194] flops_householder: [171696, 1353396, 10746796, 85653596] slope_givens: 1.99215 slope_householder: 2.98768 work_ratio_at_400: 178.002 givens_in_n2: 3.00746 householder_in_n3: 1.33834 r_diff: 1.78485e-13 time_slope_givens: 1.29041 time_slope_householder: 3.01834
- ✓ Givens on a Hessenberg matrix: about 3 n^2 operations, slope between 1.9 and 2.1
- ✓ Householder ignoring the zeros: about 4/3 n^3, slope between 2.8 and 3.1
- ✓ at n = 400 Householder does more than 100 times the work
- ✓ the two give the same R up to row signs, to 1e-12
Open in the workbenchAtlasMore math claims
- Full statement
- QR of an upper Hessenberg matrix by Givens rotations takes rotations and about floating-point operations, while Householder QR that ignores the zeros takes about . From to 400 the counted operations grow with log-log slopes between 1.9 and 2.1 and between 2.8 and 3.1, at Householder does more than 100 times the work, and the two give the same up to the signs of its rows (relative difference below ).
- Scope
- Operation counts are counted in the programs' inner loops (multiplications and additions of the updates; square roots and the reflector setup are left out); the wall-clock times are shown but not asserted. One random Hessenberg matrix per size.
- Reference
- Golub and Van Loan, Matrix Computations (4th ed., 2013), sections 5.1.9 and 5.2.5 ( flops for Hessenberg QR by Givens, for Householder QR of a square matrix), the step every QR-algorithm iteration on a Hessenberg matrix repeats.
claims/math/givens_hessenberg.viv#c12c3fac3f