Energy cutoff and FFT meshes: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The [[Projector-augmented-wave_formalism|plane-wave expansion of the orbitals]] and the associated mesh to perform the FFTs have a very large impact on the accuracy of a calculation.
The [[Projector-augmented-wave_formalism|plane-wave expansion of the Kohn-Sham (KS) orbitals]] are associated to a mesh to perform FFTs from real space coordinates $\mathbf{r}$ to reciprocal coordinates $\mathbf{G}$ and vice versa. These have a very large impact on the accuracy of any ab-initio calculation particularly including basic [[Setting up an electronic minimization|electronic minimization calculations]].
They are determined by the energy cutoff {{TAG|ENCUT}}, which is one of the most important parameters
The so-called FFT mesh and thus basis-set truncation is a result of the selected energy cutoff ({{TAG|ENCUT}}). It is one of the most important parameters for the accuracy. Some indications and illustrations on how to choose {{TAG|ENCUT}} or other related tags like {{TAG|PREC}} are provided below.
for the accuracy. {{TAG|ENCUT}} needs to be chosen large enough to ensure that the errors due to the basis-set
truncation and finite mesh size are below the required accuracy. Some indications on how to choose {{TAG|ENCUT}}
or other related tags like {{TAG|PREC}} are provided below.


= How to =
= Aspects to refine the choice of the cutoff energy, FFT mesh and related parameters =


== Energy cutoff ==
== Energy cutoff ==


The energy cutoff {{TAG|ENCUT}} should be chosen according to the pseudopotential ({{TAG|POTCAR}})
The energy cutoff ({{TAG|ENCUT}}) should be chosen according to the [[pseudopotential]] ({{TAG|POTCAR}})
and required accuracy. The default value for {{TAG|ENCUT}} is the largest among the ENMAX values found
and required accuracy. The default value for {{TAG|ENCUT}} is the largest among the '''ENMAX''' values found
in the {{TAG|POTCAR}} file. Values smaller than the default should never be used, since
in the {{TAG|POTCAR}} file. Values smaller than the default should never be used, since
they may possibly lead to large errors. This default minimal value
it leads to very large errors. The default minimal value
should usually result in an error in the cohesive energy which is less than 10 meV.
should usually result in an error in the cohesive energy which is less than 10 meV.
{{NB|mind|The recommended and usual procedure for choosing {{TAG|ENCUT}} is to perform a series of calculations with different {{TAG|ENCUT}} values (larger than the default one) and to monitor the results for the property of interest.}}
{{NB|tip|The recommended procedure for choosing {{TAG|ENCUT}} is to perform a series of calculations with different {{TAG|ENCUT}} values (larger than the default one) and to monitor the results for the property of interest.}}


Regarding the convergence of the total energy with respect to {{TAG|ENCUT}},
Regarding the convergence of the total energy with respect to {{TAG|ENCUT}},
the distinction between the '''total energy''' and the '''total energy difference'''
the distinction between the '''total energy''' and the '''total energy difference'''
(e.g., between different geometries during a structure relaxation or of two polymorphs) should be made.
(e.g., between different geometries during a [[structure relaxation]] or of two polymorphs) should be made.
Usually, the total energy difference converges much faster than the total energies.
Usually, the total energy difference converges much faster than the total energies.
This is especially true if both geometries are rather similar (e.g., structure relaxation),
This is especially true if both geometries are rather similar (e.g., [[structure relaxation]]),
and in this case the errors due to the finite energy cutoff should to some extent cancel each other when
and in this case the errors due to the finite energy cutoff should to some extent cancel each other when
calculating the energies difference. However, if two configurations differ strongly from each other,
calculating the energies difference. However, if two configurations differ strongly from each other,
e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with
e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with
respect to {{TAG|ENCUT}} may be quite slow.
respect to {{TAG|ENCUT}} may be quite slow.
{{NB|important|
{{NB|important|We strongly recommend specifying the energy cutoff ({{TAG|ENCUT}}) always manually in the {{FILE|INCAR}} file to ensure the same accuracy between calculations. Otherwise, the default {{TAG|ENCUT}} may differ among the different calculations if other atomic species are present, with  the consequence that the total energies can not be compared.}}
*We strongly recommend specifying the energy cutoff {{TAG|ENCUT}} always manually in the {{FILE|INCAR}} file to ensure the same accuracy between calculations. Otherwise, the default {{TAG|ENCUT}} may differ among the different calculations (e.g., for the calculation of the cohesive energy), with  the consequence that the total energies, for instance, can not be compared.}}


