VASP HDF5 file reader — OVITO User Manual 3.16.0 documentation

# VASP HDF5 file reader

Added in version 3.16.0.

This file reader imports the HDF5-based output files written by recent versions of the VASP simulation package. The HDF5 format is a more compact and structured alternative to the legacy text-based files (see the VASP POSCAR / XDATCAR / CHGCAR file reader). Both `vaspout.h5` (ionic trajectories) and `vaspwave.h5` (charge densities and wavefunctions) are recognized.

OVITO reads the following data from VASP HDF5 files:

- The atomic structure: ion positions, chemical element types, and the number of ions of each type.

- The simulation cell (lattice vectors).

- The full ion-dynamics trajectory of a molecular-dynamics or relaxation run. Each ionic step is displayed as a separate frame in the animation timeline.

- Per-atom velocities (`Velocity` particle property) and forces (`Force` particle property), when present.

- The per-frame energies (e.g. free energy, total energy), which are exposed as global attributes with a `VASP.` name prefix.

- The electronic charge density field (from `vaspwave.h5`), which is imported as a voxel grid with identifier `charge-density`. The field values are divided by the simulation cell volume, so the `Charge Density` property is in units of electrons/Å³. For spin-polarized calculations (two spin channels), OVITO computes the total charge density (spin-up + spin-down) as `Charge Density` and the magnetization density (spin-up - spin-down) as a second property `Magnetization Density`. When the file is first opened in the OVITO desktop application, a Create isosurface modifier is automatically inserted into the pipeline to visualize the charge density.

## Trajectory files

If the file contains an ion-dynamics trajectory (stored under the `intermediate/ion_dynamics` group), OVITO loads all ionic steps as a sequence of animation frames. The lattice vectors, positions, velocities, forces, and energies are read on a per-frame basis, so variable-cell runs (e.g. `ISIF=3` relaxations or NpT molecular dynamics) are handled correctly.

## Options

Center simulation cell on coordinate origin

  If enabled, the simulation cell and atomic coordinates are translated to center the box at the coordinate origin. Otherwise, one corner of the simulation cell remains fixed at the coordinate origin.

Generate bonds

  Activates the generation of ad-hoc bonds connecting the atoms loaded from the file. Ad-hoc bond generation is based on the van der Waals radii of the chemical elements. Alternatively, you can apply the `CreateBondsModifier` to the system after import, which provides more control over the generation of pair-wise bonds.

## Python parameters

The file reader accepts the following optional keyword parameters in a call to the `import_file()` or `load()` Python functions.

import_file(location, centering=False, generate_bonds=False)
  Parameters:

    - centering (bool) – If `True`, the simulation cell and atomic coordinates are translated to center the box at the coordinate origin. If `False`, one corner of the simulation cell remains fixed at the coordinate origin.

    - generate_bonds (bool) – Activates the generation of ad-hoc bonds connecting the atoms loaded from the file.