jarvis.io.vasp package

Submodules

jarvis.io.vasp.inputs module

Modules handling input files for VASP calculations.

class jarvis.io.vasp.inputs.Incar(tags={})[source]

Bases: object

Make VASP INCAR files as python dictionary of keys and values.

classmethod from_dict(data={})[source]

Construct from dictionary.

static from_file(filename='INCAR')[source]

Read INCAR file.

static from_string(lines)[source]

Construct from string.

to_dict()[source]

Convert into dictionary.

update(d={})[source]

Provide the new tags as a dictionary to update Incar object.

write_file(filename)[source]

Write Incar to a file.

class jarvis.io.vasp.inputs.IndividualPotcarData(data={})[source]

Bases: object

Class for individual POTCAR file handling.

from_file()[source]

Read from file.

from_string()[source]

Generate some of the contents in the POTCAR.

class jarvis.io.vasp.inputs.Kpoints(filename='')[source]

Bases: object

Make VASP KPOINTS as object.

get_ibz_kp()[source]

Read the Kpoints in the line-mode.

get_mesh_kp()[source]

Read Kpoints as grid.

classmethod read(lines)[source]

Read from an open file.

class jarvis.io.vasp.inputs.Poscar(atoms, comment='System')[source]

Bases: object

Class defining Poscar object.

Constructued from the Atoms object.

Args:

atoms : Atoms object

comment : Header of Poscar file

classmethod from_dict(d={})[source]

Construct Poscar object from a dictionary.

static from_file(filename='POSCAR')[source]

Read simple POSCAR file from the path.

static from_string(lines)[source]

Read Poscar from strings, useful in reading files/streams.

to_dict()[source]

Convert Poscar object to a dictionary.

write_file(filename)[source]

Write the Poscar object to a file.

class jarvis.io.vasp.inputs.Potcar(elements=[], pot_type='POT_GGA_PAW_PBE', pot_json_path='', potcar_strings=[])[source]

Bases: object

Construct muti-atoms Postcar.

catenate_potcar_files(destination_filename='POTCAR', filenames=[])[source]

Catenate potcars of sifferent elements.

classmethod from_dict(d={})[source]

Build class from a dictionary.

list_potcar_files()[source]

List POTCAR files.

to_dict()[source]

Convert to a dictionary.

write_file(filename='POTCAR')[source]

Write POTCAR file.

jarvis.io.vasp.inputs.add_ldau_incar(use_incar_dict={}, atoms=None, Uval=2, lsorbit=False, default_magmom=True)[source]

Add LDAU in incase, especially made for spillage calcs.

jarvis.io.vasp.inputs.find_ldau_magmom(atoms='', default_magmom=True, U=3.0, mag=5.0, amix=0.2, bmix=1e-05, amixmag=0.8, bmixmag=1e-05, lsorbit=False)[source]

Get necessary INCAR tags for DFT+U calculations.

jarvis.io.vasp.outputs module

Modulet for analzing VASP outputs.

class jarvis.io.vasp.outputs.Chgcar(filename='', atoms=None, chg=[], chgdif=None, aug=None, augdiff=None, dim=None, nsets=1)[source]

Bases: object

Class handling VASP CHGCAR file data.

chg_set(text, start, end, volume, ng)[source]

Return CHGCAR sets.

classmethod from_dict(d={})[source]

Construct class from a dictionary.

is_spin_orbit()[source]

Check if the calculations is spin-orbit, LSORBIT=T.

is_spin_polarized()[source]

Check if the calculations is spin-polarized, ISPIN=2.

read_file()[source]

Read CHGCAR.

to_dict()[source]

Convert to a dictionary.

class jarvis.io.vasp.outputs.Locpot(filename='', atoms=None, chg=[], chgdif=None, aug=None, augdiff=None, dim=None, nsets=1)[source]

Bases: jarvis.io.vasp.outputs.Chgcar

Read LOCPOT files.

vac_potential(direction='X', Ef=0, filename='Avg.png', plot=True)[source]

Calculate vacuum potential used in work-function calculation.

class jarvis.io.vasp.outputs.Oszicar(filename, data={})[source]

Bases: object

Construct Oszicar object.

electronic_steps

Get all electronic steps realted data.

classmethod from_dict(d={})[source]

Construct class from a dictionary.

ionic_steps

Get all ionic steps realted data.

magnetic_moment

Get magnetic moment.

to_dict()[source]

Convert class to a dictionary.

class jarvis.io.vasp.outputs.Outcar(filename, data={})[source]

Bases: object

Construct OUTCAR object.

converged

Check if calculation is converged.

efg_raw_tensor

Get raw electric field gradient tensor.

efg_tensor_diag(std_conv=True, prec=3)[source]

Get diagonalized electric field gradient tensor.

elastic_props(atoms=None, vacuum=False)[source]

Obtain elastic tensor and calculate related properties.

For 3D and 2D cases.

Args:

outcar: OUTCAR file path

vacuum: whether the structure has vaccum such as 2D materials for vacuum structures bulk and shear mod. Needs extra attention and elastic tensor are in Nm^-1 rather than GPa

Returns:
info: data for elastic tensor (in string and object representation), bulk, shear modulus, and phonon modes
classmethod from_dict(d={})[source]

Construct class from a dictionary.

magnetization(dir='x', elements=[])[source]

Get magnetization in x,y,z.

nbands

Get number of bands.

nelect

Get number of electrons.

nions

Get number of ions.

phonon_eigenvalues

Get phonon eigenvalues.

piezoelectric_tensor

Get piezoelectric tensor.

quad_mom