== FFT mesh ==
== FFT mesh ==


=== Coarse mesh ===
There are a number of quantities, e.g., the Kohn-Sham orbitals, the charge density, magnetization, XC potential, etc. that are described on a real-space mesh in the unit cell. Depending on the relation of the specific quantity to the KS orbitals the real-space mesh and associated FFT mesh must be choosen denser.


The size of the coarse FFT mesh ({{TAG|NGX}},{{TAG|NGY}},{{TAG|NGZ}}) is determined by {{TAG|ENCUT}} and {{TAG|PREC}}.
=== Mesh for the KS orbitals (soft mesh or coarse mesh)===
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.
 
The FFT mesh for the KS orbitals is the so-called coarse or soft mesh. The size of the coarse FFT mesh ({{TAG|NGX}},{{TAG|NGY}},{{TAG|NGZ}}) is determined by {{TAG|ENCUT}} and {{TAG|PREC}}. {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.


In order to avoid {{TAG|Wrap-around errors}}
In order to avoid [[wrap-around errors]] the FFT mesh should contain all wave vectors up to <math>2G_{\rm cut}</math>, where <math>G_{\rm cut}</math> is defined by
the FFT mesh should contain all wave vectors up to <math>2G_{\rm cut}</math>, where <math>G_{\rm cut}</math> is defined by
:<math>E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2</math>
:<math>E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2</math>
with <math>E_{\rm cut}</math>={{TAG|ENCUT}}.
with <math>E_{\rm cut}</math>={{TAG|ENCUT}}.
Nevertheless, it is not always possible and necessary to use such a large FFT mesh.
It is not always possible or necessary to use such a large FFT mesh for the KS orbitals, particularly during the test phase where a lower accuracy may surfize while other parameters of the calculation are varied and adjusted.
Usually, only 'high quality' calculations (as defined in {{TAG|Technical errors}}) require a mesh that avoids
Usually, only high-quality calculations require a mesh that avoids
any wrap-around error. Such calculations can be done with {{TAG|PREC}}=Accurate.
any [[wrap-around error]]. Such calculations can be done with {{TAG|PREC|Accurate}}.


For most calculations, and in particular with standard pseudopotentials with their default cutoff energies,  
For most calculations, and in particular with standard pseudopotentials with their default cutoff energies,  
it is sufficient to set {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} to <math>3/4</math> of the required values to
it is sufficient to choose {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} to <math>3/4</math> of the required values to
avoid any wrap-around errors, i.e., to include only the wave vectors up to <math>(3/2)G_{\rm cut}</math>.
avoid most wrap-around errors, i.e., to include only the wave vectors up to <math>(3/2)G_{\rm cut}</math>.
This is the case when {{TAG|PREC}}=Normal, which is the default.
This is the case when {{TAG|PREC}}=Normal, which is the default.


If {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} are set manually to values that may lead to sizeable wrap-around errors,
If {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} are set manually to values that may lead to sizeable [[wrap-around errors]],
then a warning will be printed in {{FILE|OUTCAR}} (search for the string 'wrap').
a warning will be printed in {{FILE|OUTCAR}} (search for the string 'wrap').


A hint that the wrap around errors may be too large is given by the forces.
A hint that the [[wrap-around errors]] may be too large is given by the forces.
If there is a considerable drift in the forces, the FFT mesh should be increased.
If there is a considerable drift in the forces, the FFT mesh should be increased.
Search for the string 'total drift' in the {{TAG|OUTCAR}} file that is located beneath the line ''TOTAL-FORCE'':
Search for the string 'total drift' in the {{TAG|OUTCAR}} file that is located beneath the line ''TOTAL-FORCE'':
Line 59: Line 55:
forces you are interested in (usually 0.1 eV/Å).
forces you are interested in (usually 0.1 eV/Å).


=== Fine mesh ===
=== Mesh for the densities (fine mesh) ===


For the representation of the augmentation charges a second finer FFT mesh
For the representation of the charge density, which contains the KS orbitals to the power of 2, and other quantities like the augmentation charges a second finer FFT mesh
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}) is used.
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}) is used.
With {{TAG|PREC}}=Normal and Accurate, this fine grid has a size
With {{TAG|PREC}}=Normal and Accurate, this fine grid has a size
Line 67: Line 63:
twice larger than the coarse grid.
twice larger than the coarse grid.
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.
This denser mesh is used only in some parts of the code,
such that the increase in the computational time should be only moderate.


