interface module

This module, interface.py contains the interfaces which reads in data and calculates for instance parametrized bandstructures etc.

Contains routines that interface T4ME, e.g. to the parameter files or to other input files.

interface.bandstructure_numpy(bs, filename, location=None)

Sets the bandstructure from a NumPy datafile file.

Loads and stores the parameters in the bandstructure configuration file (defaults to bandparam.yml).

Parameters:
bs : object

A Bandstructure() object.

filename : string

The filename of the NumPy data file to be read. The bandstructure configuration file have to be named “bandparam.yml” in this case.

location : string, optional

The location of the NumPy data file. Defaults to the “input” directory in the current working directory.

Returns:
None

Notes

This routine read NumPy datafiles containing the electron energy dispersions and optionally the band velocities.

The datastructure of the supplied numpy array
should be on the following format:
[
[kx], [ky], [kz], [e_1], [v_x_1], [v_y_1], [v_z_1],
[e_2], [v_x_2], [v_y_2], [v_z_2], … ,
[e_n], [v_x_n], [v_y_n], [v_z_n]
]

If the band velocities are not supplied they are simply not present. Each column of data has the length of the number of k-point in the full BZ.

The bandstructure configuration file is still read due to the need of the scattering properties etc.

This interface is enabled by setting read in the general configuration file to “numpy” (datafile with only electron energy dispersions) or “numpyv” (datafile with electron energy and group velocity dispersion)

interface.bandstructure_param(bs, location=None, filename=None)

Sets the bandstructure from the parameters in the bandstructure configuration file (default bandparam.yml).

Also loads and stores the parameters.

Parameters:
bs : object

A Bandstructure() object.

location : string, optional

The location of the bandstructure configuration file. Defaults later to the “input” directory in the current working directory.

filename : string, optional

The filename of the bandstructure configuration file. Defaults to “bandparam.yml”.

Returns:
None

Notes

This interface prepares analytic and tight binding generation of the band structure and also loads and stores all bandstructure related parameters.

interface.bandstructure_vasp(bs, location=None, filename=None)

Sets the bandstructure from a VASP XML file.

Loads and stores the parameters in the bandstructure configuration file (defaults to bandparam.yml).

Parameters:
bs : object

A Bandstructure() object.

location : string, optional

The location of the VASP XML file. Defaults to the “input” directory in the current working directory.

filename : string, optional

The filename of the VASP XML file to be read. Defaults to “vasprun.xml”. The bandstructure configuration file have to be named “bandparam.yml” in this case.

Returns:
None

Notes

This interface read and sets up the bandstructure based on a VASP XML file. Currently it does not read the band velocities as VASP does not yet support this feature. However, work is in progress to enable this. The band velocities have to be generated by an interpolation routine later. Flags are automatically set for this. The bandstructure configuration file is still read due to the need of the scattering properties etc.

This interface is enabled by setting read in the general configuration file to vasp.

interface.lattice_param_numpy(lattice, location=None, filename=None)

Interface used to format the elements needed to generate the Lattice() object.

Used if the lattice is generated from the celldata YAML file (parameterfile and Numpy intput files).

Parameters:
lattice : object

A Lattice() object where we can store additional parameters detected during setup for later access.

location : string, optional

The location of the YAML parameter file determining the celldata.

filename : string, optional

The filename of the YAML parameter file determining the celldata.

Returns:
unitcell : ndarray
Dimension: (3,3)

The unitcell in cartesian coordinates and {AA} units.

positions : ndarray
Dimension: (N,3)

The positions of the N atoms in the unitcell in cartesian coordinates.

species : ndarray
Dimension: (N)

Integer atomic numbers of the atomic species in the same order as positions. Hydrogen starts with 1, while the element X is located at 0. Otherwise it follows the periodic table.

kmesh : object
Dimension: (3)

A Kmesh() obhect for the reciprocal mesh generation containment. Should include sampling, mesh, mesh_ired and other parameters needed for later processing.

Notes

Upon writing a custom interface, please make sure that the parameters in the YAML files are not overwritten.

interface.lattice_vasp(lattice, location=None, filename=None)

Interface used to format the elements needed to generate the Lattice() object.

Used if the lattice is generated from the VASP XML file.

Parameters:
lattice : object

A Lattice() object where we can store additional parameters detected during setup for later access.

location : string, optional

The location of the VASP XML file determining the celldata.

filename : string, optional

The filename of the VASP XML file determining the celldata.

Returns:
unitcell : ndarray
Dimension: (3,3)

The unitcell in cartesian coordinates and {AA} units.

positions : ndarray
Dimension: (N,3)

The positions of the N atoms in the unitcell in cartesian coordinates.

species : ndarray
Dimension: (N)

Integer atomic numbers of the atomic species in the same order as positions. Hydrogen starts with 1, while the element X is located at 0. Otherwise it follows the periodic table.

kmesh : object
Dimension: (3)

A Kmesh() object for the reciprocal mesh generation containment. Should include sampling, mesh, mesh_ired and other parameters needed for later processing.

Notes

Upon writing a custom interface, please make sure that the parameters in the YAML parameter files are not overwritten.

Additional parameters pertaining VASP are stored inside the Param() object with a vasp preemble, i.e. param.vasp_something.

interface.lattice_w90(lattice)

Interface used to format the elements needed to generate the Lattice() object.

Used if the lattice is generated from the Wannier90 win file.

Parameters:
lattice : object

A Lattice() object where we can store additional parameters detected during setup for later access.

Returns:
unitcell : ndarray
Dimension: (3,3)

The unitcell in cartesian coordinates and {AA} units.

positions : ndarray
Dimension: (N,3)

The positions of the N atoms in the unitcell in cartesian coordinates.

species : ndarray
Dimension: (N)

Integer atomic numbers of the atomic species in the same order as positions. Hydrogen starts with 1, while the element X is located at 0. Otherwise it follows the periodic table.

kmesh : object

A Kmesh() object for the reciprocal mesh generation containment. Should include sampling, mesh, mesh_ired and other parameters needed for later processing.

Notes

Upon writing a custom interface, please make sure that the parameters in the YAML parameter file is not overwritten.

Additional parameters pertaining VASP are stored inside the Param() object with a vasp preemble, i.e. param.vasp_something.

interface.read_band_parameters(bs, numbands, location=None, filename=None)

Reads and stores the information in the band parameters configuration file (bandparam.yml).

Parameters:
bs : object

The active Bandstructure() object.

numbands : int

The number of bands

location : string, optional

The folder in which the band configuration file is placed. Defaults to the relative folder “input”.

filename : string, optional

The filename of the band configuration file. Defaults to bandparam.yml.

Returns:
None

Notes

Reads and stores the values in the band configuration file. When writing custom interfaces it is sufficient to call this routine in order for the setup of the individual band parameters to be consistent.