There are two general cases to SMARTS search. In the first case, we do not have any preference for how to partition the chemical environments in A, but we would still like to determine which partitions we can calculate by manipulating Q 0 . The number of manipulations on Q 0 is exponential but fortunately can be enumerated. For n possible manipulations in Q 0 and choose only k, we can find the partitions that are most accessible by performing the minimal manipulations to Q 0 . We refer to this as a numerical search, as it requires an iterative, semiexhaustive search as a function of k bits. Alternatively, there are cases where there is a partition of interest, and we want to know the SMARTS pattern which induces it. This pattern can be directly computed, if it exists, using operations defined in this work. We refer to this approach as the analytical search. We describe both methods below.