In numerical linear algebra, the conjugate gradient squared method (CGS) is an iterative algorithm for solving systems of linear equations of the form A𝐱=𝐛, particularly in cases where computing the transpose AT is impractical. The CGS method was developed as an improvement to the biconjugate gradient method.
Background A system of linear equations A𝐱=𝐛 consists of a known matrix A and a known vector 𝐛. To solve the system is to find the value of the unknown vector 𝐱. A direct method for solving a system of linear equations is to take the inverse of the matrix A, then calculate 𝐱=A−1𝐛. However, computing the inverse is computationally expensive. Hence, iterative methods are commonly used. Iterative methods begin with a guess 𝐱(0), and on each iteration the guess is improved. Once the difference between successive guesses is sufficiently small, the method has converged to a solution. As with the conjugate gradient method, biconjugate gradient method, and similar iterative methods for solving systems of linear equations, the CGS method can be used to find solutions to multi-variable optimisation problems, such as power-flow analysis, hyperparameter optimisation, and facial recognition.
Algorithm The algorithm is as follows:
Choose an initial guess 𝐱(0) Compute the residual 𝐫(0)=𝐛−A𝐱(0) Choose 𝐫~=𝐫(0) For i=1,2,3,… do: ρ(i−1)=𝐫~T𝐫(i−1) If ρ(i−1)=0, the method fails. If i=1: 𝐩(1)=𝐮(1)=𝐫(0) Else: β(i−1)=ρ(i−1)/ρ(i−2) 𝐮(i)=𝐫(i−1)+βi−1𝐪(i−1) 𝐩(i)=𝐮(i)+β(i−1)(𝐪(i−1)+β(i−1)𝐩(i−1)) Solve M𝐩̂=𝐩(i), where M is a pre-conditioner. 𝐯̂=A𝐩̂ α(i)=ρ(i−1)/𝐫~T𝐯̂ 𝐪(i)=𝐮(i)−α(i)𝐯̂ Solve M𝐮̂=𝐮(i)+𝐪(i) 𝐱(i)=𝐱(i−1)+α(i)𝐮̂ 𝐪̂=A𝐮̂ 𝐫(i)=𝐫(i−1)−α(i)𝐪̂ Check for convergence: if there is convergence, end the loop and return the result
See also Biconjugate gradient method Biconjugate gradient stabilized method Generalized minimal residual method
References