Extraction classes

Instances of the extraction classes are returned by calls to the vasp and affiliated methods. They simply grep the OUTCAR for values of interest, e.g. eigenvalues or vasp parameters. Indeed, these should contain an Extract attribute which refers to a class capable of handling the output of the method or vasp object. They can be instanciated as follows:

>>> a = vasp.Extract('outdir')
>>> a = vasp.epitaxial.Extract('outdir')

Where outdir is the location of the relevant calculation. The results from the calculations can then be accessed as attributes:

>>> a.total_energy
array(-666.667) * eV

It is possible to extract calculations from a complete folder tree:

>>> from pylada.vasp import MassExtract
>>> a = MassExtract('outdir')
>>> a.total_energy
{
  '/some/path':       array(-666.667) * eV,
  '/some/otherpath':  array(-999.996) * eV,
}

The extraction classes are separated into I/O (IOMixin) and actual methods to grep the OUTCAR for results (ExtractBase). This setup makes it convenient to change the kind of object that can be grepped, from the standard file on a hard-disk, to a file in a database.

Extract derives from the following classes.

class pylada.vasp.extract.Extract(directory=None, **kwargs)[source]

Bases: pylada.tools.extract.AbstractExtractBase, pylada.vasp.extract.mixin.IOMixin, pylada.vasp.extract.base.ExtractBase

Extracts DFT data from an OUTCAR.

HubbardU_NLEP

Hubbard U/NLEP parameters.

LDAUType

Type of LDA+U performed.

algo

Returns the kind of algorithms.

all_total_energies

Greps total energies for all electronic steps from OUTCAR.

alphabet

Greps alpha+bet from OUTCAR

cbm

Returns Condunction Band Minimum.

copy(**kwargs)

Returns a shallow copy of this object.

Parameters:kwargs – Any keyword argument is set as an attribute of this object. The attribute must exist.
datetime

Greps execution date and time.

density

Computes density of the material.

dielectric_constant

Dielectric constant of the material.

directory

Directory where output should be found.

ediff

Greps EDIFF from OUTCAR.

ediffg

Greps EDIFFG from OUTCAR.

eigenvalues

Greps eigenvalues from OUTCAR.

In spin-polarized cases, the leading dimension of the numpy array are spins, followed by kpoints, and finally with bands. In spin-unpolarized cases, the leading dimension are the kpoints, followed by the bands.

electronic_dielectric_constant

Electronic contribution to the dielectric constant.

electropot

Greps average atomic electrostatic potentials from OUTCAR.

encut

Energy cutoff.

energies_sigma0

Greps total energy extrapolated to $sigma=0$ from OUTCAR.

energy

Greps total energy from OUTCAR.

energy_sigma0

Greps total energy extrapolated to $sigma=0$ from OUTCAR.

errors

List of errors.

Errors that are encountered more than once are not repeated.

extraelectron

Returns charge state of the system.

fermi0K

Fermi energy at zero kelvin.

This procedure recomputes the fermi energy using a step-function. It avoids negative occupation numbers. As such, it may be different from the fermi energy given by vasp, depeneding on the smearing and the smearing function.

fermi_energy

Greps fermi energy from OUTCAR.

fft

Greps recommended or actual fft setting from OUTCAR.

forces

Forces on each atom.

functional

Returns vasp functional used for calculation.

Requires the functional to be pasted at the end of the calculations.

halfmetallic

True if the material is half-metallic.

ialgo

Returns the kind of algorithms.

ibrion

Greps IBRION from OUTCAR.

icharg

Greps ICHARG from OUTCAR.

initial_structure

Structure at start of calculations.

ionic_charges

Greps ionic_charges from OUTCAR.

ionic_dielectric_constant

Ionic contribution to the dielectric constant.

ions_per_specie

Alias for stoichiometry.

is_dft

True if this is a DFT calculation, as opposed to GW.

is_gw

True if this is a GW calculation, as opposed to DFT.

is_running

True if program is running on this functional.

A file ‘.pylada_is_running’ is created in the output folder when it is set-up to run CRYSTAL. The same file is removed when CRYSTAL returns (more specifically, when the pylada.process.ProgramProcess is polled). Hence, this file serves as a marker of those jobs which are currently running.

isif

Greps ISIF from OUTCAR.

ismear

Greps smearing function from OUTCAR.

ispin

Greps ISPIN from OUTCAR.

istart

Greps ISTART from OUTCAR.

isym

Greps ISYM from OUTCAR.

iterfiles(**kwargs)

iterates over input/output files.

Parameters:
  • stout (bool) – Include standard output files
  • errors (bool) – Include stderr files.
  • input (bool) – Include INCAR file
  • wavefunctions (bool) – Include WAVECAR file
  • dos (bool) – Include DOSCAR file
  • charge (bool) – Include CHGCAR file
  • structure (bool) – Include POSCAR file
  • contcar (bool) – Include CONTCAR file
  • procar (bool) – Include PROCAR file
