Energy cutoff and FFT meshes: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In general, the energy-cut-off must be chosen according to the pseudopotential.
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]].
All {{TAG|POTCAR}} files contain a default energy cut off.
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.
Use this energy cut-off, but please also
perform some bulk calculations with different energy cut-off
to find out whether the recommended setting is correct.
The cut-off which is specified in the {{TAG|POTCAR}} file
will usually result in an error in the cohesive energy
which is less than 10 meV.


You should be aware of the difference between absolute and
= Aspects to refine the choice of the cutoff energy, FFT mesh and related parameters =
relative convergence. The absolute convergence
with respect to the energy cut off {{TAG|ENCUT}} is the convergence
speed of the '''total energy''',
whereas relative convergence is the convergence speed of '''energy differences'''
between different phases (e.g. energy of fcc minus energy of bcc structure).
Energy differences converge much faster than the total energy.
This is especially true if both situations are rather similar (e.g. hcp - fcc).
In this case the error due to the finite cut-off is
'transferable' from one situation to the other situation.
If two configurations differ strongly from each other
(different distribution of s p and d electrons, different hybridization)
absolute convergence gets more and more critical.


There are some rules of thumb, which you should check whenever
== Energy cutoff ==
making a calculation: For bulk materials the number of plane waves
per atom should be between 50-100. A smaller basis set might
result in serious errors. A larger basis set is rarely necessary,
and is a hint for a badly optimized pseudopotential.
If a large  vacuum is included the number of plane
waves will be larger (i.e. <math>50\%</math> of your super cell vacuum <math>\to</math>
number of plane waves increases by a factor of 2).


More problematic than {{TAG|ENCUT}} is the choice of the FFT mesh, because
The energy cutoff ({{TAG|ENCUT}}) should be chosen according to the [[pseudopotential]] ({{TAG|POTCAR}})
this error is '''not''' easily transferable from one situation to the next.
and required accuracy. The default value for {{TAG|ENCUT}} is the largest among the '''ENMAX''' values found
For an exact calculation
in the {{TAG|POTCAR}} file. Values smaller than the default should never be used, since
the FFT mesh must contain all wave vectors up to <math>2 G_{\rm cut}</math> if
it leads to very large errors. The default minimal value
<math>E_{\rm cut}=\frac{\hbar^{2}}{2m} G_{\rm cut}^2</math>, <math>E_{\rm cut}</math> being the used energy-cut-off.
should usually result in an error in the cohesive energy which is less than 10 meV.
Increasing the FFT-mesh from this value
{{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.}}
does not change the results, except for a possibly very
small change due to the changed exchange-correlation potential.
The reasons for this behavior are explained in {{TAG|Wrap-around errors}}.


Nevertheless it is not always possible and necessary to use such a large
Regarding the convergence of the total energy with respect to {{TAG|ENCUT}},
FFT mesh. In general
the distinction between the '''total energy''' and the '''total energy difference'''
only 'high quality' calculations (as defined in {{TAG|Technical errors}}) require a mesh which avoids all wrap around errors.
(e.g., between different geometries during a [[structure relaxation]] or of two polymorphs) should be made.
For most calculations, and in particular for the
Usually, the total energy difference converges much faster than the total energies.
supplied pseudopotentials with the default cut off,  
This is especially true if both geometries are rather similar (e.g., [[structure relaxation]]),
it is sufficient to set {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}}
and in this case the errors due to the finite energy cutoff should to some extent cancel each other when
to <math>3/4</math> of the required values (set {{TAG|PREC}}=''Medium'' or {{TAG|PREC}}=Low in the {{TAG|INCAR}}
calculating the energies difference. However, if two configurations differ strongly from each other,
file before running the ''makeparam'' utility or VASP.4.X).
e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with
The values which strictly avoid any wrap-around errors are also written
respect to {{TAG|ENCUT}} may be quite slow.
to the {{TAG|OUTCAR}} file:
{{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.}}
  WARNING: wrap around error must be expected
          set NGX to  22
   
  WARNING: wrap around error must be expected
          set NGY to  22
  WARNING: wrap around error must be expected
          set NGZ to  22
Just search for the string 'wrap'.
As a rule of thumb the <math>3/4</math>  will result in FFT mesh,
which contain approximately 8x8x8=256 FFT points per atom (assuming
that there is no vacuum).


One  hint, that  the FFT mesh is sufficient, is given by the lines
== FFT mesh ==
  soft charge-density along one line
          0      1      2      3      4      5      6      7      8       
x    32.0000 -.7711 1.9743  .0141  .3397 -.0569 -.0162 -.0006  .0000
y    32.0000 6.7863  .0205  .2353  .1237 -.1729 -.0269 -.0006  .0000
z    32.0000 -.7057 -.7680 -.0557  .1610 -.2262 -.0042 -.0069  .0000


also written to the file {{TAG|OUTCAR}} (search for the string 'along'). These lines
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.
contain the charge density in reciprocal space at the positions


<math>
=== Mesh for the KS orbitals (soft mesh or coarse mesh)===
\bold{G} = 2 \pi m_x \bold{g}^{(x)} ,\quad  \bold{G} = 2 \pi  m_y \bold{g}^{(y)} ,\quad
\bold{G} = 2 \pi m_z \bold{g}^{(z)}.
</math>


The last number will always be 0 (it is set explicitly by VASP),
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.
but as a rule of thumb the
previous value divided by the total number of electrons should be smaller than <math>10^{-4}</math>.
To be more precise: Because of the wrap-around errors, certain parts
of the charge density are wrapped to the other side of the grid,
and the size of the 'wrapped' charge density
divided by the number of electrons should be less than <math>10^{-3}-10^{-4}</math>.


