Jump to content

Requests for technical support from the VASP team should be posted in the VASP Forum.

Restart and output files cheat sheet: Difference between revisions

From VASP Wiki
Hampel (talk | contribs)
Hampel (talk | contribs)
Revise per feedback: restart-file intro + definition, add LTAU/LVTOT (TAUCAR/POT), reframe LCHARGH5, drop CHG from table (note it tracks CHGCAR), link KnownIssue73 (ICHARG=11), group NB boxes
Line 1: Line 1:
The restart and output files {{FILE|WAVECAR}}, {{FILE|CHGCAR}}, {{FILE|CHG}}, and {{FILE|vaspwave.h5}} store the wavefunctions and the charge density that VASP writes at the end of a run. Four tags control which files are written and in which format: {{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LH5}}, and {{TAG|LCHARGH5}}.
VASP can continue a calculation from the converged results of a previous run instead of restarting the electronic minimization from scratch. The wavefunctions are reused through {{TAG|ISTART}} and the charge density through {{TAG|ICHARG}}; some methods additionally need the kinetic energy density or the local potential. The files that store these quantities are the ''restart files''.
 
The restart files are {{FILE|WAVECAR}} (wavefunctions), {{FILE|CHGCAR}} (charge density together with the PAW one-center occupancies), {{FILE|TAUCAR}} (kinetic energy density, for meta-GGA functionals), and {{FILE|POT}} (local potential, for OEP and hybrid-functional OEP calculations). Alternatively, these quantities are written to the single HDF5 file {{FILE|vaspwave.h5}}. The restart files differ from analysis and visualization output such as {{FILE|CHG}}, {{FILE|LOCPOT}}, {{FILE|DOSCAR}}, or {{FILE|vasprun.xml}}: the latter store derived or reduced quantities (for example, {{FILE|CHG}} omits the PAW one-center occupancies) and are not read back to continue a calculation.
 
Which restart files are written, and whether in the legacy format or in {{FILE|vaspwave.h5}}, is controlled by {{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LTAU}}, {{TAG|LVTOT}}, {{TAG|LH5}}, and {{TAG|LCHARGH5}}.


== How the tags interact ==
== How the tags interact ==


{{TAG|LWAVE}} and {{TAG|LCHARG}} decide '''whether''' the wavefunctions and the charge density are written. {{TAG|LH5}} decides '''where''' they go: the legacy files ({{FILE|WAVECAR}}, {{FILE|CHGCAR}}, {{FILE|CHG}}) for {{TAG|LH5|.FALSE.}}, or {{FILE|vaspwave.h5}} for {{TAG|LH5|.TRUE.}}. Setting {{TAG|LH5|.TRUE.}} therefore suppresses the legacy files entirely. {{TAG|LCHARGH5}} is the exception: it writes the charge density to {{FILE|vaspwave.h5}} independently of {{TAG|LH5}}, so that the density is available for plotting with {{py4vasp}} while restart information is still written to the legacy files.
{{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LTAU}}, and {{TAG|LVTOT}} decide '''whether''' the wavefunctions, the charge density, the kinetic energy density, and the local potential are written. {{TAG|LH5}} decides the '''format''': the legacy files for {{TAG|LH5|.FALSE.}}, or {{FILE|vaspwave.h5}} for {{TAG|LH5|.TRUE.}}, which suppresses the legacy files entirely. {{TAG|LCHARGH5}} is the exception: rather than switching the format, it writes the charge density to {{FILE|vaspwave.h5}} ''in addition'', so that the density is available for plotting with {{py4vasp}} while the restart information is still written to the legacy files.


