Calculation¶
- class py4vasp.Calculation(*args, **kwargs)¶
Manage access to input and output of single VASP calculation.
The
calculation
module always reads the VASP calculation from the current working directory. This class gives you a more fine grained control so that you can use a Python script or Jupyter notebook in a different folder or rename the files that VASP produces.To create a new instance, you should use the classmethod
from_path()
orfrom_file()
and not the constructor. This will ensure that the path to your VASP calculation is properly set and all features work as intended. The two methods allow you to read VASP results from a specific folder other than the working directory or a nondefault file name.With the Calculation instance, you can access the quantities VASP computes via the attributes of the object. The attributes are the same provided by the
calculation
module. You can find links to how to use these quantities below.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
from_file
(file_name)Set up a Calculation from a particular file.
from_path
(path_name)Set up a Calculation for a particular path and so that all files are opened there.
path
()Return the path in which the calculation is run.
The INCAR file of the VASP calculation.
The KPOINTS file of the VASP calculation.
The POSCAR file of the VASP calculation.
The band structure contains the k point resolved eigenvalues.
This class describes the band extrema during the relaxation or MD simulation.
The Born effective charge tensors couple electric field and atomic displacement.
CONTCAR contains structural restart-data after a relaxation or MD simulation.
This class accesses various densities (charge, magnetization, ...) of VASP.
The dielectric function describes the material response to an electric field.
The dielectric tensor is the static limit of the
dielectric function
.The density of states (DOS) describes the number of states per energy.
The elastic modulus is the second derivative of the energy with respect to strain.
The energy data for one or several steps of a relaxation or MD simulation.
BSE fatbands illustrate the excitonic properties of materials.
The forces determine the path of the atoms in a trajectory.
Force constants are the 2nd derivatives of the energy with respect to displacement.
The internal strain is the derivative of energy with respect to displacement and strain.
The k-point mesh used in the VASP calculation.
The local moments describe the charge and magnetization near an atom.
The pair-correlation function measures the distribution of atoms.
The phonon band structure contains the q-resolved phonon eigenvalues.
The phonon density of states (DOS) describes the number of modes per energy.
The piezoelectric tensor is the derivative of the energy with respect to strain and field.
The static polarization describes the electric dipole moment per unit volume.
The local potential describes the interactions between electrons and ions.
The projectors used for atom and orbital resolved quantities.
The stress describes the force acting on the shape of the unit cell.
The structure contains the unit cell and the position of all ions within.
The SYSTEM tag in the INCAR file is a title you choose for a VASP calculation.
The topology of the crystal describes the ions of a crystal and their connectivity.
The velocities describe the ionic motion during an MD simulation.
The workfunction describes the energy required to remove an electron to the vacuum.
- 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:
- 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:
- path()¶
Return the path in which the calculation is run.