POSCAR: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(26 intermediate revisions by 4 users not shown)
Line 7: Line 7:
===Minimal example===
===Minimal example===


In its simplest form the {{FILE|POSCAR}} file contains basic information about the lattice, per-element number of ions and their positions. This is sufficient in most situation where a {{VASP}} calculation is started from scratch. Have a look at this example for cubic boron nitride:
In its simplest form the {{FILE|POSCAR}} file contains basic information about the lattice, per-species number of ions and their positions. This is sufficient in most situation where a {{VASP}} calculation is started from scratch. Have a look at this example for cubic boron nitride:


  <span style="color:#808080">Cubic BN</span>
  <span style="color:#808080">Cubic BN</span>
Line 28: Line 28:
<span style="color:#2FB5AB">'''<u>Scaling factor and lattice'''</u></span>
<span style="color:#2FB5AB">'''<u>Scaling factor and lattice'''</u></span>


In this block the first line specifies a universal lattice scaling factor <math>s</math>. The next three lines define the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors  <math>{\vec a}_1, {\vec a}_2</math> and <math>{\vec a}_3</math> are the product of the given numbers with the lattice scaling factor. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.
In this block the first line specifies a universal lattice scaling factor <math>s</math>. The next three lines define the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors  <math>{\vec a}_1, {\vec a}_2</math> and <math>{\vec a}_3</math> (in <math>\AA</math>) are the product of the given numbers with the lattice scaling factor. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.


<span style="color:#A82C35"><u>'''Ion elements and numbers: '''</u></span>
<span style="color:#A82C35"><u>'''Ion species and numbers: '''</u></span>


This section defines how many ions of each element are present. The first line lists the element names, the second specifies the number of ions for each element. The given order should match the order of elements appearing in the {{FILE|POTCAR}} file.
This section defines how many ions of each species are present. The first line lists the species names, the second specifies the number of ions for each species. The given order should match the order of species appearing in the {{FILE|POTCAR}} file.
{{NB|warning|If machine-learned force fields are used ({{TAG|ML_LMLFF}}{{=}}.TRUE.), it is not possible to give the same name to different groups of atoms in the {{FILE|POSCAR}} file.}}


<span style="color:#2C68FC"><u>'''Ion positions: '''</u></span>
<span style="color:#2C68FC"><u>'''Ion positions: '''</u></span>


Finally, the ion positions are listed in this section. The first line selects one of the two possible modes how the coordinates <math>x_1, x_2</math> and <math>x_3</math> given in the following lines are interpreted:
Finally, the ion positions <math>{\vec R}</math> (in <math>\AA</math>) are listed in this section. The first line selects one of the two possible modes how the coordinates <math>x_1, x_2</math> and <math>x_3</math> given in the following lines are interpreted:


* "Direct" means the positions are provided in direct (fractional) coordinates:<p><math>{\vec R} = x_1 {\vec a}_1 + x_2 {\vec a}_2 +  x_3 {\vec a}_3,</math></p><p>where <math>{\vec R}</math> is the position vector of an ion.</p>
* "Direct" means the positions are provided in direct (fractional) coordinates:<p><math>{\vec R} = x_1 {\vec a}_1 + x_2 {\vec a}_2 +  x_3 {\vec a}_3,</math></p><p>where <math>{\vec R}</math> is the position vector of an ion.</p>
Line 42: Line 43:
* "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.<p><math> {\vec R} = s \left( \begin{array}{c}x_1 \\ x_2 \\ x_3\end{array} \right).</math></p>
* "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.<p><math> {\vec R} = s \left( \begin{array}{c}x_1 \\ x_2 \\ x_3\end{array} \right).</math></p>


The total number of lines with positions must match the total number of ions given in the previous section. The ion elements are also derived from there, i.e. in the example above it is implied that the list of positions contains one boron ion, followed by one nitrogen nuclei.
The total number of lines with positions must match the total number of ions given in the previous section. The ion species are also derived from there, i.e. in the example above it is implied that the list of positions contains one boron ion, followed by one nitrogen nuclei.