A file is written according to the following rules:
The files are written according to the following rules:
* {{FILE|WAVECAR}} — {{TAG|LWAVE|.TRUE.}} and {{TAG|LH5|.FALSE.}}
* {{FILE|WAVECAR}} &mdash; {{TAG|LWAVE|.TRUE.}} and {{TAG|LH5|.FALSE.}}; the {{FILE|vaspwave.h5}} group <code>/wave</code> &mdash; {{TAG|LWAVE|.TRUE.}} and {{TAG|LH5|.TRUE.}}
* {{FILE|vaspwave.h5}} group <code>/wave</code> &mdash; {{TAG|LWAVE|.TRUE.}} and {{TAG|LH5|.TRUE.}}
* {{FILE|CHGCAR}} &mdash; {{TAG|LCHARG|.TRUE.}} and {{TAG|LH5|.FALSE.}}; the {{FILE|vaspwave.h5}} group <code>/charge</code> &mdash; {{TAG|LCHARGH5|.TRUE.}}
* {{FILE|CHGCAR}} and {{FILE|CHG}} &mdash; {{TAG|LCHARG|.TRUE.}} and {{TAG|LH5|.FALSE.}}<ref>For a meta-GGA functional (a {{TAG|METAGGA}} that requires the kinetic energy density), {{TAG|LTAU}} defaults to {{TAG|LTAU|.TRUE.}}. The kinetic energy density is then written analogously to the charge density: to {{FILE|TAUCAR}} (or, under the same {{TAG|LH5}}/{{TAG|LCHARGH5}} rules, to the {{FILE|vaspwave.h5}} group <code>/kinetic_energy_density</code>).</ref>
* {{FILE|TAUCAR}} &mdash; like {{FILE|CHGCAR}}, but additionally requires {{TAG|LTAU|.TRUE.}}; the {{FILE|vaspwave.h5}} group <code>/kinetic_energy_density</code> follows the <code>/charge</code> rule. {{TAG|LTAU}} defaults to {{TAG|LTAU|.TRUE.}} for meta-GGA functionals.
* {{FILE|vaspwave.h5}} group <code>/charge</code> &mdash; {{TAG|LCHARGH5|.TRUE.}}
* {{FILE|POT}} &mdash; {{TAG|LVTOT|.TRUE.}} and {{TAG|LH5|.FALSE.}}; the {{FILE|vaspwave.h5}} group <code>/potential</code> requires {{TAG|LVTOT|.TRUE.}} and {{TAG|LH5|.TRUE.}}. Only OEP and hybrid-functional OEP calculations write {{FILE|POT}}.
{{NB|mind|{{FILE|CHG}} is written together with {{FILE|CHGCAR}} under the same condition, but it omits the PAW one-center occupancies. Like {{FILE|LOCPOT}}, it is an analysis file and not a restart file.}}


=== Defaults ===
=== Defaults ===


The defaults of {{TAG|LWAVE}}, {{TAG|LCHARG}}, and {{TAG|LH5}} are fixed and do not depend on the other tags:
The defaults of {{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LH5}}, and {{TAG|LVTOT}} are fixed and do not depend on the other tags:
* {{TAG|LWAVE|.TRUE.}}
* {{TAG|LWAVE|.TRUE.}}
* {{TAG|LCHARG|.TRUE.}}
* {{TAG|LCHARG|.TRUE.}}
* {{TAG|LH5|.FALSE.}}
* {{TAG|LH5|.FALSE.}}
* {{TAG|LVTOT|.FALSE.}}


{{TAG|LCHARGH5}} is the only tag whose default is not fixed: when it is not set, its value is {{TAG|LH5}} <code>.AND.</code> {{TAG|LCHARG}}. As a result, switching to HDF5 output with {{TAG|LH5|.TRUE.}} writes the charge density to {{FILE|vaspwave.h5}} automatically (as long as {{TAG|LCHARG|.TRUE.}}), while an explicit {{TAG|LCHARGH5|.FALSE.}} suppresses it.
{{TAG|LTAU}} defaults to {{TAG|LTAU|.TRUE.}} for meta-GGA functionals that need the kinetic energy density, and to {{TAG|LTAU|.FALSE.}} otherwise. {{TAG|LCHARGH5}} also has no fixed default: when it is not set, its value is {{TAG|LH5}} <code>.AND.</code> {{TAG|LCHARG}}. As a result, switching to HDF5 output with {{TAG|LH5|.TRUE.}} writes the charge density to {{FILE|vaspwave.h5}} automatically (as long as {{TAG|LCHARG|.TRUE.}}), while an explicit {{TAG|LCHARGH5|.FALSE.}} suppresses it.
{{NB|tip|To plot the charge density with {{py4vasp}} while still writing restart information to the legacy {{FILE|WAVECAR}}, set {{TAG|LCHARGH5|.TRUE.}} together with {{TAG|LH5|.FALSE.}}.}}
{{NB|tip|To plot the charge density with {{py4vasp}} while still writing restart information to the legacy {{FILE|WAVECAR}}, set {{TAG|LCHARGH5|.TRUE.}} together with {{TAG|LH5|.FALSE.}}.}}


