RMM-DIIS: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
The schemes like {{TAG|Davidson iteration scheme}} and {{TAG|Conjugate gradient optimization}}, try to optimize the expectation value
The implementation of the Residual Minimization Method with Direct Inversion in the Iterative Subspace (RMM-DIIS) in {{VASP}}{{cite|kresse:cms:1996}}{{cite|kresse:prb:96}} is based on the original work of Pulay:{{cite|pulay:cpl:1980}}{{cite}}
of the Hamiltonian for each wavefunction using an increasing trial basis-set.
Instead of minimizing the expectation value it is also possible to
minimize the norm of the residual vector. This leads to a similar iteration scheme as
described in {{TAG|Efficient single band eigenvalue-minimization}}, but a different eigenvalue problem
has to be solved (see Refs. {{cite|wood:jpa:1985}}{{cite|pulay:cpl:1980}}).
 
There is a significant difference
between optimizing the eigenvalue and the norm of the residual vector.
The norm of the
residual vector is given by


* The procedure starts with the evaluation of the preconditioned residual vector for some selected orbital <math>\psi^0_m</math>:
::<math>
K \vert R^0_m \rangle = K \vert R(\psi^0_m) \rangle
</math>
:where <math>K</math> is the [[preconditioning]] function, and the residual is computed as:
::<math>\vert R(\psi) \rangle = (H-\epsilon_{\rm app}) \vert \psi \rangle
</math>
:with
::<math>
::<math>
\langle R_n  | R_n \rangle =\langle \phi_n | (H - \epsilon)^(H - \epsilon) | \phi_n \rangle,
\epsilon_{\rm app} = \frac{\langle \psi \vert H \vert \psi \rangle}{\langle \psi \vert S \vert \psi \rangle}
</math>
* Then a Jacobi-like trial step is taken in the direction of the vector:
::<math> \vert \psi^1_m \rangle = \vert \psi^0_m \rangle + \lambda K \vert R^0_m \rangle
</math>
: and a new residual vector is determined:
::<math>\vert R^1_m \rangle = \vert R(\psi^1_m) \rangle
</math>
* Next a linear combination of the initial orbital <math>\psi^0_m</math> and the trial orbital <math>\psi^1_m</math>
::<math>\vert \bar{\psi}^M \rangle = \sum^M_{i=0} \alpha_i \vert \psi^i_m \rangle, \,\, M=1 </math>
:is sought, such that the norm of the residual vector is minimized. Assuming linearity in the residual vector:
::<math>\vert \bar{R}^M \rangle = \vert R(\bar{\psi}^M) \rangle = \sum^M_{i=0} \alpha_i \vert R^i_m \rangle
</math>
: this requires the minimization of:
::<math>\frac{\sum_{ij} \alpha_i^* \alpha_j \langle R^i_m \vert R^j_m \rangle}{\sum_{ij}\alpha_i^* \alpha_j \langle \psi^i_m \vert S \vert \psi^j_m \rangle}
</math>
: with respect to <math>{\{\alpha_i | i=0,..,M\}}</math>.
: This step is usually called ''direct inversion of the iterative subspace'' (DIIS).
* The next trial step (<math>M=2</math>) starts from <math>\bar{\psi}^1</math>, along the direction <math>K \bar{R}^1</math>. In each iteration <math>M</math> is increased by 1, and a new trial orbital:
::<math>\vert \psi^M_m \rangle = \vert \bar{\psi}^{M-1} \rangle + \lambda K \vert \bar{R}^{M-1} \rangle
</math>
</math>
: and its corresponding residual vector <math>R(\psi^M_m)</math> are added to the iterative subspace, that is subsequently inverted to yield <math>\bar{\psi}^M</math>.
: The algorithm keeps iterating until the norm of the residual <math>\bar{R}^M</math> has dropped below a certain threshold, or the maximum number of iterations per orbital has been reached ({{TAG|NRMM}}).
* Replace <math>\psi^0_m</math> by <math>\bar{\psi}^M</math> and move on to start work on the next orbital, ''e.g.'' <math>\psi^0_{m+1}</math>.
The size of the trial step <math>\lambda</math> is a critical value for the stability of the algorithm. We have found that a reasonable choice for the trial step can be obtained from the minimization of the Rayleigh quotient along the search direction in ''the first step'', this optimal <math>\lambda</math> is then used for a particular orbital until the algorithm moves on to the next orbital.{{cite|kresse:cms:1996}}{{cite|kresse:prb:96}}
As mentioned before, the optimization of an orbital is stopped when either the maximum number of iterations per orbital ({{TAG|NRMM}}), or a certain convergence threshold has been reached. The latter may be fine-tuned by means of the {{TAG|EBREAK}}, {{TAG|DEPER}}, and {{TAG|WEIMIN}} tags. Note: we do not recommend you to do so! Rather rely on the defaults instead.
The [[RMM-DIIS]] algorithm works on a "per-orbital" basis and as such it trivially parallelizes over orbitals, which is the default [[Parallelization| parallelization strategy of VASP]]. However, to cast some of the operations involved into the form of ''matrix-matrix multiplications'' and leverage the performance of BLAS3 library calls, the [[RMM-DIIS]] implementation in VASP works on {{TAG|NSIM}} orbitals simultaneously.
Note that, in the [[Self-consistency_cycle|self-consistency cycle]] of {{VASP}}, subspace rotation and [[RMM-DIIS]] refinement of the orbitals alternate.
Furthermore, {{VASP}} re-orthonormalizes the orbitals after the [[RMM-DIIS]] refinement step.
It should be emphasized that, in principle, the [[RMM-DIIS]] method should also converge without any explicit subspace diagonalization and/or re-orthonormalization.
However, in our experience their inclusion speeds up convergence so substantially that it shortens the time-to-solution of most calculations, even though these operations scale as <math>O(N^3)</math>.{{cite|kresse:cms:1996}}{{cite|kresse:prb:96}}
A drawback of the [[RMM-DIIS]] method is that it always converges toward the eigenstates which are closest to the initial trial orbitals. This leads, in principle, to serious problems because there is no guarantee of convergence to the correct ground state at all: if the initial set of orbitals does not ‘‘span’’ the ground state it might happen that in the final solution some eigenstates are ‘‘missing’’. To avoid this, the initialization of the orbitals must be done with great care.
Therefore, either the number of non-selfconsistent cycles at the start of [[Self-consistency_cycle|self-consistency cycle]] is chosen to be large ({{TAG|NELMDL}} = 12, for {{TAG|ALGO}} = VeryFast), or the non-selfconsistent cycles are done with the [[Blocked-Davidson algorithm|blocked-Davidson algorithm]] before switching over to the use of the [[RMM-DIIS]] ({{TAG|ALGO}} = Fast).


