geometry
#
Compute internal coordinates (e.g. bond lengths).
Modules:
-
smee–Differentiably evaluate energies of molecules using SMIRNOFF force fields
Functions:
-
compute_bond_vectors–Computes the vectors between each atom pair specified by the
atom_indicesas -
compute_angles–Computes the angles [rad] between each atom triplet specified by the
-
compute_dihedrals–Computes the dihedral angles [rad] between each atom quartet specified by the
-
polar_to_cartesian_coords–Converts a set of polar coordinates into cartesian coordinates.
-
compute_v_site_coords–Computes the positions of a set of virtual sites relative to a specified
-
add_v_site_coords–Appends the coordinates of any virtual sites to a conformer (or batch of
compute_bond_vectors
#
Computes the vectors between each atom pair specified by the atom_indices as
well as their norms.
Parameters:
-
conformer(Tensor) –The conformer [Å] to compute the bond vectors for with
shape=(n_atoms, 3)orshape=(n_confs, n_atoms, 3). -
atom_indices(Tensor) –The indices of the atoms involved in each bond with
shape=(n_bonds, 2)
Returns:
-
tuple[Tensor, Tensor]–The bond vectors and their norms [Å].
Source code in smee/geometry.py
compute_angles
#
Computes the angles [rad] between each atom triplet specified by the
atom_indices.
Parameters:
-
conformer(Tensor) –The conformer [Å] to compute the angles for with
shape=(n_atoms, 3)orshape=(n_confs, n_atoms, 3). -
atom_indices(Tensor) –The indices of the atoms involved in each angle with
shape=(n_angles, 3).
Returns:
-
Tensor–The valence angles [rad].
Source code in smee/geometry.py
compute_dihedrals
#
Computes the dihedral angles [rad] between each atom quartet specified by the
atom_indices.
Parameters:
-
conformer(Tensor) –The conformer [Å] to compute the dihedral angles for with
shape=(n_atoms, 3)orshape=(n_confs, n_atoms, 3). -
atom_indices(Tensor) –The indices of the atoms involved in each dihedral angle with
shape=(n_dihedrals, 4).
Returns:
-
Tensor–The dihedral angles [rad].
Source code in smee/geometry.py
polar_to_cartesian_coords
#
Converts a set of polar coordinates into cartesian coordinates.
Parameters:
-
polar_coords(Tensor) –The polar coordinates with
shape=(n_coords, 3)and with columns of distance [Å], 'in plane angle' [rad] and 'out of plane' angle [rad].
Returns:
-
Tensor–An array of the cartesian coordinates with
shape=(n_coords, 3)and units of [Å].
Source code in smee/geometry.py
compute_v_site_coords
#
compute_v_site_coords(
v_sites: VSiteMap,
conformer: Tensor,
force_field: TensorForceField,
) -> Tensor
Computes the positions of a set of virtual sites relative to a specified conformer or batch of conformers.
Parameters:
-
v_sites(VSiteMap) –A mapping between the virtual sites to add and their corresponding force field parameters.
-
conformer(Tensor) –The conformer(s) to add the virtual sites to with
shape=(n_atoms, 3)orshape=(n_batches, n_atoms, 3)and units of [Å]. -
force_field(TensorForceField) –The force field containing the virtual site parameters.
Returns:
-
Tensor–A tensor of virtual site positions [Å] with
shape=(n_v_sites, 3)orshape=(n_batches, n_v_sites, 3).
Source code in smee/geometry.py
add_v_site_coords
#
add_v_site_coords(
v_sites: VSiteMap,
conformer: Tensor,
force_field: TensorForceField,
) -> Tensor
Appends the coordinates of any virtual sites to a conformer (or batch of conformers) containing only atomic coordinates.
Notes
- This function only supports appending v-sites to the end of the list of coordinates, and not interleaving them between existing atomic coordinates.
Parameters:
-
v_sites(VSiteMap) –A mapping between the virtual sites to add and their corresponding force field parameters.
-
conformer(Tensor) –The conformer(s) to add the virtual sites to with
shape=(n_atoms, 3)orshape=(n_batches, n_atoms, 3)and units of [Å]. -
force_field(TensorForceField) –The force field containing the virtual site parameters.
Returns:
-
Tensor–The full conformer(s) with both atomic and virtual site coordinates [Å] with
shape=(n_atoms+n_v_sites, 3)orshape=(n_batches, n_atoms+n_v_sites, 3).