pymatgen.electronic_structure.cohp module

class Cohp(efermi, energies, cohp, are_coops=False, icohp=None)[source]

Bases: monty.json.MSONable

Basic COHP object.

Args/attributes:

are_coops: Indicates whether this object describes COHPs or COOPs.

efermi: Fermi energy.

energies: A sequence of energies.

cohp ({Spin: np.array}): representing the COHP for each spin.

icohp ({Spin: np.array}): representing the ICOHP for each spin.

as_dict()[source]

Json-serializable dict representation of COHP.

classmethod from_dict(d)[source]

Returns a COHP object from a dict representation of the COHP.

get_cohp(spin=None, integrated=False)[source]

Returns the COHP or ICOHP for a particular spin.

Parameters:
  • spin – Spin. Can be parsed as spin object, integer (-1/1) or str (“up”/”down”)
  • integrated – Return COHP (False) or ICOHP (True)
Returns:

Returns the CHOP or ICOHP for the input spin. If Spin is None and both spins are present, both spins will be returned as a dictionary.

get_icohp(spin=None)[source]

Convenient alternative to get the ICOHP for a particular spin.

get_interpolated_value(energy, integrated=False)[source]

Returns the COHP for a particular energy.

Parameters:energy – Energy to return the COHP value for.
class CompleteCohp(structure, avg_cohp, cohp_dict, bonds=None, are_coops=False, orb_res_cohp=None)[source]

Bases: pymatgen.electronic_structure.cohp.Cohp

A wrapper class that defines an average COHP, and individual COHPs.

Parameters:
  • structure – Structure assosciated with this COHP.
  • avg_cohp – The average cohp as a COHP object.
  • cohps – A dict of COHP objects for individual bonds of the form {label: COHP}
  • bonds – A dict containing information on the bonds of the form {label: {key: val}}. The key-val pair can be any information the user wants to put in, but typically contains the sites, the bond length, and the number of bonds. If nothing is supplied, it will default to an empty dict.
  • are_coops – indicates whether the Cohp objects are COHPs or COOPs. Defauls to False for COHPs.
  • orb_res_cohp – Orbital-resolved COHPs.
as_dict()[source]

Json-serializable dict representation of CompleteCohp.

classmethod from_dict(d)[source]

Returns CompleteCohp object from dict representation.

classmethod from_file(fmt, filename=None, structure_file=None, are_coops=False)[source]

Creates a CompleteCohp object from an output file of a COHP calculation. Valid formats are either LMTO (for the Stuttgart LMTO-ASA code) or LOBSTER (for the LOBSTER code).

Parameters:
  • cohp_file – Name of the COHP output file. Defaults to COPL for LMTO and COHPCAR.lobster/COOPCAR.lobster for LOBSTER.
  • are_coops – Indicates whether the populations are COOPs or COHPs. Defaults to False for COHPs.
  • fmt – A string for the code that was used to calculate the COHPs so that the output file can be handled correctly. Can take the values “LMTO” or “LOBSTER”.
  • structure_file – Name of the file containing the structure. If no file name is given, use CTRL for LMTO and POSCAR for LOBSTER.
Returns:

A CompleteCohp object.

get_cohp(label, spin=None, integrated=False)[source]

Get specific COHP or ICOHP. If label is not in the COHP labels, try reversing the order of the sites.

Parameters:
  • spin – Spin. Can be parsed as spin object, integer (-1/1) or str (“up”/”down”)
  • integrated – Return COHP (False) or ICOHP (True)
Returns:

Returns the CHOP or ICOHP for the input spin. If Spin is None and both spins are present, both spins will be returned as a dictionary.

get_icohp(label, spin=None)[source]

Convenient alternative to get a specific ICOHP.

get_orbital_resolved_cohp(label, orbitals)[source]

Get orbital-resolved COHP.

Parameters:
  • label – bond label.
  • orbitals – The orbitals as a label, or list or tuple of the form [(n1, orbital1), (n2, orbital2)]. Orbitals can either be str, int, or Orbital.
Returns:

A Cohp object if CompleteCohp contains orbital-resolved cohp, or None if it doesn’t.

Note: It currently assumes that orbitals are str if they aren’t the
other valid types. This is not ideal, but the easiest way to avoid unicode issues between python 2 and python 3.