Parsers

These are the implementations of the different vasp file parsers.

CHGCAR

class vasp.parser.chgcar.Chgcar(chgcar_path)[source]

POSCAR

class vasp.parser.poscar.Poscar(poscar_path)[source]

This poscar parser only parses the poscar, it does not apply any transformation or conversion from cartesian into direct or otherwise.

Parameters

poscar_path (str) – Path to a poscar file

basis = None

Basis elements

constant = None

Multiplicative constant

coordinates = None

Coordinates

modeline = None

Wether cartesian or direct

name = None

Name of the system

natoms = None

Number of atoms

symbols = None

Atomic labels

symbols_number = None

Atomic numbers

K-point

class vasp.parser.kpoint.Kpoint(lines, spin=None)[source]

Parse a kpoint text in a list of lines, e.g.: The spin has to be optional since we do not know in advance from the k-point chunk if it’s spin 1 or 2, in vasp parlance.

k-point     1 :       0.5000    0.5000    0.5000
 band No.  band energies     occupation
     1      -4.1306      2.00000
     2      -1.4815      2.00000
     3       4.2930      2.00000
     4       4.2930      2.00000
     5       7.0479      0.00000
     6       8.8314      0.00000
     7       8.8314      0.00000
     8      13.2218      0.00000
Parameters
  • lines (list) – Lines containing an outcar kpoint chunk

  • spin (parameter_type) – Wether it is spin polarized or no, (ISPIN=1,2)

bands = None

A list of bands

index = None

K-point index

spin = None

Original ISPIN

value = None

The value of the k-point

BandStructure

class vasp.parser.band_structure.BandStructure(outcar=None)[source]

This parser accepts an outcar file and parses the k-points inside, right now it will parse all the k-points, also if there are several ionic relaxation iterations.

Parameters

outcar (str) – Filepath of an outcar file

kpoints = None

A list of k-points, see vasp.parser.kpoint.Kpoint