== Overview table ==
== Overview table ==


The table lists every combination of effective (i.e., after applying the defaults) tag values and the files that are written. ✓ marks a written file, &mdash; a file that is not written. The highlighted row is the default configuration.
The table covers the wavefunctions and the charge density for every combination of effective (i.e., after applying the defaults) tag values. ✓ marks a written file, &mdash; a file that is not written. The highlighted row is the default configuration. The kinetic energy density ({{FILE|TAUCAR}}) and the OEP local potential ({{FILE|POT}}) follow the same pattern as the charge density, additionally gated by {{TAG|LTAU}} and {{TAG|LVTOT}}.


{| class="wikitable" style="text-align:center;"
{| class="wikitable" style="text-align:center;"
|+ Output files written for each effective tag combination
|+ Restart files written for each effective tag combination (wavefunctions and charge density)
! {{TAG|LWAVE}} !! {{TAG|LCHARG}} !! {{TAG|LH5}} !! {{TAG|LCHARGH5}} !! {{FILE|WAVECAR}} !! {{FILE|CHGCAR}} !! {{FILE|CHG}} !! {{FILE|vaspwave.h5}} /wave !! {{FILE|vaspwave.h5}} /charge
! {{TAG|LWAVE}} !! {{TAG|LCHARG}} !! {{TAG|LH5}} !! {{TAG|LCHARGH5}} !! {{FILE|WAVECAR}} !! {{FILE|CHGCAR}} !! {{FILE|vaspwave.h5}} /wave !! {{FILE|vaspwave.h5}} /charge
|- style="background:#eaffea;"
|- style="background:#eaffea;"
| .TRUE. || .TRUE. || .FALSE. || .FALSE. || ✓ || ✓ || ✓ || — || —
| .TRUE. || .TRUE. || .FALSE. || .FALSE. || ✓ || ✓ || — || —
|-
|-
| .TRUE. || .TRUE. || .FALSE. || .TRUE. || ✓ || ✓ || ✓ || — || ✓
| .TRUE. || .TRUE. || .FALSE. || .TRUE. || ✓ || ✓ || — || ✓
|-
|-
| .TRUE. || .FALSE. || .FALSE. || .FALSE. || ✓ || — || — || — || —
| .TRUE. || .FALSE. || .FALSE. || .FALSE. || ✓ || — || — || —
|-
|-
| .TRUE. || .FALSE. || .FALSE. || .TRUE. || ✓ || — || — || — || ✓
| .TRUE. || .FALSE. || .FALSE. || .TRUE. || ✓ || — || — || ✓
|-
|-
| .FALSE. || .TRUE. || .FALSE. || .FALSE. || — || ✓ || ✓ || — || —
| .FALSE. || .TRUE. || .FALSE. || .FALSE. || — || ✓ || — || —
|-
|-
| .FALSE. || .TRUE. || .FALSE. || .TRUE. || — || ✓ || ✓ || — || ✓
| .FALSE. || .TRUE. || .FALSE. || .TRUE. || — || ✓ || — || ✓
|-
|-
| .FALSE. || .FALSE. || .FALSE. || .FALSE. || — || — || — || — || —
| .FALSE. || .FALSE. || .FALSE. || .FALSE. || — || — || — || —
|-
|-
| .FALSE. || .FALSE. || .FALSE. || .TRUE. || — || — || — || — || ✓
| .FALSE. || .FALSE. || .FALSE. || .TRUE. || — || — || — || ✓
|-
|-
| .TRUE. || .TRUE. || .TRUE. || .FALSE. || — || — || — || ✓ || —
| .TRUE. || .TRUE. || .TRUE. || .FALSE. || — || — || ✓ || —
|-
|-
| .TRUE. || .TRUE. || .TRUE. || .TRUE. || — || — || — || ✓ || ✓
| .TRUE. || .TRUE. || .TRUE. || .TRUE. || — || — || ✓ || ✓
|-
|-
| .TRUE. || .FALSE. || .TRUE. || .FALSE. || — || — || — || ✓ || —
| .TRUE. || .FALSE. || .TRUE. || .FALSE. || — || — || ✓ || —
|-
|-
| .TRUE. || .FALSE. || .TRUE. || .TRUE. || — || — || — || ✓ || ✓
| .TRUE. || .FALSE. || .TRUE. || .TRUE. || — || — || ✓ || ✓
|-
|-
| .FALSE. || .TRUE. || .TRUE. || .FALSE. || — || — || — || — || —
| .FALSE. || .TRUE. || .TRUE. || .FALSE. || — || — || — || —
|-
|-
| .FALSE. || .TRUE. || .TRUE. || .TRUE. || — || — || — || — || ✓
| .FALSE. || .TRUE. || .TRUE. || .TRUE. || — || — || — || ✓
|-
|-
| .FALSE. || .FALSE. || .TRUE. || .FALSE. || — || — || — || — || —
| .FALSE. || .FALSE. || .TRUE. || .FALSE. || — || — || — || —
|-
|-
| .FALSE. || .FALSE. || .TRUE. || .TRUE. || — || — || — || — || ✓
| .FALSE. || .FALSE. || .TRUE. || .TRUE. || — || — || — || ✓
|}
|}
{{NB|mind|The tag {{TAG|LWAVEH5}} has no effect in current versions of VASP and is ignored. Use {{TAG|LH5}} to redirect the wavefunctions to {{FILE|vaspwave.h5}}.}}
{{NB|mind|The tag {{TAG|LWAVEH5}} has no effect in current versions of VASP and is ignored. Use {{TAG|LH5}} to redirect the wavefunctions to {{FILE|vaspwave.h5}}.}}
 
