Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions pymultiwfn/bonding/bonding.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from ..io import load
from .fuzzy import FuzzyAtom, fuzzy_bond_order, calculate_fuzzy_bond_order_matrix
from .intrinsic import intrinsic_bond_order, calculate_intrinsic_bond_order_matrix, IntrinsicBondResult


class Bonding:
Expand Down Expand Up @@ -114,3 +115,38 @@ def get_fuzzy_bond_order_matrix(self) -> np.ndarray:
self.fuzzy_atoms
)
return self._fuzzy_matrix

def get_intrinsic_bond_order(self, atom_i: int, atom_j: int) -> float:
"""Calculate intrinsic bond order between two atoms.

The intrinsic bond order (IBO) accounts for bond polarity
and provides a measure of the intrinsic covalent character
of a bond.

Args:
atom_i: Index of first atom (0-based)
atom_j: Index of second atom (0-based)

Returns:
Intrinsic bond order value

Raises:
ValueError: If atom indices are invalid
"""
if not (0 <= atom_i < self.natoms and 0 <= atom_j < self.natoms):
raise ValueError(f"Atom indices must be in range [0, {self.natoms})")
if atom_i == atom_j:
raise ValueError("Atom indices must be different")

return intrinsic_bond_order(self.wfn, atom_i, atom_j)

def get_intrinsic_bond_order_matrix(self) -> IntrinsicBondResult:
"""Calculate intrinsic bond order matrix for all atom pairs.

Returns:
IntrinsicBondResult containing:
- bond_order_matrix: NxN matrix of intrinsic bond orders
- polarity_matrix: NxN matrix of bond polarity corrections
- wiberg_matrix: NxN matrix of Wiberg bond orders
"""
return calculate_intrinsic_bond_order_matrix(self.wfn)
Loading
Loading