In mathematics, the conjugate gradient method is an algorithm for the numerical solution of particular systems of linear equations, namely those whose matrix is positive-definite. The conjugate gradient method is often implemented as an iterative algorithm, applicable to sparse systems that are too large to be handled by a direct implementation or other direct methods such as the Cholesky decomposition. Large sparse systems often arise when numerically solving partial differential equations or optimization problems. The conjugate gradient method can also be used to solve unconstrained optimization problems such as energy minimization. It is commonly attributed to Magnus Hestenes and Eduard Stiefel, who programmed it on the Z4, and extensively researched it. The biconjugate gradient method provides a generalization to non-symmetric matrices. Various nonlinear conjugate gradient methods seek minima of nonlinear optimization problems. Description of the problem addressed by conjugate gradients Suppose we want to solve the system of linear equations for the vector , where the known matrix is symmetric (i.e., AT = A), positive-definite (i.e. xTAx > 0 for all non-zero vectors in Rn), and real, and is known as well. We denote the unique solution of this system by . Derivation as a direct method The conjugate gradient method can be derived from several different perspectives, including specialization of the conjugate direction method for optimization, and variation of the Arnoldi/Lanczos iteration for eigenvalue problems. Despite differences in their approaches, these derivations share a common topic—proving the orthogonality of the residuals and conjugacy of the search directions. These two properties are crucial to developing the well-known succinct formulation of the method. We say that two non-zero vectors u and v are conjugate (with respect to ) if Since is symmetric and positive-definite, the left-hand side defines an inner product Two vectors are conjugate if and only if they are orthogonal with respect to this inner product. Being conjugate is a symmetric relation: if is conjugate to , then is conjugate to . Suppose that is a set of mutually conjugate vectors with respect to , i.e. for all . Then forms a basis for , and we may express the solution of in this basis: Left-multiplying the problem with the vector yields and so This gives the following method for solving the equation : find a sequence of conjugate directions, and then compute the coefficients . As an iterative method If we choose the conjugate vectors carefully, then we