Generalised eigenproblems and structured matrices
| Problem | Solve ; build Toeplitz, Hankel, circulant and other structured matrices; and solve linear systems with them faster than |
| Devised by | Cleve Moler and G. W. Stewart (1973), the QZ algorithm; Norman Levinson (1947) and William Trench (1964), Toeplitz solvers; James Cooley and John Tukey (1965), the FFT; Jacques Hadamard (1893) and James Sylvester (1867), Hadamard matrices |
| Accuracy | Generalised eigenvalues and eigenvectors agree with SciPy (LAPACK) to ; constructors exactly; fast solvers to – |
| Cost | eigh_generalized: a Cholesky factorisation and two triangular solves, about , plus eigh; qz/eig_generalized: about –; solve_toeplitz: ; solve_circulant: three FFTs, ; solve_banded: ; solveh_banded: |
| Read first | Symmetric and general eigensolvers, Cholesky factorisation, Further factorisations |
| API | eigh_generalized, eig_generalized, qz, toeplitz, hankel, circulant, solve_toeplitz, solve_circulant, solve_banded, solveh_banded, and the constructors hadamard, block_diag, companion, pascal, invpascal, hilbert, invhilbert, leslie, dft, convolution_matrix, fiedler |
Overview
Generalised eigenproblems are the natural form of many physical problems. In vibration analysis , with stiffness and mass . The finite element method gives such pairs, and so does every linear DAE . Multiplying by reduces the problem to a standard one, but it destroys symmetry, loses accuracy when is ill-conditioned, and fails when is singular. In that last case the pencil has infinite eigenvalues, which are legitimate and correspond to algebraic constraints. The library offers:
eigh_generalizedfor Hermitian and positive definite, by a Cholesky reduction that keeps symmetry. The eigenvectors are -orthonormal.qzandeig_generalizedfor general pencils, by the QZ algorithm. It works with and together, never inverts , and returns infinite eigenvalues as such.
Structured matrices are determined by numbers instead of :
- Toeplitz matrices, constant along diagonals, from stationary processes and convolutions;
- Hankel matrices, constant along anti-diagonals, from moment problems and system identification;
- circulant matrices, the periodic convolutions;
- banded matrices, from finite differences and splines.
Exploiting the structure brings an solve down to (Levinson), (FFT) or (band LU), and the storage down likewise.
Where it is used
Two kinds of matrix problem appear constantly in engineering.
- Generalised eigenproblems . Vibration analysis of structures (stiffness and mass ), and linear discriminant analysis.
- Toeplitz and circulant matrices. Convolutions, autocorrelation matrices of stationary signals and periodic boundary conditions; solved much faster than a general matrix.
- Hankel matrices. System identification and the analysis of exponential sums.
History
Kronecker and Weierstrass (1860s–1890) classified matrix pencils , including their infinite eigenvalues. The first stable algorithm was Cleve Moler and G. W. Stewart’s QZ
algorithm (1973). It applies the QR algorithm to implicitly, with unitary transformations on the left () and right (), and became EISPACK’s qzhes/qzit and later LAPACK’s gges.
Norman Levinson (1947) solved the symmetric Toeplitz systems of Wiener’s prediction theory in operations. James Durbin (1960) specialised it to Yule-Walker equations, and William Trench (1964) and Shalhav Zohar (1969) extended it to nonsymmetric matrices. The FFT of James Cooley and John Tukey (1965) made circulant systems cost , and superfast Toeplitz solvers built on it followed. James Sylvester (1867) constructed the Hadamard matrices of order . Jacques Hadamard (1893) showed that they attain the largest possible determinant among matrices with entries of modulus at most 1.
The idea
Symmetric-definite pencils: Cholesky reduction
If , then is equivalent to
is Hermitian, so its eigenvalues are real and its eigenvectors orthonormal. The are then -orthonormal, , which is the normalisation that LAPACK’s sygv
and SciPy’s eigh(a, b) return. The method is stable when is well conditioned. Its accuracy degrades with , since appears twice.
The QZ algorithm
For a general pencil, QZ computes the generalised Schur form: unitary and with
so that , and the eigenvalues are . They are written as the pair , so that , an infinite eigenvalue, causes no division. It proceeds in three steps:
- Triangularise by a QR factorisation, , and replace by .
- Hessenberg-triangular reduction. Givens rotations from the left zero below its subdiagonal, column by column from the bottom. Each one creates a single nonzero just below ’s diagonal, which a rotation from the right removes. That rotation leaves ’s new zero intact.
- QZ sweeps. These are the implicitly shifted QR algorithm applied to , without forming it. The shift is the eigenvalue of the trailing pencil closer to . A left rotation determined by creates a bulge, which alternating right and left rotations chase down to the bottom. When a subdiagonal entry of becomes negligible, the problem splits.
A zero on the diagonal of is an infinite eigenvalue. Rotations from the left move the zero down to the bottom row, each followed by a right rotation that restores ’s Hessenberg form, and a final rotation
deflates it. The library works in complex arithmetic, which needs only single shifts. Like LAPACK’s zhgeqz, it makes the diagonal of real and non-negative.
Right eigenvectors follow from the triangular pencil. is solved by back substitution with , then is normalised to unit length, as SciPy normalises.
Toeplitz systems: Levinson recursion
For a Toeplitz matrix , every leading principal submatrix is again Toeplitz, and so is the reversed matrix , with the reversal. Levinson’s recursion grows the solution of one size at a time. Alongside it, it keeps the solutions , of two auxiliary systems whose right-hand sides are the next column and row of . Extending to size needs only inner products of length and a few scalar divisions:
with similar updates for and . The total cost is about operations, against for LU. The recursion divides by quantities that vanish when a leading principal minor is singular. Because it does not pivot, it can be unstable for indefinite or nearly singular matrices, while it is reliable for positive definite ones.
Circulant systems: the FFT
A circulant matrix is a polynomial in the cyclic shift, and the DFT diagonalises the cyclic shift. Therefore , with the DFT matrix and the first column, and
which costs three FFTs. The eigenvalues of are the entries of , so the system is singular when one of them vanishes. The library then returns an error, as SciPy does by default.
Banded systems
Gaussian elimination on a matrix with subdiagonals and superdiagonals creates no fill outside the band, except that row interchanges can widen ’s upper band to . With
partial pivoting restricted to the candidate rows, the work is and the storage . SciPy’s band storage, ab[u + i − j, j] = A[i, j], keeps each diagonal in a row of
ab. For a Hermitian positive definite band, Cholesky needs no pivoting and keeps the bandwidth exactly, at half the cost.
Algorithm
eig_generalized(A, B):
- ; , , , .
- For and : a left rotation on rows zeros , then a right rotation on columns zeros .
- Repeat until the active block is empty. Deflate negligible subdiagonal entries of . Chase any zero diagonal entry of to the bottom and deflate it. Otherwise do a single-shift QZ sweep, using an exceptional shift every tenth iteration.
- Make ’s diagonal real and non-negative. Set ( if ), and compute the eigenvectors by back substitution.
solve_banded((l, u), ab, b): for , pick the largest for , swap it into row , eliminate the rows below, and update . Then back-substitute with
’s band of width . Each stored row holds the columns of its current position’s window, and moves with the row when it is interchanged.
Implementation
The QZ algorithm:
/// The generalised complex Schur form of the pencil `(A, B)` (SciPy's `qz(a, b, output='complex')`):
/// unitary `Q`, `Z` with `Qᴴ A Z = S`, `Qᴴ B Z = T` upper triangular. The generalised eigenvalues
/// are `S_ii / T_ii` (infinite where `T_ii = 0`). `B` is first made triangular by a QR
/// factorisation and `A` Hessenberg by Givens rotations that keep `B` triangular; then QZ sweeps
/// with Wilkinson-type shifts chase a bulge down the pencil until the subdiagonal of `S`
/// vanishes. A zero on the diagonal of `T` (an infinite eigenvalue) is chased to the bottom and
/// deflated.
pub fn qz<T: Scalar, S: Data<Elem = T>, S2: Data<Elem = T>>(a: &ArrayBase<S, Ix2>, b: &ArrayBase<S2, Ix2>) -> Result<QzFactors> {
let n = a.nrows();
if a.ncols() != n || b.dim() != (n, n) {
return Err(LinalgError::Shape(format!("A ({:?}) and B ({:?}) must be square and of one size", a.dim(), b.dim())));
}
let ac = a.mapv(|v| v.to_complex());
let bc = b.mapv(|v| v.to_complex());
if ac.iter().chain(bc.iter()).any(|v| !v.re.is_finite() || !v.im.is_finite()) {
return Err(LinalgError::NonFinite);
}
// B = Q₀ R₀; S = Q₀ᴴ A.
let f0 = qr(&bc, QrMode::Full, false)?;
let q0h = f0.q.t().mapv(|v| v.conj());
let mut f = QzFactors { s: q0h.dot(&ac), t: f0.r, q: f0.q, z: Array2::from_shape_fn((n, n), |(i, j)| if i == j { C::new(1.0, 0.0) } else { cz() }) };
// Hessenberg-triangular reduction.
for j in 0..n.saturating_sub(2) {
for i in (j + 2..n).rev() {
let (c, s) = rotation(f.s[(i - 1, j)], f.s[(i, j)]);
left_rot(&mut f, i - 1, i, c, s, 0);
f.s[(i, j)] = cz();
// T[i, i−1] filled in; zero it with columns (i, i − 1).
let (c, s) = rotation(f.t[(i, i)], f.t[(i, i - 1)]);
right_rot(&mut f, i, i - 1, c, s, n, i + 1);
f.t[(i, i - 1)] = cz();
}
}
let norm = |m: &Array2<C>| m.iter().map(|v| v.norm_sqr()).sum::<f64>().sqrt();
let (snorm, tnorm) = (norm(&f.s).max(f64::MIN_POSITIVE), norm(&f.t).max(f64::MIN_POSITIVE));
let eps = f64::EPSILON;
let mut hi = n;
let mut its = 0;
let mut total = 0;
while hi > 0 {
let ihi = hi - 1;
// The start of the active block: the last negligible subdiagonal entry.
let mut l = ihi;
while l > 0 {
let sub = f.s[(l, l - 1)].norm();
if sub <= eps * (f.s[(l, l)].norm() + f.s[(l - 1, l - 1)].norm()).max(eps * snorm) {
f.s[(l, l - 1)] = cz();
break;
}
l -= 1;
}
if l == ihi {
hi -= 1;
its = 0;
continue;
}
total += 1;
if total > 30 * n.max(1) * 10 {
return Err(LinalgError::Shape("qz: the QZ iteration did not converge".into()));
}
// An infinite eigenvalue: chase the zero on T's diagonal to the bottom and deflate.
if let Some(j) = (l..=ihi).find(|&j| f.t[(j, j)].norm() <= eps * tnorm) {
f.t[(j, j)] = cz();
for k in j..ihi {
let (c, s) = rotation(f.t[(k, k + 1)], f.t[(k + 1, k + 1)]);
left_rot(&mut f, k, k + 1, c, s, k.saturating_sub(1));
f.t[(k + 1, k + 1)] = cz();
if k > l {
let (c, s) = rotation(f.s[(k + 1, k)], f.s[(k + 1, k - 1)]);
right_rot(&mut f, k, k - 1, c, s, (k + 2).min(n), k + 1);
f.s[(k + 1, k - 1)] = cz();
}
}
let (c, s) = rotation(f.s[(ihi, ihi)], f.s[(ihi, ihi - 1)]);
right_rot(&mut f, ihi, ihi - 1, c, s, ihi + 1, ihi + 1);
f.s[(ihi, ihi - 1)] = cz();
continue;
}
its += 1;
// Shift: the eigenvalue of the trailing 2 × 2 pencil nearer S_mm / T_mm.
let m = ihi;
let shift = if its % 10 == 0 {
// An exceptional shift breaks cycles.
f.s[(m, m - 1)] / f.t[(m - 1, m - 1)] + f.s[(m, m)] / f.t[(m, m)]
} else {
let (a11, a12, a21, a22) = (f.s[(m - 1, m - 1)], f.s[(m - 1, m)], f.s[(m, m - 1)], f.s[(m, m)]);
let (b11, b12, b22) = (f.t[(m - 1, m - 1)], f.t[(m - 1, m)], f.t[(m, m)]);
// det(A₂ − λ B₂) = 0: (a11 − λb11)(a22 − λb22) − (a12 − λb12) a21 = 0.
let qa = b11 * b22;
let qb = -(a11 * b22 + a22 * b11 - b12 * a21);
let qc = a11 * a22 - a12 * a21;
let disc = (qb * qb - qa * qc * 4.0).sqrt();
let (r1, r2) = ((-qb + disc) / (qa * 2.0), (-qb - disc) / (qa * 2.0));
let target = a22 / b22;
if (r1 - target).norm() <= (r2 - target).norm() { r1 } else { r2 }
};
// The QZ sweep from l to ihi.
let (c, s) = rotation(f.s[(l, l)] - shift * f.t[(l, l)], f.s[(l + 1, l)]);
left_rot(&mut f, l, l + 1, c, s, l);
for k in l..ihi {
let (c, s) = rotation(f.t[(k + 1, k + 1)], f.t[(k + 1, k)]);
right_rot(&mut f, k + 1, k, c, s, (k + 3).min(ihi + 1), k + 2);
f.t[(k + 1, k)] = cz();
if k + 1 < ihi {
let (c, s) = rotation(f.s[(k + 1, k)], f.s[(k + 2, k)]);
left_rot(&mut f, k + 1, k + 2, c, s, k);
f.s[(k + 2, k)] = cz();
}
}
}
// Make T's diagonal real and non-negative, as LAPACK does.
for i in 0..n {
let b = f.t[(i, i)];
if b.norm() > 0.0 && (b.im != 0.0 || b.re < 0.0) {
let phase = b.conj() / b.norm();
for j in i..n {
f.t[(i, j)] *= phase;
f.s[(i, j)] *= phase;
}
for r in 0..n {
f.q[(r, i)] *= phase.conj();
}
f.t[(i, i)] = C::new(f.t[(i, i)].norm(), 0.0);
}
}
for i in 0..n {
for j in 0..i {
f.s[(i, j)] = cz();
f.t[(i, j)] = cz();
}
}
Ok(f)
}
The symmetric-definite reduction:
/// The eigenvalues (ascending) and eigenvectors of the symmetric-definite problem `A x = λ B x`,
/// `A` Hermitian and `B` Hermitian positive definite (SciPy's `eigh(a, b)`, LAPACK's `sygv`
/// type 1). With `B = L Lᴴ`, the problem becomes the standard `C y = λ y` for
/// `C = L⁻¹ A L⁻ᴴ`, and `x = L⁻ᴴ y`; the eigenvectors are `B`-orthonormal, `Xᴴ B X = I`.
pub fn eigh_generalized<T: Scalar, S: Data<Elem = T>, S2: Data<Elem = T>>(a: &ArrayBase<S, Ix2>, b: &ArrayBase<S2, Ix2>, uplo: UPLO) -> Result<(Array1<f64>, Array2<T>)> {
let n = a.nrows();
if a.ncols() != n || b.dim() != (n, n) {
return Err(LinalgError::Shape(format!("A ({:?}) and B ({:?}) must be square and of one size", a.dim(), b.dim())));
}
// Both triangles of A from the `uplo` one.
let full = Array2::from_shape_fn((n, n), |(i, j)| {
let read_lower = matches!(uplo, UPLO::Lower);
if (i >= j) == read_lower || i == j { a[(i, j)] } else { a[(j, i)].conj() }
});
let l = b.cholesky(uplo).map(|f| if matches!(uplo, UPLO::Lower) { f } else { f.t().mapv(|v| v.conj()) })?;
// C = L⁻¹ A L⁻ᴴ: W = L⁻¹ A, then C = (L⁻¹ Wᴴ)ᴴ.
let w = l.solve_triangular(UPLO::Lower, Diag::NonUnit, &full)?;
let wh = w.t().mapv(|v| v.conj());
let c = l.solve_triangular(UPLO::Lower, Diag::NonUnit, &wh)?.t().mapv(|v| v.conj());
let c = Array2::from_shape_fn((n, n), |(i, j)| (c[(i, j)] + c[(j, i)].conj()).scale(0.5));
let (values, y) = c.eigh(UPLO::Lower)?;
let lh = l.t().mapv(|v| v.conj());
let x = lh.solve_triangular(UPLO::Upper, Diag::NonUnit, &y)?;
Ok((values, x))
}
Levinson recursion and the FFT solver:
/// Solves `T x = b` for the Toeplitz matrix `T` with first column `c` and first row `r` (default
/// `conj(c)`) by Levinson recursion in `O(n²)` operations (SciPy's `solve_toeplitz`, after the
/// classic `toeplz`). The recursion builds the solutions for the leading `m × m` sections one size at
/// a time, together with those of two auxiliary systems for the reversed sections; it needs every
/// leading principal minor to be non-singular, and is not stable for indefinite or badly
/// conditioned `T` (then use `solve`).
pub fn solve_toeplitz<T: Scalar>(c: &[T], r: Option<&[T]>, b: &[T]) -> Result<Array1<T>> {
let n = b.len();
let conj: Vec<T> = c.iter().map(|v| v.conj()).collect();
let r = r.unwrap_or(&conj);
if c.len() != n || r.len() != n || n == 0 {
return Err(LinalgError::Shape(format!("solve_toeplitz: c, r and b must have one length, got {}, {}, {n}", c.len(), r.len())));
}
if c.iter().chain(r).chain(b).any(|v| !v.is_finite()) {
return Err(LinalgError::NonFinite);
}
// R[k] (1-based, k = 1..2n−1) with T_ij = R[n + i − j].
let mut rr = vec![T::zero(); 2 * n];
for k in 1..2 * n {
let d = k as isize - n as isize; // i − j
rr[k] = if d >= 0 { c[d as usize] } else { r[(-d) as usize] };
}
let singular = || LinalgError::Shape("solve_toeplitz: a leading principal minor is singular".into());
let y: Vec<T> = std::iter::once(T::zero()).chain(b.iter().copied()).collect();
let mut x = vec![T::zero(); n + 1];
let mut g = vec![T::zero(); n + 1];
let mut h = vec![T::zero(); n + 1];
if rr[n] == T::zero() {
return Err(singular());
}
x[1] = y[1] / rr[n];
if n == 1 {
return Ok(Array1::from_vec(x[1..].to_vec()));
}
g[1] = rr[n - 1] / rr[n];
h[1] = rr[n + 1] / rr[n];
for m in 1..=n {
let m1 = m + 1;
let mut sxn = -y[m1];
let mut sd = -rr[n];
for j in 1..=m {
sxn += rr[n + m1 - j] * x[j];
sd += rr[n + m1 - j] * g[m - j + 1];
}
if sd == T::zero() {
return Err(singular());
}
x[m1] = sxn / sd;
for j in 1..=m {
let t = x[m1] * g[m - j + 1];
x[j] -= t;
}
if m1 == n {
break;
}
let mut sgn = -rr[n - m1];
let mut shn = -rr[n + m1];
let mut sgd = -rr[n];
for j in 1..=m {
sgn += rr[n + j - m1] * g[j];
shn += rr[n + m1 - j] * h[j];
sgd += rr[n + j - m1] * h[m - j + 1];
}
if sgd == T::zero() {
return Err(singular());
}
g[m1] = sgn / sgd;
h[m1] = shn / sd;
let (pp, qq) = (g[m1], h[m1]);
let mut k = m;
for j in 1..=m.div_ceil(2) {
let (pt1, pt2, qt1, qt2) = (g[j], g[k], h[j], h[k]);
g[j] = pt1 - pp * qt2;
g[k] = pt2 - pp * qt1;
h[j] = qt1 - qq * pt2;
h[k] = qt2 - qq * pt1;
k -= 1;
}
}
Ok(Array1::from_vec(x[1..].to_vec()))
}
/// Solves `C x = b` for the circulant matrix `C` with first column `c` in `O(n log n)` (SciPy's
/// `solve_circulant`): the DFT diagonalises every circulant matrix, `C = F⁻¹ diag(F c) F`, so
/// `x = F⁻¹ (F b / F c)`. An error is returned when some `|F c|` is below `tol` (default
/// `n ε max |F c|`), where `C` is numerically singular.
pub fn solve_circulant<T: Scalar>(c: &[T], b: &[T], tol: Option<f64>) -> Result<Array1<T>> {
let n = c.len();
if b.len() != n || n == 0 {
return Err(LinalgError::Shape(format!("solve_circulant: c and b must have one length, got {n} and {}", b.len())));
}
let transform = |v: Vec<C>, direction: FftDirection| -> Result<Vec<C>> {
let mut data = ArrayD::from_shape_vec(IxDyn(&[n]), v).expect("shape");
fft_axis(&mut data, 0, direction).map_err(|e| LinalgError::Shape(format!("fft: {e:?}")))?;
Ok(data.into_iter().collect())
};
let fc = transform(c.iter().map(|z| z.to_complex()).collect(), FftDirection::Forward)?;
let fb = transform(b.iter().map(|z| z.to_complex()).collect(), FftDirection::Forward)?;
let largest = fc.iter().fold(0.0f64, |m, v| m.max(v.norm()));
let tol = tol.unwrap_or(largest * n as f64 * f64::EPSILON);
if fc.iter().any(|v| v.norm() <= tol) {
return Err(LinalgError::Shape("solve_circulant: the circulant matrix is singular".into()));
}
// The quotient stays complex until after the inverse transform.
let q: Vec<C> = fb.iter().zip(&fc).map(|(p, d)| p / d).collect();
let x = transform(q, FftDirection::Inverse)?;
Ok(Array1::from_iter(x.into_iter().map(T::from_complex)))
}
qzreturns only the complex form (SciPy’soutput='complex'). The real QZ form with blocks is not implemented.- The Toeplitz solver follows the classic
toeplz, as SciPy’s does, and takesr = conj(c)when no first row is given, so that the default matrix is Hermitian. solve_circulantuses the library’s FFT, which handles any length.- The banded solvers take one right-hand side. SciPy’s also accept several columns.
In practice
The references are from SciPy 1.17.1, written by book/generator/data/make_genstruct_refs.py. Generalised eigenproblems, with eigenvectors compared after aligning the arbitrary phase
(or sign) of each:
Table 7.15. Generalised eigenproblems against SciPy.
| problem | eigenvalues (relative difference) | eigenvectors, up to phase (relative) |
|---|---|---|
eigh_generalized, real symmetric-definite, n = 7 | 4e-16 | 4e-15 |
eigh_generalized, Hermitian-definite, n = 6 | 1e-15 | 9e-16 |
eig_generalized, real, n = 6 | 1e-15 | 2e-15 |
eig_generalized, real, n = 12 | 3e-15 | 1e-14 |
eig_generalized, complex, n = 5 | 1e-15 | 3e-15 |
eig_generalized, singular B (one infinite eigenvalue) | 0 | — |
qz (complex), n = 8: eigenvalues; ‖Q S Zᴴ − A‖ = 2e-15 | 8e-15 | — |
The library’s complex QZ and LAPACK’s real QZ find the same eigenvalues, to the accuracy the pencils allow, and the same eigenvectors up to phase. With , both report one infinite eigenvalue and the same two finite ones.
Table 7.16. Structured matrices and fast solvers against SciPy.
| functions | largest relative difference from SciPy |
|---|---|
constructors: toeplitz, hankel, circulant, hadamard, block_diag, companion, pascal, invpascal, hilbert, invhilbert, leslie, convolution_matrix, fiedler | 0 |
dft (three scalings); Hermitian toeplitz | 8e-16 |
solve_toeplitz, n = 40, nonsymmetric | 0 |
solve_toeplitz, n = 40, complex Hermitian | 6e-16 |
solve_circulant, n = 40, real and complex | 4e-15 |
solve_banded, n = 40, l = 3, u = 2 (pivoting) | 9e-13 |
solveh_banded, n = 40, bandwidth 2 | 3e-16 |
The constructors agree exactly. The real Toeplitz solve is identical too, since both follow the same recursion, and the complex one agrees to rounding. The banded solve with pivoting differs by . Its matrix has a small diagonal, so the solution has entries up to 30 for a right-hand side of size 1, and the condition number amplifies the different rounding of the two eliminations.
Figure 7.11. Solving structured systems of size n, against dense LU. Dense LU grows like , Levinson like , the FFT like and band LU like . At the Toeplitz system takes 6 ms by Levinson against 60 ms by LU, and the banded one 0.1 ms.
Strengths
- QZ handles singular and ill-conditioned and infinite eigenvalues, without ever inverting .
- Generalised eigenvalues and eigenvectors identical to LAPACK’s up to rounding (and phase).
- Fast solvers for the common structures, with the same storage conventions as SciPy.
Weaknesses
- Unblocked QZ, with no aggressive early deflation: slower than LAPACK for large pencils.
- No real QZ form, and no reordering of the generalised Schur form (
ordqz). - Levinson recursion is unstable for indefinite Toeplitz matrices with nearly singular leading sections. Use
solve, or the circulant preconditioning of iterative solvers, for those.
Exercises
- Show that the eigenvalues of a symmetric-definite pencil are real, and that eigenvectors for distinct eigenvalues are -orthogonal.
- Find the eigenvalues of , . What does look like?
- Show that the DFT matrix diagonalises every circulant matrix, and find the eigenvalues of the circulant with first column .
- Count the operations of Levinson’s recursion, and compare with LU for .
- For a tridiagonal matrix (), how many nonzeros can row interchanges add to ? How does this compare with the band of width ?
Hints and answers
- With , the eigenvalues are those of the symmetric , so they are real. If and , then , so when .
- , a polynomial of degree 1 instead of 2. The finite eigenvalue is . The missing degree is the infinite eigenvalue, which QZ reports as .
- The cyclic shift satisfies for the Fourier vectors , and . The eigenvalues are , those of the periodic second difference.
- Each step costs about operations, so for , and about as much again for the auxiliary vectors: for , against for LU.
- One extra superdiagonal: has bandwidth 2, which is . LAPACK’s tridiagonal solver
gtsvstores exactly that.
Further reading
- C. B. Moler and G. W. Stewart, “An algorithm for generalized matrix eigenvalue problems”, SIAM Journal on Numerical Analysis 10 (1973) 241–256.
- G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed., Johns Hopkins University Press, 2013: section 7.7 (QZ), section 8.7 (symmetric-definite pencils), sections 4.3 and 4.7 (banded and Toeplitz systems).
- N. Levinson, “The Wiener RMS (root mean square) error criterion in filter design and prediction”, Journal of Mathematics and Physics 25 (1947) 261–278.
- W. F. Trench, “An algorithm for the inversion of finite Toeplitz matrices”, Journal of the Society for Industrial and Applied Mathematics 12 (1964) 515–522.
- P. J. Davis, Circulant Matrices, Wiley, 1979.
- W. H. Press, S. A. Teukolsky, W. T. Vetterling and B. P. Flannery, Numerical Recipes, 3rd ed., Cambridge University Press, 2007, section 2.8 (Vandermonde and Toeplitz matrices).
- E. Anderson et al., LAPACK Users’ Guide, 3rd ed., SIAM, 1999.