Sparse Matrix Techniques for MCAO Luc Gilles lgilles@mtu.edu Michigan Technological University, ECE Department Brent Ellerbroek bellerbroek@gemini.edu Gemini Observatory Curt Vogel vogel@math.montana.edu Montana State University, Math Sciences November 25, 2002 L. Gilles, CfAO Fall Retreat 2002 p.1/21
Wavefront Estimation from Idealized WFS Data - Open-loop WFS: s = Gϕ + η - η and ϕ random with known statistics C η = η η T and C ϕ = ϕ ϕ T ˆϕ = G s (noise-weighted pseudo-inverse) ˆϕ = arg min ϕ J(ϕ) J(ϕ) = 1 2 [ η 2 C 1 η + ϕ 2 C 1 ϕ ] = 1 2 [ η, C 1 η η + ϕ, Cϕ 1 ϕ ] ˆϕ = G s with G = ( G T C 1 η G + Cϕ 1 ) 1 G T Cη 1 - Block-layered structure for MCAO - (SNR) 2 = Gϕ 2 / η 2 = Gϕ 2 /(2 n z σ 2 ) L. Gilles, CfAO Fall Retreat 2002 p.2/21
Key Approximations to Inverse Turbulence Covariance Approximation #1 - C ϕ is block diagonal (different layers are statistically independent) - For each turbulent layer l, C ϕl is BTTB (phase structure function) - Approximate BBTB matrix by BCCB matrix (diagonalized by DFT) - C ϕl BCCB(τ l ) = F 1 diag(ˆτ l )F where ˆτ l = Fτ l (eigenvalues) - ˆτ l = c l κ 11/3 (Kolmogorov PSD) C 1 ϕ l BCCB(Λ l ) = F 1 diag(λ l ) F, λ l = ˆτ 1 l = c 1 l κ 11/3 L. Gilles, CfAO Fall Retreat 2002 p.3/21
Key Approximations to Inverse Turbulence Covariance - BCCB(Λ l ) is a full matrix. Approximation #2 - Entries Λ l rapidly decay to small values - Approximate BCCB(Λ l ) by Sl 2 where S l = c l S and S is the discrete Laplacian matrix with periodic boundary conditions S = BCCB(v) = F 1 diag(ˆv)f (sparse BCCB) ˆv = 4 [ sin 2 (πκ x x)/ x 2 + sin 2 (πκ y y)/ y 2] x, y 0 4π2 κ 2 - S = S y I x + I y S x where S y and S x are 1D versions L. Gilles, CfAO Fall Retreat 2002 p.4/21
Key Approximations to Inverse Turbulence Covariance Sparsity Patterns in 1D [S u] i = ( u i 1 + 2u i u i+1 ) / x 2 S = circ(v), v = (2, 1, 0,, 0, 1) T / x 2 = (2 e 0 e 1 e n 1 )/ x 2 S = F 1 diag(ˆv)f, ˆv = Fv = (2 ê 0 ê 1 ê n 1 )/ x 2 ˆv = 4 sin 2 (πκ x)/ x 2 (eigenvalues) x 0 4π 2 κ 2 L. Gilles, CfAO Fall Retreat 2002 p.5/21
Key Approximations to Inverse Turbulence Covariance 0.1 0.08 Eigenvalues λ (1), λ (2) (biharmo) λ (2) (power 11/3) λ (1) 0.1 0.05 c (1) = IDFT[ λ (1) ], c (2) = IDFT[ λ (2) ] 0.06 0.04 0 0.02 0.05 0 5 10 15 20 25 30 0.1 5 10 15 20 25 30 0 C (1) = circ[ c (1) ] C (2) = circ[ c (2) ], Threshold = 3 10 2 0 32 0 32 15.62% Fill 32 0 32 53.1% Fill L. Gilles, CfAO Fall Retreat 2002 p.6/21
MCAO Minimum Variance Reconstructor Problem: find optimal actuator commands â minimizing MCAO wide-field error metric W â = Rs R = arg min J(R) R J(R) = ɛ 2 W = ɛ T Wɛ ɛ = H a â H ϕ ϕ (aperture-plane residual phase) R = H a }{{} F itting H ϕ G }{{} Estimation G = ( G T Cη 1 G }{{} + Cϕ 1 }{{} ) 1 G T Cη 1 Sparse+low rank (LGS) Sparse approx H a = ( H at W H a + low-rank ) 1 H at W L. Gilles, CfAO Fall Retreat 2002 p.7/21
Multigrid (MG) Methods - Can sometimes be used as stand-alone system solvers. - Can be used as preconditioners. - Rely on multiple scales (grid sizes) inherent in certain problems. - Need smoother which damps out high-frequency components of error on fine grids. - Classical Gauss-Seidel iteration works well for Laplace s equation. - Remaining low frequency error is well-represented on coarser grids. - Are recursive versions of the following 2-grid scheme. L. Gilles, CfAO Fall Retreat 2002 p.8/21
2-Grid Scheme x h S(x h, y h,...) r h A h x h y h x h x h + e h x h S(x h, y h,...) Restrict r H Ih Hr h Interpolate e h IH h e H Solve A H e H = r H - S(v, w,...) denotes application of smoother to solve Ax = w with initial guess x = v. - To obtain MG V-cycle, apply 2-grid scheme recursively. Carry out Solve step with (e H, r H ) in place of (x h, y h ). L. Gilles, CfAO Fall Retreat 2002 p.9/21
Multigrid (MG) Methods - Inter-grid transfers (restriction, or up-binning, and interpolation, or down-binning) are cheap. - Cost is typically dominated by smoother application on finest grid. - Choice of smoother is problem-dependent. - Block (i.e., layer-oriented) symmetric Gauss-Seidel (B-SGS) works well for MCAO estimation step. - FFT-based modified Richardson iteration works well for Ex-AO estimation. L. Gilles, CfAO Fall Retreat 2002 p.10/21
Block Gauss-Seidel Smoother Based on block L + D + U splitting A = 0 0... 0 A 11 0... 0. A 21 0... 0 0 A....... + 22 0.. 0....... 0 A n1... A n,n 1 0 0... 0 A nn }{{}}{{} L 0 A 12... A 1n. 0 0... +........ A n 1,n } 0... 0 {{ 0 } U D L. Gilles, CfAO Fall Retreat 2002 p.11/21
Block Gauss-Seidel Smoother Ax = b is equivalent to (L + D)x = b Ux. This motivates the block forward iteration (L + D)x k+1 = b Ux k, k = 0, 1,.... Similarly, we obtain the block backward interation (D + U)x k+1 = b Lx k, k = 0, 1,.... Block symmetric Gauss-Seidel (B-SGS) is obtained by interweaving forward and backward iterations. L. Gilles, CfAO Fall Retreat 2002 p.12/21
Efficient PCG Solver - MG preconditioned CG Estimation Step - Block SGS smoother: requires only inversion of diagonal blocks. Implemented using reordering + full Cholesky factorization. Fitting Step - Incomplete Cholesky preconditioned CG. Incomplete Cholesky applied to full sparse matrix without reordering. L. Gilles, CfAO Fall Retreat 2002 p.13/21
Preliminary Results Algorithm tested against conventional matrix multiply reconstructors on 8m class problems with 7 10 3 degrees of freedom 32m class problems with 7 10 4 degrees of freedom solvable in Matlab with 2-3Gb memory Convergence obtained in 2-10 iterations - Convergence rate a strong function of WFS noise level - Weak function of problem dimensionality, NGS vs. LGS MCAO L. Gilles, CfAO Fall Retreat 2002 p.14/21
Sample MCAO Problem Dimensionality Aperture diameter (m) 8 16 32 WFS measurements 2240 8560 33320 Turbulence phase points 7270 21226 70838 DM actuators 789 2417 8449 L. Gilles, CfAO Fall Retreat 2002 p.15/21
Sample MCAO Problem Dimensionality Estimation matrix to be inverted. 6 layers, 5 NGS s. D=16m. Phase screens 128 128. L. Gilles, CfAO Fall Retreat 2002 p.16/21
Fig.1 Top layer diagonal block of estimation matrix. D=16m. Phase screens 128 128. L. Gilles, CfAO Fall Retreat 2002 p.17/21
Fig.2 Fitting matrix (3 DM s, 932 actuators/dm). D=16m. L. Gilles, CfAO Fall Retreat 2002 p.18/21
Fig.3 Estimation, 6-layer profile, 5 WFSs using 5 NGS s. FoV diameter 100 arcsec, 1 V-cycle/CG iteration, 1 SGS iter/grid level, SNR = 20, r 0 = 25cm, x = r 0. 10 0 Estimation Error Norm Averaged over FoV 32m 16m 8m 10 0 CG Estimation Residual Norm 32m 16m 8m 10 1 10 1 10 2 0 5 10 15 20 CG Estimation Iteration 10 2 0 5 10 15 20 CG Estimation Iteration 10 0 Direct Solve vs CG (8m) RMS Estimation Error (32m) x 10 3 2.1983 10 1 1.0992 10 2 0 5 10 15 20 CG Estimation Iteration 0 L. Gilles, CfAO Fall Retreat 2002 p.19/21
Fig.4 Fitting after 20 CG estimation iterations. Average over array of 5 5 observation directions. FoV diameter 100 arcsec. Incomplete Cholesky preconditioning, regularization parameter α = 1e-5. Error Norm (32m) Averaged over FoV 0Residual 10 3 DMs 2 DMs 1 DM Error Norm (16m) Averaged over FoV 0Residual 10 3 DMs 2 DMs 1 DM 10 1 10 1 10 2 0 5 10 15 20 CG Fitting Iteration 10 2 0 5 10 15 20 CG Fitting Iteration Error Norm (8m) Averaged over FoV 0Residual 10 3 DMs 2 DMs 1 DM 10 0 Residual Error Norm Averaged over FoV 10 1 10 1 32m 16m 8m 10 2 0 5 10 15 20 CG Fitting Iteration 10 2 0 2 4 6 8 CG Estimation Iteration L. Gilles, CfAO Fall Retreat 2002 p.20/21
Fig.5 Fitting after 20 CG estimation iterations. Average over array of 5 5 observation directions. FoV diameter 100 arcsec. Incomplete Cholesky preconditioning, regularization parameter α = 1e-5. 10 0 Direct Solve vs CG (8m) 10 0 CG Residual Norm (8m) 10 1 3 DMs 2 DMs 1 DM 10 2 10 5 3 DMs 2 DMs 1 DM 10 3 0 5 10 15 20 CG Fitting Iteration 10 10 0 5 10 15 20 CG Fitting Iteration 10 0 CG Residual Norm (16m) RMS Residual Error (32m, 2DMs) x 10 3 3.0976 10 5 3 DMs 2 DMs 1 DM 1.5488 10 10 0 5 10 15 20 CG Fitting Iteration 0 L. Gilles, CfAO Fall Retreat 2002 p.21/21