PackSim: Fast and Open Crystal Alignment
Abstract
Advances in machine learning are accelerating molecular crystal structure prediction (CSP), increasing the need for fast, interpretable evaluation of candidate structures. Existing comparators can be costly to run at scale or provide limited feedback on differences in molecular packing. We present PackSim, a fast, open-source crystal comparator with a Python interface and a parallel Rust backend. PackSim aligns molecular packing shells with a single rigid-body motion and reports a root-mean-square deviation (RMSD) together with the number of matched molecules. We formalize shell comparison as a truncated, isomorphism-corrected RMSD objective with penalties for unmatched components, and approximate it through coarse-to-fine alignment and connectivity-preserving atom matching. We evaluate PackSim on controlled perturbations, experimental crystal structures, generative CSP predictions, and submissions to the seventh CSP blind test. On 500 experimental crystal pairs with 15-molecule shells, PackSim reduces median latency relative to COMPACK by a factor of 1.6 on one worker thread, with further reductions through parallel execution. It agrees with COMPACK on 95.0% of within-family match decisions and 94.7% of blind-test solve decisions. PackSim makes alignment-based evaluation more accessible and efficient while retaining structural overlays for diagnosing prediction errors. Code is available at https://anonymous.4open.science/r/packsim-408E/README.md