===Full format specification===
===Full format specification===
Line 52: Line 53:
! Section
! Section
! Number of lines<br />
! Number of lines<br />
! Mandatory<br />
! Required section?<br />
! Content
! Content
|-
|-
| Comment
| Comment
| 1<br />
| 1<br />
| yes
| mandatory
|  
| The first line is reserved for a free user comment, e.g. a system description. The maximum line length is 40 characters, extra characters are truncated.
|-
|-
| Scaling factor(s)
| Scaling factor(s)
| 1<br />
| 1<br />
| yes
| mandatory
|  
| This line may contain one or three numbers. If one number is provided it specifies a universal lattice scaling factor <math>s</math>. It is multiplied with the three vectors in the following section to obtain the lattice vectors of the unit cell. Also, the ion positions are scaled with this factor if the "Cartesian" mode is selected (see section "Ion positions"). If the number is negative, it is interpreted as the desired cell volume. Then, the scaling factor <math>s</math> is computed automatically to obtain the desired volume. If three numbers are provided in this line they act as individual scaling factors for the x-,y- and z-Cartesian components for the lattice vectors (and "Cartesian" mode ion positions). In this case all three numbers must be positive.
|-
|-
| Lattice
| Lattice
| 3
| 3
| yes
| mandatory
|  
| This sections contains three lines defining the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors <math>{\vec a}_1, {\vec a}_2</math> and <math>{\vec a}_3</math> (in <math>\AA</math>) are the product of the given numbers with the lattice scaling factor <code>s</code>. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.
|-
| Species names
| 1
| optional
| This line lists the species of the present ions. The given order should match the order of species appearing in the {{FILE|POTCAR}} file. This line is optional, if omitted the species names are taken from the {{FILE|POTCAR}} file. {{NB|warning|
*In a {{VASP}} calculation the {{FILE|POTCAR}} file together with the <code>Ions per species</code> section below defines the species of all ions provided in the {{FILE|POSCAR}} file! This <code>Species names</code> section should be considered only as a helpful comment to identify species when inspecting a {{FILE|POSCAR}} file independently. Switching species names here will not actually change the species of ions in a calculation if the {{FILE|POTCAR}} file stays the same!
*If machine-learned force fields are used ({{TAG|ML_LMLFF}}{{=}}.TRUE.), it is not possible to give the same name to different groups of atoms in the {{FILE|POSCAR}} file.
*The number of characters a species name can have is only two. If more than two characters are given the code will run but will truncate the name species names after two characters. For example, "Si1" and "Si2" would both be treated as "Si" and Si". In the case of {{TAG|ML_LMLFF}}{{=}}.TRUE. the code would be terminated since twice the same name for different species is not allowed.}}
|-
| Ions per species
| 1
| mandatory
| This mandatory line lists how many ions of each species are present. The given order should match the order of species appearing in the {{FILE|POTCAR}} file.
|-
|-
| Selective dynamics
| Selective dynamics
| 1
| 1
| no
| optional
|  
| If the line after the "Ions per species" section contains <code>Selective dynamics</code> it enables the "selective dynamics" feature (actually only the first character is relevant and must be ''S'' or ''s''). This allows to provide extra flags for each atom signaling whether the respective coordinate(s) of this atom will be allowed to change during the ionic relaxation. This setting is useful if only certain shells around a defect or layers near a surface should relax. See also the {{TAG|IBRION}} tag.
|-
|-
| Atom positions<br />
| Ion positions<br />
| #atoms + 1
| 1 + #atoms
| yes
| mandatory
|  
| Here, the ion positions <math>{\vec R}</math> (in <math>\AA</math>) are listed. The first line selects one of the two possible modes how the coordinates <math>x_1, x_2</math> and <math>x_3</math> given in the following lines are interpreted:
 
* "Direct" means the positions are provided in direct (fractional) coordinates:<p><math>{\vec R} = x_1 {\vec a}_1 + x_2 {\vec a}_2 +  x_3 {\vec a}_3,</math></p><p>where <math>{\vec R}</math> is the position vector of an ion.</p>
 
* "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.<p><math> {\vec R} = s \left( \begin{array}{c}x_1 \\ x_2 \\ x_3\end{array} \right).</math></p>
 
Actually, only the first character on the line is significant and the only key characters recognized are <code>C</code>, <code>c</code>, <code>K</code> or <code>k</code> for switching to the "Cartesian" mode. Everything else will be interpreted as "Direct" mode.
 
The total number of lines with positions must match the total number of ions given in the "Ions per species" section. The ion species are also derived from there, e.g. if the "Ions per species" section lists <code>5 8</code>, then there must be five ion position lines for the first species, followed by eight ions of the second species. If your are not sure whether you have a correct input please check the {{TAG|OUTCAR}} file, which contains both the final Cartesian components of the vector <math>{\vec R}</math> and the positions in direct (fractional) coordinates.
 
If the selective dynamics feature is enabled on each coordinate triplet is followed by three additional logical flags, i.e. each is either <code>T</code> or <code>F</code> for true and false, respectively. This determines whether to allow changes of the coordinates or not. If the line selective dynamics is removed from the {{TAG|POSCAR}} file this flag will be ignored (and internally set to <code>T</code>).
{{NB|mind|The flags refer to the positions of the ions in direct coordinates, no matter whether the positions are entered in "Cartesian" or "Direct" coordinate modes.}} For example, consider the following ion specification:
...
<span style="color:#A82C35">Selective dynamics</span>
Cartesian
0.00 0.00 0.00 <span style="color:#A82C35">T F T</span>
1.27 0.98 0.32 <span style="color:#A82C35">F T F</span>
...
Here, the first atom is allowed to move into the direction of the first and third direct lattice vector. The second atom may only move in the second lattice vector direction.
 
If no initial velocities are provided, the file may end here.
|-
|-
| Lattice velocities<br />
| Lattice velocities<br />
| ?
| 8
| no
| from {{FILE|CONTCAR}} only<sup>1</sup>
|  
| Contains the lattice vectors <math>{\vec a}_1, {\vec a}_2</math> and <math>{\vec a}_3</math> and their velocities. Lattice velocities occur when in molecular dynamics simulations lattice vectors are treated as dynamic variables, i.e., are allowed to change over time ({{TAG|IBRION}}=0 together with {{TAG|ISIF}}=3). When written to the {{FILE|CONTCAR}} file the section starts with a line containing the string <code>Lattice velocities and vectors</code>. While reading in the {{FILE|POSCAR}} file upon restarting only the first character of the line is checked for <code>L</code> or <code>l</code>. The following line specifies the initialization state of the lattice velocities (usually just the integer 1). The next three lines contain the velocities corresponding to the three lattice vectors divided by the time step given via the {{TAG|POTIM}} tag. The remaining three lines repeat the actual lattice vectors <math>{\vec a}_1, {\vec a}_2</math> and <math>{\vec a}_3</math> where multiplication with the scaling factor <math>s</math> has already been taken into account.
|-
|-
<!--
| Empty spheres<br />
| Empty spheres<br />
| ?
| 2 + #number of desired empty spheres
| no
| optional
|  
| Note: It seems this feature has never been properly documented and is not used any more.
|-
|-
| Velocities
-->
| variable
| Ion velocities
| no
| 1 + #atoms
|  
| optional
| Here initial velocities for all ions can be provided. The input format is similar to the section "Ion positions" above. The first line determines the input mode which is either "Direct" or "Cartesian". In contrast to the reading of ion positions there is no multiplication with the scaling factor <math>s</math> applied in the "Cartesian" mode. Another minor difference is the interpretation of the contents of the first line in this section. In addition to <code>C</code>, <code>c</code>, <code>K</code> or <code>k</code> as the first character also an empty line is switching on the "Cartesian" mode. Everything else enables the "Direct" mode instead. The velocity section written out to the {{FILE|CONTCAR}} file always starts with an empty line and velocities are given in "Cartesian" mode. The following lines contain the velocity vectors of each ion defined in the "Ion positions" section. Velocities must be provided in units "direct lattice vector/timestep" or <math>\AA</math>/fs for "Direct" or "Cartesian" mode, respectively. {{NB|tip|Entering velocities by hand is rarely done because a simple alternative to set initial velocities is provided via the {{TAG|TEBEG}} tag.}} {{NB|mind|Different rules for the input in this section apply for special {{VASP}} features:
* {{TAG|IBRION}}{{=}}0 and {{TAG|SMASS}}{{=}}-2: In this case the velocities are kept constant during the MD allowing to calculate the energy for a set of different linear dependent positions (for instance frozen phonons and dimers with varying bond-length). The actual steps taken are {{TAG|POTIM}} times read velocities. Hence, to avoid ambiguities, set {{TAG|POTIM}} to 1. Then, the velocities will are simply interpreted as vectors, along which the ions are moved. Therefore, for the "Direct" and "Cartesian" modes they are given in units of direct coordinates and <math>\AA</math>, respectively (again, no multiplication with the scaling factor).
* {{TAG|IBRION}}{{=}}44: The vectors in this section are interpreted as directions of the unstable mode in the context of the [[Improved Dimer Method]].}}
|-
|-
| MD extra
| MD extra
| variable
| variable
| no
| from {{FILE|CONTCAR}} only<sup>1</sup>
|  
| The predictor-corrector coordinates are only provided to continue a molecular dynamic run from a {{TAG|CONTCAR}} file of a previous run, they can not be entered by hand.
|}
|}