and possesses a quadratic unrestricted minimum at the each
The [[RMM-DIIS]] is approximately a factor of 1.5-2 faster than the [[Blocked-Davidson algorithm|blocked-Davidson algorithm]], but less robust.
eigenfunction <math>\phi_n</math>. If you have a good starting guess for
the eigenfunction it is possible to use this algorithm without
the knowledge of other wavefunctions, and therefore
without the explicit orthogonalization of the preconditioned residual vector
(eq. for <math>g_n</math> in {{TAG|Single band steepest descent scheme}}).
In this case, after a sweep over all bands a Gram-Schmidt orthogonalization is  necessary
to obtain a new orthogonal trial-basis set.
Without the  explicit orthogonalization to the current set of trial wavefunctions
all other algorithms tend to converge to the lowest band, no matter
from which band they started.


More information regarding related input variables and potential problems is available in the [[IALGO#RMM-DIIS]] section.
== References ==
== References ==
<references/>
<references/>
----
----
[[Category:Electronic minimization]][[Category:Theory]]
[[Category:Electronic minimization]][[Category:Theory]]

Latest revision as of 09:43, 14 November 2023

The implementation of the Residual Minimization Method with Direct Inversion in the Iterative Subspace (RMM-DIIS) in VASP[1][2] is based on the original work of Pulay:[3]

  • The procedure starts with the evaluation of the preconditioned residual vector for some selected orbital :
where is the preconditioning function, and the residual is computed as:
with
  • Then a Jacobi-like trial step is taken in the direction of the vector:
and a new residual vector is determined:
  • Next a linear combination of the initial orbital and the trial orbital
is sought, such that the norm of the residual vector is minimized. Assuming linearity in the residual vector:
this requires the minimization of:
with respect to .
This step is usually called direct inversion of the iterative subspace (DIIS).
  • The next trial step () starts from , along the direction . In each iteration is increased by 1, and a new trial orbital:
and its corresponding residual vector are added to the iterative subspace, that is subsequently inverted to yield .
The algorithm keeps iterating until the norm of the residual has dropped below a certain threshold, or the maximum number of iterations per orbital has been reached (NRMM).
  • Replace by and move on to start work on the next orbital, e.g. .

The size of the trial step is a critical value for the stability of the algorithm. We have found that a reasonable choice for the trial step can be obtained from the minimization of the Rayleigh quotient along the search direction in the first step, this optimal is then used for a particular orbital until the algorithm moves on to the next orbital.[1][2]

As mentioned before, the optimization of an orbital is stopped when either the maximum number of iterations per orbital (NRMM), or a certain convergence threshold has been reached. The latter may be fine-tuned by means of the EBREAK, DEPER, and WEIMIN tags. Note: we do not recommend you to do so! Rather rely on the defaults instead.

The RMM-DIIS algorithm works on a "per-orbital" basis and as such it trivially parallelizes over orbitals, which is the default parallelization strategy of VASP. However, to cast some of the operations involved into the form of matrix-matrix multiplications and leverage the performance of BLAS3 library calls, the RMM-DIIS implementation in VASP works on NSIM orbitals simultaneously.

Note that, in the self-consistency cycle of VASP, subspace rotation and RMM-DIIS refinement of the orbitals alternate. Furthermore, VASP re-orthonormalizes the orbitals after the RMM-DIIS refinement step. It should be emphasized that, in principle, the RMM-DIIS method should also converge without any explicit subspace diagonalization and/or re-orthonormalization. However, in our experience their inclusion speeds up convergence so substantially that it shortens the time-to-solution of most calculations, even though these operations scale as .[1][2]

A drawback of the RMM-DIIS method is that it always converges toward the eigenstates which are closest to the initial trial orbitals. This leads, in principle, to serious problems because there is no guarantee of convergence to the correct ground state at all: if the initial set of orbitals does not ‘‘span’’ the ground state it might happen that in the final solution some eigenstates are ‘‘missing’’. To avoid this, the initialization of the orbitals must be done with great care. Therefore, either the number of non-selfconsistent cycles at the start of self-consistency cycle is chosen to be large (NELMDL = 12, for ALGO = VeryFast), or the non-selfconsistent cycles are done with the blocked-Davidson algorithm before switching over to the use of the RMM-DIIS (ALGO = Fast).

The RMM-DIIS is approximately a factor of 1.5-2 faster than the blocked-Davidson algorithm, but less robust.

References