Analysis#
- class lobsterpy.coxx.analyze.Analysis(structure=None, icoxxlist_obj=None, completecoxx_obj=None, charge_obj=None, madelung_obj=None, are_cobis=False, are_coops=False, cutoff_icohp=0.1, noise_cutoff=0.1, orbital_cutoff=0.05, orbital_resolved=False, start=None, summed_spins=True, type_charge='Mulliken', which_bonds='cation-anion')[source]#
Bases:
MSONableClass to automatically analyze COHP/COOP/COBI populations from Lobster.
Can be initialized using either file paths or pymatgen objects. Pymatgen objects will be preferred in case both are supplied.
- Parameters:
are_cobis (bool) – bool indicating if file contains COBI/ICOBI data
are_coops (bool) – bool indicating if file contains COOP/ICOOP data
cutoff_icohp (float) – Cutoff in percentage for evaluating neighbors based on ICOHP values. cutoff_icohp*max_icohp limits the number of considered neighbours for evaluating environments.
charge_obj (Charge | None) – pymatgen lobster.io.charge object
completecoxx_obj (CompleteCohp | None) – pymatgen.electronic_structure.cohp.CompleteCohp object
icoxxlist_obj (Icohplist | None) – pymatgen lobster.io.Icohplist object
madelung_obj (MadelungEnergies | None) – pymatgen lobster.io.MadelungEnergies object
noise_cutoff (float) – Sets the lower limit tolerance for ICOHPs or ICOOPs or ICOBIs considered in analysis.
orbital_cutoff (float) – Sets the minimum percentage for the orbital contribution considered to be relevant in orbital resolved analysis. (Affects only when orbital_resolved argument is set to True) Set it to 0 to get results of all orbitals in the detected relevant bonds. Default is to 0.05 i.e. only analyzes if orbital contribution is 5 % or more.
orbital_resolved (bool) – bool indicating whether orbital wise analysis is performed
type_charge (Literal['Mulliken', 'Loewdin', 'Valences']) – If no charge_obj is provided, Valences will be used (see pymatgen BVAnalyzer). Otherwise, Mulliken charges from CHARGE.lobster are used by default.
which_bonds (Literal['cation-anion', 'all']) – Selects kinds of bonds that are analyzed. cation-anion is the default. Alternatively, all bonds can also be selected. Support to other kinds of bonds will be added soon.
summed_spins (bool) – if True, COHP Spin.up and Spin.down populations will be summed
start (float | None) – sets the lower limit of energy for evaluation of bonding and antibonding percentages below efermi. Defaults to None (i.e., all populations below efermi are included)
structure (Structure | None)
- Variables:
condensed_bonding_analysis (-) – dict including a summary of the most important bonding properties
final_dict_bonds (-) – dict including information on ICOHPs per bond type
final_dict_ions (-) – dict including information on environments of cations
chemenv (-) – pymatgen.io.lobster.lobsterenv.LobsterNeighbors object
lse (-) – LightStructureEnvironment from pymatgen
anion_types (-) – Set of Element objects from pymatgen
list_equivalent_sites (-) – list of site indices of sites that indicate which sites are equivalent e.g., [0 1 2 2 2] where site 0, 1, 2 indicate sites that are independent from each other
seq_cohps (-) – list of cohps
seq_coord_ions (-) – list of co-ordination environment strings for each cation
seq_equivalent_sites (-) – seq of inequivalent sites
seq_ineq_ions (-) – seq of inequivalent cations/sites in the structure
seq_infos_bonds (-) – information on cation anion bonds (lists of pymatgen.io.lobster.lobsterenv.ICOHPNeighborsInfo)
spg (-) – space group information
structure (-) – Structure object
- setup_env()[source]#
Set up the light structure environments based on COHPs using this method.
- Returns:
None
- classmethod from_files(structure_path, icoxxlist_path, coxxcar_path, charge_path=None, madelung_path=None, **kwargs)[source]#
Create Analysis from explicit file paths.
- Parameters:
structure_path (str | Path) – path to structure (e.g., CONTCAR (preferred), POSCAR.lobster or POSCAR)
icoxxlist_path (str | Path) – path to ICOHPLIST.lobster or ICOBILIST.lobster or ICOOPLIST.lobster.
coxxcar_path (str | Path) – path to COHPCAR.lobster or COBICAR.lobster or COOPCAR.lobster .
charge_path (str | Path | None) – path to CHARGE.lobster.
madelung_path (str | Path | None) – path to MadelungEnergies.lobster.
kwargs – Additional arguments passed to Analysis constructor
- Returns:
Analysis object
- Return type:
- classmethod from_directory(path_to_lobster_calc, read_madelung_energies=False, analyze_coops=False, analyze_cobis=False, type_charge='Mulliken', **kwargs)[source]#
Create Analysis from a directory containing LOBSTER calculation files.
- Parameters:
path_to_lobster_calc (str | Path) – Path to directory with LOBSTER calculation files
read_madelung_energies (bool) – Whether to read Madelung energies from file
analyze_coops (bool) – Whether to analyze COOPs instead of COHPs
analyze_cobis (bool) – Whether to analyze COBIs instead of COHPs
type_charge (Literal['Mulliken', 'Loewdin', 'Valences']) – If no charge file is provided, Valences will be used (see pymatgen BVAnalyzer). Otherwise, Mulliken charges from CHARGE.lobster are used by default.
kwargs – Additional arguments passed to Analysis constructor
- Returns:
Analysis object
- Return type:
- as_dict()[source]#
Serialize the Analysis object to a dictionary.
- Returns:
Dictionary representation of the Analysis object
- Return type:
dict
- classmethod from_dict(d)[source]#
Reconstruct an Analysis object from a dictionary.
This method properly handles deserialization of nested pymatgen objects that have @module and @class keys.
- Parameters:
d (dict) – Dictionary representation of the Analysis object
- Returns:
Analysis object
- Return type:
- get_information_all_bonds(summed_spins=True)[source]#
Gather all information on the bonds within the compound with this method.
- Returns:
None
- Parameters:
summed_spins (bool)
- get_site_bond_resolved_labels()[source]#
Return relevant bond labels for each symmetrically independent site.
- Returns:
dict with bond labels for each site, e.g. {‘Na1: Na-Cl’: [‘21’, ‘23’, ‘24’, ‘27’, ‘28’, ‘30’]}
- property charges: list[float]#
Charges used for chemical environment analysis.
List of charges for each site in the structure.
- property completecoxx: CompleteCohp#
Pymatgen CompleteCohp object.
Depending on the type of files read during Analyse class initialization, it can contain COHP, COOP or COBI data.
- property icoxxlist: Icohplist#
Pymatgen Icohplist object.
Depending on the type of files read during Analyse class initialization, it can contain ICOHP, ICOOP or ICOBI data.
- property lobsterneighbors: LobsterNeighbors#
Pymatgen LobsterNeighbors object.
- get_site_orbital_resolved_labels()[source]#
Return relevant orbitals and bond labels for each symmetrically independent site.
- Returns:
dict with bond labels for each site for relevant orbitals, e.g. {‘Na1: Na-Cl’: {‘3p-3s’: {‘bond_labels’: [‘21’, ‘23’, ‘24’, ‘27’, ‘28’, ‘30’], ‘relevant_sub_orbitals’: [‘3py-3s’, ‘3pz-3s’, ‘3px-3s’]}}
- set_condensed_bonding_analysis()[source]#
Condense the bonding analysis into a summary dictionary.
- Returns:
None
- set_summary_dicts()[source]#
Set summary dict that can be used for correlations.
bond_dict that includes information on each bond
“has_antbd” tells if there are antbonding states “ICOHP_mean” shows the mean of all ICOHPs in EV
{‘Yb-Sb’: { ‘has_antbdg’: False, ‘ICOHP_mean’: -1.7448}, ‘Mn-Sb’: { ‘has_antbdg’: True, ‘ICOHP_mean’: -1.525}}
a cation dict that includes all different coordination environments and counts for them {‘Na’: {‘T:4’: 4, ‘A:2’: 4}, ‘Si’: {‘T:6’: 4, ‘PP:6’: 4}}
- Returns:
None