# Preconditioner

In mathematics, preconditioning is the application of a transformation, called the preconditioner, that conditions a given problem into a form that is more suitable for numerical solving methods. Preconditioning is typically related to reducing a condition number of the problem. The preconditioned problem is then usually solved by an iterative method.

## Preconditioning for linear systems

In linear algebra and numerical analysis, a preconditioner ${\displaystyle P}$ of a matrix ${\displaystyle A}$ is a matrix such that ${\displaystyle P^{-1}A}$ has a smaller condition number than ${\displaystyle A}$. It is also common to call ${\displaystyle T=P^{-1}}$ the preconditioner, rather than ${\displaystyle P}$, since ${\displaystyle P}$ itself is rarely explicitly available. In modern preconditioning, the application of ${\displaystyle T=P^{-1}}$, i.e., multiplication of a column vector, or a block of column vectors, by ${\displaystyle T=P^{-1}}$, is commonly performed by rather sophisticated computer software packages in a matrix-free fashion, i.e., where neither ${\displaystyle P}$, nor ${\displaystyle T=P^{-1}}$ (and often not even ${\displaystyle A}$) are explicitly available in a matrix form.

Preconditioners are useful in iterative methods to solve a linear system ${\displaystyle Ax=b}$ for ${\displaystyle x}$ since the rate of convergence for most iterative linear solvers increases because the condition number of a matrix decreases as a result of preconditioning. Preconditioned iterative solvers typically outperform direct solvers, e.g., Gaussian elimination, for large, especially for sparse, matrices. Iterative solvers can be used as matrix-free methods, i.e. become the only choice if the coefficient matrix ${\displaystyle A}$ is not stored explicitly, but is accessed by evaluating matrix-vector products.

### Description

Instead of solving the original linear system above, one may solve the right preconditioned system:

${\displaystyle AP^{-1}Px=b}$

via solving

${\displaystyle AP^{-1}y=b}$

for ${\displaystyle y}$ and

${\displaystyle Px=y}$

for ${\displaystyle x}$.

Alternatively, one may solve the left preconditioned system:

${\displaystyle P^{-1}(Ax-b)=0.}$

Both systems give the same solution as the original system as long as the preconditioner matrix ${\displaystyle P}$ is nonsingular. The left preconditioning is more common.

The goal of this preconditioned system is to reduce the condition number of the left or right preconditioned system matrix ${\displaystyle P^{-1}A}$ or ${\displaystyle AP^{-1},}$ respectively. The preconditioned matrix ${\displaystyle P^{-1}A}$ or ${\displaystyle AP^{-1}}$ is almost never explicitly formed. Only the action of applying the preconditioner solve operation ${\displaystyle P^{-1}}$ to a given vector need to be computed in iterative methods.

Typically there is a trade-off in the choice of ${\displaystyle P}$. Since the operator ${\displaystyle P^{-1}}$ must be applied at each step of the iterative linear solver, it should have a small cost (computing time) of applying the ${\displaystyle P^{-1}}$ operation. The cheapest preconditioner would therefore be ${\displaystyle P=I}$ since then ${\displaystyle P^{-1}=I.}$ Clearly, this results in the original linear system and the preconditioner does nothing. At the other extreme, the choice ${\displaystyle P=A}$ gives ${\displaystyle P^{-1}A=AP^{-1}=I,}$ which has optimal condition number of 1, requiring a single iteration for convergence; however in this case ${\displaystyle P^{-1}=A^{-1},}$ and applying the preconditioner is as difficult as solving the original system. One therefore chooses ${\displaystyle P}$ as somewhere between these two extremes, in an attempt to achieve a minimal number of linear iterations while keeping the operator ${\displaystyle P^{-1}}$ as simple as possible. Some examples of typical preconditioning approaches are detailed below.

### Preconditioned iterative methods

Preconditioned iterative methods for ${\displaystyle Ax-b=0}$ are, in most cases, mathematically equivalent to standard iterative methods applied to the preconditioned system ${\displaystyle P^{-1}(Ax-b)=0.}$ For example, the standard Richardson iteration for solving ${\displaystyle Ax-b=0}$ is

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}(A\mathbf {x} _{n}-\mathbf {b} ),\ n\geq 0.}$

Applied to the preconditioned system ${\displaystyle P^{-1}(Ax-b)=0,}$ it turns into a preconditioned method

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}P^{-1}(A\mathbf {x} _{n}-\mathbf {b} ),\ n\geq 0.}$