Get quadrupole momemnt.

to_dict()[source]

Convert class to a dictionary.

total_charge(elements=[])[source]

Get total charge.

class jarvis.io.vasp.outputs.Vasprun(filename='vasprun.xml', data={})[source]

Bases: object

Construct vasprun.xml handling object.

all_energies

Get all total energies.

all_forces

Get all forces.

all_input_parameters

Get all explicit input parameters. Need to add a few more.

all_stresses

Get all stresses.

all_structures

Get all structures.

avg_absorption_coefficient

Get average absoprtion coefficient. Used in solar-cell module.

dfpt_data

Get DFPT IBRION=8 LEPSILON lated data.

dielectric_loptics

Get real and imag. dielectric function data.

efermi

Get Fermi-energy.

eigenvalues

Get all eigenvalues.

elements

Get atom elements.

fermi_velocities

Get fermi velocities in m/s.

final_energy

Get final energy.

classmethod from_dict(d={})[source]

Construct class from a dictionary.

get_atom_resolved_dos(plot=False)[source]

Get atom resolved density of states.

get_bandstructure(E_low=-4, E_high=4, spin=0, zero_efermi=True, kpoints_file_path='KPOINTS', plot=False)[source]

Get electronic bandstructure plot.

get_dir_gap

Get direct bandgap.

get_indir_gap

Get indirect bandgap.

get_spdf_dos(plot=False)[source]

Get spdf resolved partial density of states.

is_spin_orbit

Check if the calculation is spin orbit.

is_spin_polarized

Check if the calculation is spin polarized.

kpoints

Get Kpoints.

nbands

Get number of electronic bands.

nkpoints

Get number of kpoints.

nspins

Get total numnber of spins.

num_atoms

Get number of simulation atoms.

num_types

Get number of atom types.

partial_dos_spdf

Get partial density of states.

phonon_data(fc_mass=True)[source]

Get phonon data.

projected_atoms_spins_kpoints_bands

Use for atom,spin,kpoint and band projected bandstructures.

projected_spins_kpoints_bands

Use for spin, kpoint and band projected bandstructure plots.

to_dict()[source]

Convert class to a dictionary.

total_dos

Get total density of states.

vrun_structure_to_atoms(s={})[source]

Convert structure to Atoms object.

xml_to_dict()[source]

Convert XML to dictionary.

class jarvis.io.vasp.outputs.Wavecar(filename='WAVECAR', lsorbit=False, lgamma=False, recl=None, nspin=None, rtag=None, nkpts=None, nbands=None, encut=None, lattice_mat=None, nplws=None, wfc=None, efermi=None, kvecs=None, energies=None, occs=None, gvec=None)[source]

Bases: object

Class for VASP Pseudowavefunction stored in WAVECAR.

The format of VASP WAVECAR, as shown in
http://www.andrew.cmu.edu/user/feenstra/wavetrans/
is:

Record-length #spin components RTAG(a value specifying the precision) #k-points #bands ENCUT(maximum energy for plane waves) LatVec-A LatVec-B LatVec-C Loop over spin

Loop over k-points

#plane waves, k vector Loop over bands

band energy, band occupation

End loop over bands Loop over bands

Loop over plane waves
Plane-wave coefficient

End loop over plane waves

End loop over bands

End loop over k-points

End loop over spin

checkIndex(ispin, ikpt, iband)[source]

Check if the index is valid.

gvectors(ikpt=1)[source]

Generate the G-vectors.

satisfies the following relation
(G + k)**2 / 2 < ENCUT
isSocWfc()[source]

Check if the WAVECAR is from an SOC calculation.

readBandCoeff(ispin=1, ikpt=1, iband=1, norm=False)[source]

Read the planewave coefficients of specified KS states.

readWFBand(ispin=1, ikpt=1, iband=1)[source]

Extract KS energies and Fermi occupations from WAVECAR.

readWFHeader()[source]

Read the system information from WAVECAR.

It is written in the first two record.

rec1: recl, nspin, rtag rec2: nkpts, nbands, encut, ((cell(i,j) i=1, 3), j=1, 3)

setWFPrec()[source]

Set wavefunction coefficients precision.

TAG = 45200: single precision complex, np.complex64, or complex(qs) TAG = 45210: double precision complex, np.complex128, or complex(q)
whereRec(ispin=1, ikpt=1, iband=1)[source]

Return the rec position for specified KS state.

class jarvis.io.vasp.outputs.Waveder(filename, gamma_only=False)[source]

Bases: object

Class for reading a WAVEDER file.

The LOPTICS tag produces a WAVEDER file. The WAVEDER contains the derivative of the orbitals with respect to k.

cder_data

Return the orbital derivative between states.

get_orbital_derivative_between_states(band_i, band_j, kpoint, spin, cart_dir)[source]

Return a valuebetween bands band_i and band_j.

For k-point index, spin-channel and cartesian direction.

Args:

band_i (Integer): Index of band i

band_j (Integer): Index of band j

kpoint (Integer): Index of k-point

spin (Integer): Index of spin-channel (0 or 1)

cart_dir (Integer): Index of cartesian direction (0,1,2)

Returns:
a float value
nbands

Return the number of bands in the calculation.

nelect

Return the number of electrons in the calculation.

nkpoints

Return the number of k-points in the calculation.

jarvis.io.vasp.outputs.parse_raman_dat(vasp_raman_path='RAMANDIR-bulk@JVASP-1002_mp-149/vasp_raman.dat')[source]

Parse vasp_raman.dat .

generated by https://github.com/raman-sc/VASP

Module contents

Methods for handling input/output files for VASP.