CHGCAR: Difference between revisions
(→Format) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
* Structure in {{FILE|POSCAR}} format | * Structure in {{FILE|POSCAR}} format | ||
* FFT-grid dimensions {{TAG|NGXF}}, {{TAG|NGYF}}, {{TAG|NGZF}} | * FFT-grid dimensions {{TAG|NGXF}}, {{TAG|NGYF}}, {{TAG|NGZF}} | ||
* Charge | * Charge times FFT-grid volume is written with multiple real numbers per line until all {{TAG|NGXF}}*{{TAG|NGYF}}*{{TAG|NGZF}} values of the block are written. | ||
* Augmentation occupancies | * Augmentation occupancies | ||
Line 71: | Line 71: | ||
---- | ---- | ||
[[Category:Files]][[Category:Input files]][[Category:Output files]] | [[Category:Files]][[Category:Input files]][[Category:Output files]][[Category:Electronic ground-state properties]][[Category:Charge density]] |
Latest revision as of 12:00, 11 June 2024
The CHGCAR file stores the charge density and the PAW one-center occupancies. It is written by default, but it can be avoided (LCHARG) or redirected to vaspwave.h5 (LH5). The CHGCAR file can be read to restart a calculation (ICHARG).
Tip: We recommend starting from the CHGCAR file when repeatedly restarting with small changes in the input parameters, e.g., the k-point mesh (KPOINTS). |
The CHG file also stores the charge density without the PAW one-center occupancies and is intended for visualization and post-processing.
Format
The CHGCAR consists of the following blocks:
- Structure in POSCAR format
- FFT-grid dimensions NGXF, NGYF, NGZF
- Charge times FFT-grid volume is written with multiple real numbers per line until all NGXF*NGYF*NGZF values of the block are written.
- Augmentation occupancies
The real-space mesh (NX,NY,NZ) is uniform and is spanned by the lattice vectors defined in the structure block. The coordinates of the mesh points can be restored via
- .
The dimensions can be increased by increasing the cutoff energy (ENCUT) or explicitly by setting the fine FFT-grid dimensions (NGXF, NGYF, NGZF).
To arrange the data on the real-space grid in the unit cell, mind that the data runs fastest over NX and slowest over NZ. To be more explicit, the density is written using the following command in Fortran
Important: Remember that the values must be divided by the FFT-grid volume and the cell volume to obtain the charge density in units 1/Å. |
Hence,
- ,
where is the charge density in units 1/Å. Sanity check: The integral of over the unit cell yields the number of valence electrons (NELECT),
- .
By our convention, the charge density is in units 1/Å and **not** e/Å because the potential (e.g. LOCPOT, WRT_POTENTIAL) is assumed to be in eV. However, e, so while this convention makes the sign of less ambiguous, it has no effect on the numerical values.
Warning: The augmentation occupancies are written up to the l-quantum number set by the LMAXMIX. |
Restarting calculations without one-center PAW occupancy matrices up to the appropriate l-quantum number leads to loss of information. This is particularly problematic for calculations with fixed charge density, e.g., band-structure calculations. See LMAXMIX for more details.
Magnetic calculations
For magnetic calculations, the CHGCAR file contains additional data blocks for the magnetization. In particular, for spin-polarized calculations (ISPIN=2), the first set contains the total charge density (spin up + spin down) and the second one is the magnetization density (spin up - spin down):
- Structure
- FFT-grid dimensions
- Charge density times FFT-grid volume (spin up + spin down)
- Augmentation occupancies
- FFT-grid dimensions
- Magnetization density (spin up - spin down)
- Augmentation occupancies
For noncollinear calculation (LNONCOLLINEAR=T), contains the total charge density and the magnetization density in the spinor basis set by SAXIS:
- Structure
- FFT-grid dimensions
- Charge density times FFT-grid volume
- Augmentation occupancies
- Augmentation occupancies (imaginary part)
- FFT-grid dimensions
- Magnetization density times FFT-grid volume **in direction**
- Augmentation occupancies
- Augmentation occupancies (imaginary part)
- FFT-grid dimensions
- Magnetization density times FFT-grid volume in direction
- ...
- FFT-grid dimensions
- Magnetization density times FFT-grid volume in direction
- ....
Molecular dynamics and structure relaxation (IBRION)
In the case of molecular-dynamics (MD) simulations (IBRION=0), CHGCAR contains the extrapolated charge density for the next step, which corresponds to the atomic structure in the CONTCAR file. Although it makes the charge density incompatible with the last atomic coordinates in the OUTCAR file, it allows one to use the CHGCAR and the CONTCAR files consistently for continuing the MD simulation.
Warning: In MD simulations, the charge density in CHGCAR is not the self-consistent charge density for the structure in the CONTCAR file. Hence, one should not perform a band-structure calculation directly after the MD simulation. |
For static and relaxation calculations (IBRION=-1,1,2), the charge density in CHGCAR is the self-consistent charge density for the last iteration. Hence, it can be used for accurate band structure calculations.
Related tags and articles
WAVECAR, CHG, LCHARG, ICHARG, LMAXMIX, FFT-grid dimensions: ENCUT,NGXF,NGYF,NGZF