Geometry#

autode.geom.are_coords_reasonable(coords: ndarray) bool#

Determine if a set of coords are reasonable. No distances can be < 0.7 Å and if there are more than 4 atoms ensure they do not all lie in the same plane. The latter possibility arises from RDKit’s conformer generation algorithm breaking

Return type:

bool

autode.geom.calc_heavy_atom_rmsd(atoms1: Atoms, atoms2: Atoms) float#

Calculate the RMSD between two sets of atoms considering only the ‘heavy’ atoms, i.e. the non-hydrogen atoms

Parameters:

atoms2 (list(autode.atoms.Atom)) –

Returns:

RMSD between the two sets

Return type:

(float)

autode.geom.calc_rmsd(coords1: ndarray, coords2: ndarray) float#

Calculate the RMSD between two sets of coordinates using the Kabsch algorithm

Parameters:

coords2 (np.ndarray) – shape = (n ,3)

Returns:

Root mean squared distance

Return type:

(float)

autode.geom.get_neighbour_list(species: Species, atom_i: int, index_set: Sequence[int]) Sequence[int]#

Calculate a neighbour list from atom i as a list of atom labels

Parameters:
  • species (autode.species.Species) –

  • index_set (set(int) | None) – Indexes that are possible neighbours for atom_i, if None then all atoms are ok

Returns:

list of atom ids in ascending distance away from i

Return type:

(list(int))

autode.geom.get_points_on_sphere(n_points: int, r: float = 1) List[ndarray]#

Find n evenly spaced points on a sphere using the “How to generate equidistributed points on the surface of a sphere” by Markus Deserno, 2004.

Parameters:

r (float) – radius of the sphere

Returns:

(list(np.ndarray))

autode.geom.get_rot_mat_euler(axis: ndarray, theta: float | Angle) ndarray#

Compute the 3D rotation matrix using the Euler Rodrigues formula https://en.wikipedia.org/wiki/Euler–Rodrigues_formula for an anticlockwise rotation of theta radians about a given axis

Parameters:

theta (float) – Angle in radians (float)

Returns:

Rotation matrix. shape = (3, 3)

Return type:

(np.ndarray)

autode.geom.get_rot_mat_euler_from_terms(a: float, b: float, c: float, d: float) ndarray#

3D rotation matrix from terms unique terms in the matrix

autode.geom.get_rot_mat_kabsch(p_matrix: ndarray, q_matrix: ndarray) ndarray#

Get the optimal rotation matrix with the Kabsch algorithm. Notation is from https://en.wikipedia.org/wiki/Kabsch_algorithm

Parameters:

q_matrix (np.ndarray) –

Returns:

rotation matrix

Return type:

(np.ndarray)

autode.geom.proj(u: ndarray, v: ndarray) ndarray#

Calculate the projection of v onto the direction of u. Useful for https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process

Parameters:

v (np.ndarray) –

Returns:

proj_u(v)

Return type:

(np.ndarray)

autode.geom.symm_matrix_from_ltril(array: Sequence[float] | Sequence[Sequence[float]]) ndarray#

Construct a symmetric matrix from the lower triangular elements e.g.:

array = [0, 1, 2] ->  array([[0, 1],
                             [1, 2]])
Return type:

(np.ndarray)