Examples of popular preconditioned iterative methods for linear systems include the preconditioned conjugate gradient method, the biconjugate gradient method, and generalized minimal residual method. Iterative methods, which use scalar products to compute the iterative parameters, require corresponding changes in the scalar product together with substituting ${\displaystyle P^{-1}(Ax-b)=0}$ for ${\displaystyle Ax-b=0.}$

#### Linear preconditioning

Let a linear iterative method be given by the matrix splitting ${\displaystyle A=M-N}$, and iteration matrix ${\displaystyle C=I-M^{-1}A}$.

Assume the following

• the system matrix ${\displaystyle A}$ is symmetric positive-definite
• the splitting matrix ${\displaystyle M}$ is symmetric positive-definite
• the linear iterative method is convergent: ${\displaystyle \rho (C)<1}$.

Then, the reduction of the system's condition number ${\displaystyle \kappa (M^{-1}A)}$ can be bounded from above by

${\displaystyle \kappa (M^{-1}A)\leq {\frac {1+\rho (C)}{1-\rho (C)}}\,.}$

### Geometric interpretation

For a symmetric positive definite matrix ${\displaystyle A}$ the preconditioner ${\displaystyle P}$ is typically chosen to be symmetric positive definite as well. The preconditioned operator ${\displaystyle P^{-1}A}$ is then also symmetric positive definite, but with respect to the ${\displaystyle P}$-based scalar product. In this case, the desired effect in applying a preconditioner is to make the quadratic form of the preconditioned operator ${\displaystyle P^{-1}A}$ with respect to the ${\displaystyle P}$-based scalar product to be nearly spherical .

### Variable and non-linear preconditioning

Denoting ${\displaystyle T=P^{-1}}$, we highlight that preconditioning is practically implemented as multiplying some vector ${\displaystyle r}$ by ${\displaystyle T}$, i.e., computing the product ${\displaystyle Tr.}$ In many applications, ${\displaystyle T}$ is not given as a matrix, but rather as an operator ${\displaystyle T(r)}$ acting on the vector ${\displaystyle r}$. Some popular preconditioners, however, change with ${\displaystyle r}$ and the dependence on ${\displaystyle r}$ may not be linear. Typical examples involve using non-linear iterative methods, e.g., the conjugate gradient method, as a part of the preconditioner construction. Such preconditioners may be practically very efficient, however, their behavior is hard to predict theoretically.

### Spectrally equivalent preconditioning

The most common use of preconditioning is for iterative solution of linear systems resulting from approximations of partial differential equations. The better the approximation quality, the larger the matrix size is. In such a case, the goal of optimal preconditioning is, on the one side, to make the spectral condition number of ${\displaystyle P^{-1}A}$ to be bounded from above by a constant independent of the matrix size, which is called spectrally equivalent preconditioning by D'yakonov. On the other hand, the cost of application of the ${\displaystyle P^{-1}}$ should ideally be proportional (also independent of the matrix size) to the cost of multiplication of ${\displaystyle A}$ by a vector.

### Examples

#### Jacobi (or diagonal) preconditioner

The Jacobi preconditioner is one of the simplest forms of preconditioning, in which the preconditioner is chosen to be the diagonal of the matrix ${\displaystyle P=\mathrm {diag} (A).}$ Assuming ${\displaystyle A_{ii}\neq 0,\forall i}$, we get ${\displaystyle P_{ij}^{-1}={\frac {\delta _{ij}}{A_{ij}}}.}$ It is efficient for diagonally dominant matrices ${\displaystyle A}$.

#### SPAI

The Sparse Approximate Inverse preconditioner minimises ${\displaystyle \|AT-I\|_{F},}$ where ${\displaystyle \|\cdot \|_{F}}$ is the Frobenius norm and ${\displaystyle T=P^{-1}}$ is from some suitably constrained set of sparse matrices. Under the Frobenius norm, this reduces to solving numerous independent least-squares problems (one for every column). The entries in ${\displaystyle T}$ must be restricted to some sparsity pattern or the problem remains as difficult and time-consuming as finding the exact inverse of ${\displaystyle A}$. The method was introduced by M.J. Grote and T. Huckle together with an approach to selecting sparsity patterns.[1]

## Preconditioning for eigenvalue problems

Eigenvalue problems can be framed in several alternative ways, each leading to its own preconditioning. The traditional preconditioning is based on the so-called spectral transformations. Knowing (approximately) the targeted eigenvalue, one can compute the corresponding eigenvector by solving the related homogeneous linear system, thus allowing to use preconditioning for linear system. Finally, formulating the eigenvalue problem as optimization of the Rayleigh quotient brings preconditioned optimization techniques to the scene.[2]

### Spectral transformations

