POSCAR
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-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:
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 Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): s . The next three lines define the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle {\vec a}_1, {\vec a}_2} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle {\vec a}_3} 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 elements and numbers:
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 POTCAR file.
Ion positions:
Finally, the ion positions are listed in this section. The first line selects one of the two possible modes how the coordinates Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle x_1, x_2} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle x_3} given in the following lines are interpreted:
- "Direct" means the positions are provided in direct (fractional) coordinates:
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle {\vec R} = x_1 {\vec a}_1 + x_2 {\vec a}_2 + x_3 {\vec a}_3,}
where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {{\vec R}} 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.
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {\displaystyle {\vec R} = s \left( \begin{array}{c}x_1 \\ x_2 \\ x_3\end{array} \right).}
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.
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 |
Mandatory |
Content |
---|---|---|---|
Comment | 1 |
yes | |
Scaling factor(s) | 1 |
yes | |
Lattice | 3 | yes | |
Selective dynamics | 1 | no | |
Atom positions |
#atoms + 1 | yes | |
Lattice velocities |
? | no | |
Empty spheres |
? | no | |
Velocities | variable | no | |
MD extra | variable | no |
- Line 1 The first line is treated as a comment line (you should write down the name of the system).
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 Selective dynamics Cartesian 0.00 0.00 0.00 T T F 0.25 0.25 0.25 F F F Cartesian 0.01 0.01 0.01 0.00 0.00 0.00 optionally predictor-corrector coordinates 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 POTCAR file).
- 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 POTCAR and the INCAR file.
- 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.
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.
- 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
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {{\vec R}}=x_{1}{{\vec a}}_{1}+x_{2}{{\vec a}}_{2}+x_{3}{{\vec a}}_{3}
where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {{\vec a}}_{{1...3}}
are the three basis vectors, and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): x_{{1...3}}
are the supplied values. In the cartesian mode the positions are only scaled by the factor Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): s
on the second line of the POSCAR file
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {{\vec R}}=s\left({\begin{array}{c}x_{1}\\x_{2}\\x_{3}\end{array}}\right).
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 OUTCAR file, which contains both the final components of the vector Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): {{\vec R}} 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 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 TEBEG.
- Section: atom velocities Entering velocities by hand is rarely done (one important case is e.g. using the tags IBRION=0 and SMASS=-2), but if done the velocities are provided at the end of the 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 Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): \AA /fs (no multiplication with the scaling factor in this case) or (direct lattice vector/timestep).
When the initial velocities are supplied in the POSCAR and the tags IBRION=0 and 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 IBRION=0 and SMASS=-2 the actual steps taken are POTIM times read velocities. To avoid ambiguities, set 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 (Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://www.vasp.at/wiki/restbase/vasp.at/v1/":): \AA , 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 CONTCAR file of a previous run, they can not be entered by hand.