MAXMIX: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{TAGDEF|MAXMIX|[integer]|-45}}
{{TAGDEF|MAXMIX|[integer]|-45}}


Description: {{TAG|MAXMIX}} specifies the maximum number steps stored in Broyden mixer ({{TAG|IMIX}}=4).
Description: {{TAG|MAXMIX}} specifies the maximum number of steps stored in the Broyden mixer ({{TAG|IMIX}}=4).
----
----
{{TAG|MAXMIX}} specifies the maximum number of vectors stored in the Broyden/Pulay mixer, in other words it corresponds to the maximal rank of the approximation of the charge dielectric function build up by the mixer. {{TAG|MAXMIX}} can be either negative or positive:
{{TAG|MAXMIX}} specifies the maximum number of vectors stored in the Broyden/Pulay mixer, in other words, it corresponds to the maximal rank of the approximation of the charge-dielectric function build up by the mixer. {{TAG|MAXMIX}} can be either negative or positive:
*{{TAG|MAXMIX}}<0
*{{TAG|MAXMIX}}<0
:The mixer is reset after each ionic step or if the number of electronic steps exceeds |{{TAG|MAXMIX}}| (this is the default and similar to the behavior of VASP.4.3 and VASP.3.2).
:The mixer is reset after each ionic step or if the number of electronic steps exceeds |{{TAG|MAXMIX}}| (this is the default and similar to the behavior of VASP.4.3 and VASP.3.2).
*{{TAG|MAXMIX}}>0
*{{TAG|MAXMIX}}>0
:The charge density mixer is only reset if the storage capabilities are exceeded. The reset is done "smoothly" by removing the five oldest vectors from the iteration history. Therefore, if {{TAG|MAXMIX}} is positive, the approximation for the charge dielectric function which was obtained in previous ionic steps is "reused" in the current ionic step, and this in turn can reduce the number of electronic steps during relaxations and MD's. Especially for relaxations which start from a good ionic starting guess and for systems with a strong charge sloshing behavior the speedup can be significant. We found that for a 12 &Aring; long box containing 16 Fe atoms the number of electronic iterations decreased from 8 to 2-3 when {{TAG|MAXMIX}} was set to 40. For a carbon surface the number of iterations decreased from 7 to 3. At the same time the energy stability increased significantly. But be careful, this option increases the memory requirements for the mixer considerably, and thus the option is not recommended for systems were charge sloshing is negligible anyway (like bulk simple metals). The optimal setting for {{TAG|MAXMIX}} is usually around three times the number of electronic steps required in the first iteration. Too large values for {{TAG|MAXMIX}} might cause the code to crash (because linear dependencies between input vectors might develop).
:The charge density mixer is only reset if the storage capabilities are exceeded. The reset is done "smoothly" by removing the five oldest vectors from the iteration history. Therefore, if {{TAG|MAXMIX}} is positive, the approximation for the charge dielectric function which was obtained in previous ionic steps is "reused" in the current ionic step, and this, in turn, can reduce the number of electronic steps during relaxations and MD's. Especially for relaxations that start from a good ionic starting guess and for systems with a strong charge sloshing behavior the speedup can be significant. We found that for a 12 &Aring; long box containing 16 Fe atoms the number of electronic iterations decreased from 8 to 2-3 when {{TAG|MAXMIX}} was set to 40. For a carbon surface the number of iterations decreased from 7 to 3. At the same time, the energy stability increased significantly. But be careful, this option increases the memory requirements for the mixer considerably, and thus the option is not recommended for systems where charge sloshing is negligible anyway (like bulk simple metals). The optimal setting for {{TAG|MAXMIX}} is usually around three times the number of electronic steps required in the first iteration. Too large values for {{TAG|MAXMIX}} might cause the code to crash (because linear dependencies between input vectors might develop). Too small values for {{TAG|MAXMIX}} can slow your convergence significantly. For instance, if you need 50 self-consistency cycles, and set {{TAG|MAXMIX}}  to 20, you force the mixer to remove iteration history continuously, which can cause divergence and at least a slow down of the convergence.
* Caution: do not set {{TAG|MAXMIX}}>0 in the following cases. (i) If your initial positions in the {{TAG|POSCAR}} file are far from the fully relaxed positions, the ions might move considerably during relaxation. In this case, it is not expedient to "reuse" charge mixing information from the previous ionic steps. (ii) During machine learning, the first-principles calculations are often bypassed for hundreds or even thousands of ionic steps, and the ions might move considerably between first-principles calculations. In these cases using {{TAG|MAXMIX}} will very often lead to electronic divergence or strange errors during the self-consistency cycle. In general, whenever the column RMS(c) in the {{TAG|OSZICAR}} files shows a sudden increase in the norm of the charge density residual vector, try to remove the tag {{TAG|MAXMIX}} from the INCAR file.


