# DIIS

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/DIIS
> Markdown URL: https://mediated.wiki/source/DIIS.md
> Source: https://en.wikipedia.org/wiki/DIIS
> Source revision: 1262632523
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

**DIIS** (**direct inversion in the iterative subspace** or **direct inversion of the iterative subspace**), also known as **Pulay mixing**, is a technique for [extrapolating](/source/Extrapolation) the solution to a set of linear equations by directly minimizing an error residual (e.g. a [Newton–Raphson](/source/Newton's_method) step size) with respect to a linear combination of known sample vectors. DIIS was developed by [Peter Pulay](/source/Peter_Pulay) in the field of computational [quantum chemistry](/source/Quantum_chemistry) with the intent to accelerate and stabilize the [convergence](/source/Convergence_(mathematics)) of the [Hartree–Fock](/source/Hartree%E2%80%93Fock) self-consistent field method.[1][2][3]

At a given iteration, the approach constructs a [linear combination](/source/Linear_combination) of approximate error vectors from previous iterations. The coefficients of the linear combination are determined so to best approximate, in a [least squares](/source/Least_squares) sense, the [null vector](/source/Null_vector). The newly determined coefficients are then used to extrapolate the function variable for the next iteration.

## Details

At each iteration, an approximate error vector, **e***i*, corresponding to the variable value, **p***i* is determined. After sufficient iterations, a linear combination of *m* previous error vectors is constructed

- \mathbf e_{m+1}=\sum_{i = 1}^m\ c_i\mathbf e_i.

The DIIS method seeks to minimize the norm of **e***m*+1 under the constraint that the coefficients sum to one. The reason why the coefficients must sum to one can be seen if we write the trial vector as the sum of the exact solution (**p**f) and an error vector. In the DIIS approximation, we get:

- \begin{align} \mathbf p &= \sum_i c_i \left( \mathbf p^\text{f} + \mathbf e_i \right) \\ &= \mathbf p^\text{f} \sum_i c_i + \sum_i c_i \mathbf e_i \end{align}

We minimize the second term while it is clear that the sum coefficients must be equal to one if we want to find the exact solution. The minimization is done by a [Lagrange multiplier](/source/Lagrange_multiplier) technique. Introducing an undetermined multiplier *λ*, a Lagrangian is constructed as

- \begin{align} L&=\left\|\mathbf e_{m+1}\right\|^2-2\lambda\left(\sum_i\ c_i-1\right),\\ &=\sum_{ij}c_jB_{ji}c_i-2\lambda\left(\sum_i\ c_i-1\right),\text{ where } B_{ij}=\langle\mathbf e_j, \mathbf e_i\rangle. \end{align}

Equating zero to the derivatives of *L* with respect to the coefficients and the multiplier leads to a system of (*m* + 1) [linear equations](/source/Linear_equation) to be solved for the *m* coefficients (and the Lagrange multiplier).

- \begin{bmatrix} B_{11} & B_{12} & B_{13} & ... & B_{1m} & -1 \\ B_{21} & B_{22} & B_{23} & ... & B_{2m} & -1 \\ B_{31} & B_{32} & B_{33} & ... & B_{3m} & -1 \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ B_{m1} & B_{m2} & B_{m3} & ... & B_{mm} & -1 \\ 1 & 1 & 1 & ... & 1 & 0 \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \\ c_3 \\ \vdots \\ c_m \\ \lambda \end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{bmatrix}

Moving the minus sign to *λ*, results in an equivalent symmetric problem.

- \begin{bmatrix} B_{11} & B_{12} & B_{13} & ... & B_{1m} & 1 \\ B_{21} & B_{22} & B_{23} & ... & B_{2m} & 1 \\ B_{31} & B_{32} & B_{33} & ... & B_{3m} & 1 \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ B_{m1} & B_{m2} & B_{m3} & ... & B_{mm} & 1 \\ 1 & 1 & 1 & ... & 1 & 0 \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \\ c_3 \\ \vdots \\ c_m \\ -\lambda \end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{bmatrix}

The coefficients are then used to update the variable as

- \mathbf p_{m+1}=\sum_{i = 1}^m c_i\mathbf p_i.

## References

1. Pulay, Péter (1980). "Convergence acceleration of iterative sequences. the case of SCF iteration". *Chemical Physics Letters*. **73** (2): 393–398. [Bibcode:1980CPL....73..393P](https://ui.adsabs.harvard.edu/abs/1980CPL....73..393P). [doi:10.1016/0009-2614(80)80396-4](https://doi.org/10.1016/0009-2614(80)80396-4)

1. Pulay, Péter (1982). "Improved SCF Convergence Acceleration". *Journal of Computational Chemistry*. **3** (4): 556–560. [doi:10.1002/jcc.540030413](https://doi.org/10.1002/jcc.540030413). [S2CID 120876883](https://api.semanticscholar.org/CorpusID:120876883)

1. Shepard, Ron & Minkoff, Michael (2010). "Some comments on the DIIS method". *Molecular Physics*. **105** (19–22): 2839–2848. [Bibcode:2007MolPh.105.2839S](https://ui.adsabs.harvard.edu/abs/2007MolPh.105.2839S). [doi:10.1080/00268970701691611](https://doi.org/10.1080/00268970701691611). [S2CID 94014926](https://api.semanticscholar.org/CorpusID:94014926)

## Literature

- Garza, Alejandro J. & Scuseria, Gustavo E. (2012). ["Comparison of self-consistent field convergence acceleration techniques"](https://scholarship.rice.edu/bitstream/1911/94152/1/FieldConvergence.pdf). *Journal of Chemical Physics*. **173** (5): 054110. [Bibcode:2012JChPh.137e4110G](https://ui.adsabs.harvard.edu/abs/2012JChPh.137e4110G). [doi:10.1063/1.4740249](https://doi.org/10.1063/1.4740249). [hdl:1911/94152](https://hdl.handle.net/1911/94152). [PMID 22894335](https://pubmed.ncbi.nlm.nih.gov/22894335)
- Rohwedder, Thorsten & Schneider, Reinhold (2011). "An analysis for the DIIS acceleration method used in quantum chemistry calculations". *Journal of Mathematical Chemistry*. **49** (9): 1889. [CiteSeerX 10.1.1.461.1285](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.461.1285). [doi:10.1007/s10910-011-9863-y](https://doi.org/10.1007/s10910-011-9863-y). [S2CID 51759476](https://api.semanticscholar.org/CorpusID:51759476)

## See also

- [GMRES](/source/GMRES)

## External links

- [The Mathematics of DIIS](http://vergil.chemistry.gatech.edu/notes/diis/node2.html)

---
Adapted from the Wikipedia article [DIIS](https://en.wikipedia.org/wiki/DIIS) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/DIIS?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
