KPOINTS: Difference between revisions

From VASP Wiki
No edit summary
 
(42 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The {{FILE|KPOINTS}} file specifies the Bloch vectors ('''k''' points) used to sample the Brillouin zone.
The {{FILE|KPOINTS}} file specifies the Bloch vectors ('''k''' points) used to sample the Brillouin zone.
Converging this sampling is one of the most important tasks in many calculations.
Converging this sampling is one of the essential tasks in many calculations concerning the [[Electronic minimization|electronic minimization]].
A regular mesh is the most common choice to select '''k''' points.
A [[#Regular k-point mesh|regular mesh]] is the most common choice to select '''k''' points:
Choose the number of points along each direction approximately inversely proportional to the corresponding length of the unit cell.
Build the {{FILE|KPOINTS}} file based on this template and [[#Regular k-point mesh|read below]] for the exact specification.
  Regular 4 x 4 x 4 mesh centered at Gamma  
  Regular 4 x 4 x 4 mesh centered at Gamma  
  0
  0
  Gamma
  Gamma
  4 4 4
  4 4 4
{{NB|tip|Choose the number of points along each direction approximately inversely proportional to the corresponding length of the unit cell.}}


The band structure describes the eigenvalues of the orbitals throughout the Brillouin zone.
A [[:Category:Band structure | band structure]] is often visualized along high-symmetry paths.
It gives a detailed insight into the material determining many optical and transport properties.
A band structure is often visualized along high symmetry paths.
Some external tools{{cite|bilbao:kvec}}{{cite|seekpath}} help to identify these points for materials of any symmetry.
Some external tools{{cite|bilbao:kvec}}{{cite|seekpath}} help to identify these points for materials of any symmetry.
Use the template below to setup [[#Band-structure calculations|band-structure calculations]].
Use the template below to setup [[#Band-structure calculations|band-structure calculations]].
Line 18: Line 15:
  k points along high symmetry lines
  k points along high symmetry lines
   40              ! number of points per line
   40              ! number of points per line
  Line-mode
  line mode
  reciprocal
  fractional
   0    0    0    gamma
   0    0    0    Γ
   0.5  0.5  0    X
   0.5  0.5  0    X
   
   
Line 27: Line 24:
   
   
   0.5  0.75 0.25 W
   0.5  0.75 0.25 W
   0    0    0    gamma
   0    0    0    Γ
{{NB|tip|If the {{FILE|KPOINTS}} file is not present, the tag {{TAG|KSPACING}} determines the '''k'''-point sampling. Use that option for a quick first run but prefer setting the mesh manually for production calculations.}}
{{NB|tip|If the {{FILE|KPOINTS}} file is not present, the tag {{TAG|KSPACING}} determines the '''k'''-point sampling. Use that option for a quick first run but prefer generating a [[#Regular k-point mesh|regular mesh]] for production calculations.}}
 


== Coordinate system ==
== Coordinate system ==


Two variants of the {{FILE|KPOINTS}} file (the [[#Explicit k-point mesh|explicit list]] and the [[#Band-structure calculations|line mode]]) specify the coordinates of the '''k''' point.
When specifying coordinates in the {{FILE|KPOINTS}} file, use one of the following coordinate systems:
Both allow selecting one of the supported coordinate systems:


;Reciprocal coordinate system: The '''k''' points are linear combinations of the reciprocal lattice vectors <math>{\mathbf b}_{1\ldots3}</math>
;Fractional coordinate system: The '''k''' points are linear combinations of the reciprocal lattice vectors <math>{\mathbf b}_{1\ldots3}</math>
:: <math>{\mathbf k} = x_1 {\mathbf b}_1 + x_2 {\mathbf b}_2 + x_3 {\mathbf b}_3</math>~.
:: <math>{\mathbf k} = x_1 {\mathbf b}_1 + x_2 {\mathbf b}_2 + x_3 {\mathbf b}_3~.</math>
: Use the factors <math>x_{1\ldots3}</math> as the coordinates in {{FILE|KPOINTS}}.
: Use the factors <math>x_{1\ldots3}</math> as the coordinates in {{FILE|KPOINTS}}.


;Cartesian coordinate system: The coordinates <math>x_{1\ldots3}</math> directly correspond to the '''k''' point
;Cartesian coordinate system: The coordinates <math>x_{1\ldots3}</math> directly correspond to the '''k''' point
::<math>{\mathbf k} =\frac{2 \pi}{a} (x_1, x_2 , x_3).</math>
::<math>{\mathbf k} =\frac{2 \pi}{a} (x_1, x_2 , x_3)~.</math>
: up to the scaling factor <math>2\pi / a</math>. Here, <math>a</math> is the scaling parameter specified on the second line of the {{FILE|POSCAR}} file.
: up to the scaling factor <math>2\pi / a</math>. Here, <math>a</math> is the scaling parameter specified on the second line of the {{FILE|POSCAR}} file.


Consider the face-centered cubic lattice as an example;
'''Example: face-centered-cubic (fcc) lattice'''
its unit cell is spanned by the following basis vectors
 
The following lattice vectors <math>\mathbf a_i</math> span the unit cell:


::<math>
::<math>
Line 52: Line 48:
\mathbf a_2 = a \begin{pmatrix} 1/2 \\ 0 \\ 1/2\end{pmatrix}  
\mathbf a_2 = a \begin{pmatrix} 1/2 \\ 0 \\ 1/2\end{pmatrix}  
\qquad
\qquad
\mathbf a_3 = a \begin{pmatrix} 1/2 \\ 1/2 \\ 0\end{pmatrix}~.
\mathbf a_3 = a \begin{pmatrix} 1/2 \\ 1/2 \\ 0\end{pmatrix}
</math>
</math>


The corresponding reciprocal lattice vectors are:
The corresponding reciprocal lattice vectors <math>\mathbf b_i</math> are


::<math>
::<math>
Line 62: Line 58:
\mathbf b_2 = \frac{2 \pi}{a} \begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix}
\mathbf b_2 = \frac{2 \pi}{a} \begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix}
\qquad
\qquad
\mathbf b_3 = \frac{2 \pi}{a} \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}
\mathbf b_3 = \frac{2 \pi}{a} \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}~.
</math>
</math>


The following table shows several high-symmetry points of the fcc lattice expressed in Cartesian and reciprocal coordinates, respectively:
The following table shows several high-symmetry points of the fcc lattice expressed in Cartesian and fractional coordinates, respectively:


  Point    Cartesian coordinates    Reciprocal coordinates
  Point    Cartesian coordinates    Fractional coordinates
             (units of 2pi/a)        (units of b1,b2,b3)
             (units of 2pi/a)        (units of b1,b2,b3)
  ----------------------------------------------------------
  ----------------------------------------------------------
   G         (  0    0    0  )        (  0    0    0  )
   Γ         (  0    0    0  )        (  0    0    0  )
   X        (  0    0    1  )        ( 1/2  1/2  0  )
   X        (  0    0    1  )        ( 1/2  1/2  0  )
   W        ( 1/2  0    1  )        ( 1/2  3/4  1/4 )
   W        ( 1/2  0    1  )        ( 1/2  3/4  1/4 )
Line 79: Line 75:


When an explicit '''k'''-point mesh is provided, VASP uses exactly the provided points.
When an explicit '''k'''-point mesh is provided, VASP uses exactly the provided points.
The main use case of this mode is to look at particular features in the band structure for example for effective mass calculations.
The primary use case of this mode is to look at particular features in the band structure, e.g., for effective mass calculations.
For [[#Regular regular k-point mesh|regular meshes]] and [[#Band structure calculations|band structures]], prefer the automatic generation to avoid mistakes.
For [[#Regular regular k-point mesh|regular meshes]] and [[#Band structure calculations|band structures]], we recommend using the automatic generation to avoid mistakes.
Nevertheless, all other modes write the processed input in this format to {{FILE|IBZKPT}} so understanding this format helps analyze mistakes in setting up the {{FILE|KPOINTS}} file.
Nevertheless, all other modes write the processed input in this format to the {{FILE|IBZKPT}} file, so understanding this format helps analyze mistakes in setting up the {{FILE|KPOINTS}} file.
A typical example has the following format:
A typical example has the following format:


  Explicit k-point list
  <span style="color:#808080">Explicit k-point list</span>
  4
  <span style="color:#2FB5AB">4</span>
  Cartesian
  <span style="color:#A82C35">Cartesian</span>
  0.0  0.0  0.0  1
  <span style="color:#2C68FC">0.0  0.0  0.0  1
  0.0  0.0  0.5  1
  0.0  0.0  0.5  1
  0.0  0.5  0.5  2
  0.0  0.5  0.5  2
  0.5  0.5  0.5  4
  0.5  0.5  0.5  4</span>


* The first line is treated as a comment line.
* The first line is treated as a <span style="color:#808080">comment line</span>.
* Provide the number of '''k''' points on the second line.
* Provide the <span style="color:#2FB5AB">number of '''k''' points</span> on the second line.
* The first character on the third line specifies the [[#Coordinate system|coordinate system]]. Use ''C'', ''c'', ''K'', or ''k'' to indicate Cartesian coordinates. Any other character is interpreted as reciprocal coordinates but we advise writing ''reciprocal'' to make this clear.
* The first character on the third line specifies the [[#Coordinate system|coordinate system]]. Use <span style="color:#A82C35">''C'', ''c'', ''K'', or ''k'' to indicate Cartesian coordinates. Any other character is interpreted as fractional/reciprocal coordinates</span> but we advise writing ''fractional'' or ''reciprocal'' to make this clear.
* Each following line contains the coordinates and weight of one '''k''' point. VASP takes care that weights are properly normalized so only relative weight is important. Typically the weights correspond to the symmetry degeneracy of a '''k''' point.
* Each following line contains the <span style="color:#2C68FC">coordinates and weight of one '''k''' point</span>. VASP takes care that weights are properly normalized so only relative weight is important. Typically the weights correspond to the symmetry degeneracy of a '''k''' point.


Use the explicit mode for
Use the explicit mode for
Line 101: Line 97:
* a (small) number of '''k''' points not forming a regular mesh.
* a (small) number of '''k''' points not forming a regular mesh.
* the calculation of band structure when [[#Band structure calculations|the line mode]] is not suitable (example: [[Si_bandstructure|hybrid functionals]]).
* the calculation of band structure when [[#Band structure calculations|the line mode]] is not suitable (example: [[Si_bandstructure|hybrid functionals]]).
* the irreducible part of the [[KPOINTS#generalized_regular_meshes|genereralized regular meshes]] generated for a particular target sampling density.{{cite|wisesa:prb:2016}}{{cite|morgan:cms:2020}} Generate the corresponding {{FILE|KPOINTS}} files with KpLib{{cite|kplib}} or autoGR.{{cite|auto_gr}}
* the irreducible part of the [[KPOINTS#generalized_regular_meshes|genereralized regular meshes]] generated for a particular target sampling density.{{cite|wisesa:prb:2016}}{{cite|morgan:cms:2020}} Generate the corresponding {{FILE|KPOINTS}} files with KpLib{{cite|kplib}} or autoGR{{cite|auto_gr}}.


'''Tetrahedron method'''
'''Tetrahedron method'''


When using the tetrahedron method (see {{TAG|ISMEAR}}), extend the list of '''k''' points by a list of all tetrahedra.
:When using the tetrahedron method (see {{TAG|ISMEAR}}), extend the list of '''k''' points by a list of all tetrahedra.


  Explicit k-point list
  Explicit k-point list
Line 118: Line 114:
  6    1 2 3 4
  6    1 2 3 4


First, the line following the list of '''k''' point coordinates and weights must start with 'T' or 't'.
:The line following the list of '''k''' point coordinates and weights must start with 'T' or 't'. On the next line, enter the number of tetrahedra and the volume weight common to all the tetrahedra. The volume weight is simply the ratio between the volume of a tetrahedron and the volume of the first Brillouin zone.
On the next line, enter the number of tetrahedra and the volume weight common to all the tetrahedron.
The volume weight is simply the ratio between the volume of a tetrahedron and the volume of the first Brillouin zone.
 
Subsequently, list the symmetry degeneration weight and the four corner points of each tetrahedron.
The four integers represent the indices of the corners of the tetrahedron in the '''k'''-point list given above.
Here, the counter start at 1 which corresponds to the '''k''' point specified in the fourth line.
{{NB|warning|VASP does not renormalize the weights of the tetrahedra. Make sure they are properly normalized.}}


{{NB|important|Explicitly listing all the '''k''' points is not very convenient, especially in the context of the tetrahedron method. Keep in mind that the automatic modes generate the {{FILE|IBZKPT}} file in this format. Prefer modifying an automatically-generated {{FILE|IBZKPT}} over building the explicit list from scratch for any nontrivial case.}}
:Subsequently, list the symmetry-degeneration weight and the four corner points of each tetrahedron. The four integers represent the indices of the corners of the tetrahedron in the '''k'''-point list given above. Here, the counter starts at 1 and corresponds to the '''k''' point specified in the fourth line.
{{NB|warning|VASP does not renormalize the weights of the tetrahedra. Make sure they are appropriately normalized.|:}}
{{NB|important|Explicitly listing all the '''k''' points is not very convenient, especially in the context of the tetrahedron method. Keep in mind that the automatic modes generate the {{FILE|IBZKPT}} file in this format. For any nontrivial case, preferably modify an automatically-generated {{FILE|IBZKPT}} instead of building an explicit list from scratch.}}


== Regular '''k'''-point mesh ==
== Regular '''k'''-point mesh ==


A slightly more flexible (and probably the most commonly used) flavour of the automatic mesh generation mode, allows the user to supply the numbers for the subdivisions <math>N_1</math>, <math>N_2</math> and <math>N_3</math> manually:
This mode will automatically generate a mesh where each lattice vector is subdivided into an explicitly defined number of subdivisions.
 
It offers sufficient flexibility and stability and should be preferred for most production calculations.
Automatic mesh
Choose the number of subdivisions <math>N_1</math>, <math>N_2</math> and <math>N_3</math> in the {{FILE|KPOINTS}} file like this
0              ! number of k-points = 0 -> automatic generation scheme
Gamma          ! generate a Gamma centered mesh
4  4  4        ! subdivisions N_1, N_2 and N_3 along recipr. latt. vectors
0. 0. 0.      ! optional shift of the mesh (s_1, s_2, s_3)
 
* In this case, the first non-blank character on the third line (again, only the first character is significant) should be a ''G'' or ''g'', to generate Monkhorts-Pack meshes centered at the <math>\Gamma</math> point (as above) or ''M'' or ''m'', to select the original Monkhorst-Pack scheme.{{cite|monkhorst:prb:1976}}
 
:While these choices are identical for an odd number of subdivisions, in the original Monkhorst-Pack scheme with an even number of subdivisions, i.e., <math>{\rm mod}(N_i,2)=0</math>, the k-point meshes are shifted away from the origin (<math>\Gamma</math>):
::<math>{\vec k} = {\vec b}_1 \frac{n_1+1/2}{N_1} + {\vec b}_2 \frac{n_2+1/2}{N_2}  + {\vec b}_3 \frac{n_3+1/2}{N_3}</math>
 
* The fifth line is optional, and supplies an additional shift of the k-mesh (with respect to the origin). Usually the shift is zero, since the two most important cases are covered by the flags ''M'' or ''m'', ''G'' or ''g''. The shift <math>(s_1, s_2, s_3)</math> must be given in coordinates of the reciprocal lattice, i.e., expressed in the basis of the reciprocal lattice.
 
:The resulting mesh in the ''G'' or ''g'' case is given by:
::<math> {\vec k} = {\vec b}_1 \frac{n_1+s_1}{N_1} + {\vec b}_2 \frac{n_2+s_2}{N_2}  + {\vec b}_3 \frac{n_3+s_3}{N_3} </math>
 
:and in the ''M'' or ''m'' case:
::<math>{\vec k} = {\vec b}_1 \frac{n_1+s_1+1/2}{N_1} + {\vec b}_2 \frac{n_2+s_2+1/2}{N_2}  + {\vec b}_3 \frac{n_3+s_3+1/2}{N_3}.</math>
 
:with (in both cases):
::<math>n_1=0...,N_1-1 \quad  n_2=0...,N_2-1 \quad  n_3=0...,N_3-1 </math>


:'''N.B.:''' As one can easily see above, the selection ''M'' without shift, is equivalent to ''G'' with a shift of <math>s=(0.5, 0.5, 0.5)</math>, and vice versa.
<span style="color:#808080">Regular k-point mesh</span>
<span style="color:#2FB5AB">0              ! 0 -> determine number of k points automatically</span>
<span style="color:#A82C35">Gamma          ! generate a Gamma centered mesh</span>
<span style="color:#2C68FC">4  4  4        ! subdivisions N_1, N_2 and N_3 along the reciprocal lattice vectors</span>
<span style="color:#4C265F">0  0  0        ! optional shift of the mesh (s_1, s_2, s_3)</span>


This leaves the obvious question: how to choose <math>N_1</math>, <math>N_2</math>, and <math>N_3</math>?
* The first line is a <span style="color:#808080">comment line</span>.
* In the second line, set the number of '''k''' points to <span style="color:#2FB5AB">0 to indicate an automatic mesh generation</span>.
* The first nonblank character of the third line determines the center of the mesh. The <span style="color:#A82C35">possible choice are Γ-centered (''G'', ''g'') or the Monkhorst-Pack scheme (''M'', ''m'')</span>.{{cite|monkhorst:prb:1976}}
* Specify the desired number of <span style="color:#2C68FC">subdivisions</span> <math>N_1</math>, <math>N_2</math> and <math>N_3</math> in the fourth line.
* Optionally add a fifth line to <span style="color:#4C265F">shift</span> the mesh by <math>(s_1, s_2, s_3)</math> with respect to the default.


Commonly the following rule of thumb applies: <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> are chosen such that
;Γ-centered mesh
:<math>N_1 : N_2 : N_3 \approx |b_1| : |b_2| : |b_3|</math>
: The following '''k''' points sample the Brillouin zone
where <math>b_i \; (i=1,2,3)</math> are the reciprocal lattice vectors.
::<math> {\mathbf k} = \sum_{i = 1}^3 \frac{n_i+s_i}{N_i} {\mathbf b}_i  \qquad \forall {n_i \in [0, N_i[}</math>
Note that this is in the spirit of the specification of the [[KPOINTS#Rk_length| R<sub>k</sub> length parameter]].


For many lattices, e.g. cubic, tetragonal, and simple orthorhombic, this is identical to:
;Monkhorst-Pack mesh
:<math>N_1 : N_2 : N_3 \approx \frac{1}{|a_1|} : \frac{1}{|a_2|} : \frac{1}{|a_3|}</math>
: The '''k''' point mesh results from this definition
where <math>a_i \; (i=1,2,3)</math> are the Bravais lattice vectors of the unit cell.
::<math> {\mathbf k} = \sum_{i = 1}^3 \frac{n_i+s_i+\frac{1-N_i}{2}}{N_i} {\mathbf b}_i  \qquad \forall {n_i \in [0, N_i[}</math>


Of course, this only provides a guide w.r.t. the ratios between <math>N_i \; (i=1,2,3)</math>. The actual density of the k-points mesh has to be chosen such that some relevant output quantity of the calculation is converged w.r.t. the sampling density.
The spacing between the points is the same for both meshes.
The only difference is the shift <math>(1-N_i)/2</math> in the numerator of the Monkhorst-Pack mesh.
For an odd number of subdivisions, this term is an integer, and therefore the two meshes agree due to periodic boundaries.
When the number of subdivisions is even the Γ-centered mesh is shifted by <math>s_i = 1/2</math> compared to the Monkhorst-Pack one.
{{NB|important|Monkhorst-Pack meshes may converge faster than the Γ-centered ones. However, carefully read the [[KPOINTS#Symmetry reduction of the mesh|section on symmetry considerations]] to avoid breaking the symmetry with a Monkhorst-Pack mesh.}}


'''N.B.: please read the [[KPOINTS#Symmetry reduction of the mesh|subsection on symmetry considerations connected to your choice of Monkhorst-Pack meshes]] carefully!'''
'''Guidelines for the choice of the subdivisions'''


As a rule of thumb, choose <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> such that
::<math>N_1 : N_2 : N_3 \approx |\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|~.</math>
This guideline is also implemented for the automatic '''k'''-point generation using {{TAG|KSPACING}}.
Nevertheless, specifying the <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> manually ensures that changes in the lattice vectors do not affect the '''k'''-point mesh.
When the primitive cell has (nearly) perpendicular axes (cubic, tetragonal, orthorhombic), this is equivalent to:
::<math>N_1 : N_2 : N_3 \approx \frac{1}{|\mathbf a_1|} : \frac{1}{|\mathbf a_2|} : \frac{1}{|\mathbf a_3|}~.</math>
Of course, this only provides a guide for the ratios between the subsections. The actual density of the '''k''' point mesh has to be increased until some relevant output quantity of the calculation is converged.


== Symmetry reduction of the mesh ==
== Symmetry reduction of the mesh ==


For the automatically generated k-point meshes mentioned above, symmetry is used (for {{TAG|ISYM}}<tt>&ge;0</tt>) to reduce the number of k-points to the irreducible subset of symmetry inequivalent k-points and to set the weights in accordance with their symmetry multiplicity.
VASP determines the [[:Category:Symmetry|symmetry of the system]].
This can reduce the total number of k-points significantly.
For {{TAG|ISYM}} <math>\ge</math> 0, the automatically generated '''k'''-point meshes are reduced to the irreducible subset.
Every '''k''' point acquires a weight following their symmetry multiplicity.
This can significantly reduce the total number of '''k''' points.
{{NB|important|To enable an efficient symmetry reduction, the (shifted) regular mesh of '''k''' points should conserve the point-group symmetry of the reciprocal lattice. Specifically, the generating lattice (<math>\mathbf g_i = \mathbf k_i / N_i</math>) should belong to the same class of Bravais lattice as the reciprocal lattice.}}
Consequently, refrain from using a shifted regular mesh for some Bravais lattices, see table.
Importantly, this includes the default Monkhorst-Pack mesh for even numbers of subdivisions.
Furthermore, the reciprocal lattice vectors do not in general align with lattice vectors.
There is typically a difference in the subdivisions obtained from the inverse of the lattice vectors or the reciprocal lattice vectors.
::<math>
\frac{1}{|\mathbf a_1|} : \frac{1}{|\mathbf a_2|} : \frac{1}{|\mathbf a_3|} \neq |\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3| \qquad \text{in general}
</math>
In some special cases, the two options are equal, e.g., when the length of all vectors is the same, or they are mutually perpendicular.
Unfortunately, either choice yields incompatible '''k''' point meshes for some of the Bravais lattices.
Consult the table below to make an informed choice depending on the symmetry of the system.


'''To enable an efficient symmetry reduction of the automatically generated k-point meshes, the (shifted) regular mesh of k-points should conserve the point group symmetry of the reciprocal lattice.'''
{| class=wikitable
! Bravais lattice
! variant
! mesh choices
! subsection choices
|-
| triclinic
| primitive
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
|rowspan="2"| monoclinic
| primitive
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| base-centered
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
|rowspan="4"| orthorhombic
| primitive
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| base-centered
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| body-centered
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>
|-
| face-centered
| <math>\Gamma</math>-centered
| <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
|rowspan="2"| tetragonal
| primitive
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| body-centered
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>
|-
|rowspan="2"| hexagonal
| rhombohedral
| <math>\Gamma</math>-centered
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| hexagonal
| <math>\Gamma</math>-centered
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
|rowspan="3"| cubic
| primitive
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| body-centered
| <math>\Gamma</math>-centered, Monkhorst Pack
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|-
| face-centered
| <math>\Gamma</math>-centered
| <math>|\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math>, <math>|\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>
|}
{{NB|tip|VASP issues an error when it detects an incompatible '''k'''-point mesh. The specific error message depends on the particular setup but includes the name of the routine ''IBZKPT'', some warning about the ''generating k-lattice'', and some suggestions to overcome the problem.}}


For the most common use-case of automatic mesh generation, i.e., [[KPOINTS#Monkhorst-Pack|Monkhorst-Pack]] meshes, this dictates that:
Summarizing the information in the table above


* For face-centered cubic (fcc), hexagonal, and fcc-orthorhombic crystalline lattices one should only use <math>\Gamma</math>-centered Monkhorst-Pack meshes.  
* Use '''only''' <math>\Gamma</math>-centered meshes for face-centered cubic (fcc), hexagonal, and fcc-orthorhombic crystalline lattices.
* Choose the ratios of the subdivisions <math>N_1 : N_2 : N_3 = |\mathbf a_1|^{-1} : |\mathbf a_2|^{-1} : |\mathbf a_3|^{-1}</math> for ''body-centered tetragonal'' and ''body-centered orthorhombic'' lattices. Keep in mind that the {{TAG|KSPACING}} uses the reciprocal lattice vectors so may not be suitable for these symmetries.
* For ''face-centered orthorhombic'' crystal structures, choose subdivisions according to <math>N_1 : N_2 : N_3 = |\mathbf b_1| : |\mathbf b_2| : |\mathbf b_3|</math>.
* For any other symmetry, all combinations should work but a change to other subdivisions or meshes may overcome possible issues.


* The reciprocal lattice and generating lattice (defined by the generating vectors <math>g_i=b_i/N_i, \; i=1,2,3</math>) should belong to the same class of Bravais lattices.
Solve problems with the primitive cells of the body-centered tetragonal and body/face-centered orthorhombic Bravais lattices with one of these options:


:This is almost always ensured when one chooses the mesh dimensions in accordance with the common rule of thumb:
# Choose <math>N_1=N_2=N_3</math>. For <math>N \times N \times N</math> Monkhorst-Pack meshes the reciprocal lattice is always of the same Bravais lattice as the generating lattice. For body-centered tetragonal and face-centered orthorhombic primitive cells, the reciprocal lattices are body-centered tetragonal and body-centered orthorhombic, respectively. Therefore, choosing equal subdivisions is justified because the length of all reciprocal lattice vectors is the same <math>|\mathbf b_1|=|\mathbf b_2|=|\mathbf b_3|</math>
::<math>N_1 : N_2 : N_3 \approx |b_1| : |b_2| : |b_3|</math>
# A simple but computationally-expensive option is to change to the conventional cell of the structure. For the body-centered tetragonal/orthorhombic structure, the conventional cell is two times bigger than the primitive cell.
:where <math>b_i \; (i=1,2,3)</math> are the reciprocal lattice vectors.
# Alternatively, define the '''k'''-point mesh for the conventional cell. This approach requires a [[KPOINTS#Generalized_regular_meshes|generalized regular mesh]] introduced in the next section and is demonstrated for the example of a body-centered orthorhombic lattice.
:Sadly, this is not completely foolproof. For instance, for the primitive cells of the ''body-centered tetragonal'' and ''body-centered orthorhombic'' lattices this criterion will not yield an appropriate generating lattice (this affects the use of [[KPOINTS#Rk_length|automatically generated meshes defined by the <math>R_k</math> length parameter]] and meshes defined by means of the {{TAG|KSPACING}}-tag as well).


:For the primitive cells of body-centered tetragonal, body-centered orthorhombic, and most other Bravais lattices one might alternatively choose the mesh dimensions in a accordance with:
== Generalized regular meshes ==
::<math>N_1 : N_2 : N_3 \approx \frac{1}{|a_1|} : \frac{1}{|a_2|} : \frac{1}{|a_3|}</math>
:where <math>a_i \; (i=1,2,3)</math> are the lattice vectors of the crystalline unit cell.
:Unfortunately, this is not guaranteed to always work either: this criterion will, for instance, fail to define an appropriate generating lattice for the primitive cells of ''face-centered orthorhombic'' crystal structures.
 
:The problems with the primitive cells of the body-centered tetragonal, and body/face-centered orthorhombic Bravais lattices can be solved in three different ways:
 
#Choose <math>N_1=N_2=N_3</math>. For <math>N \times N \times N</math> Monkhorst-Pack meshes the reciprocal lattice and the generating lattice are guaranteed to be of the same Bravais lattice type. For body-centered tetragonal and face-centered orthorhombic primitive cells this is a good solution since their reciprocal lattices are body-centered tetragonal (!) and body-centered orthorhombic, respectively, i.e.: <math>|b_1|=|b_2|=|b_3|</math>. 
#A simple but computationally expensive option for body-centered tetragonal/orthorhombic cells: change the representation of your structure from the primitive cell to the conventional tetragonal/orthorhombic cell. The latter is a supercell containing two primitive cells.
#Stick to the primitive cell representation of your structure but define your k-mesh w.r.t. the reciprocal lattice of the corresponding conventional cell, using [[KPOINTS#Generalized_regular_meshes|the generalized regular mesh format]]. An example, the construction of a generalized regular mesh of k-points based on the conventional cell of the body-centered orthorhombic lattice, is given near the end of [[KPOINTS#Generalized_regular_meshes|the subsection on generalized regular meshes]].
 
<!--
The reciprocal lattice that corresponds to a fcc-orthorhombic crystalline lattice (<math>|a_1|\neq|a_2|\neq|a_3|</math>) is body-centered orthorhombic (<math>|b_1|=|b_2|=|b_3|</math>), the generating lattice <math>g_i=b_i/N_i \;(i=1,2,3)</math> with <math>N_1 \neq N_2 \neq N_3</math>, however, will be triclinic.
-->


== Generalized regular meshes ==
When more control about the generated mesh is desired, one can specify the generating vectors explicitly.
A typical use case would be to generate the mesh for the ''conventional'' unit cell and apply it to the ''primitive'' one.
Build a {{FILE|KPOINTS}} file for this mode starting from this template


  Automatic generation
  Automatic generation
Line 216: Line 277:
  0.00 0.00 0.00
  0.00 0.00 0.00


* If the first non-blank character on the third line of the {{FILE|KPOINTS}} file is not an ''A'', ''a'', ''M'', ''m'', ''G'' or ''g'' the third flavour of automatic mesh generation is selected: the mesh of k-points is defined by the specification of its generating basis vectors.
The mode is activated by specifying the [[#Coordinate system|coordinate system]] with the first nonblank character in line 3.
A ''C'', ''c'', ''K'' or ''k'' character determines that the generating basis vectors are in Cartesian coordinates.
Use ''r'' or ''R'' to select the reciprocal coordinate system instead.
The latter is also the default used if VASP cannot interpret the provided character but we recommend not relying on this behavior.
Otherwise, the introduction of further automatic modes in the future versions of VASP may change the interpretation of the {{FILE|KPOINTS}} file.  


:These generating vectors may be specified in Cartesian coordinates or in coordinates of the reciprocal lattice: if the first non-blank character is a ''C'', ''c'', ''K'' or ''k'' the generating vectors are assumed to be specified in Cartesian coordinates. Any other character (than ''a'', ''m'', ''g'', ''c'', or ''k'') implies the use of coordinates w.r.t. the reciprocal lattice vectors (reciprocal mode). We advise everyone to write ''reciprocal'', ''r'', or ''R'' to select reciprocal coordinates, since future versions of  VASP might require that the first letter agrees with ''r'' for the recipocal mode.
VASP generates three vectors <math>\mathbf g_1</math>, <math>\mathbf g_2</math>, and <math>\mathbf g_3</math> from the coefficients <math>x_i</math> given in line 4–6.
Depending on the selected [[#Coordinate system|coordinate system]] these vectors are either multiples of the reciprocal lattice vectors
<math>\mathbf b_i</math> (reciprocal) or simply multiplying the coefficients by <math>2\pi/a</math> (Cartesian).
Here <math>a</math> is the scaling parameter you have specified on the second line of the {{FILE|POSCAR}} file.
{{NB|important|The generating vectors <math>\mathbf g_1</math>, <math>\mathbf g_2</math>, and <math>\mathbf g_3</math> must be commensurate with the reciprocal lattice. This means <math>\mathbf b_i = \textstyle \sum_{j} M_{ij} \mathbf g_j</math> where the matrix <math>M</math> contains only integer entries. If this is not the case the code will exit in error.}}


* On lines 4-6 one should specify the generating vectors <math>g_1</math>, <math>g_2</math>, and <math>g_3</math>, respectively.
Combined with the shift (<math>s_1</math>, <math>s_2</math>, <math>s_3</math>) specified in the last line, VASP uses the generating vectors <math>\mathbf g_i</math> to construct the '''k'''-point mesh
:In the reciprocal mode the generating vectors are specified as:
:: <math>{\vec g} = x_1 {\vec b}_1 + x_2 {\vec b}_2 +  x_3 {\vec b}_3</math>
:where <math>{\vec b}_{1...3}</math> are the three reciprocal basis vectors, and <math>x_{1...3}</math> are the values you supply.


:In the Cartesian input format the generating vectors are given by:
::<math>{\mathbf k} = \sum_i {\mathbf g}_i (n_i + s_i) \qquad n_i \in [0, N_i[</math>
::<math>{\vec g} =\frac{2 \pi}{a} (x_1, x_2 , x_3).</math>
:where <math>a</math> is the scaling parameter you have specified on the second line of the {{FILE|POSCAR}} file.


:These generating vectors then define a mesh of k-points given by:
where VASP chooses the <math>N_i</math> to include all possible points of the generating mesh in the first Brillouin zone.
::<math>{\vec k} = {\vec g}_1 n_1 + {\vec g}_2 n_2  + {\vec g}_3 n_3 ,\qquad  n_1=0...,N_1-1 \quad  n_2=0...,N_2-1 \quad  n_3=0...,N_3-1 </math>
:where VASP will automatically choose <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> such that all possible points of the generating mesh in the first Brillouin zone of the reciprocal lattice will be included.


:'''N.B.:''' The generating k-lattice defined by the vectors <math>g_1</math>, <math>g_2</math>, and <math>g_3</math> and the reciprocal lattice must be commensurate. This means it must be possible to express the reciprocal lattice vectors as sums of integer multiples of the generating lattice vectors. If this is not the case the code will exit in error.
The [[#Regular k-point mesh|regular '''k'''-point meshes]] are a subset of the generalized regular meshes, for which
 
::<math>\mathbf g_i = \mathbf b_i / N_i~.</math>
* On the seventh line one has to specify a shift of the k-point lattice w.r.t. the origin, in coordinates (<math>s_1</math>, <math>s_2</math>, <math>s_3</math>) w.r.t. the generating lattice vectors <math>g_1</math>, <math>g_2</math>, and <math>g_3</math>.
Here, the generating lattice vectors are integer subdivisions of the reciprocal lattice vectors according to the <math>N_i</math> defined in the {{FILE|KPOINTS}} file.
 
The resulting shifted mesh of k-points is given by:
::<math>{\vec k} = {\vec g}_1 (n_1 + s_1) + {\vec g}_2 (n_2 +s_2)  + {\vec g}_3 (n_3 + s_3) ,\qquad  n_1=0...,N_1-1 \quad  n_2=0...,N_2-1 \quad  n_3=0...,N_3-1 </math>
 
 
From this definition and the definition of the Monkhorst-Pack meshes above it may be clear that Monkhorst-Pack meshes are a particular subset of generalized regular meshes, for which:
:<math>g_i=b_i/N_i, \qquad i=1,2,3</math>
(i.e., the generating lattice vectors are integer subdivisions of the reciprocal lattice vectors).


For instance, the generalized regular mesh given by
For instance, the generalized regular mesh given by
Line 264: Line 318:




A typical use-case for generalized regular meshes: to generate a mesh of k-points based on the ''conventional'' cell of a particular Bravais lattice, to be used with for instance the ''primitive'' cell of that lattice (see the [[KPOINTS#Symmetry_reduction_of_the_mesh|subsection on symmetry considerations]]).
A typical use-case for generalized regular meshes is to generate a '''k'''-point mesh based on the ''conventional'' cell of a particular Bravais lattice to be used with the ''primitive'' cell of that lattice (see the [[#Symmetry reduction of the mesh|subsection on symmetry considerations]]).
As an example, consider the primitive cell of a ''body-centered orthorhombic'' lattice:
As an example, consider the primitive cell of a ''body-centered orthorhombic'' lattice:
:<math>
::<math>
A = a \left( \begin{array}{rrr}
A = a \left( \begin{array}{rrr}
-1/2  &  b/2a &  c/2a \\
-1/2  &  b/2a &  c/2a \\
Line 275: Line 329:
where the rows of <math>A</math> represent the lattice vector of the primitive cell.
where the rows of <math>A</math> represent the lattice vector of the primitive cell.
The corresponding conventional cell is given by
The corresponding conventional cell is given by
:<math>
::<math>
A = a \left( \begin{array}{rrr}
A = a \left( \begin{array}{rrr}
  1  &  0  &  0  \\
  1  &  0  &  0  \\
Line 284: Line 338:


and its reciprocal lattice by
and its reciprocal lattice by
:<math>
::<math>
B = \frac{2\pi}{a} \left( \begin{array}{rrr}
B = \frac{2\pi}{a} \left( \begin{array}{rrr}
  1  &  0  &  0  \\
  1  &  0  &  0  \\
  0  &  a/b &  0  \\
  0  &  a/b &  0  \\
  0 &  0  &  a/c \\
  0 &  0  &  a/c \\
\end{array} \right)
\end{array} \right)~.
</math>
</math>


Then the following generating lattice based on the reciprocal lattice of the conventional cell  
Then the following generating lattice based on the reciprocal lattice of the conventional cell  
:<math>
::<math>
G = \frac{2\pi}{a} \left( \begin{array}{rrr}
G = \frac{2\pi}{a} \left( \begin{array}{rrr}
  1/N_1  &  0  &  0  \\
  1/N_1  &  0  &  0  \\
Line 301: Line 355:
</math>
</math>
yields a roughly uniform sampling of the Brillouin zone when <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> are chosen such that:
yields a roughly uniform sampling of the Brillouin zone when <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> are chosen such that:
:<math>N_1 : N_2 : N_3 \approx 1 : \frac{a}{b} : \frac{a}{c}</math>
::<math>N_1 : N_2 : N_3 \approx 1 : \frac{a}{b} : \frac{a}{c}</math>


For instance, for a body-centered orthorhombic primitive cell with <math>a=5, \; b/a=1.2 \; c/a=0.5</math>, here given in {{FILE|POSCAR}} file format:
For instance, for a body-centered orthorhombic primitive cell with <math>a=5, \; b/a=1.2 \; c/a=0.5</math>, here given in {{FILE|POSCAR}} file format:
Line 330: Line 384:
corresponds to the aforementioned generating lattice for <math>N_1=2</math>, <math>N_2=2</math>, and <math>N_3=4</math>.
corresponds to the aforementioned generating lattice for <math>N_1=2</math>, <math>N_2=2</math>, and <math>N_3=4</math>.


Furthermore, using generalized regular meshes potentially requires fewer '''k''' points compared to Monkhorst-Pack meshes to converge total energy calculations.{{cite|wisesa:prb:2016}}{{cite|morgan:cms:2020}}
Specifically this statement applies to the number of '''k''' points in the irreducible part of the Brillouin zone after symmetry reduction.
For the moment, however, VASP does not automatically construct optimal generalized regular '''k'''-point meshes.
But external tools{{cite|kplib}}{{cite|auto_gr}} construct meshes with certain target sampling density in the spirit of the aforementioned publications.


Furthermore, the use of generalized regular meshes has been shown to be potentially superior to the use of Monkhorst-Pack meshes in terms of the convergence of total energy calculations with respect to the number of k-points in the irreducible part of the Brillouin zone (i.e., the resulting number of k-points after symmetry reduction).{{cite|wisesa:prb:2016}}{{cite|morgan:cms:2020}}
== Band-structure calculations ==
For the moment, however, VASP is not able to automatically construct optimal generalized regular k-points meshes with a certain target sampling density (in the spirit of the aforementioned publications).


== Band-structure calculations ==
When properties depend on the '''k''' vector, it is often convenient to visualize the property along high-symmetry lines.
To facilitate the calculation of (DFT) band structure, there is a mode that generates strings of k-points connecting specific points in the Brillouin zone:
The line mode generates '''k''' points between user-defined points in the Brillouin zone.
The most common use case is analyzing the electronic band structure.
{{NB|warning|The mesh generated by this mode is not suitable for self-consistent calculations. Please set {{TAG|ICHARG}} {{=}} 11 to avoid updating the density.}}
{{NB|mind| For meta-GGA and hybrid functionals, a regular mesh must always be provided. Refer to [[Band-structure calculation using meta-GGA functionals |band-structure calculations using meta-GGA functionals]] ''or'' [[Band-structure calculation using hybrid functionals|using hybrid functionals]], respectively.}}
Build the {{FILE|KPOINTS}} based on this template


  k-points along high symmetry lines
  <span style="color:#808080">k points along high symmetry lines</span>
  40              ! 40 intersections
<span style="color:#2FB5AB"> 40              ! number of points per line</span>
  Line-mode
  <span style="color:#A82C35">line mode</span>
  reciprocal
  <span style="color:#2C68FC">fractional</span>
  0    0    0    gamma
<span style="color:#4C265F">  0    0    0    Γ
   0.5  0.5  0    X
   0.5  0.5  0    X
   
   
Line 348: Line 409:
   
   
   0.5  0.75 0.25 W
   0.5  0.75 0.25 W
   0    0    0    gamma
   0    0    0    Γ</span>


* The first line is treated as a comment line.
* The first line is a <span style="color:#808080">comment line</span>.
* On the second line, you specify the number of points per line-segment
* Specify the <span style="color:#2FB5AB">number of points per line segment</span> on the second line.
* To generate strings of k-points connecting specific points of the Brillouin zone, the first non-blank character on the third line must be an ''L'' or ''l'' (for ''line-mode''):
* The line mode activates when the first nonblank character on the third line is an <span style="color:#A82C35">''L'' or ''l'' (for ''line mode'')</span>
* The coordinates of the k-points to be connected can be supplied in Cartesian coordinates (first non-blank character on the 4th line is either ''C'', ''c'', ''K'', or ''k'') or in coordinates w.r.t. the reciprocal lattice vectors (the first non-blank character on the 4th line is any character other than the aforementioned).
* The fourth line defines the [[#Coordinate system|coordinate system]]. Use <span style="color:#2C68FC">Cartesian (''C'', ''c'', ''K'', or ''k'') or fractional (any other character) coordinates</span>.
* The following lines have to specify the begin and end points of the line segments that are to be connected by strings of k-points.
* Afterwards, any pair of lines define one <span style="color:#4C265F">path through the Brillouin zone</span>. The empty lines and the label of the high-symmetry points are not required but simplify understanding the {{FILE|KPOINTS}} file. [https://www.vasp.at/py4vasp/latest/ py4vasp] uses the labels for the band structure plots.
:In the reciprocal mode the k-points are specified as:
:: <math>{\vec k} = x_1 {\vec b}_1 + x_2 {\vec b}_2 +  x_3 {\vec b}_3</math>
:where <math>{\vec b}_{1...3}</math> are the three reciprocal basis vectors, and <math>x_{1...3}</math> are the values you supply.


:In the Cartesian input format the k-points are given by:
The generated '''k'''-point mesh depends on the selected [[#Coordinate system|coordinate system]].
::<math>{\vec k} =\frac{2 \pi}{a}  (x_1, x_2 , x_3).</math>
VASP produces equidistant '''k''' points for each segment such that the total of points including the endpoints equals the required number.
:where <math>a</math> is the scaling parameter you have specified on the second line of the {{FILE|POSCAR}} file.
Specifically for the template above, 40 points from <math>\Gamma</math> to X, 40 points from X to W, and 40 points from W to <math>\Gamma</math>.
Because the endpoints are included every time, this generates two X and W points.


Transforming the same template to Cartesian coordinates produces


The example above will generate 40 k-points between the first and the second supplied point, 40 k-points between the third and the fourth, and another 40 points between the final two points.
  k points along high symmetry lines
In the case above the coordinates of the k-points are supplied in coordinates (w.r.t. the reciprocal lattice).
   40             ! number of points per line
 
  line mode
Alternatively one may specify these points in Cartesian coordinates:
 
  k-points along high symmetry lines
   40           ! 40 intersections
  Line-mode
  Cartesian
  Cartesian
   0  0  0  gamma
   0  0  0  Γ
   0  0  1  X
   0  0  1  X
   
   
Line 380: Line 435:
   
   
   0.5 0  1  W
   0.5 0  1  W
   0  0  1  gamma
   0  0  1  Γ


The choice of points and their labels, in the example above, correspond to (several of) the high-symmetry points in the Brillouin zone of a face-centered cubic (fcc) lattice.
External tools{{cite|bilbao:kvec}}{{cite|seekpath}} are useful to decide which paths in the Brillouin zone to include.
The tools provide the coordinates and the labels for a given structure.
Because these paths depend on the symmetry, take special care that the analysis is not tainted by finite precision or rounding.
Also, keep in mind that the primitive and the conventional unit cell have different reciprocal coordinate systems.


Here is another example, a {{FILE|KPOINTS}} file for hexagonal structures:
Here is an example of a hexagonal structure


  k-points along high symmetry lines for hexagonal str.
  k-points along high symmetry lines for hexagonal structure
   40
   40
  line
  line
  rec
  reciprocal
  0.000    0.000    0.500  A
  0.000    0.000    0.500  A
  0.000    0.000    0.000  Gamma
  0.000    0.000    0.000  Gamma
Line 401: Line 459:
  0.333333 0.333333 0.000  K
  0.333333 0.333333 0.000  K
  0.000    0.000    0.000  Gamma
  0.000    0.000    0.000  Gamma
{{NB|mind|The primary use of this particular mode of '''k'''-point generation is the calculation of DFT band structures. Because the mesh does not yield a good electronic density, it should only be used on a converged density. Therefore, run a calculation using a [[#Regular k-point mesh|regular '''k'''-point mesh]] first. Freeze this density by setting {{TAG|ICHARG}} {{=}} 11 and run a non-self-consistent calculation with the line-mode '''k'''-point mesh afterward.
As of VASP.6.3, the {{FILE|KPOINTS_OPT}} file runs these two steps in a single calculation. It uses the same format and its presence triggers the postprocessing step. Use it for band-structure calculations with hybrid functionals to avoid the more cumbersome [[Si bandstructure|manual specification]].}}


== Automatic '''k'''-point mesh ==
{{NB|deprecated|The {{TAG|KSPACING}} tag provides almost the same functionality. Preferably use that method instead.}}
The following {{FILE|KPOINTS}} file generates a regular <math>\Gamma</math>-centered '''k'''-point.
The subdivisions <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> are along the reciprocal lattice vectors <math>\mathbf b_1</math>, <math>\mathbf b_2</math>, and <math>\mathbf b_3</math>, respectively.


'''N.B.:''' As mentioned above, this particular mode of k-points generation is primarily used for the calculation of DFT band structures.
<span style="color:#808080">Fully automatic mesh</span>
This is a two-step procedure: first, you have to perform a fully self-consistent calculation with a regular k-point mesh (e.g. a [[KPOINTS#Monkhorst-Pack | Monkhorst-Pack mesh]]), and in the second step one does the actual band structure calculation with the ''line-mode'' {{FILE|KPOINTS}} file.
<span style="color:#2FB5AB">0              ! 0 -> automatic generation scheme </span>
The second step is a non-selfconsistent calculation (set {{TAG|ICHARG}}=11) that needs to start from the self-consistent charge density ({{FILE|CHGCAR}} file) you have obtained in the first step. There are several examples of this in the [[Bulk_Systems_-_Tutorial | tutorial on simple bulk systems]].
<span style="color:#A82C35">Auto          ! fully automatic</span>
<span style="color:#2C68FC">  10          ! length (R_k)</span>


== Automatic k-mesh generation ==
* The first line is a <span style="color:#808080">comment line</span>.
* <span style="color:#2FB5AB">Automatically</span> determine the number of '''k''' points <span style="color:#2FB5AB">by setting '0'</span> on the second line.
* The first nonblank character in the third line is <span style="color:#A82C35">''A'' or ''a'' activating the fully-automatic mode</span>.
* The fourth line defines a <span style="color:#2C68FC">length (<math>R_k</math>) that determines the subdivisions</span> <math>N_1</math>, <math>N_2</math>, and <math>N_3</math>.


The most convenient way to specify the k-point sampling of the first Brillouin zone is to have VASP automatically generate a (shifted) regular mesh of points. This mode of k-point generation comes in three different flavours: [[KPOINTS#Rk_length|R<sub>k</sub> length]], [[KPOINTS#Monkhorst-Pack|Monkhorst-Pack]], and [[KPOINTS#Generalized_regular_meshes|generalized regular meshes]].
For every lattice vector <math>\mathbf b_i</math> the number of subdivisions is calculated as
::<math>N_i = \text{int}\left(\max(1, R_k |{\mathbf b}_i| + 0.5)\right)~.</math>
Note that this similar to the {{TAG|KSPACING}} tag, when the length <math>R_k = 2\pi/\text{KSPACING}</math>.
The generated mesh is centered at <math>\Gamma</math>
::<math>{\mathbf k} = \sum_{i=1}^3 {\mathbf b}_i \frac{n_i}{N_i} \qquad \forall n_i \in [0, N_i[ </math>


The following {{FILE|KPOINTS}} file suffices to fully automatically generate a regular mesh of k-points, centered on the <math>\Gamma</math>-point, with <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> subdivisions along the reciprocal lattice vectors <math>b_1</math>, <math>b_2</math>, and <math>b_3</math>, respectively.
Useful values for the length vary between <math>R_k = 10</math> (large gap insulators) and <math>R_k = 100</math> (''d'' metals).
Please verify that changes to <math>R_k</math> do not affect the quantity of interest.
For production calculations, preferably specify the mesh dimensions explicitly to avoid discontinuities between different cell sizes.


Automatic mesh
== Related tags and sections ==
0              ! number of k-points = 0 -> automatic generation scheme
{{TAG|KSPACING}}, {{FILE|KPOINTS_OPT}}, {{FILE|IBZKPT}}
Auto          ! fully automatic
  10          ! length (R_k)


* The first line is treated as a comment line.
* The '0' on the second line signifies that you request an automatically generated mesh of k-points
* To select the fully automatic flavor of mesh generation the first non-blank character in the third line must be ''A'' or ''a''.
* On the fourth and last line you need to specify a length parameter (<math>R_k</math>) that determines <math>N_1</math>, <math>N_2</math>, and <math>N_3</math> (the number of subdivisions along the reciprocal lattice vectors <math>b_1</math>, <math>b_2</math>, and <math>b_3</math>) in the following manner:
::<math>N_1 = {\rm int}\left({\rm max}(1,R_k*|{\vec b}_1|+0.5)\right)</math>
::<math>N_2 = {\rm int}\left({\rm max}(1,R_k*|{\vec b}_2|+0.5)\right)</math>
::<math>N_3 = {\rm int}\left({\rm max}(1,R_k*|{\vec b}_3|+0.5)\right)</math>
:where <math>|{\vec b}_i|</math> is the norm of the reciprocal lattice vector <math>{\vec b}_{i}</math>.
The fully automatic scheme then generates an <math>N_1 \times N_2 \times N_3</math> <math>\Gamma</math>-centered Monkhorst-Pack mesh of k-points:
:<math>{\vec k} = {\vec b}_1 \frac{n_1}{N_1} + {\vec b}_2 \frac{n_2}{N_2}  + {\vec b}_3 \frac{n_3}{N_3} ,\qquad  n_1=0...,N_1-1 \quad  n_2=0...,N_2-1 \quad  n_3=0...,N_3-1 </math>
Useful values for the length vary between R<sub>k</sub>=10 (large gap insulators) and 100 (d-metals).
Note, the aforementioned values are just a rule of thumb: the actual length parameter <math>R_k</math> will have to be chosen such that some relevant output quantity of the calculation is converged w.r.t. to this parameter.
'''N.B.:''' an almost identical flavor of automatic mesh generation is offered by the {{TAG|KSPACING}} tag.
== Related tags and sections ==
{{TAG|KSPACING}}, {{FILE|KPOINTS_OPT}}
== References ==
== References ==
<references/>
<references/>


----
[[Category:VASP]][[Category:Files]][[Category:Input files]][[Category:Band structure]][[Category:Symmetry]]
[[The_VASP_Manual|Contents]]
 
[[Category:VASP]][[Category:Files]][[Category:Input files]]

Latest revision as of 18:41, 1 September 2022

The KPOINTS file specifies the Bloch vectors (k points) used to sample the Brillouin zone. Converging this sampling is one of the essential tasks in many calculations concerning the electronic minimization. A regular mesh is the most common choice to select k points:

Regular 4 x 4 x 4 mesh centered at Gamma 
0
Gamma
4 4 4
Tip: Choose the number of points along each direction approximately inversely proportional to the corresponding length of the unit cell.

A band structure is often visualized along high-symmetry paths. Some external tools[1][2] help to identify these points for materials of any symmetry. Use the template below to setup band-structure calculations. Alternatively, use a KPOINTS_OPT file to get the band structure as a postprocessing step after the regular calculation.

k points along high symmetry lines
 40              ! number of points per line
line mode
fractional
  0    0    0    Γ
  0.5  0.5  0    X

  0.5  0.5  0    X
  0.5  0.75 0.25 W

  0.5  0.75 0.25 W
  0    0    0    Γ
Tip: If the KPOINTS file is not present, the tag KSPACING determines the k-point sampling. Use that option for a quick first run but prefer generating a regular mesh for production calculations.

Coordinate system

When specifying coordinates in the KPOINTS file, use one of the following coordinate systems:

Fractional coordinate system
The k points are linear combinations of the reciprocal lattice vectors
Use the factors as the coordinates in KPOINTS.
Cartesian coordinate system
The coordinates directly correspond to the k point
up to the scaling factor . Here, is the scaling parameter specified on the second line of the POSCAR file.

Example: face-centered-cubic (fcc) lattice

The following lattice vectors span the unit cell:

The corresponding reciprocal lattice vectors are

The following table shows several high-symmetry points of the fcc lattice expressed in Cartesian and fractional coordinates, respectively:

Point     Cartesian coordinates     Fractional coordinates
            (units of 2pi/a)         (units of b1,b2,b3)
----------------------------------------------------------
  Γ         (  0    0    0  )         (  0    0    0  )
  X         (  0    0    1  )         ( 1/2  1/2   0  )
  W         ( 1/2   0    1  )         ( 1/2  3/4  1/4 )
  K         ( 3/4  3/4   0  )         ( 3/8  3/8  3/4 )
  L         ( 1/2  1/2  1/2 )         ( 1/2  1/2  1/2 )

Explicit k-point mesh

When an explicit k-point mesh is provided, VASP uses exactly the provided points. The primary use case of this mode is to look at particular features in the band structure, e.g., for effective mass calculations. For regular meshes and band structures, we recommend using the automatic generation to avoid mistakes. Nevertheless, all other modes write the processed input in this format to the IBZKPT file, so understanding this format helps analyze mistakes in setting up the KPOINTS file. A typical example has the following format:

Explicit k-point list
4
Cartesian
0.0  0.0  0.0   1
0.0  0.0  0.5   1
0.0  0.5  0.5   2
0.5  0.5  0.5   4
  • The first line is treated as a comment line.
  • Provide the number of k points on the second line.
  • The first character on the third line specifies the coordinate system. Use C, c, K, or k to indicate Cartesian coordinates. Any other character is interpreted as fractional/reciprocal coordinates but we advise writing fractional or reciprocal to make this clear.
  • Each following line contains the coordinates and weight of one k point. VASP takes care that weights are properly normalized so only relative weight is important. Typically the weights correspond to the symmetry degeneracy of a k point.

Use the explicit mode for

Tetrahedron method

When using the tetrahedron method (see ISMEAR), extend the list of k points by a list of all tetrahedra.
Explicit k-point list
4
Cartesian
0.0  0.0  0.0   1
0.0  0.0  0.5   1
0.0  0.5  0.5   2
0.5  0.5  0.5   4
Tetrahedra
1  0.183333333333333
6    1 2 3 4
The line following the list of k point coordinates and weights must start with 'T' or 't'. On the next line, enter the number of tetrahedra and the volume weight common to all the tetrahedra. The volume weight is simply the ratio between the volume of a tetrahedron and the volume of the first Brillouin zone.
Subsequently, list the symmetry-degeneration weight and the four corner points of each tetrahedron. The four integers represent the indices of the corners of the tetrahedron in the k-point list given above. Here, the counter starts at 1 and corresponds to the k point specified in the fourth line.
Warning: VASP does not renormalize the weights of the tetrahedra. Make sure they are appropriately normalized.
Important: Explicitly listing all the k points is not very convenient, especially in the context of the tetrahedron method. Keep in mind that the automatic modes generate the IBZKPT file in this format. For any nontrivial case, preferably modify an automatically-generated IBZKPT instead of building an explicit list from scratch.

Regular k-point mesh

This mode will automatically generate a mesh where each lattice vector is subdivided into an explicitly defined number of subdivisions. It offers sufficient flexibility and stability and should be preferred for most production calculations. Choose the number of subdivisions , and in the KPOINTS file like this

Regular k-point mesh
0              ! 0 -> determine number of k points automatically
Gamma          ! generate a Gamma centered mesh
4  4  4        ! subdivisions N_1, N_2 and N_3 along the reciprocal lattice vectors
0  0  0        ! optional shift of the mesh (s_1, s_2, s_3)
  • The first line is a comment line.
  • In the second line, set the number of k points to 0 to indicate an automatic mesh generation.
  • The first nonblank character of the third line determines the center of the mesh. The possible choice are Γ-centered (G, g) or the Monkhorst-Pack scheme (M, m).[7]
  • Specify the desired number of subdivisions , and in the fourth line.
  • Optionally add a fifth line to shift the mesh by with respect to the default.
Γ-centered mesh
The following k points sample the Brillouin zone
Monkhorst-Pack mesh
The k point mesh results from this definition

The spacing between the points is the same for both meshes. The only difference is the shift in the numerator of the Monkhorst-Pack mesh. For an odd number of subdivisions, this term is an integer, and therefore the two meshes agree due to periodic boundaries. When the number of subdivisions is even the Γ-centered mesh is shifted by compared to the Monkhorst-Pack one.

Important: Monkhorst-Pack meshes may converge faster than the Γ-centered ones. However, carefully read the section on symmetry considerations to avoid breaking the symmetry with a Monkhorst-Pack mesh.

Guidelines for the choice of the subdivisions

As a rule of thumb, choose , , and such that

This guideline is also implemented for the automatic k-point generation using KSPACING. Nevertheless, specifying the , , and manually ensures that changes in the lattice vectors do not affect the k-point mesh. When the primitive cell has (nearly) perpendicular axes (cubic, tetragonal, orthorhombic), this is equivalent to:

Of course, this only provides a guide for the ratios between the subsections. The actual density of the k point mesh has to be increased until some relevant output quantity of the calculation is converged.

Symmetry reduction of the mesh

VASP determines the symmetry of the system. For ISYM 0, the automatically generated k-point meshes are reduced to the irreducible subset. Every k point acquires a weight following their symmetry multiplicity. This can significantly reduce the total number of k points.

Important: To enable an efficient symmetry reduction, the (shifted) regular mesh of k points should conserve the point-group symmetry of the reciprocal lattice. Specifically, the generating lattice () should belong to the same class of Bravais lattice as the reciprocal lattice.

Consequently, refrain from using a shifted regular mesh for some Bravais lattices, see table. Importantly, this includes the default Monkhorst-Pack mesh for even numbers of subdivisions. Furthermore, the reciprocal lattice vectors do not in general align with lattice vectors. There is typically a difference in the subdivisions obtained from the inverse of the lattice vectors or the reciprocal lattice vectors.

In some special cases, the two options are equal, e.g., when the length of all vectors is the same, or they are mutually perpendicular. Unfortunately, either choice yields incompatible k point meshes for some of the Bravais lattices. Consult the table below to make an informed choice depending on the symmetry of the system.

Bravais lattice variant mesh choices subsection choices
triclinic primitive -centered, Monkhorst Pack ,
monoclinic primitive -centered, Monkhorst Pack ,
base-centered -centered, Monkhorst Pack ,
orthorhombic primitive -centered, Monkhorst Pack ,
base-centered -centered, Monkhorst Pack ,
body-centered -centered, Monkhorst Pack
face-centered -centered
tetragonal primitive -centered, Monkhorst Pack ,
body-centered -centered, Monkhorst Pack
hexagonal rhombohedral -centered ,
hexagonal -centered ,
cubic primitive -centered, Monkhorst Pack ,
body-centered -centered, Monkhorst Pack ,
face-centered -centered ,
Tip: VASP issues an error when it detects an incompatible k-point mesh. The specific error message depends on the particular setup but includes the name of the routine IBZKPT, some warning about the generating k-lattice, and some suggestions to overcome the problem.

Summarizing the information in the table above

  • Use only -centered meshes for face-centered cubic (fcc), hexagonal, and fcc-orthorhombic crystalline lattices.
  • Choose the ratios of the subdivisions for body-centered tetragonal and body-centered orthorhombic lattices. Keep in mind that the KSPACING uses the reciprocal lattice vectors so may not be suitable for these symmetries.
  • For face-centered orthorhombic crystal structures, choose subdivisions according to .
  • For any other symmetry, all combinations should work but a change to other subdivisions or meshes may overcome possible issues.

Solve problems with the primitive cells of the body-centered tetragonal and body/face-centered orthorhombic Bravais lattices with one of these options:

  1. Choose . For Monkhorst-Pack meshes the reciprocal lattice is always of the same Bravais lattice as the generating lattice. For body-centered tetragonal and face-centered orthorhombic primitive cells, the reciprocal lattices are body-centered tetragonal and body-centered orthorhombic, respectively. Therefore, choosing equal subdivisions is justified because the length of all reciprocal lattice vectors is the same .
  2. A simple but computationally-expensive option is to change to the conventional cell of the structure. For the body-centered tetragonal/orthorhombic structure, the conventional cell is two times bigger than the primitive cell.
  3. Alternatively, define the k-point mesh for the conventional cell. This approach requires a generalized regular mesh introduced in the next section and is demonstrated for the example of a body-centered orthorhombic lattice.

Generalized regular meshes

When more control about the generated mesh is desired, one can specify the generating vectors explicitly. A typical use case would be to generate the mesh for the conventional unit cell and apply it to the primitive one. Build a KPOINTS file for this mode starting from this template

Automatic generation
0
Cartesian
0.25 0.00 0.00
0.00 0.25 0.00
0.00 0.00 0.25
0.00 0.00 0.00

The mode is activated by specifying the coordinate system with the first nonblank character in line 3. A C, c, K or k character determines that the generating basis vectors are in Cartesian coordinates. Use r or R to select the reciprocal coordinate system instead. The latter is also the default used if VASP cannot interpret the provided character but we recommend not relying on this behavior. Otherwise, the introduction of further automatic modes in the future versions of VASP may change the interpretation of the KPOINTS file.

VASP generates three vectors , , and from the coefficients given in line 4–6. Depending on the selected coordinate system these vectors are either multiples of the reciprocal lattice vectors (reciprocal) or simply multiplying the coefficients by (Cartesian). Here is the scaling parameter you have specified on the second line of the POSCAR file.

Important: The generating vectors , , and must be commensurate with the reciprocal lattice. This means where the matrix contains only integer entries. If this is not the case the code will exit in error.

Combined with the shift (, , ) specified in the last line, VASP uses the generating vectors to construct the k-point mesh

where VASP chooses the to include all possible points of the generating mesh in the first Brillouin zone.

The regular k-point meshes are a subset of the generalized regular meshes, for which

Here, the generating lattice vectors are integer subdivisions of the reciprocal lattice vectors according to the defined in the KPOINTS file.

For instance, the generalized regular mesh given by

Automatic generation
0
Reciprocal
 0.25 0.00 0.00
 0.00 0.25 0.00
 0.00 0.00 0.25
 0.50 0.50 0.50

is equivalent to the Monkhorst-Pack mesh specified by

Automatic generation
0
Monkhorst-pack
 4 4 4
 0 0 0


A typical use-case for generalized regular meshes is to generate a k-point mesh based on the conventional cell of a particular Bravais lattice to be used with the primitive cell of that lattice (see the subsection on symmetry considerations). As an example, consider the primitive cell of a body-centered orthorhombic lattice:

where the rows of represent the lattice vector of the primitive cell. The corresponding conventional cell is given by

and its reciprocal lattice by

Then the following generating lattice based on the reciprocal lattice of the conventional cell

yields a roughly uniform sampling of the Brillouin zone when , , and are chosen such that:

For instance, for a body-centered orthorhombic primitive cell with , here given in POSCAR file format:

body-centered orthorhombic primitive cell
5.0
-0.500000  0.600000  0.250000
 0.500000 -0.600000  0.250000
 0.500000  0.600000 -0.250000
1
direct
0.000000 0.000000 0.000000

this following KPOINTS file

Generalized regular mesh
0
Cartesian
 0.50000000  0.00000000  0.00000000
 0.00000000  0.41666667  0.00000000
 0.00000000  0.00000000  0.50000000
 0.00000000  0.00000000  0.00000000

corresponds to the aforementioned generating lattice for , , and .

Furthermore, using generalized regular meshes potentially requires fewer k points compared to Monkhorst-Pack meshes to converge total energy calculations.[3][4] Specifically this statement applies to the number of k points in the irreducible part of the Brillouin zone after symmetry reduction. For the moment, however, VASP does not automatically construct optimal generalized regular k-point meshes. But external tools[5][6] construct meshes with certain target sampling density in the spirit of the aforementioned publications.

Band-structure calculations

When properties depend on the k vector, it is often convenient to visualize the property along high-symmetry lines. The line mode generates k points between user-defined points in the Brillouin zone. The most common use case is analyzing the electronic band structure.

Warning: The mesh generated by this mode is not suitable for self-consistent calculations. Please set ICHARG = 11 to avoid updating the density.
Mind: For meta-GGA and hybrid functionals, a regular mesh must always be provided. Refer to band-structure calculations using meta-GGA functionals or using hybrid functionals, respectively.

Build the KPOINTS based on this template

k points along high symmetry lines
 40              ! number of points per line
line mode
fractional
  0    0    0    Γ
  0.5  0.5  0    X

  0.5  0.5  0    X
  0.5  0.75 0.25 W

  0.5  0.75 0.25 W
  0    0    0    Γ
  • The first line is a comment line.
  • Specify the number of points per line segment on the second line.
  • The line mode activates when the first nonblank character on the third line is an L or l (for line mode)
  • The fourth line defines the coordinate system. Use Cartesian (C, c, K, or k) or fractional (any other character) coordinates.
  • Afterwards, any pair of lines define one path through the Brillouin zone. The empty lines and the label of the high-symmetry points are not required but simplify understanding the KPOINTS file. py4vasp uses the labels for the band structure plots.

The generated k-point mesh depends on the selected coordinate system. VASP produces equidistant k points for each segment such that the total of points including the endpoints equals the required number. Specifically for the template above, 40 points from to X, 40 points from X to W, and 40 points from W to . Because the endpoints are included every time, this generates two X and W points.

Transforming the same template to Cartesian coordinates produces

k points along high symmetry lines
 40              ! number of points per line
line mode
Cartesian
  0   0   0   Γ
  0   0   1   X

  0   0   1   X
  0.5 0   1   W

  0.5 0   1   W
  0   0   1   Γ

External tools[1][2] are useful to decide which paths in the Brillouin zone to include. The tools provide the coordinates and the labels for a given structure. Because these paths depend on the symmetry, take special care that the analysis is not tainted by finite precision or rounding. Also, keep in mind that the primitive and the conventional unit cell have different reciprocal coordinate systems.

Here is an example of a hexagonal structure

k-points along high symmetry lines for hexagonal structure
 40
line
reciprocal
0.000    0.000    0.500  A
0.000    0.000    0.000  Gamma

0.000    0.000    0.000  Gamma 
0.500    0.000    0.000  M

0.500    0.000    0.000  M
0.333333 0.333333 0.000  K 

0.333333 0.333333 0.000  K
0.000    0.000    0.000  Gamma
Mind: The primary use of this particular mode of k-point generation is the calculation of DFT band structures. Because the mesh does not yield a good electronic density, it should only be used on a converged density. Therefore, run a calculation using a regular k-point mesh first. Freeze this density by setting ICHARG = 11 and run a non-self-consistent calculation with the line-mode k-point mesh afterward.

As of VASP.6.3, the KPOINTS_OPT file runs these two steps in a single calculation. It uses the same format and its presence triggers the postprocessing step. Use it for band-structure calculations with hybrid functionals to avoid the more cumbersome manual specification.

Automatic k-point mesh

Deprecated: The KSPACING tag provides almost the same functionality. Preferably use that method instead.

The following KPOINTS file generates a regular -centered k-point. The subdivisions , , and are along the reciprocal lattice vectors , , and , respectively.

Fully automatic mesh
0              ! 0 -> automatic generation scheme 
Auto           ! fully automatic
  10           ! length (R_k)
  • The first line is a comment line.
  • Automatically determine the number of k points by setting '0' on the second line.
  • The first nonblank character in the third line is A or a activating the fully-automatic mode.
  • The fourth line defines a length () that determines the subdivisions , , and .

For every lattice vector the number of subdivisions is calculated as

Note that this similar to the KSPACING tag, when the length . The generated mesh is centered at

Useful values for the length vary between (large gap insulators) and (d metals). Please verify that changes to do not affect the quantity of interest. For production calculations, preferably specify the mesh dimensions explicitly to avoid discontinuities between different cell sizes.

Related tags and sections

KSPACING, KPOINTS_OPT, IBZKPT

References