A Tour of the Lanczos Algorithm and Its Convergence Guarantees Through the Decades
Total Page:16
File Type:pdf, Size:1020Kb
A Tour of the Lanczos Algorithm and its Convergence Guarantees through the Decades Qiaochu Yuan Department of Mathematics UC Berkeley Joint work with Prof. Ming Gu, Bo Li April 17, 2018 Qiaochu Yuan Tour of Lanczos April 17, 2018 1 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 2 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 Our work: (2015) (1966, 1971, 1980) 1) Convergence boundsConvergence for Convergence (1975, 1980) RBL, arbitrary b bounds for bounds for Convergence 2) Superlinear convergenceRandomized Lanczos bounds for Block Lanczos Block Lanczosfor typical data matrices Qiaochu Yuan Tour of Lanczos April 17, 2018 3 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 4 / 43 Lanczos Iteration Algorithm Developed by Lanczos in 1950 [Lan50]. Widely used iterative algorithm for computing the extremal eigenvalues and corresponding eigenvectors of a large, sparse, symmetric matrix A. Goal n×n Given a symmetric matrix A 2 R , with eigenvalues λ1 > λ2 > ··· > λn and associated eigenvectors u1; ··· ; un, want to find approximations for λi , i = 1; ··· ; k, the k largest eigenvalues of A ui , i = 1; ··· ; k, the associated eigenvectors where k n. Qiaochu Yuan Tour of Lanczos April 17, 2018 5 / 43 Lanczos - Details General idea: 1 Select an initial vector v. 2 Construct Krylov subspace K (A; v; k) = spanfv; Av; A2v; ··· ; Ak−1vg. 3 Restrict and project A to the Krylov subspace, T = projKAjK 4 Use eigen values and vectors of T as approximations to those of A. In matrices: k−1 n×k Kk = v Av ··· A v 2 R Qk = q1 q2 ··· qk qr (Kk ) T k×k Tk = Qk AQk 2 R Qiaochu Yuan Tour of Lanczos April 17, 2018 6 / 43 Lanczos - Details 2 3 α1 β1 6 .. .. 7 6 β1 . 7 6 7 A q1 ··· qj = q1 ··· qj qj+1 6 .. .. 7 6 . βj−1 7 6 7 4 βj−1 αj 5 βj At each step j = 1; ··· ; k of Lanczos iteration: T AQj = Qj Tj + βj qj+1ej+1 Use the three-term recurrence: Aqj = βj−1qj−1 + αj qj + βj qj+1 Calculate the αs, βs as: T αj = qj Aqj (1) rj = (A − αj I) qj − βj−1qj (2) βj = krj k2, qj+1 = rj /βj (3) Qiaochu Yuan Tour of Lanczos April 17, 2018 7 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 8 / 43 Convergence of Lanczos (k) How well does λi , the eigenvalues of Tk , approximate λi , the eigenvalues of A, for i = 1; ··· ; k? First answered by Kaniel in 1966 [Kan66] and Paige in 1971 [Pai71]. Theorem (Kaniel-Paige Inequality) If v is chosen to be not orthogonal to the eigenspace associated with λ1, then 2 (k) tan θ (u1; v) 0 ≤ λ1 − λ1 ≤ (λ1 − λn) 2 (4) Tk−1 (γ1) where Ti (x) is the Chebyshev polynomial of degree i, θ (·; ·) is the angle between two vectors, and λ1 − λ2 γ1 = 1 + 2 λ2 − λn Qiaochu Yuan Tour of Lanczos April 17, 2018 9 / 43 Convergence of Lanczos Later generalized by Saad in 1980 [Saa80]. Theorem (Saad Inequality) T For i = 1; ··· ; k, if v is chosen such that ui v 6= 0, then (k) !2 (k) Li tan θ (ui ; v) 0 ≤ λi − λi ≤ (λi − λn) (5) Tk−i (γi ) where Ti (x) is the Chebyshev polynomial of degree i, θ (·; ·) is the angle between two vectors, and λi − λi+1 γi = 1 + 2 λi+1 − λn 8 λ(k)−λ < Qi−1 j n (k) j=1 (k) if i 6= 1 Li = λj −λi : 1 if i = 1 Qiaochu Yuan Tour of Lanczos April 17, 2018 10 / 43 Aside - Chebyshev Polynomials Recall 1 p j p j T (x) = x + x2 − 1 + x − x2 − 1 (6) j 2 When j is large, j 1 p 2 T (x) ≈ x + x − 1 140 j 2 120 Chebyshev, Lanczos and when g is small, 100 j 1 p 80 Tj (1 + g) ≈ 1 + g + 2g 2 60 determines the convergence of 40 Monomial, power method Lanczos with 20 0 λi − λi+1 g = Θ 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 λi+1 − λn Qiaochu Yuan Tour of Lanczos April 17, 2018 11 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 12 / 43 Block Lanczos Algorithm Introduced by Golub and Underwood in 1977 [GU77] and Cullum and Donath in 1974 [CD74]. The block generalization of the Lanczos method uses, instead of a single initial vector v, a block of b vectors V = v1 ··· vb , and builds the Krylov subspace in q iterations as q−1 Kq (A; V; q) = span V; AV; ··· ; A V . k ≤ b, bq n. Compared to classical Lanczos, block Lanczos is more memory and cache efficient, using BLAS3 operations. has the ability to converge to eigenvalues with cluster size > 1. has faster convergence with respect to number of iterations. Qiaochu Yuan Tour of Lanczos April 17, 2018 13 / 43 Block Lanczos Algorithm - Details 2 T 3 A1 B1 6 .. .. 7 6 B1 . 7 6 . 7 A Q1 ··· Qj = Q1 ··· Qj Qj+1 6 .. .. T 7 6 Bj−1 7 6 7 4 Bj−1 Aj 5 Bj At each step j = 1; ··· ; k of Lanczos iteration: AQ = QTj + Qj+1 0 ··· 0 Bj Use the three-term recurrence: T AQj = Qj−1Bj−1 + Qj Aj + Qj+1Bj Calculate the As, Bs as: T Aj = Qj AQj (7) T Qj+1Bj qr AQj − Qj Aj − Qj Bj−1 (8) Qiaochu Yuan Tour of Lanczos April 17, 2018 14 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 15 / 43 Convergence of Block Lanczos First analyzed by Underwood in 1975 [Und75] with the introduction of the algorithm. Theorem (Underwood Inequality) Let λi , ui , i = 1; ··· ; n be the eigenvalues and eigenvectors of A T respectively. Let U = u1 ··· ub . If U V is of full rank b, then for i = 1; ··· ; b 2 (q) tan Θ(U; V) 0 ≤ λi − λi ≤ (λ1 − λn) 2 (9) Tq−1 (ρi ) where Ti (x) is the Chebyshev polynomial of degree i, T cos Θ (U; V) = σmin U V , and λi − λb+1 ρi = 1 + 2 λb+1 − λn Qiaochu Yuan Tour of Lanczos April 17, 2018 16 / 43 Convergence of Block Lanczos Theorem (Saad Inequality [Saa80]) Let λj , uj , j = 1; ··· ; n be the eigenvalues and eigenvectors of A T respectively. Let Ui = ui ··· ui+b−1 . For i = 1; ··· ; b, if Ui V is of full rank b, then (q) !2 (q) Li tan Θ (Ui ; V) 0 ≤ λi − λi ≤ (λi − λn) (10) Tq−i (^γi ) where Ti (x) is the Chebyshev polynomial of degree i, T cos Θ (U; V) = σmin U V , and λi − λi+b γ^i = 1 + 2 λi+b − λn 8 λ(q)−λ < Qi−1 j n (q) j=1 (q) if i 6= 1 Li = λj −λi : 1 if i = 1 Qiaochu Yuan Tour of Lanczos April 17, 2018 17 / 43 Aside - Block Size Recall, when j is large and g is small 1 j T (1 + g) ≈ 1 + g + p2g (11) j 2 λ − λ classical: g = Θ i i+1 λi+1 − λn 140 λi − λi+b g g block: gb = Θ 120 b λi+b − λn 100 Suppose eigenvalue distributed as 80 λ > (1 + )λ for all j: Chebyshev, Lanczos j j+1 60 1 − (1 + )−b 40 g ≈ · λ Monomial, power method b (1 + )−b i 20 0 ≈ b · λi 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 ≈ b · g Qiaochu Yuan Tour of Lanczos April 17, 2018 18 / 43 Timeline (1965) Lanczos algorithm (2009, 2010, 2015) for SVD Randomized (1950) (1974, 1977) Block Lanczos Lanczos iteration Block Lanczos algorithm algorithm 1950 1960 1970 1980 1990 2000 2010 (2015) (1966, 1971, 1980) Convergence Convergence (1975, 1980) bounds for bounds for Convergence Randomized Lanczos bounds for Block Lanczos Block Lanczos Qiaochu Yuan Tour of Lanczos April 17, 2018 19 / 43 Randomized Block Lanczos In recent years, there has been increased interest in algorithms to compute low-rank approximations of matrices, with high computational efficiency requirement, running on large matrices low approximation accuracy requirement, 2-3 digits of accuracy Applications mostly in big-data computations compression of data matrices matrix processing techniques, e.g.