Category:Density mixing: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Density mixing''' refers to the way of updating, e.g., the charge density with each iteration step in a self-consistent calculation within density-functional theory (DFT). In the case of magnetism and metaGGAs, VASP can also consider the spin-magnetization density and kinetic-energy density. Selecting the optimal procedure enhances the convergence of the [[:Category:Electronic minimization|electronic minimization]] and avoids [[charge sloshing]]. In many cases, VASP automatically selects suitable values, and it is unnecessary to [[#Improve the convergence|set the tags related to density mixing manually]].
== Theory ==
== Theory ==
In each iteration of a DFT cycle, we start from a given charge density <math>\rho_{in}</math> and obtain the corresponding Kohn-Sham Hamiltonian and its eigenstates (wavefunctions). From the occupied states, we can compute a new charge density <math>\rho_{out}</math>, so that conceptionally we need to solve a multidimensional fixed-point problem. In the case of magnetism and MetaGGAs, the problem becomes even more complex, because in addition also the magnetization density and the kinetic-energy density are relevant.
In each iteration of a DFT calculation, we start from a given charge density <math>\rho_{in}</math> and obtain the corresponding Kohn-Sham (KS) Hamiltonian and its eigenstates, i.e., KS orbitals. From the occupied KS orbitals, we can compute a new charge density <math>\rho_{out}</math>. Thus, conceptionally VASP solves a multidimensional fixed-point problem. To solve this problem, VASP uses nonlinear solvers that work with the input vector <math>\rho_{in}</math> and the residual <math>R = \rho_{out} - \rho_{in}</math>. The optimal solution is obtained within the subspace spanned by the input vectors. The most efficient density-mixing schemes are the Broyden{{cite|broyden:mc:1965}}  and the Pulay{{cite|pulay:cpl:1980}} mixing ({{TAG|IMIX}}=4). In the Broyden{{cite|broyden:mc:1965}} mixing, an approximate of the Jacobian matrix is iteratively improved to find the optimal solution. In the Pulay{{cite|pulay:cpl:1980}} mixing, the input vectors are combined assuming linearity to minimize the residual.


To solve this problem, we use nonlinear solvers that work with the input vector <math>\rho_{in}</math> and the residual <math>R = \rho_{out} - \rho_{in}</math>. In these methods a subspace is built from the input vectors and the optimal solution within this subspace is obtained. The most efficient solutions are the Broyden{{cite|broyden:mc:1965}}  and the Pulay{{cite|pulay:cpl:1980}} mixing scheme. In the former method, an approximate of the Jacobian matrix is iteratively improved to find the optimal solution. In the latter method, the input vectors are combined assuming linearity to minimize the residual.
The implementation in VASP is based on the work of Johnson{{cite|johnson:prb:1988}}. Kresse and Furthmüller{{cite|kresse:cms:1996}} extended on it and demonstrated that the Broyden and Pulay schemes transform into each other for certain choices of weights for the previous iterations. They also introduced an efficient metric putting additional weight on the long-range components of the density (small <math>\mathbf G</math> vectors), resulting in a more robust convergence. Furthermore, VASP uses a Kerker preconditioning{{cite|kerker:prb:1981}} to improve the choice of the input density for the next iteration.
 
The implementation in VASP is based on the work of Johnson{{cite|johnson:prb:1988}}. Kresse and Furthmüller{{cite|kresse:cms:1996}} extended on it and demonstrated that the Broyden and Pulay scheme transform into each other for certain choices of weights for the previous iterations. They also introduced an efficient metric putting additional weight on the long-range components of the density (small <math>\mathbf G</math> vectors) resulting in a more robust convergence. Furthermore, a preconditioning can improve the choice of the input density for the next iteration and we use a Kerker preconditioning{{cite|kerker:prb:1981}} in VASP.


== How to ==
== How to ==


===Improve the convergence===
===Improve the convergence===
For most simple DFT calculations the default choice of the convergence parameters is quite well suited to converge the calculation. As a first step, we suggest to visualize your structure or examine the output for warnings to check for very close atoms. This can occasionally happen during a relaxation if a too large ionic step is performed. If the structure is correct, we recommend to increase the number of steps {{TAG|NELM}} and only if that doesn't work starting to tweak the parameters {{TAG|AMIX}} or {{TAG|BMIX}}; preferably the latter.
For most simple DFT calculations, the default choice of the convergence parameters is well suited to converge the calculation. As a first step, we suggest visualizing your structure or examining the output for warnings to check for very close atoms. That can happen during a structure relaxation if VASP performs a large ionic step. If the structure is correct, we recommend increasing the number of steps {{TAG|NELM}} and only if that doesn't work starting to tweak the parameters {{TAG|AMIX}} or {{TAG|BMIX}}; preferably the latter.


===Magnetic calculations===
===Magnetic calculations===
For magnetic materials not only the charge density, but also the magnetization density needs to converge.
For magnetic materials, the charge density and the spin-magnetization density need to converge.
{{:Converge magnetic calculations}}
 
Hence, if you have problems to converge to a desired magnetic solution, try to calculate first the non-magnetic groundstate, and continue from the generated {{TAG|WAVECAR}} and {{TAG|CHGCAR}} file. For the continuation job, you need to set
{{TAG|ISPIN}} {{=}} 2
{{TAG|ICHARG}} {{=}} 1
in the {{TAG|INCAR}} file.


===MetaGGAs===
===MetaGGAs===
{{:Kinetic-energy density mixing}}
For the density mixing schemes to work reliably, the charge density mixer must know all quantities that affect the total energy during the self-consistency cycle. For a standard DFT functional, this is solely the charge density. In the case of meta-GGAs, however, the total energy depends on the kinetic-energy density.
 
In many cases, the density-mixing scheme works well enough without passing the kinetic-energy density through the mixer, which is why {{TAG|LMIXTAU}}=.FALSE., per default. However, when the self-consistency cycle fails to converge for one of the algorithms exploiting density mixing, e.g., {{TAG|IALGO}}=38 or 48, one may set {{TAG|LMIXTAU}}=.TRUE. to have VASP pass the kinetic-energy density through the mixer as well.
It sometimes helps to cure convergence problems in the self-consistency cycle.


== References ==
== References ==
<references/>


----


[[Category:VASP]][[Category:Electronic Minimization]]
 
[[Category:VASP]][[Category:Electronic minimization]]

Latest revision as of 13:59, 15 July 2024

Density mixing refers to the way of updating, e.g., the charge density with each iteration step in a self-consistent calculation within density-functional theory (DFT). In the case of magnetism and metaGGAs, VASP can also consider the spin-magnetization density and kinetic-energy density. Selecting the optimal procedure enhances the convergence of the electronic minimization and avoids charge sloshing. In many cases, VASP automatically selects suitable values, and it is unnecessary to set the tags related to density mixing manually.

Theory

In each iteration of a DFT calculation, we start from a given charge density and obtain the corresponding Kohn-Sham (KS) Hamiltonian and its eigenstates, i.e., KS orbitals. From the occupied KS orbitals, we can compute a new charge density . Thus, conceptionally VASP solves a multidimensional fixed-point problem. To solve this problem, VASP uses nonlinear solvers that work with the input vector and the residual . The optimal solution is obtained within the subspace spanned by the input vectors. The most efficient density-mixing schemes are the Broyden[1] and the Pulay[2] mixing (IMIX=4). In the Broyden[1] mixing, an approximate of the Jacobian matrix is iteratively improved to find the optimal solution. In the Pulay[2] mixing, the input vectors are combined assuming linearity to minimize the residual.

The implementation in VASP is based on the work of Johnson[3]. Kresse and Furthmüller[4] extended on it and demonstrated that the Broyden and Pulay schemes transform into each other for certain choices of weights for the previous iterations. They also introduced an efficient metric putting additional weight on the long-range components of the density (small vectors), resulting in a more robust convergence. Furthermore, VASP uses a Kerker preconditioning[5] to improve the choice of the input density for the next iteration.

How to

Improve the convergence

For most simple DFT calculations, the default choice of the convergence parameters is well suited to converge the calculation. As a first step, we suggest visualizing your structure or examining the output for warnings to check for very close atoms. That can happen during a structure relaxation if VASP performs a large ionic step. If the structure is correct, we recommend increasing the number of steps NELM and only if that doesn't work starting to tweak the parameters AMIX or BMIX; preferably the latter.

Magnetic calculations

For magnetic materials, the charge density and the spin-magnetization density need to converge.

Hence, if you have problems to converge to a desired magnetic solution, try to calculate first the non-magnetic groundstate, and continue from the generated WAVECAR and CHGCAR file. For the continuation job, you need to set

ISPIN = 2
ICHARG = 1 

in the INCAR file.

MetaGGAs

For the density mixing schemes to work reliably, the charge density mixer must know all quantities that affect the total energy during the self-consistency cycle. For a standard DFT functional, this is solely the charge density. In the case of meta-GGAs, however, the total energy depends on the kinetic-energy density.

In many cases, the density-mixing scheme works well enough without passing the kinetic-energy density through the mixer, which is why LMIXTAU=.FALSE., per default. However, when the self-consistency cycle fails to converge for one of the algorithms exploiting density mixing, e.g., IALGO=38 or 48, one may set LMIXTAU=.TRUE. to have VASP pass the kinetic-energy density through the mixer as well. It sometimes helps to cure convergence problems in the self-consistency cycle.

References

Pages in category "Density mixing"

The following 13 pages are in this category, out of 13 total.