* '''Line 1''' The first line is treated as a comment line (you should write down the name of the system).
<sup>1</sup> "from {{TAG|CONTCAR}} only": This section is usually not entered manually by the user. It appears in the {{FILE|CONTCAR}} file output at the end of {{VASP}} runs which involve ionic steps and is intended for restarting a previous calculation.
 
===Precision and symmetry===
 
VASP determines the symmetry of the system from the {{FILE| POSCAR}} file.
It is a common mistake to enter the positions with insufficient precision
(too few digits). To make the best use of the symmetry routines in VASP, it is strongly
recommended to specify the positions (and lattice parameters)  in the {{FILE| POSCAR}} file with at least 7 significant digits (but preferably more).
Internal tests for symmetry operations are done against a user-supplied
value for the precision, specified by {{TAG|SYMPREC}} (defaults to 10<sup>-5</sup>).
Hence,  5 significant digits are absolutely borderline and can cause
serious issues in the automatic symmetry determination, for instance, finding some
but not all generators for the symmetry group. Also, "noise" in the positions
might grow during relaxations, so that sometimes, upon reading the {{TAG|CONTCAR}} file,
some symmetry operations are not found. All these issues are best avoided by
making the initial {{FILE|POSCAR}} file as accurate as possible.
 
If you have a {{FILE|POSCAR}} file with the positions written with low precision and would like to reconstruct with higher precision, we recommend using a symmetry package, such as spglib{{cite|spglib}}, to find the symmetries given a certain precision, symmetrizing the lattice vectors and positions and writing the {{FILE|POSCAR}} file with a higher number of significant digits.
This can be done using pymatgen{{cite|pymatgen}} (which interfaces with spglib{{cite|spglib}}) to symmetrize the structure and write it to a {{FILE|POSCAR}} file, see [https://gist.github.com/henriquemiranda/e4a1b616693aac339ef011af6484f890 example on github].
 
===Examples===


  Cubic BN
  Cubic BN
    3.57
3.57
  0.0 0.5 0.5
0.00000000 0.50000000 0.50000000
  0.5 0.0 0.5
0.50000000 0.00000000 0.50000000
  0.5 0.5 0.0
0.50000000 0.50000000 0.00000000
    B N
B N
    1 1
1 1
  Selective dynamics
  Selective dynamics
  Cartesian
  Cartesian
  0.00 0.00 0.00 T T F
0.00000000 0.00000000 0.00000000 T T F
  0.25 0.25 0.25 F F F
0.25000000 0.25000000 0.25000000 F F F
  Cartesian
  Cartesian
  0.01 0.01 0.01
0.01000000 0.01000000 0.01000000
  0.00 0.00 0.00
0.00000000 0.00000000 0.00000000
  optionally predictor-corrector coordinates  
  optionally predictor-corrector coordinates  
     given on file CONTCAR of MD-run
     given on file CONTCAR of MD-run
   ....
   ....
   ....
   ....
or
Cubic BN
    3.57
  0.0 0.5 0.5
  0.5 0.0 0.5
  0.5 0.5 0.0
    B N
    1 1
Direct
  0.00 0.00 0.00
  0.25 0.25 0.25
* '''Line 1''' The first line is treated as a comment line (you should write down the name of the system).
* '''Line 2''' The second line provides a universal scaling factor (lattice constant), which is used to scale all lattice vectors and all atomic coordinates (of this value is negative it is interpreted as the total volume of the cell).
* '''Lines 3-5''' On the following three lines the three lattice vectors defining the unit cell of the system are given (first line corresponding to the first lattice vector, second to the second, and third to the third).


* '''Line 6''' The sixth line specifies the constituting elements (in the order how they appear in the {{TAG|POTCAR}} file).
fcc Si
3.9
  0.50000000 0.50000000 0.00000000
  0.00000000 0.50000000 0.50000000
  0.50000000 0.00000000 0.50000000
  1
cartesian
0.00000000 0.00000000 0.00000000


* '''Line 7''' The seventh line supplies the number of atoms per atomic species (one number for each atomic species). The ordering must be consistent with the {{TAG|POTCAR}} and the {{TAG|INCAR}} file.
MgO Fm-3m (No. 225)
1.0
  2.606553 0.000000 1.504894
  0.868851 2.457482 1.504894
  0.000000 0.000000 3.009789
  Mg O
  1 1
direct
  0.000000 0.000000 0.000000 Mg
  0.500000 0.500000 0.500000 O


* '''Line 8 (optional)''' The eighth line switches to selective dynamics (only the first character is relevant and must be ''S'' or ''s''). This mode allows to provide extra flags for each atom signaling whether the respective coordinate(s) of this atom will be allowed to change during the ionic relaxation. This setting is useful if only certain shells around a defect or layers near a surface should relax.
== Related tags and articles==
{{TAG|SYMPREC}}, {{TAG|IBRION}}, {{FILE|CONTCAR}}, {{FILE|POTCAR}}


'''Mind''': The selective dynamics input tag is optional: the seventh line supplies the switch between cartesian and direct lattice if the Selective dynamics tag is omitted.
== References ==
<references/>


* '''Section: atom coordinates''' The eighth line (or ninth line if selective dynamics is switched on) specifies whether the atomic positions are provided in cartesian coordinates or in direct coordinates (respectively fractional coordinates). Only the first character on the line is significant and the only key characters recognized by VASP are ''C'', ''c'', ''K'' or ''k'' for switching to the cartesian mode.
The next lines give the three coordinates for each atom. In the direct mode the positions are given by <br />
<math>{\vec R} = x_1 {\vec a}_1 + x_2 {\vec a}_2 +  x_3 {\vec a}_3</math> <br />
where <math>{\vec a}_{1...3}</math> are the three basis vectors, and <math>x_{1...3}</math> are the supplied values. In the cartesian mode the positions are only scaled by the factor <math>s</math> on the second line of the {{TAG|POSCAR}} file
<math> {\vec R} = s \left( \begin{array}{c}
                        x_1 \\ x_2 \\ x_3
                      \end{array} \right). </math>
The ordering of these lines must be correct  and consistent with the number of atoms per species on the sixth line. If your are not sure whether you have a correct input please check the {{TAG|OUTCAR}} file, which contains both the final components of the vector <math>{\vec R}</math> and the positions in direct (fractional) coordinates. If selective dynamics are switched on each coordinate a triplet is followed by three additional logical flags determining whether to allow changes of the coordinates or not (in our example the 1. coordinate of atom 1 and all coordinates of atom 2 are fixed). If the line selective dynamics is removed from the {{TAG|POSCAR}} file this flag will be ignored (and internally set to ''.T.'').
'''Mind''': The flags refer to the positions of the ions in direct coordinates, no matter whether the positions are entered in cartesian or direct coordinates. Therefore, in the example given above the first ion is allowed to move into the direction of the first and second direct lattice vector.
If no initial velocities are provided, the file may end here. For molecular dynamics the velocities are initialised randomly according to a Maxwell-Boltzmann distribution at the initial temperature {{TAG|TEBEG}}.
* '''Section: atom velocities''' Entering velocities by hand is rarely done (one important case is e.g. using the tags {{TAG|IBRION}}=0 and {{TAG|SMASS}}=-2), but if done the velocities are provided at the end of the {{TAG|POSCAR}} file very similalry to the positions.  As previously the first line supplies a switch between cartesian coordinates and direct coordinates. On the next lines the initial velocities are provided. They are given in units <math>\AA</math>/fs (no multiplication with the scaling factor in this case) or (direct lattice vector/timestep).
When the initial velocities are supplied in the {{TAG|POSCAR}} and the tags {{TAG|IBRION}}=0 and {{TAG|SMASS}}=-2) are set, the velocities are kept constant during the MD allowing to calculate the energy for a set of different linear dependent positions (for instance frozen phonons and dimers with varying bond-length).
'''Mind''': For {{TAG|IBRION}}=0 and {{TAG|SMASS}}=-2 the actual steps taken are {{TAG|POTIM}} times read velocities. To avoid ambiguities, set {{TAG|POTIM}} to 1. In this case
the velocities are simply interpreted as vectors, along which the ions are moved. For the ''cartesian'' switch, the vector is given in cartesian coordinates (<math>\AA</math>, no multiplication with the scaling factor in this case) for the ''direct'' switch the vector is given in direct coordinates.
* '''Section: predictor-corrector coordinates'''
The predictor-corrector coordinates are only provided to continue a molecular dynamic run from a {{TAG|CONTCAR}} file of a previous run, they can not be entered by hand.
----
----
[[The_VASP_Manual|Contents]]
[[Category:Files]][[Category:Input files]][[Category:Symmetry]]
 
