If the result is not null, b j > 0, then there is a shared bit in Q j that is not in Q \j and these bits induce the desired partition. This calculation, as it does not commute, can be repeated with the operands reversed to determine if there are any bits in Q \j that can induce the partition as well. This approach, as it does not require an iterative bit search and instead calculates the difference directly, means that b j can potentially contain a complex set of SMARTS information that would be been infeasible to find using the numerical approach, for example if b j ≈ n/2 where n is the number of total bits to search in Q 0 . Additionally, this method easily finds bits that are in extended chemical environments if Q j , and by extension b j , has more nodes than the SMARTS S 0 we are splitting. If there is a difference in the groups as computed by Eqn. 16, the analytic approach will rapidly find it. However, we should note that this is a relatively simplistic approach, and does not work for all cases. For example, since the difference is defined using a single mapping there are potentially other mappings that are valid and would give a different result but are missed. It is possible to consider all valid mappings of Q \j and Q j , but doing so introduces a graph isomorphism search. Pursuing such searches adds to the complexity and must be carefully designed such that it does not far exceed the computational requirements of the numerical search method. Regardless, the analytical search method presented here is powerful if the number of chemical environments is small. In such cases, it is possible to enumerate all possible partitions and directly compute the SMARTS for each. This approach additionally excels when the task is to cluster chemical environments according to some existing labels (see Sec. VI A and Sec. VI B in the Results). The labels define the partitions, and we can therefore apply the direct search approach to rapidly find new SMARTS patterns when the numerical search would be costlier.