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.

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

Bases: pymatgen.analysis.chemenv.coordination_environments.structure_environments.LightStructureEnvironments

Class to store LightStructureEnvironments based on Lobster outputs

Constructor for the LightStructureEnvironments object.

  • 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).


Bson-serializable dict representation of the LightStructureEnvironments object. :return: Bson-serializable dict representation of the LightStructureEnvironments object.

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

will set up a LightStructureEnvironments from Lobster :param structure: Structure object :param list_ce_symbol: list of symbols for coordination environments :param list_csm: list of continous symmetry measures :param list_permutation: list of permutations :param list_neighsite: list of neighboring sites :param list_neighisite: list of neighboring isites (number of a site) :param valences: list of valences

Returns: LobsterLightStructureEnvironments

property uniquely_determines_coordination_environments[source]

True if the coordination environments are uniquely determined.

class LobsterNeighbors(are_coops=False, filename_ICOHP=None, valences=None, limits=None, structure=None, additional_condition=0, only_bonds_to=None, perc_strength_ICOHP=0.15, valences_from_charges=False, filename_CHARGE=None)[source]

Bases: pymatgen.analysis.local_env.NearNeighbors

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

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

  • so far (ICOHPLIST.lobster) –

  • filename_ICOHP – (str) Path to ICOOPLIST.lobster

  • valences – (list of integers/floats) gives valence/charge for each element

  • limits – limit to decide which ICOHPs should be considered

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

  • pymatgen.core.structure) (from) –


  • only_bonds_to – (list of 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) –

  • strongest ICOHP) (the) –

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

  • instead of valences (Mulliken)) –

  • filename_CHARGE – (str) Path to Charge.lobster

get_info_cohps_to_neighbors(path_to_COHPCAR='COHPCAR.lobster', isites=[], only_bonds_to=None, onlycation_isites=True, per_bond=True, summed_spin_channels=False)[source]

will return info about the cohps from all sites mentioned in isites with neighbors :param path_to_COHPCAR: str, path to COHPCAR :param isites: list of int that indicate the number of the site :param only_bonds_to: list of str, e.g. [“O”] to only show cohps of anything to oxygen :param onlycation_isites: if isites=[], only cation sites will be returned :param per_bond: will normalize per bond :param summed_spin_channels: will sum all spin channels

Returns: label for cohp (str), CompleteCohp object which describes all cohps of the sites as given by isites and the other parameters

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

will return infos about interactions between neighbors of a certain atom :param isites: list of site ids, if isite==[], all isites will be used :param onlycation_isites: will only use cations, if isite==[]


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

this method will return information of cohps of neighbors :param isites: list of site ids, if isite==[], all isites will be used to add the icohps of the neighbors :param onlycation_isites: will only use cations, if isite==[]


sum of icohps of neighbors to certain sites [given by the id in structure], number of bonds to this site, labels (from ICOHPLIST) for these bonds [the latter is useful for plotting summed COHP plots]


will return a LobsterLightStructureEnvironments object if the structure only contains coordination environments smaller 13 :param only_cation_environments: only data for cations will be returned

Returns: LobsterLightStructureEnvironments Object

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

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

  • structure (Structure) – input structure.

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

  • use_weights (boolean) – 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


coordination number.

Return type

cn (integer or float)

property molecules_allowed[source]

can this NearNeighbors class be used with Molecule objects?


Boolean property

plot_cohps_of_neighbors(path_to_COHPCAR='COHPCAR.lobster', isites=[], onlycation_isites=True, only_bonds_to=None, per_bond=False, summed_spin_channels=False, xlim=None, ylim=[- 10, 6], integrated=False)[source]

will plot summed cohps (please be careful in the spin polarized case (plots might overlap (exactly!)) :param isites: list of site ids, if isite==[], all isites will be used to add the icohps of the neighbors :param onlycation_isites: bool, will only use cations, if isite==[] :param only_bonds_to: list of str, only anions in this list will be considered :param per_bond: bool, will lead to a normalization of the plotted COHP per number of bond if True, :param otherwise the sum: :param will be plotted: :param xlim: list of float, limits of x values :param ylim: list of float, limits of y values :param integrated: bool, if true will show integrated cohp instead of cohp


plt of the cohps

property structures_allowed[source]

can this NearNeighbors class be used with Structure objects?


Boolean property