{{NB|mind|Reading the charge density back from {{FILE|vaspwave.h5}} is not yet implemented. A fixed-density restart ({{TAG|ICHARG|11}}) cannot use a {{FILE|vaspwave.h5}} that was written with {{TAG|LH5|.TRUE.}}; write the {{FILE|CHGCAR}} for such restarts. See [[Known issues#KnownIssue73]].}}
{{NB|mind|This page describes VASP 6.5 and later. HDF5 output ({{FILE|vaspwave.h5}}) is available as of VASP 6.0, and additional datasets are written as of VASP 6.6.0. In VASP 6.0 to 6.4.2 the default of {{TAG|LCHARG}} was <code>.NOT.</code>{{TAG|LH5}}, and some combinations with {{TAG|LH5|.TRUE.}} still wrote the legacy {{FILE|CHGCAR}}.}}
{{NB|mind|This page describes VASP 6.5 and later. HDF5 output ({{FILE|vaspwave.h5}}) is available as of VASP 6.0, and additional datasets are written as of VASP 6.6.0. In VASP 6.0 to 6.4.2 the default of {{TAG|LCHARG}} was <code>.NOT.</code>{{TAG|LH5}}, and some combinations with {{TAG|LH5|.TRUE.}} still wrote the legacy {{FILE|CHGCAR}}.}}


== Related tags and articles ==
== Related tags and articles ==


Files: {{FILE|WAVECAR}}, {{FILE|CHGCAR}}, {{FILE|CHG}}, {{FILE|vaspwave.h5}}, {{FILE|TAUCAR}}
Files: {{FILE|WAVECAR}}, {{FILE|CHGCAR}}, {{FILE|CHG}}, {{FILE|TAUCAR}}, {{FILE|POT}}, {{FILE|LOCPOT}}, {{FILE|vaspwave.h5}}


Tags: {{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LH5}}, {{TAG|LCHARGH5}}, {{TAG|LTAU}}
Tags: {{TAG|LWAVE}}, {{TAG|LCHARG}}, {{TAG|LCHARGH5}}, {{TAG|LTAU}}, {{TAG|LVTOT}}, {{TAG|LH5}}, {{TAG|ISTART}}, {{TAG|ICHARG}}


== References ==
== References ==

Revision as of 13:08, 16 June 2026

VASP can continue a calculation from the converged results of a previous run instead of restarting the electronic minimization from scratch. The wavefunctions are reused through ISTART and the charge density through ICHARG; some methods additionally need the kinetic energy density or the local potential. The files that store these quantities are the restart files.

The restart files are WAVECAR (wavefunctions), CHGCAR (charge density together with the PAW one-center occupancies), TAUCAR (kinetic energy density, for meta-GGA functionals), and POT (local potential, for OEP and hybrid-functional OEP calculations). Alternatively, these quantities are written to the single HDF5 file vaspwave.h5. The restart files differ from analysis and visualization output such as CHG, LOCPOT, DOSCAR, or vasprun.xml: the latter store derived or reduced quantities (for example, CHG omits the PAW one-center occupancies) and are not read back to continue a calculation.

Which restart files are written, and whether in the legacy format or in vaspwave.h5, is controlled by LWAVE, LCHARG, LTAU, LVTOT, LH5, and LCHARGH5.

How the tags interact

LWAVE, LCHARG, LTAU, and LVTOT decide whether the wavefunctions, the charge density, the kinetic energy density, and the local potential are written. LH5 decides the format: the legacy files for LH5 = .FALSE., or vaspwave.h5 for LH5 = .TRUE., which suppresses the legacy files entirely. LCHARGH5 is the exception: rather than switching the format, it writes the charge density to vaspwave.h5 in addition, so that the density is available for plotting with py4vasp while the restart information is still written to the legacy files.

The files are written according to the following rules:

Defaults

The defaults of LWAVE, LCHARG, LH5, and LVTOT are fixed and do not depend on the other tags:

LTAU defaults to LTAU = .TRUE. for meta-GGA functionals that need the kinetic energy density, and to LTAU = .FALSE. otherwise. LCHARGH5 also has no fixed default: when it is not set, its value is LH5 .AND. LCHARG. As a result, switching to HDF5 output with LH5 = .TRUE. writes the charge density to vaspwave.h5 automatically (as long as LCHARG = .TRUE.), while an explicit LCHARGH5 = .FALSE. suppresses it.

Overview table

The table covers the wavefunctions and the charge density for every combination of effective (i.e., after applying the defaults) tag values. ✓ marks a written file, — a file that is not written. The highlighted row is the default configuration. The kinetic energy density (TAUCAR) and the OEP local potential (POT) follow the same pattern as the charge density, additionally gated by LTAU and LVTOT.

Restart files written for each effective tag combination (wavefunctions and charge density)
LWAVE LCHARG LH5 LCHARGH5 WAVECAR CHGCAR vaspwave.h5 /wave vaspwave.h5 /charge
.TRUE. .TRUE. .FALSE. .FALSE.
.TRUE. .TRUE. .FALSE. .TRUE.
.TRUE. .FALSE. .FALSE. .FALSE.
.TRUE. .FALSE. .FALSE. .TRUE.
.FALSE. .TRUE. .FALSE. .FALSE.
.FALSE. .TRUE. .FALSE. .TRUE.
.FALSE. .FALSE. .FALSE. .FALSE.
.FALSE. .FALSE. .FALSE. .TRUE.
.TRUE. .TRUE. .TRUE. .FALSE.
.TRUE. .TRUE. .TRUE. .TRUE.
.TRUE. .FALSE. .TRUE. .FALSE.
.TRUE. .FALSE. .TRUE. .TRUE.
.FALSE. .TRUE. .TRUE. .FALSE.
.FALSE. .TRUE. .TRUE. .TRUE.
.FALSE. .FALSE. .TRUE. .FALSE.
.FALSE. .FALSE. .TRUE. .TRUE.

Related tags and articles

Files: WAVECAR, CHGCAR, CHG, TAUCAR, POT, LOCPOT, vaspwave.h5

Tags: LWAVE, LCHARG, LCHARGH5, LTAU, LVTOT, LH5, ISTART, ICHARG

References