pymatgen.io.lobster package

This package implements modules for input and output to and from Lobster. It imports the key classes form both lobster.inputs and lobster_outputs to allow most classes to be simply called as pymatgen.io.lobster.Lobsterin for example, to retain backwards compatibility.

Submodules

pymatgen.io.lobster.inputs module

Module for reading Lobster input files. For more information on LOBSTER see www.cohp.de. If you use this module, please cite: J. George, G. Petretto, A. Naik, M. Esters, A. J. Jackson, R. Nelson, R. Dronskowski, G.-M. Rignanese, G. Hautier, “Automated Bonding Analysis with Crystal Orbital Hamilton Populations”, ChemPlusChem 2022, e202200123, DOI: 10.1002/cplu.202200123.

class Lobsterin(settingsdict: dict)[source]

Bases: UserDict, MSONable

This class can handle and generate lobsterin files Furthermore, it can also modify INCAR files for lobster, generate KPOINT files for fatband calculations in Lobster, and generate the standard primitive cells in a POSCAR file that are needed for the fatband calculations. There are also several standard lobsterin files that can be easily generated.

Parameters:

settingsdict – dict to initialize Lobsterin.

AVAILABLE_KEYWORDS = ('COHPstartEnergy', 'COHPendEnergy', 'gaussianSmearingWidth', 'useDecimalPlaces', 'COHPSteps', 'basisSet', 'cohpGenerator', 'realspaceHamiltonian', 'realspaceOverlap', 'printPAWRealSpaceWavefunction', 'printLCAORealSpaceWavefunction', 'kSpaceCOHP', 'EwaldSum', 'saveProjectionToFile', 'skipdos', 'skipcohp', 'skipcoop', 'skipcobi', 'skipMadelungEnergy', 'loadProjectionFromFile', 'forceEnergyRange', 'DensityOfEnergy', 'BWDF', 'BWDFCOHP', 'skipPopulationAnalysis', 'skipGrossPopulation', 'userecommendedbasisfunctions', 'skipProjection', 'writeBasisFunctions', 'writeMatricesToFile', 'noFFTforVisualization', 'RMSp', 'onlyReadVasprun.xml', 'noMemoryMappedFiles', 'skipPAWOrthonormalityTest', 'doNotIgnoreExcessiveBands', 'doNotUseAbsoluteSpilling', 'skipReOrthonormalization', 'forceV1HMatrix', 'useOriginalTetrahedronMethod', 'forceEnergyRange', 'bandwiseSpilling', 'kpointwiseSpilling', 'LSODOS', 'basisfunctions', 'cohpbetween', 'createFatband')[source]
BOOLEAN_KEYWORDS = ('saveProjectionToFile', 'skipdos', 'skipcohp', 'skipcoop', 'skipcobi', 'skipMadelungEnergy', 'loadProjectionFromFile', 'forceEnergyRange', 'DensityOfEnergy', 'BWDF', 'BWDFCOHP', 'skipPopulationAnalysis', 'skipGrossPopulation', 'userecommendedbasisfunctions', 'skipProjection', 'writeBasisFunctions', 'writeMatricesToFile', 'noFFTforVisualization', 'RMSp', 'onlyReadVasprun.xml', 'noMemoryMappedFiles', 'skipPAWOrthonormalityTest', 'doNotIgnoreExcessiveBands', 'doNotUseAbsoluteSpilling', 'skipReOrthonormalization', 'forceV1HMatrix', 'useOriginalTetrahedronMethod', 'forceEnergyRange', 'bandwiseSpilling', 'kpointwiseSpilling', 'LSODOS')[source]
FLOAT_KEYWORDS = ('COHPstartEnergy', 'COHPendEnergy', 'gaussianSmearingWidth', 'useDecimalPlaces', 'COHPSteps')[source]
LISTKEYWORDS = ('basisfunctions', 'cohpbetween', 'createFatband')[source]
STRING_KEYWORDS = ('basisSet', 'cohpGenerator', 'realspaceHamiltonian', 'realspaceOverlap', 'printPAWRealSpaceWavefunction', 'printLCAORealSpaceWavefunction', 'kSpaceCOHP', 'EwaldSum')[source]
as_dict()[source]

MSONable dict

diff(other)[source]

Diff function for lobsterin. Compares two lobsterin and indicates which parameters are the same. Similar to the diff in INCAR.

Parameters:

other (Lobsterin) – Lobsterin object to compare to

Returns:

dict with differences and similarities

classmethod from_dict(dct: dict) Self[source]
Parameters:

dct (dict) – Dict representation.

Returns:

Lobsterin

classmethod from_file(lobsterin: str)[source]
Parameters:

lobsterin (str) – path to lobsterin.

Returns:

Lobsterin object

static get_all_possible_basis_functions(structure: Structure, potcar_symbols: list, address_basis_file_min: str | None = None, address_basis_file_max: str | None = None)[source]
Parameters:
  • structure – Structure object

  • potcar_symbols – list of the potcar symbols

  • address_basis_file_min – path to file with the minimum required basis by the POTCAR

  • address_basis_file_max – path to file with the largest possible basis of the POTCAR.

Returns:

Can be used to create new Lobsterin objects in

standard_calculations_from_vasp_files as dict_for_basis

Return type:

list[dict]

static get_basis(structure: Structure, potcar_symbols: list, address_basis_file: str | None = None)[source]

