Skip to main content

adjacency_matrix()

Determine connectivity from covalent radii.

Usage

Source

adjacency_matrix(
    geo,
    *,
    sigma=1.3,
    flood_fill=False,
    enforce_valence=False,
)

Two atoms are bonded if their distance is less than sigma times the sum of their covalent radii.

Parameters

geo: Geometry

Geometry.

sigma: float = 1.3

Scaling factor for the sum of covalent radii.

flood_fill: bool = False

If True, increase sigma in steps of 0.05 until the molecule is a single fragment, or until no more bonds can be added.

enforce_valence: bool = False
If True, cap the bonds to each atom at autogeom.rd.max_bond_count. Bonds are accepted shortest first, relative to the sum of covalent radii, so the result does not depend on atom order.

Returns

np.ndarray
Symmetric 0/1 adjacency matrix, shape (N, N).