httk.iface.vasp_if module

class httk.iface.vasp_if.OutcarReader(ioa)[source]

Bases: object

parse()[source]
httk.iface.vasp_if.apply_dist(ELASTICSTEP, DELTASTEP, sym, deltas, distortions)[source]
httk.iface.vasp_if.calculate_kpoints(struct, dens=20)[source]
httk.iface.vasp_if.copy_template(dirtemplate, dirname, templatename)[source]
httk.iface.vasp_if.distort(dist_mat, mat)[source]

Apply distortion matrix

httk.iface.vasp_if.elastic_config(fn)[source]
httk.iface.vasp_if.get_computation_info(ioa)[source]

Finds the VASP version number, values of ENCUT, # of kpoints from the OUTCAR.

httk.iface.vasp_if.get_dist_matrix(array)[source]
httk.iface.vasp_if.get_elastic_constants(path, settings_path='..')[source]
httk.iface.vasp_if.get_magmom(symbol)[source]
httk.iface.vasp_if.get_magnetizations(ionlist, high, low)[source]
httk.iface.vasp_if.get_pseudopotential(species, poscarspath=None)[source]
httk.iface.vasp_if.is_dualmagnetic(ion, ionlist)[source]
httk.iface.vasp_if.magnetization_recurse(basemags, dualmags, high, low)[source]
httk.iface.vasp_if.poscar_to_strs(fio, included_decimals='')[source]
Parses a file on VASPs POSCAR format. Returns

(cell, scale, vol, coords, coords_reduced, counts, occupations, comment)

where

cell: 3x3 nested list of strings designating the cell scale: string representing the overall scale of the cell vol: string representing the volume of the cell (only one of scale and vol will be set, the other one = None) coords: Nx3 nested list of strings designating the coordinates coords_reduced: bool, true = coords are given in reduced coordinate (in vasp D or Direct), false = coords are given in cartesian coordinates counts: how many atoms of each type occupations: which species of each atom type (integers), or -1, … -N if no species are given. comment: the comment string given at the top of the file

httk.iface.vasp_if.poscar_to_structure(f, included_decimals='', structure_class=<class 'httk.atomistic.structure.Structure'>)[source]
httk.iface.vasp_if.prepare_single_run(dirpath, struct, poscarspath=None, template='t:/vasp/single/static', overwrite=False)[source]
httk.iface.vasp_if.read_outcar(ioa)[source]
httk.iface.vasp_if.read_wavecar(file, gamma_mode='x', wavefunc_prec=None)[source]

Reads the information in a VASP WAVECAR file into a PlaneWaveFunctions object.

Input file: File-like object or io adapter pointing to WAVECAR file gamma_mode: Reduction axis in the gamma-point format

Return PlaneWaveObject acting as proxy for the WAVECAR file

httk.iface.vasp_if.rotation_matrix(axis, theta)[source]

Return the rotation matrix associated with counterclockwise rotation about the given axis by theta radians.

Parameters:
  • axis

  • theta

httk.iface.vasp_if.save_vesta(filename, structure, isosurface, cols=10)[source]
httk.iface.vasp_if.structure_to_comment(struct)[source]
httk.iface.vasp_if.structure_to_poscar(f, struct, fix_negative_determinant=False, comment=None, primitive_cell=True)[source]
httk.iface.vasp_if.write_generic_kpoints_file(fio, comment=None, mp=True)[source]
httk.iface.vasp_if.write_kpoints_file(fio, kpoints, comment=None, mp=True, gamma_centered=False)[source]
httk.iface.vasp_if.write_poscar(fio, cell, coords, coords_reduced, counts, occupations, comment='Comment', scale='1', vol=None)[source]

Writes a file on VASPs POSCAR format. Where it says string below, any type that works with str(x) is also ok.

Input arguments

f: file stream to put output on cell: 3x3 nested list of strings designating the cell coords: Nx3 nested list of strings designating the coordinates coords_reduced: bool, true = coords are given in reduced coordinate (in vasp D or Direct), false = coords are given in cartesian coordinates counts: how many atoms of each type occupations: which species of each atom type comment: (optional) the comment string given at the top of the file scale: (optional) string representing the overall scale of the cell vol: string representing the volume of the cell (only one of scale and vol can be set)

httk.iface.vasp_if.write_wavecar(file_wrapper, planewaves, bands=None, spins=None, ikpts=None, format=None, gamma_half='x', keep_records=False)[source]

Writes a PlaneWaveFunctions object to specified file.

Optional arguments are for writing a subset of the plane-wave object, limiting the new file to certain spin-components, k-points or bands. Writing to gamma format or standard format can be specified, when possible.

Input file_wrapper: Filename or file object to new file (will be closed and opened in binary read mode if necessary) planewaves: PlaneWaveFunctions object to copy to file spins: Indices of spin components to write, default is all, counting from 1 ikpts: Indices of k-points to write, default is all, counting from 1 bands: Indices of bands to write, default is all, counting from 1 format: Output format. Either ‘std’ or ‘gamma’, default is same format as planewaves object gamma_half: If writing to gamma format, change the axis of reduction, either ‘z’ or ‘x’ keep_records: If True, the coefficients will be written while keeping their positions in the binary file.

If only selection of coeffs are to be written, all other coefficients will be set to zero.