kpoints

Greps k-points from OUTCAR.

Numpy array where each row is a k-vector in cartesian units.

lasph

Greps LASPH from OUTCAR.

lcharg

Greps LWAVE from OUTCAR.

lcompat

Greps LCOMPAT from OUTCAR.

lcorr

Greps LCORR from OUTCAR.

ldiag

Greps LDIAG from OUTCAR.

ldipol

Greps LDIPOL from OUTCAR.

lelf

Greps LELF from OUTCAR.

lgga_compat

Greps LGGA_COMPAT from OUTCAR.

lmaxmix

Greps LMAXMIX from OUTCAR.

lnoncollinear

Greps LNONCOLLINEAR from OUTCAR.

lorbit

Greps LORBIT from OUTCAR.

lreal

Greps LREAL from OUTCAR.

lreal_compat

Greps LREAL_COMPAT from OUTCAR.

lsecvar

Greps LSECVAR from OUTCAR.

lsorbit

Greps LSORBIT from OUTCAR.

lvtot

Greps LVTOT from OUTCAR.

lwave

Greps LWAVE from OUTCAR.

magnetization

Greps partial charges from OUTCAR.

This is a numpy array where the first dimension is the ion (eg one row per ion), and the second the partial charges for each angular momentum. The total is not included.

metagga

Greps METAGGA from OUTCAR.

moment

Returns magnetic moment from OUTCAR.

multiplicity

Greps multiplicity of each k-point from OUTCAR.

name

Greps POSCAR title from OUTCAR.

nbands

Number of bands in calculation.

nbprocs

Number of bands in calculation.

nelect

Greps nelect from OUTCAR.

nelm

Greps NELM from OUTCAR.

nelmdl

Greps NELMDL from OUTCAR.

nelmin

Greps NELMIN from OUTCAR.

nonscf

True if non-selfconsistent calculation.

nsw

Greps NSW from OUTCAR.

nupdown

Greps NUPDOWN from OUTCAR.

occupations

Greps occupations from OUTCAR.

In spin-polarized cases, the leading dimension of the numpy array are spins, followed by kpoints, and finally with bands. In spin-unpolarized cases, the leading dimension are the kpoints, followed by the bands.

partial_charges

Greps partial charges from OUTCAR.

This is a numpy array where the first dimension is the ion (eg one row per ion), and the second the partial charges for each angular momentum. The total is not included.

potim

Greps POTIM from OUTCAR.

precision

Greps PREC from OUTCAR.

pressure

Greps last pressure from OUTCAR

pressures

Greps all pressures from OUTCAR

pseudopotential

Title of the first POTCAR.

pulay_pressure

Greps pressure from OUTCAR

qp_eigenvalues

Greps quasi-particle eigenvalues from OUTCAR.

In spin-polarized cases, the leading dimension of the numpy array are spins, followed by kpoints, and finally with bands. In spin-unpolarized cases, the leading dimension are the kpoints, followed by the bands.

reciprocal_volume

Reciprocal space volume (including 2pi).

recommended_fft

Greps recommended or actual fft setting from OUTCAR.

relaxation

Returns the kind of relaxation performed in this calculation.

self_energies

Greps self-energies of each eigenvalue from OUTCAR.

In spin-polarized cases, the leading dimension of the numpy array are spins, followed by kpoints, and finally with bands. In spin-unpolarized cases, the leading dimension are the kpoints, followed by the bands.

sigma

Greps smearing function from OUTCAR.

species

Greps species from OUTCAR.

stoichiometry

Stoichiometry of the compound.

stress

Returns final total stress.

stresses

Returns total stress at each relaxation step.

structure

Greps structure and total energy from OUTCAR.

success[source]

True if calculation was successfull.

system

Greps system title from OUTCAR.

total_energies

Greps total energies for all ionic steps from OUTCAR.

total_energy

Greps total energy from OUTCAR.

uncache()

Uncache values.

valence

Greps number of valence bands from OUTCAR.

vbm

Returns Valence Band Maximum.

volume

Unit-cell volume.

warnings

List of warnings.

Warnings that are encountered more than once are not repeated.

xc_g0

Greps XC(G=0) from OUTCAR

class pylada.vasp.extract.MassExtract(path=None, **kwargs)[source]

Bases: pylada.jobfolder.extract.AbstractMassExtract

Extracts all Vasp calculations in directory and sub-directories.

Trolls through all subdirectories for vasp calculations, and organises results as a dictionary where keys are the name of the diretories.

Usage is simply:

>>> from pylada.vasp import MassExtract
>>> a = MassExtract('path') # or nothing if path is current directory.
>>> a.success
{
  '/some/path/':      True,
  '/some/other/path': True
}
>>> a.eigenvalues

Previous topic

Relaxation methods

Next topic

pylada.vasp.extract.base

This Page