[[Category:Files]][[Category:Input files]]

Latest revision as of 12:12, 18 October 2023

The POSCAR file is a mandatory VASP input file. It is a plain text file and contains at least the lattice geometry and the ionic positions. Optionally, also starting velocities for a molecular-dynamics simulation can be provided here. This file shares its format with VASP output file CONTCAR. That may contain an additional section with predictor-corrector coordinates necessary for restarting molecular-dynamics runs.

Creating a POSCAR file is often the starting point of VASP-supported research. It can be written manually or obtained from various online materials and crystallographic databases providing a download in the POSCAR file format.

File format

Minimal example

In its simplest form the POSCAR file contains basic information about the lattice, per-species number of ions and their positions. This is sufficient in most situation where a VASP calculation is started from scratch. Have a look at this example for cubic boron nitride:

Cubic BN
3.57
0.0 0.5 0.5
0.5 0.0 0.5
0.5 0.5 0.0
B N
1 1
Direct
0.00 0.00 0.00 
0.25 0.25 0.25

As indicated by the text coloring there are four blocks corresponding to the following file contents:

Comment line

The first line is reserved for a free user comment, e.g. a system description.

Scaling factor and lattice

In this block the first line specifies a universal lattice scaling factor . The next three lines define the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors and (in ) are the product of the given numbers with the lattice scaling factor. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.

