vasprun package

vasprun.smear_data(data, sigma)[source]

Apply Gaussian smearing to spectrum y value.

Parameters:

sigma – Std dev for Gaussian smear function

class vasprun.units[source]

Bases: object

a2bohr = 0.529
am2kg = 1.6605402e-27
c = 29979245800.0
ev2cm = 8065.6
ev2hartree = 27.211386245988
ev2j = 1.60217733e-19
pi = 3.1415926
plank = 6.626075e-34
proton_mass = 1836
class vasprun.vasprun(vasp_file='vasprun.xml', verbosity=0)[source]

Bases: object

parse vasprun.xml and return all useful info to self.values

Parameters:
  • vasp_file – the path of vasprun.xml

  • verbosity – output error msgs or not

static assign_type(type, content)[source]
static dict_clean(dict_del)[source]

Delete the keys that is {} and None Loops recursively over nested dictionaries.

eigenvalues_by_band(band=0)[source]
export_incar(filename=None, print_incar=True)[source]

export incar

export_kpoints(filename=None)[source]

export kpoints

export_poscar(filename)[source]

export poscar

Parameters:

filename – string

Returns:

a POSCAR file

get_band_gap()[source]
get_bands()[source]

Function for computing the valence band index from the count of electrons

Parameters:

None

Returns:

an integer number occupy: bool number

Return type:

bands

static get_cbm(kpoints, efermi, eigens, IBAND)[source]
get_dos(rows, style='t')[source]
static get_element(atom_names_dictionary)[source]
static get_formula(atom_names_dictionary)[source]
get_potcar(child)[source]

parse the potcar information

  • {‘labels’: [‘O’, ‘Sr_sv’], ‘pot_type’: ‘paw’, ‘functional’: ‘pbe’}

  • [‘PAW_PBE’, ‘N’, ‘08Apr2002’]

static get_vbm(kpoints, efermi, eigens, IBAND)[source]
static parse_array(array)[source]
parse_bandpath()[source]
parse_born_chg(charge)[source]

obtain the born charge

parse_calculation(calculation)[source]
static parse_composition(atom_info)[source]
parse_dos(dos)[source]
parse_dynmat(dynmat)[source]
parse_eigenvalue(eigenvalue)[source]
parse_finalpos(finalpos)[source]

obtain final configuration

parse_i_tag_collection(itags_collection)[source]
parse_kpoints(kpoints)[source]
static parse_name_array(atominfo)[source]
parse_parameters(child)[source]
parse_projected(proj)[source]
parse_v(v)[source]

obtain final configuration

static parse_varray(varray)[source]
static parse_varray_pymatgen(elem)[source]
parse_vaspxml(xml_object)[source]

parse the following tags

  • incar

  • kpoints

  • atominfo - composition, elements, formula

  • calculation - eigenvalues, energy, dos, fermi energy, stress, force

  • finalpos - lattice, rec_lat, positions

plot_band(ax=None, filename=None, style='normal', ylim=[-20, 3], plim=[0.0, 0.5], labels=None, saveBands=False, dpi=300)[source]

plot the bandstructure

Parameters:
  • filename – string

  • styles – string (normal or projected)

  • ylim – list, the range of energy values on the y-axis, e.g. [-5, 3]

  • plim – float (the ratio of color plot in the projected mode)

Returns:

A figure with band structure

plot_band_dos(filename=None, band_style='normal', dos_style='t+a', smear=None, e_range=[-10, 3], dos_max=None, plim=[0.0, 0.5], band_labels=None, figsize=(6, 4), dpi=300)[source]
Parameters:
  • filename (string) – the path of figure

  • smear (float) – the width of smearing, defult: None

  • styles (string) – (t or s or t+spd or ele)

  • e_range (list) – the range of energy values on the x-axis, e.g. [-5, 3]

Returns:

A figure with band structure

plot_dos(ax=None, filename=None, smear=None, flip=False, style='t', xlim=[-3, 3], dos_range=[0, None], dpi=300)[source]

plot the DOS

Parameters:
  • ax – default None

  • filename – string

  • styles – string (t or s or t+spd)

  • xlim – list, the range of energy values on the x-axis, e.g. [-5, 3]

  • smear – float (the width of smearing, defult: None)

  • flip – whether or not flip the x/y

Returns:

A figure with band structure

show_eigenvalues_by_band(bands=[0])[source]

Subpackages