Another important hint that the wrap around errors are too
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
large is given by the forces. If there is a considerable drift in
:<math>E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2</math>
the forces, increase the FFT mesh.
with <math>E_{\rm cut}</math>={{TAG|ENCUT}}.
Search for the string 'total drift' in the {{TAG|OUTCAR}} file, it is located
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.
beneath the line ''TOTAL-FORCE'':
Usually, only high-quality calculations require a mesh that avoids
     total drift:               -.00273     -.01048      .03856
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,
it is sufficient to choose {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} to <math>3/4</math> of the required values to
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.
 
If {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} are set manually to values that may lead to sizeable [[wrap-around errors]],
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.
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'':
     total drift:                               -0.002730     0.010480      0.038560
The drift should definitely not exceed the magnitude of the forces,
The drift should definitely not exceed the magnitude of the forces,
in general it should be smaller than the size of the
in general it should be smaller than the size of the
forces you are interested in (usually 0.1 eV/<math>\AA</math>).
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
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}) is used.
With {{TAG|PREC}}=Normal and Accurate, this fine grid has a size
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}})=<math>2\times</math>({{TAG|NGX}},{{TAG|NGY}},{{TAG|NGZ}}),
twice larger than the coarse grid.
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|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.


For the representation of the augmentation charges a second
Note that the {{TAG|ENAUG}} tag can also be used to set the size of the fine mesh,
more accurate FFT mesh is used. Generally the time spent for the calculation
however this tag is '''deprecated''' and should not be used anymore.
on this mesh is relatively small, therefore there is no need
Furthermore, it is active only with the '''deprecated''' settings {{TAG|PREC|Low, Medium or High}}; otherwise it is ignored.
to worry too much about the size of the
mesh, and relying on the defaults of the ''makeparam'' utility
is in most cases safe.
In some rare cases like Cu, Fe<math>\_</math>pv
with extremely 'hard' augmentation charges,
it might be necessary to increase {{TAG|NGXF}} in comparison to the default
setting. This can be done either by hand (setting {{TAG|NGXF}}
in the param.inc file) or by giving a
value for {{TAG|ENAUG}} in the {{TAG|INCAR} file.


As for the soft part of the charge density the
=== Support grid ===
total charge density (which is the sum of augmentation charges and soft part)
is also written to the file {{TAG|OUTCAR}}:
  total charge-density along one line
          0      1      2      3      4      5      6      7      8       
x    32.0000 -.7711 1.9743  .0141  .3397 -.0569 -.0162 -.0006  .0000
y    32.0000 6.7863  .0205  .2353  .1237 -.1729 -.0269 -.0006  .0000
z    32.0000 -.7057 -.7680 -.0557  .1610 -.2262 -.0042 -.0069  .0000


The same criterion which holds for the soft part should hold for the
For {{TAG|ADDGRID|True}}, an additional 'support' grid is used for the evaluation of the augmentation charges.
total charge density. If the second mesh is too small the forces
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.
might also be wrong (leading to a  'total drift' in the forces).


'''Mind''': The second mesh is only used
= Example: volume relaxation and pressure=
in conjunction with US-pseudopotentials.
For normconserving pseudopotentials neither the charge density
nor the local potentials are set on the fine mesh.
In this case set NG(X,Y,Z)F to NGX, Y, Z or simply to 1. Both settings result
in the same storage allocation.


'''Mind''': If very hard non-linear/partial core corrections are
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]].
included the convergence of the exchange-correlation potential
with respect to the FFT grid might cause problems. All
supplied pseudopotentials have been tested in this respect and are safe.


== When to set ENCUT (and ENAUG) by hand ==
== Related tags and articles ==


In most cases once can safely use the default values for
{{TAG|ENCUT}},
{{TAG|ENCUT}} and {{TAG|ENAUG}}, which are read from the {{TAG|POTCAR}} file.
{{TAG|PREC}},
But there are some cases where this can results in small, easily avoidable
{{TAG|ADDGRID}},
inaccuracies.
{{TAG|ENAUG}},
{{TAG|NGX}},
{{TAG|NGY}},
{{TAG|NGZ}},
{{TAG|NGXF}},
{{TAG|NGYF}},
{{TAG|NGZF}}


For instance, if you are interested in the energy difference between
[[Projector-augmented-wave formalism]], [[wrap-around errors]], [[volume relaxation]], [[Pulay stress]]
bulk phases with different compositions (i.e. Co - CoSi - Si).
In this case the default {{TAG|ENCUT}} will be different for the calculations
of pure Co and pure Si, but it is  preferable to use the same
cut off for all calculations.
In this case determine the maximal {{TAG|ENCUT}} and {{TAG|ENAUG}} from the {{TAG|POTCAR}} files
and use this value for all calculations.


Another example is the calculation of adsorption energies of molecules
on surfaces. To minimize (for instance) non-transferable wrap errors one
should calculate
the energy of an isolated molecule, of the surface only, and of
the adsorbate/surface complex in the same super cell, using the same cut off.
This usually requires to fix {{TAG|ENCUT}} and {{TAG|ENAUG}} by hand in the {{TAG|INCAR}} file.
If one also wants to use real space optimization ({{TAG|LREAL}}=''On''), it is recommended
to use {{TAG|LREAL}}=''On'' for all three calculations as well (the {{TAG|ROPT}} flag
should also be similar for all calculations).


----
[[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