Ion species and numbers:

This section defines how many ions of each species are present. The first line lists the species names, the second specifies the number of ions for each species. The given order should match the order of species appearing in the POTCAR file.

Warning: If machine-learned force fields are used (ML_LMLFF=.TRUE.), it is not possible to give the same name to different groups of atoms in the POSCAR file.

Ion positions:

Finally, the ion positions (in ) are listed in this section. The first line selects one of the two possible modes how the coordinates and given in the following lines are interpreted:

  • "Direct" means the positions are provided in direct (fractional) coordinates:

    where is the position vector of an ion.

  • "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.

The total number of lines with positions must match the total number of ions given in the previous section. The ion species are also derived from there, i.e. in the example above it is implied that the list of positions contains one boron ion, followed by one nitrogen nuclei.

Full format specification

The POSCAR file format is constructed from multiple sections arranged in a predefined order. Some sections contain only a single line, others span over many lines, some may even be omitted. The following list defines the section order and their contents:

Section Number of lines
Required section?
Content
Comment 1
mandatory The first line is reserved for a free user comment, e.g. a system description. The maximum line length is 40 characters, extra characters are truncated.
Scaling factor(s) 1
mandatory This line may contain one or three numbers. If one number is provided it specifies a universal lattice scaling factor . It is multiplied with the three vectors in the following section to obtain the lattice vectors of the unit cell. Also, the ion positions are scaled with this factor if the "Cartesian" mode is selected (see section "Ion positions"). If the number is negative, it is interpreted as the desired cell volume. Then, the scaling factor is computed automatically to obtain the desired volume. If three numbers are provided in this line they act as individual scaling factors for the x-,y- and z-Cartesian components for the lattice vectors (and "Cartesian" mode ion positions). In this case all three numbers must be positive.
Lattice 3 mandatory This sections contains three lines defining the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors and (in ) are the product of the given numbers with the lattice scaling factor s. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.
Species names 1 optional This line lists the species of the present ions. The given order should match the order of species appearing in the POTCAR file. This line is optional, if omitted the species names are taken from the POTCAR file.
Warning:
  • In a VASP calculation the POTCAR file together with the Ions per species section below defines the species of all ions provided in the POSCAR file! This Species names section should be considered only as a helpful comment to identify species when inspecting a POSCAR file independently. Switching species names here will not actually change the species of ions in a calculation if the POTCAR file stays the same!
  • If machine-learned force fields are used (ML_LMLFF=.TRUE.), it is not possible to give the same name to different groups of atoms in the POSCAR file.
  • The number of characters a species name can have is only two. If more than two characters are given the code will run but will truncate the name species names after two characters. For example, "Si1" and "Si2" would both be treated as "Si" and Si". In the case of ML_LMLFF=.TRUE. the code would be terminated since twice the same name for different species is not allowed.