Get the basis from given potcar_symbols (e.g., [“Fe_pv”,”Si”]

Parameters:
  • structure (Structure) – Structure object

  • potcar_symbols – list of potcar symbols

Returns:

returns basis

classmethod standard_calculations_from_vasp_files(POSCAR_input: str = 'POSCAR', INCAR_input: str = 'INCAR', POTCAR_input: str | None = None, Vasprun_output: str = 'vasprun.xml', dict_for_basis: dict | None = None, option: str = 'standard')[source]

Will generate Lobsterin with standard settings.

Parameters:
  • POSCAR_input (str) – path to POSCAR

  • INCAR_input (str) – path to INCAR

  • POTCAR_input (str) – path to POTCAR

  • dict_for_basis (dict) – can be provided: it should look the following: dict_for_basis={“Fe”:’3p 3d 4s 4f’, “C”: ‘2s 2p’} and will overwrite all settings from POTCAR_input

  • option (str) – ‘standard’ will start a normal lobster run where COHPs, COOPs, DOS, CHARGE etc. will be calculated ‘standard_with_energy_range_from_vasprun’ will start a normal lobster run for entire energy range of VASP static run. vasprun.xml file needs to be in current directory. ‘standard_from_projection’ will start a normal lobster run from a projection ‘standard_with_fatband’ will do a fatband calculation, run over all orbitals ‘onlyprojection’ will only do a projection ‘onlydos’ will only calculate a projected dos ‘onlycohp’ will only calculate cohp ‘onlycoop’ will only calculate coop ‘onlycohpcoop’ will only calculate cohp and coop

Returns:

Lobsterin Object with standard settings

write_INCAR(incar_input: str = 'INCAR', incar_output: str = 'INCAR.lobster', poscar_input: str = 'POSCAR', isym: int = -1, further_settings: dict | None = None)[source]

Will only make the run static, insert nbands, make ISYM=-1, set LWAVE=True and write a new INCAR. You have to check for the rest.

Parameters:
  • incar_input (str) – path to input INCAR

  • incar_output (str) – path to output INCAR

  • poscar_input (str) – path to input POSCAR

  • isym (int) – isym equal to -1 or 0 are possible. Current Lobster version only allow -1.

  • further_settings (dict) – A dict can be used to include further settings, e.g. {“ISMEAR”:-5}

static write_KPOINTS(POSCAR_input: str = 'POSCAR', KPOINTS_output='KPOINTS.lobster', reciprocal_density: int = 100, isym: int = -1, from_grid: bool = False, input_grid: Sequence[int] = (5, 5, 5), line_mode: bool = True, kpoints_line_density: int = 20, symprec: float = 0.01)[source]

Writes a KPOINT file for lobster (only ISYM=-1 and ISYM=0 are possible), grids are gamma centered.

Parameters:
  • POSCAR_input (str) – path to POSCAR

  • KPOINTS_output (str) – path to output KPOINTS

  • reciprocal_density (int) – Grid density

  • isym (int) – either -1 or 0. Current Lobster versions only allow -1.

  • from_grid (bool) – If True KPOINTS will be generated with the help of a grid given in input_grid. Otherwise, they will be generated from the reciprocal_density

  • input_grid (list) – grid to generate the KPOINTS file

  • line_mode (bool) – If True, band structure will be generated

  • kpoints_line_density (int) – density of the lines in the band structure

  • symprec (float) – precision to determine symmetry

static write_POSCAR_with_standard_primitive(POSCAR_input='POSCAR', POSCAR_output='POSCAR.lobster', symprec: float = 0.01)[source]

Writes a POSCAR with the standard primitive cell. This is needed to arrive at the correct kpath.

Parameters:
  • POSCAR_input (str) – filename of input POSCAR

  • POSCAR_output (str) – filename of output POSCAR

  • symprec (float) – precision to find symmetry

write_lobsterin(path='lobsterin', overwritedict=None)[source]

Writes a lobsterin file.

Parameters:
  • path (str) – filename of the lobsterin file that will be written

  • overwritedict (dict) – dict that can be used to overwrite lobsterin, e.g. {“skipdos”: True}

get_all_possible_basis_combinations(min_basis: list, max_basis: list) list[source]
Parameters:
  • min_basis – list of basis entries: e.g., [‘Si 3p 3s ‘]

  • max_basis – list of basis entries: e.g., [‘Si 3p 3s ‘].

Returns:

all possible combinations of basis functions, e.g. [[‘Si 3p 3s’]]

Return type:

list[list[str]]

pymatgen.io.lobster.lobsterenv module

This module provides classes to perform analyses of the local environments (e.g., finding near neighbors) of single sites in molecules and structures based on bonding analysis with Lobster. If you use this module, please cite: J. George, G. Petretto, A. Naik, M. Esters, A. J. Jackson, R. Nelson, R. Dronskowski, G.-M. Rignanese, G. Hautier, “Automated Bonding Analysis with Crystal Orbital Hamilton Populations”, ChemPlusChem 2022, e202200123, DOI: 10.1002/cplu.202200123.

class ICOHPNeighborsInfo(total_icohp: float, list_icohps: list[float], n_bonds: int, labels: list[str], atoms: list[list[str]], central_isites: list[int] | None)[source]

Bases: NamedTuple

Tuple to represent information on relevant bonds :param total_icohp: sum of icohp values of neighbors to the selected sites [given by the id in structure] :type total_icohp: float :param list_icohps: list of summed icohp values for all identified interactions with neighbors :type list_icohps: list :param n_bonds: number of identified bonds to the selected sites :type n_bonds: int :param labels: labels (from ICOHPLIST) for all identified bonds :type labels: list[str] :param atoms: list of list describing the species present in the identified interactions

(names from ICOHPLIST), e.g., [“Ag3”, “O5”]

Parameters:

central_isites (list[int]) – list of the central isite for each identified interaction.

Create new instance of ICOHPNeighborsInfo(total_icohp, list_icohps, n_bonds, labels, atoms, central_isites)

atoms: list[list[str]][source]

Alias for field number 4

central_isites: list[int] | None[source]

Alias for field number 5

labels: list[str][source]

Alias for field number 3

list_icohps: list[float][source]

Alias for field number 1

n_bonds: int[source]

Alias for field number 2

total_icohp: float[source]

Alias for field number 0

class LobsterLightStructureEnvironments(strategy, coordination_environments=None, all_nbs_sites=None, neighbors_sets=None, structure=None, valences=None, valences_origin=None)[source]

Bases: LightStructureEnvironments

Class to store LightStructureEnvironments based on Lobster outputs.

Constructor for the LightStructureEnvironments object.

Parameters:
  • strategy – ChemEnv strategy used to get the environments.

  • coordination_environments – The coordination environments identified.

  • all_nbs_sites – All the possible neighbors for each site in the structure.

  • neighbors_sets – The neighbors sets of each site in the structure.

  • structure – The structure.

  • valences – The valences used to get the environments (if needed).

  • valences_origin – How the valences were obtained (e.g. from the Bond-valence analysis or from the original structure).

as_dict()[source]

Bson-serializable dict representation of the LightStructureEnvironments object.

Returns:

Bson-serializable dict representation of the LightStructureEnvironments object.

classmethod from_Lobster(list_ce_symbol, list_csm, list_permutation, list_neighsite, list_neighisite, structure: Structure, valences=None)[source]

Will set up a LightStructureEnvironments from Lobster.

Parameters:
  • structure – Structure object

  • list_ce_symbol – list of symbols for coordination environments

  • list_csm – list of continuous symmetry measures

  • list_permutation – list of permutations

  • list_neighsite – list of neighboring sites

  • list_neighisite – list of neighboring isites (number of a site)

  • valences – list of valences

Returns:

LobsterLightStructureEnvironments

property uniquely_determines_coordination_environments[source]

True if the coordination environments are uniquely determined.

class LobsterNeighbors(structure: Structure, filename_icohp: str | None = 'ICOHPLIST.lobster', obj_icohp: Icohplist | None = None, are_coops: bool = False, are_cobis: bool = False, valences: list[float] | None = None, limits: tuple[float, float] | None = None, additional_condition: int = 0, only_bonds_to: list[str] | None = None, perc_strength_icohp: float = 0.15, noise_cutoff: float = 0.1, valences_from_charges: bool = False, filename_charge: str | None = None, obj_charge: Charge | None = None, which_charge: str = 'Mulliken', adapt_extremum_to_add_cond: bool = False, add_additional_data_sg: bool = False, filename_blist_sg1: str | None = None, filename_blist_sg2: str | None = None, id_blist_sg1: str = 'ICOOP', id_blist_sg2: str = 'ICOBI')[source]

Bases: NearNeighbors

This class combines capabilities from LocalEnv and ChemEnv to determine coordination environments based on bonding analysis.

Parameters:
  • filename_icohp – (str) Path to ICOHPLIST.lobster or ICOOPLIST.lobster or ICOBILIST.lobster

  • obj_icohp – Icohplist object

  • structure – (Structure) typically constructed by Structure.from_file(“POSCAR”)

  • are_coops – (bool) if True, the file is a ICOOPLIST.lobster and not a ICOHPLIST.lobster; only tested for ICOHPLIST.lobster so far

  • are_cobis – (bool) if True, the file is a ICOBILIST.lobster and not a ICOHPLIST.lobster

  • valences (Mulliken) instead of) – (list[float]): gives valence/charge for each element

  • limits (tuple[float, float] | None) – limit to decide which ICOHPs (ICOOP or ICOBI) should be considered

  • additional_condition (int) – Additional condition that decides which kind of bonds will be considered NO_ADDITIONAL_CONDITION = 0 ONLY_ANION_CATION_BONDS = 1 NO_ELEMENT_TO_SAME_ELEMENT_BONDS = 2 ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS = 3 ONLY_ELEMENT_TO_OXYGEN_BONDS = 4 DO_NOT_CONSIDER_ANION_CATION_BONDS=5 ONLY_CATION_CATION_BONDS=6

  • only_bonds_to – (list[str]) will only consider bonds to certain elements (e.g. [“O”] for oxygen)

  • perc_strength_icohp – if no limits are given, this will decide which icohps will still be considered (

  • to (relative) –

  • ICOHP (the strongest) –

  • noise_cutoff – if provided hardcodes the lower limit of icohps considered

  • valences_from_charges – if True and path to CHARGE.lobster is provided, will use Lobster charges (

  • valences

  • filename_charge – (str) Path to Charge.lobster

  • obj_charge – Charge object

  • which_charge – (str) “Mulliken” or “Loewdin”

  • adapt_extremum_to_add_cond – (bool) will adapt the limits to only focus on the bonds determined by the

  • condition (additional) –

  • add_additional_data_sg – (bool) will add the information from filename_add_bondinglist_sg1,

  • filename_blist_sg1 – (str) Path to additional ICOOP, ICOBI data for structure graphs

  • filename_blist_sg2 – (str) Path to additional ICOOP, ICOBI data for structure graphs

  • id_blist_sg1 – (str) Identity of data in filename_blist_sg1, e.g., “icoop” or “icobi”

  • id_blist_sg2 – (str) Identity of data in filename_blist_sg2, e.g., “icoop” or “icobi”.

property anion_types[source]

Return the types of anions present in crystal structure as a set

Returns:

describing anions in the crystal structure.

Return type:

set[Element]

get_anion_types(**kwargs)[source]
get_info_cohps_to_neighbors(path_to_cohpcar: str | None = 'COHPCAR.lobster', obj_cohpcar: CompleteCohp | None = None, isites: list[int] | None = None, only_bonds_to: list[str] | None = None, onlycation_isites: bool = True, per_bond: bool = True, summed_spin_channels: bool = False)[source]

Return info about the cohps (coops or cobis) as a summed cohp object and a label from all sites mentioned in isites with neighbors.

Parameters:
  • path_to_cohpcar – str, path to COHPCAR or COOPCAR or COBICAR

  • obj_cohpcar – CompleteCohp object

  • isites – list of int that indicate the number of the site

  • only_bonds_to – list of str, e.g. [“O”] to only show cohps of anything to oxygen

  • onlycation_isites – if isites=None, only cation sites will be returned

  • per_bond – will normalize per bond

  • summed_spin_channels – will sum all spin channels

Returns:

label for cohp (str), CompleteCohp object which describes all cohps (coops or cobis)

of the sites as given by isites and the other parameters

Return type:

str

get_info_icohps_between_neighbors(isites=None, onlycation_isites=True)[source]

Return infos about interactions between neighbors of a certain atom.

Parameters:
  • isites – list of site ids, if isite==None, all isites will be used

  • onlycation_isites – will only use cations, if isite==None

Returns

ICOHPNeighborsInfo

get_info_icohps_to_neighbors(isites=None, onlycation_isites=True)[source]

This method returns information on the icohps of neighbors for certain sites as identified by their site id. This is useful for plotting the relevant cohps of a site in the structure. (could be ICOOPLIST.lobster or ICOHPLIST.lobster or ICOBILIST.lobster)

Parameters:
  • isites – list of site ids. If isite==None, all isites will be used to add the icohps of the neighbors

  • onlycation_isites – if True and if isite==None, it will only analyse the sites of the cations

Returns:

ICOHPNeighborsInfo

get_light_structure_environment(only_cation_environments=False, only_indices=None)[source]

Return a LobsterLightStructureEnvironments object if the structure only contains coordination environments smaller 13.

Parameters:
  • only_cation_environments – only data for cations will be returned

  • only_indices – will only evaluate the list of isites in this list

Returns:

LobsterLightStructureEnvironments

get_nn_info(structure: Structure, n, use_weights: bool = False)[source]

Get coordination number, CN, of site with index n in structure.

Parameters:
  • structure (Structure) – input structure.

  • n (int) – index of site for which to determine CN.

  • use_weights (bool) – flag indicating whether (True) to use weights for computing the coordination number or not (False, default: each coordinated site has equal weight). True is not implemented for LobsterNeighbors

Returns:

coordination number.

Return type:

cn (integer or float)

property molecules_allowed[source]

Whether this NearNeighbors class can be used with Molecule objects?

plot_cohps_of_neighbors(path_to_cohpcar: str | None = 'COHPCAR.lobster', obj_cohpcar: CompleteCohp | None = None, isites: list[int] | None = None, onlycation_isites: bool = True, only_bonds_to: list[str] | None = None, per_bond: bool = False, summed_spin_channels: bool = False, xlim=None, ylim=(-10, 6), integrated: bool = False)[source]

Will plot summed cohps or cobis or coops (please be careful in the spin polarized case (plots might overlap (exactly!)).

Parameters:
  • path_to_cohpcar – str, path to COHPCAR or COOPCAR or COBICAR

  • obj_cohpcar – CompleteCohp object

  • isites – list of site ids, if isite==[], all isites will be used to add the icohps of the neighbors

  • onlycation_isites – bool, will only use cations, if isite==[]

  • only_bonds_to – list of str, only anions in this list will be considered

  • per_bond – bool, will lead to a normalization of the plotted COHP per number of bond if True,

  • sum (otherwise the) –

  • plotted (will be) –

  • xlim – list of float, limits of x values

  • ylim – list of float, limits of y values

  • integrated – bool, if true will show integrated cohp instead of cohp

Returns:

plt of the cohps or coops or cobis

property structures_allowed[source]

Whether this NearNeighbors class can be used with Structure objects?

pymatgen.io.lobster.outputs module

Module for reading Lobster output files. For more information on LOBSTER see www.cohp.de. If you use this module, please cite: J. George, G. Petretto, A. Naik, M. Esters, A. J. Jackson, R. Nelson, R. Dronskowski, G.-M. Rignanese, G. Hautier, “Automated Bonding Analysis with Crystal Orbital Hamilton Populations”, ChemPlusChem 2022, e202200123, DOI: 10.1002/cplu.202200123.

class Bandoverlaps(filename: str = 'bandOverlaps.lobster', band_overlaps_dict: dict[Any, dict] | None = None, max_deviation: list[float] | None = None)[source]

Bases: MSONable

Class to read in bandOverlaps.lobster files. These files are not created during every Lobster run. .. attribute:: band_overlaps_dict

A dictionary containing the band overlap data of the form: {spin: {“kpoint as string”: {“maxDeviation”: float that describes the max deviation, “matrix”: 2D array of the size number of bands times number of bands including the overlap matrices with}}}.

type:

dict[Spin, Dict[str, Dict[str, Union[float, np.ndarray]]]]

max_deviation[source]

A list of floats describing the maximal deviation for each problematic kpoint.

Type:

list[float]

Parameters:
  • filename – filename of the “bandOverlaps.lobster” file.

  • band_overlaps_dict

    A dictionary containing the band overlap data of the form: {spin: {

    “k_points” : list of k-point array, “max_deviations”: list of max deviations associated with each k-point, “matrices”: list of the overlap matrices associated with each k-point

    }}.

  • max_deviation (list[float]) – A list of floats describing the maximal deviation for each problematic k-point.

property bandoverlapsdict[source]
has_good_quality_check_occupied_bands(number_occ_bands_spin_up: int, number_occ_bands_spin_down: int | None = None, spin_polarized: bool = False, limit_deviation: float = 0.1) bool[source]

Will check if the deviation from the ideal bandoverlap of all occupied bands is smaller or equal to limit_deviation.

Parameters:
  • number_occ_bands_spin_up (int) – number of occupied bands of spin up

  • number_occ_bands_spin_down (int) – number of occupied bands of spin down

  • spin_polarized (bool) – If True, then it was a spin polarized calculation

  • limit_deviation (float) – limit of the maxDeviation

Returns:

Boolean that will give you information about the quality of the projection

has_good_quality_maxDeviation(limit_maxDeviation: float = 0.1) bool[source]

Will check if the maxDeviation from the ideal bandoverlap is smaller or equal to limit_maxDeviation

Parameters:

limit_maxDeviation – limit of the maxDeviation

Returns:

Boolean that will give you information about the quality of the projection.

class Charge(filename: str = 'CHARGE.lobster', num_atoms: int | None = None, atomlist: list[str] | None = None, types: list[str] | None = None, mulliken: list[float] | None = None, loewdin: list[float] | None = None)[source]

Bases: MSONable

Class to read CHARGE files generated by LOBSTER.

atomlist[source]

List of atoms in CHARGE.lobster.

Type:

list[str]

types[source]

List of types of atoms in CHARGE.lobster.

Type:

list[str]

mulliken[source]

List of Mulliken charges of atoms in CHARGE.lobster.

Type:

list[float]

loewdin[source]

List of Loewdin charges of atoms in CHARGE.Loewdin.

Type:

list[float]

num_atoms[source]

Number of atoms in CHARGE.lobster.

Type:

int

Parameters:
  • filename – filename for the CHARGE file, typically “CHARGE.lobster”.

  • num_atoms – number of atoms in the structure

  • atomlist – list of atoms in the structure

  • types – list of unique species in the structure

  • mulliken – list of Mulliken charges

  • loewdin – list of Loewdin charges

property Loewdin[source]
property Mulliken[source]
get_structure_with_charges(structure_filename)[source]

Get a Structure with Mulliken and Loewdin charges as site properties

Parameters:

structure_filename – filename of POSCAR

Returns:

Structure Object with Mulliken and Loewdin charges as site properties.

class Cohpcar(are_coops: bool = False, are_cobis: bool = False, are_multi_center_cobis: bool = False, filename: str | None = None)[source]

Bases: object

Class to read COHPCAR/COOPCAR/COBICAR files generated by LOBSTER.

cohp_data[source]

A dictionary containing the COHP data of the form: {bond: {“COHP”: {Spin.up: cohps, Spin.down:cohps},

“ICOHP”: {Spin.up: icohps, Spin.down: icohps}, “length”: bond length, “sites”: sites corresponding to the bond}

Also contains an entry for the average, which does not have a “length” key.

Type:

dict[str, Dict[str, Any]]

efermi[source]

The Fermi energy in eV.

Type:

float

energies[source]

Sequence of energies in eV. Note that LOBSTER shifts the energies so that the Fermi energy is at zero.

Type:

Sequence[float]

is_spin_polarized[source]

Boolean to indicate if the calculation is spin polarized.

Type:

bool

orb_cohp[source]

A dictionary containing the orbital-resolved COHPs of the form: orb_cohp[label] = {bond_data[“orb_label”]: {

“COHP”: {Spin.up: cohps, Spin.down:cohps}, “ICOHP”: {Spin.up: icohps, Spin.down: icohps}, “orbitals”: orbitals, “length”: bond lengths, “sites”: sites corresponding to the bond},

}

Type:

dict[str, Dict[str, Dict[str, Any]]]

Parameters:
  • are_coops – Determines if the file includes COOPs. Default is False for COHPs.

  • are_cobis – Determines if the file is a list of COHPs or COBIs. Default is False for COHPs.

  • are_multi_center_cobis – Determines if the file include multi-center COBIS. Default is False for two-center cobis.

  • filename – Name of the COHPCAR file. If it is None, the default file name will be chosen, depending on the value of are_coops.

class Doscar(doscar: str = 'DOSCAR.lobster', structure_file: str | None = 'POSCAR', structure: IStructure | Structure | None = None)[source]

Bases: object

Class to deal with Lobster’s projected DOS and local projected DOS. The beforehand quantum-chemical calculation was performed with VASP.

completedos[source]

LobsterCompleteDos Object.

Type:

LobsterCompleteDos

pdos[source]

List of Dict including numpy arrays with pdos. Access as pdos[atomindex][‘orbitalstring’][‘Spin.up/Spin.down’].

Type:

list

tdos[source]

Dos Object of the total density of states.

Type:

Dos

energies[source]

Numpy array of the energies at which the DOS was calculated (in eV, relative to Efermi).

Type:

numpy.ndarray

tdensities[source]

tdensities[Spin.up]: numpy array of the total density of states for the Spin.up contribution at each of the energies. tdensities[Spin.down]: numpy array of the total density of states for the Spin.down contribution at each of the energies. If is_spin_polarized=False, tdensities[Spin.up]: numpy array of the total density of states.

Type:

dict

itdensities[source]

itdensities[Spin.up]: numpy array of the total density of states for the Spin.up contribution at each of the energies. itdensities[Spin.down]: numpy array of the total density of states for the Spin.down contribution at each of the energies. If is_spin_polarized=False, itdensities[Spin.up]: numpy array of the total density of states.

Type:

dict

is_spin_polarized[source]

Boolean. Tells if the system is spin polarized.

Type:

bool

Parameters:
  • doscar – DOSCAR filename, typically “DOSCAR.lobster”

  • structure_file – for vasp, this is typically “POSCAR”

  • structure – instead of a structure file, the structure can be given directly. structure_file will be preferred.

property completedos: LobsterCompleteDos[source]

LobsterCompleteDos

property energies: ndarray[source]

Energies

property is_spin_polarized: bool[source]

Whether run is spin polarized.

property itdensities: dict[Spin, ndarray][source]

integrated total densities as a np.ndarray

property pdos: list[source]

Projected DOS

property tdensities: dict[Spin, ndarray][source]

total densities as a np.ndarray

property tdos: Dos[source]

Total DOS

class Fatband(filenames: str | list = '.', kpoints_file: str = 'KPOINTS', vasprun_file: str | None = 'vasprun.xml', structure: Structure | IStructure | None = None, efermi: float | None = None)[source]

Bases: object

Reads in FATBAND_x_y.lobster files.

efermi[source]

Fermi energy read in from vasprun.xml.

Type:

float

eigenvals[source]

Eigenvalues as a dictionary of numpy arrays of shape (nbands, nkpoints). The first index of the array refers to the band and the second to the index of the kpoint. The kpoints are ordered according to the order of the kpoints_array attribute. If the band structure is not spin polarized, we only store one data set under Spin.up.

Type:

dict[Spin, np.ndarray]

is_spin_polarized[source]

Boolean that tells you whether this was a spin-polarized calculation.

Type:

bool

kpoints_array[source]

List of kpoints as numpy arrays, in frac_coords of the given lattice by default.

Type:

list[np.ndarray]

label_dict[source]

Dictionary that links a kpoint (in frac coords or Cartesian coordinates depending on the coords attribute) to a label.

Type:

dict[str, Union[str, np.ndarray]]

lattice[source]

Lattice object of reciprocal lattice as read in from vasprun.xml.

Type:

Lattice

nbands[source]

Number of bands used in the calculation.

Type:

int

p_eigenvals[source]

Dictionary of orbital projections as {spin: array of dict}. The indices of the array are [band_index, kpoint_index]. The dict is then built the following way: {“string of element”: “string of orbital as read in from FATBAND file”}. If the band structure is not spin polarized, we only store one data set under Spin.up.

Type:

dict[Spin, np.ndarray]

structure[source]

Structure read in from Structure object.

Type:

Structure

Parameters:
  • filenames (list or string) – can be a list of file names or a path to a folder from which all “FATBAND_*” files will be read

  • kpoints_file (str) – KPOINTS file for bandstructure calculation, typically “KPOINTS”.

  • vasprun_file (str) – Corresponding vasprun file. Instead, the Fermi energy from the DFT run can be provided. Then, this value should be set to None.

  • structure (Structure) – Structure object.

  • efermi (float) – fermi energy in eV

get_bandstructure()[source]

Returns a LobsterBandStructureSymmLine object which can be plotted with a normal BSPlotter.

class Grosspop(filename: str = 'GROSSPOP.lobster', list_dict_grosspop: list[dict] | None = None)[source]

Bases: MSONable

Class to read in GROSSPOP.lobster files.

list_dict_grosspop[source]

List of dictionaries including all information about the grosspopulations. Each dictionary contains the following keys: - ‘element’: The element symbol of the atom. - ‘Mulliken GP’: A dictionary of Mulliken gross populations, where the keys are the orbital labels and the

values are the corresponding gross populations as strings.

  • ‘Loewdin GP’: A dictionary of Loewdin gross populations, where the keys are the orbital labels and the

    values are the corresponding gross populations as strings.

The 0th entry of the list refers to the first atom in GROSSPOP.lobster and so on.

Type:

list[dict[str, str| dict[str, str]]]

Parameters:
  • filename – filename of the “GROSSPOP.lobster” file

  • list_dict_grosspop – List of dictionaries including all information about the gross populations

get_structure_with_total_grosspop(structure_filename: str) Structure[source]

Get a Structure with Mulliken and Loewdin total grosspopulations as site properties

Parameters:

structure_filename (str) – filename of POSCAR

Returns:

Structure Object with Mulliken and Loewdin total grosspopulations as site properties.

class Icohplist(are_coops: bool = False, are_cobis: bool = False, filename: str | None = None, is_spin_polarized: bool = False, orbitalwise: bool = False, icohpcollection=None)[source]

Bases: MSONable

Class to read ICOHPLIST/ICOOPLIST files generated by LOBSTER.

are_coops[source]

Indicates whether the object is consisting of COOPs.

Type:

bool

is_spin_polarized[source]

Boolean to indicate if the calculation is spin polarized.

Type:

bool

Icohplist[source]

Dict containing the listfile data of the form: {

bond: “length”: bond length, “number_of_bonds”: number of bonds “icohp”: {Spin.up: ICOHP(Ef) spin up, Spin.down: …}

}

Type:

dict[str, Dict[str, Union[float, int, Dict[Spin, float]]]]

IcohpCollection[source]

IcohpCollection Object.

Type:

IcohpCollection

Parameters:
  • are_coops – Determines if the file is a list of ICOOPs. Defaults to False for ICOHPs.

  • are_cobis – Determines if the file is a list of ICOBIs. Defaults to False for ICOHPs.

  • filename – Name of the ICOHPLIST file. If it is None, the default file name will be chosen, depending on the value of are_coops

  • is_spin_polarized – Boolean to indicate if the calculation is spin polarized

  • icohpcollection – IcohpCollection Object

property icohpcollection[source]

IcohpCollection object.

Type:

Returns

property icohplist: dict[Any, dict[str, Any]][source]

icohplist compatible with older version of this class.

Type:

Returns

class LobsterMatrices(e_fermi=None, filename: str = 'hamiltonMatrices.lobster')[source]

Bases: object

Class to read Matrices file generated by LOBSTER (e.g. hamiltonMatrices.lobster).

for filename == "hamiltonMatrices.lobster"
onsite_energies[source]

List real part of onsite energies from the matrices each k-point.

Type:

list[np.arrays]

average_onsite_energies[source]

dict with average onsite elements energies for all k-points with keys as basis used in the LOBSTER computation (uses only real part of matrix).

Type:

dict

hamilton_matrices[source]

dict with the complex hamilton matrix at each k-point with k-point and spin as keys

Type:

dict[np.arrays]

for filename == "coefficientMatrices.lobster"
onsite_coefficients[source]

List real part of onsite coefficients from the matrices each k-point.

Type:

list[np.arrays]

average_onsite_coefficient[source]

dict with average onsite elements coefficients for all k-points with keys as basis used in the LOBSTER computation (uses only real part of matrix).

Type:

dict

coefficient_matrices[source]

dict with the coefficients matrix at each k-point with k-point and spin as keys

Type:

dict[np.arrays]

for filename == "transferMatrices.lobster"
onsite_transfer[source]

List real part of onsite transfer coefficients from the matrices at each k-point.

Type:

list[np.arrays]

average_onsite_transfer[source]

dict with average onsite elements transfer coefficients for all k-points with keys as basis used in the LOBSTER computation (uses only real part of matrix).

Type:

dict

transfer_matrices[source]

dict with the coefficients matrix at each k-point with k-point and spin as keys

Type:

dict[np.arrays]

for filename == "overlapMatrices.lobster"
onsite_overlaps[source]

List real part of onsite overlaps from the matrices each k-point.

Type:

list[np.arrays]

average_onsite_overlaps[source]

dict with average onsite elements overlaps for all k-points with keys as basis used in the LOBSTER computation (uses only real part of matrix).

Type:

dict

overlap_matrices[source]

dict with the overlap matrix at each k-point with k-point as keys

Type:

dict[np.arrays]

Parameters:
  • filename – filename for the hamiltonMatrices file, typically “hamiltonMatrices.lobster”.

  • e_fermi – fermi level in eV for the structure only

  • data (relevant if input file contains hamilton matrices) –

class Lobsterout(filename: str | None, **kwargs)[source]

Bases: MSONable

Class to read in the lobsterout and evaluate the spilling, save the basis, save warnings, save infos.

basis_functions[source]

List of basis functions that were used in lobster run as strings.

Type:

list[str]

basis_type[source]

List of basis type that were used in lobster run as strings.

Type:

list[str]

charge_spilling[source]

List of charge spilling (first entry: result for spin 1, second entry: result for spin 2 or not present).

Type:

list[float]

dft_program[source]

String representing the DFT program used for the calculation of the wave function.

Type:

str

elements[source]

List of strings of elements that were present in lobster calculation.

Type:

list[str]

has_charge[source]

Whether CHARGE.lobster is present.

Type:

bool

has_cohpcar[source]

Whether COHPCAR.lobster and ICOHPLIST.lobster are present.

Type:

bool

has_madelung[source]

Whether SitePotentials.lobster and MadelungEnergies.lobster are present.

Type:

bool

has_coopcar[source]

Whether COOPCAR.lobster and ICOOPLIST.lobster are present.

Type:

bool

has_cobicar[source]

Whether COBICAR.lobster and ICOBILIST.lobster are present.

Type:

bool

has_doscar[source]

Whether DOSCAR.lobster is present.

Type:

bool

has_doscar_lso[source]

Whether DOSCAR.LSO.lobster is present.

Type:

bool

has_projection[source]

Whether projectionData.lobster is present.

Type:

bool

has_bandoverlaps[source]

Whether bandOverlaps.lobster is present.

Type:

bool

has_density_of_energies[source]

Whether DensityOfEnergy.lobster is present.

Type:

bool

has_fatbands[source]

Whether fatband calculation was performed.

Type:

bool

has_grosspopulation[source]

Whether GROSSPOP.lobster is present.

Type:

bool

info_lines[source]

String with additional infos on the run.

Type:

str

info_orthonormalization[source]

String with infos on orthonormalization.

Type:

str

is_restart_from_projection[source]

Boolean that indicates that calculation was restarted from existing projection file.

Type:

bool

lobster_version[source]

String that indicates Lobster version.

Type:

str

number_of_spins[source]

Integer indicating the number of spins.

Type:

int

number_of_threads[source]

Integer that indicates how many threads were used.

Type:

int

timing[source]

Dictionary with infos on timing.

Type:

dict[str, float]

total_spilling[source]

List of values indicating the total spilling for spin channel 1 (and spin channel 2).

Type:

list[float]

warning_lines[source]

String with all warnings.

Type:

str

Parameters:
  • filename – filename of lobsterout.

  • **kwargs – dict to initialize Lobsterout instance

as_dict()[source]

MSONable dict

get_doc()[source]

Returns: LobsterDict with all the information stored in lobsterout.

class MadelungEnergies(filename: str = 'MadelungEnergies.lobster', ewald_splitting: float | None = None, madelungenergies_mulliken: float | None = None, madelungenergies_loewdin: float | None = None)[source]

Bases: MSONable

Class to read MadelungEnergies.lobster files generated by LOBSTER.

madelungenergies_mulliken[source]

Float that gives the Madelung energy based on the Mulliken approach.

Type:

float

madelungenergies_loewdin[source]

Float that gives the Madelung energy based on the Loewdin approach.

Type:

float

ewald_splitting[source]

Ewald splitting parameter to compute SitePotentials.

Type:

float

Parameters:

filename – filename of the “MadelungEnergies.lobster” file.

property madelungenergies_Loewdin[source]
property madelungenergies_Mulliken[source]
class NciCobiList(filename: str | None = 'NcICOBILIST.lobster')[source]

Bases: object

Class to read NcICOBILIST (multi-center ICOBI) files generated by LOBSTER.

is_spin_polarized[source]

Boolean to indicate if the calculation is spin polarized.

Type:

bool

NciCobiList[source]

Dict containing the listfile data of the form:

Type:

dict

{bond

“number_of_atoms”: number of atoms involved in the multi-center interaction, “ncicobi”: {Spin.up: Nc-ICOBI(Ef) spin up, Spin.down: …}}, “interaction_type”: type of the multi-center interaction

Parameters:

filename – Name of the NcICOBILIST file.

property ncicobi_list: dict[Any, dict[str, Any]][source]

ncicobilist.

Type:

Returns

class SitePotential(filename: str = 'SitePotentials.lobster', ewald_splitting: float | None = None, num_atoms: int | None = None, atomlist: list[str] | None = None, types: list[str] | None = None, sitepotentials_loewdin: list[float] | None = None, sitepotentials_mulliken: list[float] | None = None, madelungenergies_mulliken: float | None = None, madelungenergies_loewdin: float | None = None)[source]

Bases: MSONable

Class to read SitePotentials.lobster files generated by LOBSTER.

atomlist[source]

List of atoms in SitePotentials.lobster.

Type:

list[str]

types[source]

List of types of atoms in SitePotentials.lobster.

Type:

list[str]

num_atoms[source]

Number of atoms in SitePotentials.lobster.

Type:

int

sitepotentials_mulliken[source]

List of Mulliken potentials of sites in SitePotentials.lobster.

Type:

list[float]

sitepotentials_loewdin[source]

List of Loewdin potentials of sites in SitePotentials.lobster.

Type:

list[float]

madelungenergies_mulliken[source]

Float that gives the Madelung energy based on the Mulliken approach.

Type:

float

madelungenergies_loewdin[source]

Float that gives the Madelung energy based on the Loewdin approach.

Type:

float

ewald_splitting[source]

Ewald Splitting parameter to compute SitePotentials.

Type:

float

Parameters:
  • filename – filename for the SitePotentials file, typically “SitePotentials.lobster”

  • ewald_splitting – ewald splitting parameter used for computing madelung energies

  • num_atoms – number of atoms in the structure

  • atomlist – list of atoms in the structure

  • types – list of unique atom types in the structure

  • sitepotentials_loewdin – Loewdin site potential

  • sitepotentials_mulliken – Mulliken site potential

  • madelungenergies_loewdin – Madelung energy based on the Loewdin approach

  • madelungenergies_mulliken – Madelung energy based on the Mulliken approach

get_structure_with_site_potentials(structure_filename)[source]

Get a Structure with Mulliken and Loewdin charges as site properties

Parameters:

structure_filename – filename of POSCAR

Returns:

Structure Object with Mulliken and Loewdin charges as site properties.

property madelungenergies_Loewdin[source]
property madelungenergies_Mulliken[source]
property sitepotentials_Loewdin[source]
property sitepotentials_Mulliken[source]
class Wavefunction(filename, structure)[source]

Bases: object

Class to read in wave function files from Lobster and transfer them into an object of the type VolumetricData.

grid[source]

Grid for the wave function [Nx+1,Ny+1,Nz+1].

Type:

tuple[int, int, int]

points[source]

List of points.

Type:

list[Tuple[float, float, float]]

real[source]

List of real part of wave function.

Type:

list[float]

imaginary[source]

List of imaginary part of wave function.

Type:

list[float]

distance[source]

List of distance to first point in wave function file.

Type:

list[float]

Parameters:
  • filename – filename of wavecar file from Lobster

  • structure – Structure object (e.g., created by Structure.from_file(“”)).

get_volumetricdata_density()[source]

Will return a VolumetricData object including the imaginary part of the wave function.

Returns:

VolumetricData

get_volumetricdata_imaginary()[source]

Will return a VolumetricData object including the imaginary part of the wave function.

Returns:

VolumetricData

get_volumetricdata_real()[source]

Will return a VolumetricData object including the real part of the wave function.

Returns:

VolumetricData

set_volumetric_data(grid, structure)[source]

Will create the VolumetricData Objects.

Parameters:
  • grid – grid on which wavefunction was calculated, e.g. [1,2,2]

  • structure – Structure object

write_file(filename='WAVECAR.vasp', part='real')[source]

Will save the wavefunction in a file format that can be read by VESTA This will only work if the wavefunction from lobster was constructed with: “printLCAORealSpaceWavefunction kpoint 1 coordinates 0.0 0.0 0.0 coordinates 1.0 1.0 1.0 box bandlist 1 2 3 4 5 6 ” or similar (the whole unit cell has to be covered!).

Parameters:
  • filename – Filename for the output, e.g., WAVECAR.vasp

  • part – which part of the wavefunction will be saved (“real” or “imaginary”)

get_orb_from_str(orbs)[source]
Parameters:

orbs – list of two or more str, e.g. [“2p_x”, “3s”].

Returns:

list of tw Orbital objects