Skip to main content

geom.bonds()

List bond distances.

Usage

Source

geom.bonds(
    geo,
    amat,
)

Parameters

geo: Geometry

Geometry.

amat: ArrayLike
Adjacency matrix.

Returns

np.ndarray

Sorted rows [z1, z2, distance] with z1 <= z2, shape

(nbonds, 3).

Examples

    >>> geo = Geometry(
    ...     symbols=["O", "H", "H"],
    ...     coordinates=[[0, 0, 0], [1, 0, 0], [0, 1, 0]],
    ...     charge=0,
    ...     spin=0,
    ... )
    >>> b = bonds(geo, adjacency_matrix(geo))
    >>> b.shape
(2, 3)
    >>> [tuple(float(x) for x in row) for row in b]
[(1.0, 8.0, 1.0), (1.0, 8.0, 1.0)]