By analogy with linear systems, for an eigenvalue problem ${\displaystyle Ax=\lambda x}$ one may be tempted to replace the matrix ${\displaystyle A}$ with the matrix ${\displaystyle P^{-1}A}$ using a preconditioner ${\displaystyle P}$. However, this makes sense only if the seeking eigenvectors of ${\displaystyle A}$ and ${\displaystyle P^{-1}A}$ are the same. This is the case for spectral transformations.

The most popular spectral transformation is the so-called shift-and-invert transformation, where for a given scalar ${\displaystyle \alpha }$, called the shift, the original eigenvalue problem ${\displaystyle Ax=\lambda x}$ is replaced with the shift-and-invert problem ${\displaystyle (A-\alpha I)^{-1}x=\mu x}$. The eigenvectors are preserved, and one can solve the shift-and-invert problem by an iterative solver, e.g., the power iteration. This gives the Inverse iteration, which normally converges to the eigenvector, corresponding to the eigenvalue closest to the shift ${\displaystyle \alpha }$. The Rayleigh quotient iteration is a shift-and-invert method with a variable shift.

Spectral transformations are specific for eigenvalue problems and have no analogs for linear systems. They require accurate numerical calculation of the transformation involved, which becomes the main bottleneck for large problems.

### General preconditioning

To make a close connection to linear systems, let us suppose that the targeted eigenvalue ${\displaystyle \lambda _{\star }}$ is known (approximately). Then one can compute the corresponding eigenvector from the homogeneous linear system ${\displaystyle (A-\lambda _{\star }I)x=0}$. Using the concept of left preconditioning for linear systems, we obtain ${\displaystyle T(A-\lambda _{\star }I)x=0}$, where ${\displaystyle T}$ is the preconditioner, which we can try to solve using the Richardson iteration

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}T(A-\lambda _{\star }I))\mathbf {x} _{n},\ n\geq 0.}$

#### The ideal preconditioning[2]

The Moore–Penrose pseudoinverse ${\displaystyle T=(A-\lambda _{\star }I)^{+}}$ is the preconditioner, which makes the Richardson iteration above converge in one step with ${\displaystyle \gamma _{n}=1}$, since ${\displaystyle I-(A-\lambda _{\star }I)^{+}(A-\lambda _{\star }I)}$, denoted by ${\displaystyle P_{\star }}$, is the orthogonal projector on the eigenspace, corresponding to ${\displaystyle \lambda _{\star }}$. The choice ${\displaystyle T=(A-\lambda _{\star }I)^{+}}$ is impractical for three independent reasons. First, ${\displaystyle \lambda _{\star }}$ is actually not known, although it can be replaced with its approximation ${\displaystyle {\tilde {\lambda }}_{\star }}$. Second, the exact Moore–Penrose pseudoinverse requires the knowledge of the eigenvector, which we are trying to find. This can be somewhat circumvented by the use of the Jacobi–Davidson preconditioner ${\displaystyle T=(I-{\tilde {P}}_{\star })(A-{\tilde {\lambda }}_{\star }I)^{-1}(I-{\tilde {P}}_{\star })}$, where ${\displaystyle {\tilde {P}}_{\star }}$ approximates ${\displaystyle P_{\star }}$. Last, but not least, this approach requires accurate numerical solution of linear system with the system matrix ${\displaystyle (A-{\tilde {\lambda }}_{\star }I)}$, which becomes as expensive for large problems as the shift-and-invert method above. If the solution is not accurate enough, step two may be redundant.

#### Practical preconditioning

Let us first replace the theoretical value ${\displaystyle \lambda _{\star }}$ in the Richardson iteration above with its current approximation ${\displaystyle \lambda _{n}}$ to obtain a practical algorithm

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}T(A-\lambda _{n}I)\mathbf {x} _{n},\ n\geq 0.}$

A popular choice is ${\displaystyle \lambda _{n}=\rho (x_{n})}$ using the Rayleigh quotient function ${\displaystyle \rho (\cdot )}$. Practical preconditioning may be as trivial as just using ${\displaystyle T=(diag(A))^{-1}}$ or ${\displaystyle T=(diag(A-\lambda _{n}I))^{-1}.}$ For some classes of eigenvalue problems the efficiency of ${\displaystyle T\approx A^{-1}}$ has been demonstrated, both numerically and theoretically. The choice ${\displaystyle T\approx A^{-1}}$ allows one to easily utilize for eigenvalue problems the vast variety of preconditioners developed for linear systems.

Due to the changing value ${\displaystyle \lambda _{n}}$, a comprehensive theoretical convergence analysis is much more difficult, compared to the linear systems case, even for the simplest methods, such as the Richardson iteration.

