Requests for technical support from the VASP group should be posted in the VASP-forum.

# CHGCAR

Jump to navigationJump to search

This file contains the lattice vectors, atomic coordinates, the total charge density multiplied by the volume ${\displaystyle \rho (r)*V_{{{\rm {cell}}}}}$ on the fine FFT-grid (NG(X,Y,Z)F), and the PAW one-center occupancies. CHGCAR can be used to restart VASP from an existing charge density. For visualisation the CHG file should be used, since the PAW one-centre occupancies are difficult to parse. It is possible to avoid that the CHGCAR is written by setting LCHARG=.FALSE. in the INCAR file. In VASP, the density is written using the following commands in Fortran:

WRITE(IU,FORM) (((C(NX,NY,NZ),NX=1,NGXF),NY=1,NGYF),NZ=1,NGZF)


The x index is the fastest index, and the z index the slowest index. The file can be read format-free, because at least in new versions, it is guaranteed that spaces separate each number. Please do not forget to divide by the volume before visualizing the file!

Note that the real-space mesh (NX,NY,NZ) is uniform and is spanned by the primitive lattice vectors ${\displaystyle ({\vec {a}},{\vec {b}},{\vec {c}})}$ defined in the POSCAR and can read explicitly ${\displaystyle (N_{x},N_{y},N_{z}){\hat {=}}{\frac {N_{x}-1}{N_{{GXF}}}}{\vec {a}}+{\frac {N_{y}-1}{N_{{GYF}}}}{\vec {b}}+{\frac {N_{z}-1}{N_{{GZF}}}}{\vec {c}}}$.

For spinpolarized calculations, two sets of data can be found in the CHGCAR file. The first set contains the total charge density (spin up plus spin down), the second one the magnetization density (spin up minus spin down). For non collinear calculations the file contains the total charge density and the magnetisation density in the x, y and z direction in this order.

For dynamic simulation (IBRION=0), the charge density on the file is the predicted charge density for the next step: i.e. it is compatible with the CONTCAR file, but incompatible with the last positions in the OUTCAR file. This allows the CHGCAR and the CONTCAR file to be used consistently for a molecular dynamics continuation job. For static calculations and relaxations (IBRION=-1,1,2) the written charge density is the self-consistent charge density for the last step and might be used e.g. for accurate band-structure calculations.

Mind: Since the charge density written to the file CHGCAR is not the self-consistent charge density for the positions on the CONTCAR file, do not perform a bandstructure calculation (ICHARG=11) directly after a dynamic simulation (IBRION=0).