'''Mind''': {{TAG|MAXMIX}} is only available in VASP.4.4 and newer versions, and it is strongly recommended to use this option for molecular dynamics and relaxations.


== Related Tags and Sections ==
{{NB|mind|{{TAG|MAXMIX}} is only available in VASP.4.4 and newer versions, and it is strongly recommended to use this option for molecular dynamics and relaxations.}}
 
== Related tags and articles ==
{{TAG|IMIX}},
{{TAG|IMIX}},
{{TAG|INIMIX}},
{{TAG|INIMIX}},
Line 24: Line 26:
{{sc|MAXMIX|Examples|Examples that use this tag}}
{{sc|MAXMIX|Examples|Examples that use this tag}}
----
----
[[The_VASP_Manual|Contents]]


[[Category:INCAR]][[Category:Electronic Minimization]][[Category:Mixing]]
[[Category:INCAR tag]][[Category:Density mixing]]

Latest revision as of 14:54, 17 October 2024

MAXMIX = [integer]
Default: MAXMIX = -45 

Description: MAXMIX specifies the maximum number of steps stored in the Broyden mixer (IMIX=4).


MAXMIX specifies the maximum number of vectors stored in the Broyden/Pulay mixer, in other words, it corresponds to the maximal rank of the approximation of the charge-dielectric function build up by the mixer. MAXMIX can be either negative or positive:

The mixer is reset after each ionic step or if the number of electronic steps exceeds |MAXMIX| (this is the default and similar to the behavior of VASP.4.3 and VASP.3.2).
The charge density mixer is only reset if the storage capabilities are exceeded. The reset is done "smoothly" by removing the five oldest vectors from the iteration history. Therefore, if MAXMIX is positive, the approximation for the charge dielectric function which was obtained in previous ionic steps is "reused" in the current ionic step, and this, in turn, can reduce the number of electronic steps during relaxations and MD's. Especially for relaxations that start from a good ionic starting guess and for systems with a strong charge sloshing behavior the speedup can be significant. We found that for a 12 Å long box containing 16 Fe atoms the number of electronic iterations decreased from 8 to 2-3 when MAXMIX was set to 40. For a carbon surface the number of iterations decreased from 7 to 3. At the same time, the energy stability increased significantly. But be careful, this option increases the memory requirements for the mixer considerably, and thus the option is not recommended for systems where charge sloshing is negligible anyway (like bulk simple metals). The optimal setting for MAXMIX is usually around three times the number of electronic steps required in the first iteration. Too large values for MAXMIX might cause the code to crash (because linear dependencies between input vectors might develop). Too small values for MAXMIX can slow your convergence significantly. For instance, if you need 50 self-consistency cycles, and set MAXMIX to 20, you force the mixer to remove iteration history continuously, which can cause divergence and at least a slow down of the convergence.
  • Caution: do not set MAXMIX>0 in the following cases. (i) If your initial positions in the POSCAR file are far from the fully relaxed positions, the ions might move considerably during relaxation. In this case, it is not expedient to "reuse" charge mixing information from the previous ionic steps. (ii) During machine learning, the first-principles calculations are often bypassed for hundreds or even thousands of ionic steps, and the ions might move considerably between first-principles calculations. In these cases using MAXMIX will very often lead to electronic divergence or strange errors during the self-consistency cycle. In general, whenever the column RMS(c) in the OSZICAR files shows a sudden increase in the norm of the charge density residual vector, try to remove the tag MAXMIX from the INCAR file.


Mind: MAXMIX is only available in VASP.4.4 and newer versions, and it is strongly recommended to use this option for molecular dynamics and relaxations.

Related tags and articles

IMIX, INIMIX, AMIX, BMIX, AMIX_MAG, BMIX_MAG, AMIN, MIXPRE, WC

Examples that use this tag