pymatgen.core.bonds module

class CovalentBond(site1, site2)[source]

Bases: object

Defines a covalent bond between two sites.

Initializes a covalent bond between two sites.

Parameters:
  • site1 (Site) – First site.
  • site2 (Site) – Second site.
static is_bonded(site1, site2, tol=0.2, bond_order=None, default_bl=None)[source]

Test if two sites are bonded, up to a certain limit.

Parameters:
  • site1 (Site) – First site
  • site2 (Site) – Second site
  • tol (float) – Relative tolerance to test. Basically, the code checks if the distance between the sites is less than (1 + tol) * typical bond distances. Defaults to 0.2, i.e., 20% longer.
  • bond_order – Bond order to test. If None, the code simply checks against all possible bond data. Defaults to None.
  • default_bl – If a particular type of bond does not exist, use this bond length. If None, a ValueError will be thrown.
Returns:

Boolean indicating whether two sites are bonded.

length

Length of the bond.

get_bond_length(sp1, sp2, bond_order=1)[source]

Get the bond length between two species.

Parameters:
  • sp1 (Specie) – First specie.
  • sp2 (Specie) – Second specie.
  • bond_order – For species with different possible bond orders, this allows one to obtain the bond length for a particular bond order. For example, to get the C=C bond length instead of the C-C bond length, this should be set to 2. Defaults to 1.
Returns:

Bond length in Angstrom. If no data is available, the sum of the atomic radii is used.