The drift in the forces, for instance, may also be reduced by increasing the number of points
The drift in the forces, for instance, may also be reduced by increasing the number of points
Line 76: Line 69:
Note that the {{TAG|ENAUG}} tag can also be used to set the size of the fine mesh,
Note that the {{TAG|ENAUG}} tag can also be used to set the size of the fine mesh,
however this tag is '''deprecated''' and should not be used anymore.
however this tag is '''deprecated''' and should not be used anymore.
Furthermore, it is active only with the '''deprecated''' settings {{TAG|PREC}}=Low, Medium or High, otherwise it is ignored.
Furthermore, it is active only with the '''deprecated''' settings {{TAG|PREC|Low, Medium or High}}; otherwise it is ignored.


=== Support grid ===
=== Support grid ===


When {{TAG|ADDGRID}}=.TRUE., an additional 'support' grid is used for the evaluation of the augmentation charges.
For {{TAG|ADDGRID|True}}, an additional 'support' grid is used for the evaluation of the augmentation charges.
This grid has a size of <math>2\times</math>({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}), i.e., it has twice more points that the 'fine' grid along each lattice vector. The support grid often helps to reduce the noise in the forces, however as explained in more detail at {{TAG|ADDGRID}} it should be used with caution.
This grid has a size of <math>2\times</math>({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}), i.e., it has twice more points that the fine grid along each lattice vector. The support grid often helps to reduce the noise in the forces, however as explained in more detail in the documentation of {{TAG|ADDGRID}} it should be used with caution.
 
= Example: volume relaxation and pressure=
 
An illustration of the effect of the energy cutoff ({{TAG|ENCUT}}) on the results is given for the equilibrium volume and pressure of diamond. It clearly shows the noise induced by using an unconverged value for {{TAG|ENCUT}}. See the how-to pages on [[volume relaxation]] and avoiding [[Pulay stress]].


== Related tags and articles ==
== Related tags and articles ==
Line 94: Line 91:
{{TAG|NGXF}},
{{TAG|NGXF}},
{{TAG|NGYF}},
{{TAG|NGYF}},
{{TAG|NGZF}},
{{TAG|NGZF}}
[[Wrap-around errors|Wrap-around errors]]
 
[[Projector-augmented-wave formalism]], [[wrap-around errors]], [[volume relaxation]], [[Pulay stress]]




----
[[Category:Howto]][[Category:Calculation_setup]]
<!--[[Category:Howto]][[Category:Calculation_setup]]-->

Latest revision as of 09:25, 24 October 2025

The plane-wave expansion of the Kohn-Sham (KS) orbitals are associated to a mesh to perform FFTs from real space coordinates $\mathbf{r}$ to reciprocal coordinates $\mathbf{G}$ and vice versa. These have a very large impact on the accuracy of any ab-initio calculation particularly including basic electronic minimization calculations. The so-called FFT mesh and thus basis-set truncation is a result of the selected energy cutoff (ENCUT). It is one of the most important parameters for the accuracy. Some indications and illustrations on how to choose ENCUT or other related tags like PREC are provided below.

Aspects to refine the choice of the cutoff energy, FFT mesh and related parameters

Energy cutoff

The energy cutoff (ENCUT) should be chosen according to the pseudopotential (POTCAR) and required accuracy. The default value for ENCUT is the largest among the ENMAX values found in the POTCAR file. Values smaller than the default should never be used, since it leads to very large errors. The default minimal value should usually result in an error in the cohesive energy which is less than 10 meV.

Tip: The recommended procedure for choosing ENCUT is to perform a series of calculations with different ENCUT values (larger than the default one) and to monitor the results for the property of interest.

Regarding the convergence of the total energy with respect to ENCUT, the distinction between the total energy and the total energy difference (e.g., between different geometries during a structure relaxation or of two polymorphs) should be made. Usually, the total energy difference converges much faster than the total energies. This is especially true if both geometries are rather similar (e.g., structure relaxation), and in this case the errors due to the finite energy cutoff should to some extent cancel each other when calculating the energies difference. However, if two configurations differ strongly from each other, e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with respect to ENCUT may be quite slow.

