pyiron.dft.waves package¶

pyiron.dft.waves.bandstructure module¶

This module is supposed to be common for both electronic and phonon band structures

class pyiron.dft.waves.bandstructure.BandPath(bs_obj, n_points=20)[source]

Bases: object

class pyiron.dft.waves.bandstructure.Bandstructure(structure=None, prec=1e-05)[source]
append_eigenvalues(ew, ev=None)[source]
from_hdf(hdf=None, group_name=None)[source]

Restore the PyironObject from an HDF5 file

Parameters
• hdf (ProjectHDFio) – HDF5 group object

• group_name (str) – HDF5 subgroup name - optional

get_path(num_points=10, path_type='very_short')[source]
get_pathes()[source]

provide dictionary with all predefined Bandstructure pathes for this structure

path_dict
plot()[source]
set_eigenvalues(ew_list, ev_list=None)[source]
structure
to_hdf(hdf=None, group_name=None)[source]

Store the PyironObject in an HDF5 file

Parameters
• hdf (ProjectHDFio) – HDF5 group object

• group_name (str) – HDF5 subgroup name - optional

translate_to_pylab = {"G'": '$\\Gamma^\\prime$', 'Gamma': '$\\Gamma$'}

pyiron.dft.waves.dos module¶

class pyiron.dft.waves.dos.Dos(n_bins=100, es_obj=None, eigenvalues=None, bin_density=None)[source]

Bases: object

The DOS class stores all information to store and retrieve the total and resolved density of states from an electronic structure calculation.

Parameters
• n_bins (int) – Number of histogram bins required to calculate the DOS

• es_obj – The pyiron.objects.waves.core.ElectronicStructure instance for which the DOS has to be computed

• eigenvalues (list/numpy.ndarray) – If es-obj is None, the eigenvalues could be specified as a list

get_orbital_resolved_dos(orbital_indices, spin_indices=0)[source]

Gives the dos contribution of a given indices of orbitals as arranged in the pyiron.objects.waves.ElectronicStructure instance.

Parameters
• orbital_indices (list/numpy.ndarray) – The index/indices of the orbitals for which the dos contribution is required

• spin_indices (list/numpy.ndarray) – The index/indices of the spins for which the dos contribution is required

Returns

The required dos

Return type

numpy.ndaray

get_spatial_orbital_resolved_dos(atom_indices, orbital_indices, spin_indices=0)[source]

Gives the dos contribution of a given indices of atoms as well as orbitals as arranged in the pyiron.objects.waves.ElectronicStructure instance.

Parameters
• atom_indices (list/numpy.ndarray) – The index/indices of the atoms for which the dos contribution is required

• orbital_indices (list/numpy.ndarray) – The index/indices of the orbitals for which the dos contribution is required

• spin_indices (list/numpy.ndarray) – The index/indices of the spins for which the dos contribution is required

Returns

The required dos

Return type

numpy.ndaray

get_spatially_resolved_dos(atom_indices, spin_indices=0)[source]

Gives the dos contribution of a given indices of atoms as arranged in the pyiron.objects.waves.ElectronicStructure instance.

Parameters
• atom_indices (list/numpy.ndarray) – The index/indices of the atoms for which the dos contribution is required

• spin_indices (list/numpy.ndarray) – The index/indices of the spins for which the dos contribution is required

Returns

The required dos

Return type

numpy.ndarray

get_spin_resolved_dos(spin_indices)[source]

Gives the dos contribution of a given indices of spin as arranged in the pyiron.objects.waves.ElectronicStructure instance.

Parameters

spin_indices (list/numpy.ndarray) – The index/indices of the spins for which the dos contribution is required

Returns

The required dos

Return type

numpy.ndarray

plot_orbital_resolved_dos(**kwargs)[source]

Plots the orbital resolved DOS

Parameters

**kwargs – Variable for matplotlib.pylab.plot customization (linewidth, linestyle, etc.)

Returns

matplotlib.pylab.plot

plot_total_dos(**kwargs)[source]

Plots the total DOS

Parameters

**kwargs – Variables for matplotlib.pylab.plot customization (linewidth, linestyle, etc.)

Returns

matplotlib.pylab.plot

exception pyiron.dft.waves.dos.NoResolvedDosError[source]

Bases: Exception

Raised when information on the resolved dos in unavailable

pyiron.dft.waves.electronic module¶

class pyiron.dft.waves.electronic.Band[source]

Bases: object

All data related to a single band for every k-point is stored in this module

eigenvalue

The eigenvalue of a given band at a given k-point

Type

float

occupancy

The occupancy of a given band at a given k-point

Type

float

resolved_dos_matrix

2D matrix with n rows and m columns; n being the unmber of atoms and m being the number of orbitals

Type

numpy.ndarray instance

class pyiron.dft.waves.electronic.ElectronicStructure[source]

Bases: object

This is a generic module to store electronic structure data in a clean way. Kpoint and Band classes are used to store information related to kpoints and bands respectively. Every spin configuration has a set of k-points and every k-point has a set of bands associated with it. This is loosely adapted from the pymatgen electronic_structure modules. Many of the functions have been substantially modified for pyiron

add_kpoint(value, weight)[source]

Appends a Kpoint() instance to the kpoints attribute

Parameters
• value (list/numpy.ndarray) – Value of the k-point in cartesian reciprocal coordinates

• weight (float) – The weight of the particular k-point

cbm

The Kohn-Sham CBM (value only) (eV)

Type

float

dos_densities

A (SxN) vector containing the density of states for every spin configuration with S spin configurations and N grid points

Type

numpy.ndarray

dos_energies

A (1xN) vector containing the energies with N grid points

Type

numpy.ndarray

dos_idensities

