Skip to main content

bonds()

List bond distances.

Usage

Source

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

    >>> import autogeom
    >>> geo = autogeom.Geometry(
    ...     symbols=["O", "H", "H"],
    ...     coordinates=[[0, 0, 0], [1, 0, 0], [0, 1, 0]],
    ...     charge=0,
    ...     spin=0,
    ... )
    >>> b = autogeom.bonds(geo, autogeom.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)]