Calculation

class py4vasp.Calculation(*args, **kwargs)

Manage access to input and output of VASP calculations.

This is the main user interface if you want to simply investigate the results of VASP calculations. Create a Calculation object associated with the VASP calculation that you run. Then you can access the properties of that calculation via the attributes of the object.

Examples

>>> calc = Calculation.from_path("path_to_your_calculation")
>>> calc.dos.plot()         # to plot the density of states
>>> calc.magnetism.read()   # to read the magnetic moments
>>> calc.structure.print()  # to print the structure in a POSCAR format

Notes

To create new instances, you should use the classmethod from_path() or from_file(). This will ensure that the path to your VASP calculation is properly set and all features work as intended.

band

The electronic band structure. (py4vasp.data.Band)

born_effective_charge

The Born effective charge tensors coupling electric field and atomic displacement. (py4vasp.data.BornEffectiveCharge)

density

The charge and magnetization density. (py4vasp.data.Density)

dielectric_function

The dielectric function resulting from electrons and ions. (py4vasp.data.DielectricFunction)

dielectric_tensor

The static dielectric tensor obtained from linear response. (py4vasp.data.DielectricTensor)

dispersion

Generic class for all dispersions (electrons, phonons). (py4vasp.data.Dispersion)

dos

The electronic density of states (DOS). (py4vasp.data.Dos)

elastic_modulus

The elastic modulus (second derivatives w.r.t. strain) (py4vasp.data.ElasticModulus)

energy

The energy data for one or several steps of a relaxation or MD simulation. (py4vasp.data.Energy)

fatband

Access data for producing BSE fatband plots. (py4vasp.data.Fatband)

force

The forces acting on the atoms for selected steps of the simulation. (py4vasp.data.Force)

force_constant

The force constants (second derivatives of atomic displacement). (py4vasp.data.ForceConstant)

internal_strain

The internal strain (py4vasp.data.InternalStrain)

kpoint

The k points used in the Vasp calculation. (py4vasp.data.Kpoint)

magnetism

The magnetic moments and localized charges for selected ionic steps. (py4vasp.data.Magnetism)

pair_correlation

The pair-correlation function for one or several blocks of an MD simulation. (py4vasp.data.PairCorrelation)

phonon_band

The phonon band structure. (py4vasp.data.PhononBand)

phonon_dos

The phonon density of states (DOS). (py4vasp.data.PhononDos)

piezoelectric_tensor

The piezoelectric tensor (second derivatives w.r.t. strain and field) (py4vasp.data.PiezoelectricTensor)

polarization

The static polarization of the structure obtained from linear response. (py4vasp.data.Polarization)

projector

The projectors used for atom and orbital resolved quantities. (py4vasp.data.Projector)

stress

The stress acting on the unit cell for selected steps of the simulation. (py4vasp.data.Stress)

structure

The structure of the crystal for selected steps of the simulation. (py4vasp.data.Structure)

system

Extract the system tag from the INCAR file. (py4vasp.data.System)

topology

This class accesses the topology of the crystal. (py4vasp.data.Topology)

velocity

The ion velocities for all steps of the calculation. (py4vasp.data.Velocity)

property INCAR

The INCAR file of the VASP calculation.

property KPOINTS

The KPOINTS file of the VASP calculation.

property POSCAR

The POSCAR file of the VASP calculation.

classmethod from_file(file_name)

Set up a Calculation from a particular file.

Typically this limits the amount of information, you have access to, so prefer creating the instance with the from_path() if possible.

Parameters:

file_name (str of pathlib.Path) – Name of the file from which the data is read.

Returns:

A calculation accessing the data in the given file.

Return type:

Calculation

classmethod from_path(path_name)

Set up a Calculation for a particular path and so that all files are opened there.

Parameters:

path_name (str or pathlib.Path) – Name of the path associated with the calculation.

Returns:

A calculation associated with the given path.

Return type:

Calculation

path()

Return the path in which the calculation is run.