Python scripts for VASP data import

The python scripts import VASP data for visualization in array forms. The codes include simple examples of making figures from the imported data.  

  • ReadDOSCAR: Read total and projected density of states data from DOSCAR

VMD plugins for VASP

In VMD, select a proper file type in the list (Determine file type:) and your data file when Molecule File Browser is open. You can find a well-instructed VMD manual and tutorials on the official VMD homepage or User Guide in VMD.

Atomic configurations

VASP plugins read atomic geometries from POSCAR and CONTCAR files. In addition, they can read the configuration from charge density files (e.g., CHGCAR). VASP plugins read the atom species from the POTCAR file if the file exists. If not, through the title line of POSCAR, CONTCAR, and charge density files, one can provide the atom species in version 4 or read the atom type line in version 5. VASP plugins use this information to assign atom type and name. If you fail to feed this information, all atoms will be assigned to the unknown atom "X".

Select VASP file: File>New Molecule

  1. Select corresponding file type (VASP_POSCAR)
  2. Browse and select POSCAR or CONTCAR file
  3. Press "Load" button
  4. One can load POSCAR from command line: vmd -POSCAR POSCAR/CONTCAR

Trajectories of AIMD simulation

The trajectories of MD simulations can be imported from xml, XDATCAR, and OUTCAR files. In the case of XDATCAR, the POSCAR file must be in the same directory in version 4. POSCAR provides the lattice constant and unit cell. From version 5.2, since XDATCAR file contains the unit cell information, a single XDATCAR file is enough. If you have more than one set of POSCAR/XDATCAR in a directory, then make a pairing in the form of 1.POSCAR/1.XDATCAR in version 4. 

Select VASP file: File>New Molecule

  1. Select corresponding file type (VASP_XDATCAR/VASP_XDATCAR5/VASP_xml/VASP_OUTCAR)
  2. Browse and select VASP file
  3. Press "Load" button
  4. One can load XDATCAR from command line: vmd -VASP_XDATCAR XDATCAR or vmd -VASP_XDATCAR5 XDATCAR
  5. One can load xml from command line: vmd -xml vasprun.xml
  6. One can load OUTCAR from command line: vmd -OUTCAR OUTCAR

Charge densities and partial charge densities

VMD imports charge density in the form of volumetric grid data. The grid data is displayed within unit cell volume. The charge density in CHGCAR and PARCHG is divided by unit cell volume. In contrast, data in ELFCAR and LOCPOT keep unscaled values. VASP plugins recognize ELFCAR and LOCPOT from the file name. If you change these file names accidentally, data will be divided by unit cell volume. 

Select VASP file: File>New Molecule

  1. Select corresponding file type (VASP_CHGCAR/VASP_PARCHG)
  2. Browse and select VASP file
  3. Select volume metric data set spin up+down or spin up-down
  4. Press "Load" button

Periodic presentation of charge densities

To plot the periodic charge density, import the volume data set first, read POSCAR into the molecule of 0: CHGCAR, not into New Molecule. Then, one has one Frame and one Volume data sets in the layer. Select your isosurface in the Graphical Representations and repeat it. Maybe you can notice the thin lines at the cell boundaries. It happens because the light source is located in the cell, and it makes shadows. At the cell boundary, you will have the shadows in different directions, and it leads to the thin line. Unfortunately, there is no way to avoid the lines, but it will not be significant in most cases hopefully.