nvalchemi.csp.chem.topological_atom_types_from_mol#

nvalchemi.csp.chem.topological_atom_types_from_mol(mol)[source]#

Group RDKit atoms by their element-and-bond connectivity.

Parameters:

mol (rdkit.Chem.rdchem.Mol) – Molecule whose explicit atoms and bond presence define the graph. Atom and bond annotations other than atomic number and bond presence are ignored; implicit hydrogens are not added.

Returns:

CPU type IDs in RDKit atom order. IDs are local to this molecule and assigned by first atom occurrence; separate molecules need a shared type mapping before cross-structure comparison.

Return type:

torch.Tensor, dtype torch.int32, shape [N]

Raises:
  • OptionalDependencyError – If RDKit is unavailable. Install nvalchemi-toolkit[rdkit].

  • TypeError – If mol is not an RDKit molecule.

See also

topological_atom_types_from_connectivity

The same typing from explicit atomic numbers and bond connections.