A (SxN) vector containing the density of states for every spin configuration with S spin configurations and N grid points

Type

numpy.ndarray

efermi

The Fermi-level of the system (eV). Please note that in the case of DFT this level is the Kohn-Sham Fermi level computed by the DFT code.

Type

float

eg

The band gap (eV)

Type

float

eigenvalue_matrix

A getter function to return the eigenvalue_matrix. The eigenvalue for a given kpoint index i and band index j is given by eigenvalue_matrix[i][j]

Type

numpy.ndarray

eigenvalues

Eigenvalues of the bands

Type

numpy.ndarray

from_hdf(hdf, group_name='electronic_structure')[source]

Retrieve the object from the hdf5 file

Parameters
• hdf – Path to the hdf5 file/group in the file

• group_name – Name of the group under which the attributes are stored

from_hdf_old(hdf, group_name='electronic_structure')[source]

Retrieve the object from the hdf5 file

Parameters
• hdf – Path to the hdf5 file/group in the file

• group_name – Name of the group under which the attributes are stored

generate_from_matrices()[source]

Generate the Kpoints and Bands from the kpoint lists and sometimes grand_dos_matrix

get_band_gap(resolution=1e-06)[source]

Gets the band gap of the system

Parameters

resolution (float) – An occupancy above this value is considered occupied

Returns

“band gap” (float): The band gap (eV)

”vbm”: The dictionary associated with the VBM “cbm”: The dictionary associated with the CBM

Return type

dict

get_cbm(resolution=1e-06)[source]

Gets the conduction band minimum (CBM) of the system

Parameters

resolution (float) – An occupancy above this value is considered occupied

Returns

“value” (float): Absolute energy value of the CBM (eV)

”kpoint”: The Kpoint instance associated with the CBM “band”: The Band instance associated with the CBM

Return type

dict

get_dos(n_bins=100)[source]

Gives a pyiron.objects.waves.dos.Dos instance

Parameters

n_bins (int) – Number of histogram bins for the dos

Returns

Dos instance

Return type

pyiron.objects.waves.dos.Dos

get_resolved_dos(spin_indices=0, atom_indices=None, orbital_indices=None)[source]

Get resolved dos based on the specified spin, atom and orbital indices

Parameters
• spin_indices (int/list/numpy.ndarray) – spin indices

• atom_indices (int/list/numpy.ndarray) – stom indices

• orbital_indices (int/list/numpy.ndarray) – orbital indices (based on orbital_dict)

Returns

Required resolved dos

Return type

rdos (numpy.ndarray)

get_spin_resolved_dos(spin_indices=0)[source]

Gets the spin resolved DOS

Parameters

spin_indices (int) – The index of the spin for which the DOS is required

Returns

Spin resolved dos (numpy.ndarray instance)

get_vbm(resolution=1e-06)[source]

Gets the valence band maximum (VBM) of the system

Parameters

resolution (float) – An occupancy below this value is considered unoccupied

Returns

“value” (float): Absolute energy value of the VBM (eV) “kpoint”: The Kpoint instance associated with the VBM “band”: The Band instance associated with the VBM

Return type

dict

grand_dos_matrix

Getter for the 5 dimensional grand_dos_matrix which gives the contribution of every spin, kpoint, band, atom and orbital to the total DOS. For example the dos contribution with spin index s, kpoint k, band b, atom a and orbital o is:

grand_dos_matrix[s, k, b, a, o]

The grand sum of this matrix would equal 1.0. The spatial, spin, and orbital resolved DOS can be computed using this matrix

Returns

numpy.ndarray (5 dimensional)

is_metal

Tells if the given system is metallic or not. The Fermi level crosses bands in the cas of metals but is present in the band gap in the case of semi-conductors.

Type

bool

kpoint_list

The list of kpoints in cartesian coordinates

Type

list

kpoint_weights

The weights of the kpoints of the electronic structure in cartesian coordinates

Type

list

occupancies

Occupancies of the bands

Type

numpy.ndarray

occupancy_matrix

A getter function to return the occupancy_matrix. The occupancy for a given kpoint index i and band index j is given by occupancy_matrix[i][j]

Type

numpy.ndarray

orbital_dict

A dictionary of the ordering of the orbitals

Examples

>>> self.orbital_dict[0]
's'

Type

dict

plot_fermi_dirac()[source]

Plots the obtained eigenvalue vs occupation plot

resolved_densities

A (SxAxOxN) vector containing the density of states for every spin configuration with S spin configurations, A atoms, O orbitals and N grid points. The labels of the orbitals are found on the orbital_dict

Type

numpy.ndarray

structure

The structure associated with the electronic structure object

Type

atomistics.structure.atoms.Atoms

to_hdf(hdf, group_name='electronic_structure')[source]

Store the object to hdf5 file

Parameters
• hdf – Path to the hdf5 file/group in the file

• group_name – Name of the group under which the attributes are o be stored

to_hdf_old(hdf, group_name='electronic_structure')[source]

Store the object to hdf5 file

Parameters
• hdf – Path to the hdf5 file/group in the file

• group_name – Name of the group under which the attributes are o be stored

vbm

The Kohn-Sham VBM (value only) (eV)

Type

float

class pyiron.dft.waves.electronic.Kpoint[source]

Bases: object

All data related to a single k-point is stored in this module

bands

List of pyiron.objects.waves.settings.Band object

Type

list

.. value

Value of the k-point

Type

float

.. weight

Weight of the k-point used in integration of quantities

Type

float

.. eig_occ_matrix

A Nx2 matrix with the first column with eigenvalues and the second with occupancies of every band. N being the number of bands assoiated with the k-point

Type

numpy.ndarray

add_band(eigenvalue, occupancy)[source]

eig_occ_matrix
value
weight