Important: We strongly recommend specifying the energy cutoff (ENCUT) always manually in the INCAR file to ensure the same accuracy between calculations. Otherwise, the default ENCUT may differ among the different calculations if other atomic species are present, with the consequence that the total energies can not be compared.

FFT mesh

There are a number of quantities, e.g., the Kohn-Sham orbitals, the charge density, magnetization, XC potential, etc. that are described on a real-space mesh in the unit cell. Depending on the relation of the specific quantity to the KS orbitals the real-space mesh and associated FFT mesh must be choosen denser.

Mesh for the KS orbitals (soft mesh or coarse mesh)

The FFT mesh for the KS orbitals is the so-called coarse or soft mesh. The size of the coarse FFT mesh (NGX,NGY,NGZ) is determined by ENCUT and PREC. NGX, NGY and NGZ can also be set manually.

In order to avoid wrap-around errors the FFT mesh should contain all wave vectors up to [math]\displaystyle{ 2G_{\rm cut} }[/math], where [math]\displaystyle{ G_{\rm cut} }[/math] is defined by

[math]\displaystyle{ E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2 }[/math]

with [math]\displaystyle{ E_{\rm cut} }[/math]=ENCUT. It is not always possible or necessary to use such a large FFT mesh for the KS orbitals, particularly during the test phase where a lower accuracy may surfize while other parameters of the calculation are varied and adjusted. Usually, only high-quality calculations require a mesh that avoids any wrap-around error. Such calculations can be done with PREC = Accurate.

For most calculations, and in particular with standard pseudopotentials with their default cutoff energies, it is sufficient to choose NGX, NGY and NGZ to [math]\displaystyle{ 3/4 }[/math] of the required values to avoid most wrap-around errors, i.e., to include only the wave vectors up to [math]\displaystyle{ (3/2)G_{\rm cut} }[/math]. This is the case when PREC=Normal, which is the default.

If NGX, NGY and NGZ are set manually to values that may lead to sizeable wrap-around errors, a warning will be printed in OUTCAR (search for the string 'wrap').

A hint that the wrap-around errors may be too large is given by the forces. If there is a considerable drift in the forces, the FFT mesh should be increased. Search for the string 'total drift' in the OUTCAR file that is located beneath the line TOTAL-FORCE:

    total drift:                               -0.002730      0.010480      0.038560

The drift should definitely not exceed the magnitude of the forces, in general it should be smaller than the size of the forces you are interested in (usually 0.1 eV/Å).

Mesh for the densities (fine mesh)

For the representation of the charge density, which contains the KS orbitals to the power of 2, and other quantities like the augmentation charges a second finer FFT mesh (NGXF,NGYF,NGZF) is used. With PREC=Normal and Accurate, this fine grid has a size (NGXF,NGYF,NGZF)=[math]\displaystyle{ 2\times }[/math](NGX,NGY,NGZ), twice larger than the coarse grid. NGX, NGY and NGZ can also be set manually.

The drift in the forces, for instance, may also be reduced by increasing the number of points of the fine mesh.

Note that the ENAUG tag can also be used to set the size of the fine mesh, however this tag is deprecated and should not be used anymore. Furthermore, it is active only with the deprecated settings PREC = Low, Medium or High; otherwise it is ignored.

Support grid

For ADDGRID = True, an additional 'support' grid is used for the evaluation of the augmentation charges. This grid has a size of [math]\displaystyle{ 2\times }[/math](NGXF,NGYF,NGZF), i.e., it has twice more points that the fine grid along each lattice vector. The support grid often helps to reduce the noise in the forces, however as explained in more detail in the documentation of ADDGRID it should be used with caution.

Example: volume relaxation and pressure

An illustration of the effect of the energy cutoff (ENCUT) on the results is given for the equilibrium volume and pressure of diamond. It clearly shows the noise induced by using an unconverged value for ENCUT. See the how-to pages on volume relaxation and avoiding Pulay stress.

Related tags and articles

ENCUT, PREC, ADDGRID, ENAUG, NGX, NGY, NGZ, NGXF, NGYF, NGZF

Projector-augmented-wave formalism, wrap-around errors, volume relaxation, Pulay stress