vasp/outcar format#

Aliases#

outcar, vasp/outcar

Implementation: VASPOutcarFormat

Overview#

VASP OUTCAR labeled trajectory.

VASP (Vienna Ab initio Simulation Package) is a computer program for atomic scale materials modelling.

The reader extracts ionic-step cells, coordinates, energies, forces, and virials. It supports frame subsampling, convergence filtering, and recursive loading of conventionally named OUTCAR files into dpdata.MultiSystems.

Quick examples#

The examples use the preferred alias vasp/outcar; any alias listed above is equivalent.

import dpdata

# Data with energies and forces
labeled_system = dpdata.LabeledSystem("input_file", fmt="vasp/outcar")

# Multiple compositions or calculation directories
systems = dpdata.MultiSystems.from_file("input_directory", fmt="vasp/outcar")

Conversions#

Convert from this format to LabeledSystem#

dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['outcar'] = None, **kwargs) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['vasp/outcar'] = None, **kwargs) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_outcar(file_name, begin=0, step=1, convergence_check=True, **kwargs) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_vasp_outcar(file_name, begin=0, step=1, convergence_check=True, **kwargs) dpdata.system.LabeledSystem

Load labeled ionic steps from a VASP OUTCAR.

Parameters:
file_namestr or os.PathLike

VASP OUTCAR file.

beginint, default=0

Index of the first ionic step to load.

stepint, default=1

Load every step-th ionic step.

convergence_checkbool, default=True

Exclude unconverged electronic or ionic steps when enabled.

**kwargsdict

Additional options. ml=True reads labels from VASP’s machine- learning force-field output blocks.

Returns:
LabeledSystem

converted system

Convert from this format to MultiSystems#

dpdata.MultiSystems.from_outcar(directory, **kwargs) dpdata.system.MultiSystems
dpdata.MultiSystems.from_vasp_outcar(directory, **kwargs) dpdata.system.MultiSystems

Find conventionally named OUTCAR files below directory.

VASP calculations are commonly stored one calculation per directory, so the objects consumed by from_labeled_system() are the OUTCAR files themselves rather than the calculation directories. Searching recursively also supports grouping calculations below intermediate directories such as workflow stages or temperatures.

Parameters:
directorystr or os.PathLike

Root directory containing VASP calculation directories.

**kwargsdict

Additional format options. They are consumed later when each discovered OUTCAR is loaded.

Returns:
MultiSystems

converted system