Ions per species 1 mandatory This mandatory line lists how many ions of each species are present. The given order should match the order of species appearing in the POTCAR file.
Selective dynamics 1 optional If the line after the "Ions per species" section contains Selective dynamics it enables the "selective dynamics" feature (actually only the first character is relevant and must be S or s). This allows to provide extra flags for each atom signaling whether the respective coordinate(s) of this atom will be allowed to change during the ionic relaxation. This setting is useful if only certain shells around a defect or layers near a surface should relax. See also the IBRION tag.
Ion positions
1 + #atoms mandatory Here, the ion positions (in ) are listed. The first line selects one of the two possible modes how the coordinates and given in the following lines are interpreted:
  • "Direct" means the positions are provided in direct (fractional) coordinates:

    where is the position vector of an ion.

  • "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.

Actually, only the first character on the line is significant and the only key characters recognized are C, c, K or k for switching to the "Cartesian" mode. Everything else will be interpreted as "Direct" mode.

The total number of lines with positions must match the total number of ions given in the "Ions per species" section. The ion species are also derived from there, e.g. if the "Ions per species" section lists 5 8, then there must be five ion position lines for the first species, followed by eight ions of the second species. If your are not sure whether you have a correct input please check the OUTCAR file, which contains both the final Cartesian components of the vector and the positions in direct (fractional) coordinates.

