getSubstructMatches#

nvmolkit.substructure.getSubstructMatches(
targets: Sequence[Mol],
queries: Sequence[Mol],
config: SubstructSearchConfig | None = None,
) SubstructMatchResults#

Perform batch substructure matching on GPU, returning full atom-index mappings.

Supports match deduplication (uniquify) and recursive SMARTS queries. Does not currently support chirality-aware matching (useChirality), enhanced stereochemistry (useEnhancedStereo), or other advanced RDKit SubstructMatchParameters options.

Parameters:
  • targets – List of target RDKit molecules.

  • queries – List of query RDKit molecules (typically from SMARTS).

  • configSubstructSearchConfig with execution settings. If None, uses default configuration.

Returns:

A SubstructMatchResults providing list-like access to match results. Index as results[target_idx][query_idx] to get a list of numpy arrays, each containing the target atom indices for one match.