## Preconditioning in optimization

In optimization, preconditioning is typically used to accelerate first-order optimization algorithms.

### Description

For example, to find a local minimum of a real-valued function ${\displaystyle F(\mathbf {x} )}$ using gradient descent, one takes steps proportional to the negative of the gradient ${\displaystyle -\nabla F(\mathbf {a} )}$ (or of the approximate gradient) of the function at the current point:

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}\nabla F(\mathbf {x} _{n}),\ n\geq 0.}$

The preconditioner is applied to the gradient:

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}P^{-1}\nabla F(\mathbf {x} _{n}),\ n\geq 0.}$

Preconditioning here can be viewed as changing the geometry of the vector space with the goal to make the level sets look like circles. In this case the preconditioned gradient aims closer to the point of the extrema as on the figure, which speeds up the convergence.

### Connection to linear systems

The minimum of a quadratic function

${\displaystyle F(\mathbf {x} )={\frac {1}{2}}\mathbf {x} ^{T}A\mathbf {x} -\mathbf {x} ^{T}\mathbf {b} }$,

where ${\displaystyle \mathbf {x} }$ and ${\displaystyle \mathbf {b} }$ are real column-vectors and ${\displaystyle A}$ is a real symmetric positive-definite matrix, is exactly the solution of the linear equation ${\displaystyle A\mathbf {x} =\mathbf {b} }$. Since ${\displaystyle \nabla F(\mathbf {x} )=A\mathbf {x} -\mathbf {b} }$, the preconditioned gradient descent method of minimizing ${\displaystyle F(\mathbf {x} )}$ is

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}P^{-1}(A\mathbf {x} _{n}-\mathbf {b} ),\ n\geq 0.}$

This is the preconditioned Richardson iteration for solving a system of linear equations.

### Connection to eigenvalue problems

The minimum of the Rayleigh quotient

${\displaystyle \rho (\mathbf {x} )={\frac {\mathbf {x} ^{T}A\mathbf {x} }{\mathbf {x} ^{T}\mathbf {x} }},}$

where ${\displaystyle \mathbf {x} }$ is a real non-zero column-vector and ${\displaystyle A}$ is a real symmetric positive-definite matrix, is the smallest eigenvalue of ${\displaystyle A}$, while the minimizer is the corresponding eigenvector. Since ${\displaystyle \nabla \rho (\mathbf {x} )}$ is proportional to ${\displaystyle A\mathbf {x} -\rho (\mathbf {x} )\mathbf {x} }$, the preconditioned gradient descent method of minimizing ${\displaystyle \rho (\mathbf {x} )}$ is

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}P^{-1}(A\mathbf {x} _{n}-\rho (\mathbf {x_{n}} )\mathbf {x_{n}} ),\ n\geq 0.}$

This is an analog of preconditioned Richardson iteration for solving eigenvalue problems.

### Variable preconditioning

In many cases, it may be beneficial to change the preconditioner at some or even every step of an iterative algorithm in order to accommodate for a changing shape of the level sets, as in

${\displaystyle \mathbf {x} _{n+1}=\mathbf {x} _{n}-\gamma _{n}P_{n}^{-1}\nabla F(\mathbf {x} _{n}),\ n\geq 0.}$

One should have in mind, however, that constructing an efficient preconditioner is very often computationally expensive. The increased cost of updating the preconditioner can easily override the positive effect of faster convergence.

## References

1. M.J. Grote & T. Huckle (1997) "Parallel pre-conditioning with sparse approximate inverses", SIAM_Journal_on_Scientific_Computing 18:838–53
2. Knyazev, Andrew V. (1998). "Preconditioned eigensolvers - an oxymoron?". Electronic Transactions on Numerical Analysis. 7: 104–123.
• Axelsson, Owe (1996). Iterative Solution Methods. Cambridge University Press. p. 6722. ISBN 978-0-521-55569-2.
• D'yakonov, E. G. (1996). Optimization in solving elliptic problems. CRC-Press. pp. 592. ISBN 978-0-8493-2872-5.
• Yousef Saad & Henk van der Vorst (2001) "Iterative solution of linear systems in the 20th century", §8 Preconditioning methods, pp 193–8 of Numerical Analysis: Historical Developments in the 20th Century, C. Brezinski & L Wuytack editors, Elsevier Science Publishers ISBN 0-444-50617-9.
• van der Vorst, H. A. (2003). Iterative Krylov Methods for Large Linear systems. Cambridge University Press, Cambridge. ISBN 0-521-81828-1.