If the selective dynamics feature is enabled on each coordinate triplet is followed by three additional logical flags, i.e. each is either T or F for true and false, respectively. This determines whether to allow changes of the coordinates or not. If the line selective dynamics is removed from the POSCAR file this flag will be ignored (and internally set to T).

Mind: The flags refer to the positions of the ions in direct coordinates, no matter whether the positions are entered in "Cartesian" or "Direct" coordinate modes.
For example, consider the following ion specification:
...
Selective dynamics
Cartesian
0.00 0.00 0.00 T F T
1.27 0.98 0.32 F T F
...

Here, the first atom is allowed to move into the direction of the first and third direct lattice vector. The second atom may only move in the second lattice vector direction.

If no initial velocities are provided, the file may end here.

Lattice velocities
8 from CONTCAR only1 Contains the lattice vectors and and their velocities. Lattice velocities occur when in molecular dynamics simulations lattice vectors are treated as dynamic variables, i.e., are allowed to change over time (IBRION=0 together with ISIF=3). When written to the CONTCAR file the section starts with a line containing the string Lattice velocities and vectors. While reading in the POSCAR file upon restarting only the first character of the line is checked for L or l. The following line specifies the initialization state of the lattice velocities (usually just the integer 1). The next three lines contain the velocities corresponding to the three lattice vectors divided by the time step given via the POTIM tag. The remaining three lines repeat the actual lattice vectors and where multiplication with the scaling factor has already been taken into account.
Ion velocities 1 + #atoms optional Here initial velocities for all ions can be provided. The input format is similar to the section "Ion positions" above. The first line determines the input mode which is either "Direct" or "Cartesian". In contrast to the reading of ion positions there is no multiplication with the scaling factor applied in the "Cartesian" mode. Another minor difference is the interpretation of the contents of the first line in this section. In addition to C, c, K or k as the first character also an empty line is switching on the "Cartesian" mode. Everything else enables the "Direct" mode instead. The velocity section written out to the CONTCAR file always starts with an empty line and velocities are given in "Cartesian" mode. The following lines contain the velocity vectors of each ion defined in the "Ion positions" section. Velocities must be provided in units "direct lattice vector/timestep" or /fs for "Direct" or "Cartesian" mode, respectively.
Tip: Entering velocities by hand is rarely done because a simple alternative to set initial velocities is provided via the TEBEG tag.
Mind: Different rules for the input in this section apply for special VASP features:
  • IBRION=0 and SMASS=-2: In this case the velocities are kept constant during the MD allowing to calculate the energy for a set of different linear dependent positions (for instance frozen phonons and dimers with varying bond-length). The actual steps taken are POTIM times read velocities. Hence, to avoid ambiguities, set POTIM to 1. Then, the velocities will are simply interpreted as vectors, along which the ions are moved. Therefore, for the "Direct" and "Cartesian" modes they are given in units of direct coordinates and , respectively (again, no multiplication with the scaling factor).
  • IBRION=44: The vectors in this section are interpreted as directions of the unstable mode in the context of the Improved Dimer Method.
MD extra variable from CONTCAR only1 The predictor-corrector coordinates are only provided to continue a molecular dynamic run from a CONTCAR file of a previous run, they can not be entered by hand.

1 "from CONTCAR only": This section is usually not entered manually by the user. It appears in the CONTCAR file output at the end of VASP runs which involve ionic steps and is intended for restarting a previous calculation.

Precision and symmetry

VASP determines the symmetry of the system from the POSCAR file. It is a common mistake to enter the positions with insufficient precision (too few digits). To make the best use of the symmetry routines in VASP, it is strongly recommended to specify the positions (and lattice parameters) in the POSCAR file with at least 7 significant digits (but preferably more). Internal tests for symmetry operations are done against a user-supplied value for the precision, specified by SYMPREC (defaults to 10-5). Hence, 5 significant digits are absolutely borderline and can cause serious issues in the automatic symmetry determination, for instance, finding some but not all generators for the symmetry group. Also, "noise" in the positions might grow during relaxations, so that sometimes, upon reading the CONTCAR file, some symmetry operations are not found. All these issues are best avoided by making the initial POSCAR file as accurate as possible.

If you have a POSCAR file with the positions written with low precision and would like to reconstruct with higher precision, we recommend using a symmetry package, such as spglib[1], to find the symmetries given a certain precision, symmetrizing the lattice vectors and positions and writing the POSCAR file with a higher number of significant digits. This can be done using pymatgen[2] (which interfaces with spglib[1]) to symmetrize the structure and write it to a POSCAR file, see example on github.

Examples

Cubic BN
3.57
0.00000000 0.50000000 0.50000000
0.50000000 0.00000000 0.50000000
0.50000000 0.50000000 0.00000000
B N
1 1
Selective dynamics
Cartesian
0.00000000 0.00000000 0.00000000 T T F
0.25000000 0.25000000 0.25000000 F F F
Cartesian
0.01000000 0.01000000 0.01000000
0.00000000 0.00000000 0.00000000
optionally predictor-corrector coordinates 
   given on file CONTCAR of MD-run
  ....
  ....
fcc Si
3.9
 0.50000000 0.50000000 0.00000000
 0.00000000 0.50000000 0.50000000
 0.50000000 0.00000000 0.50000000
  1
cartesian
0.00000000 0.00000000 0.00000000
MgO Fm-3m (No. 225)
1.0
 2.606553 0.000000 1.504894
 0.868851 2.457482 1.504894
 0.000000 0.000000 3.009789
 Mg O
 1 1
direct
 0.000000 0.000000 0.000000 Mg
 0.500000 0.500000 0.500000 O

Related tags and articles

SYMPREC, IBRION, CONTCAR, POTCAR

References