2025
Skipping force calculations in molecular dynamics
I trained neural networks to stand in for most of the force calculations in a molecular simulation, with a physics correction every so often. It needed about 20 times fewer force calls at a mean bond-length error of 0.036 Å.
The idea
Most of the cost of a molecular dynamics simulation is calculating forces at every step. I trained neural networks to predict where the atoms go next, and built a hybrid integrator that runs on those predictions and periodically corrects them with a real physics calculation.
Models and data
I compared E(3)-equivariant networks with Transformer architectures in PyTorch, and built the whole pipeline myself: data generation, training and trajectory analysis. The training data came from simulations of 12 drug-like molecules with OpenMM molecular mechanics, and a separate set of 41 molecules with quantum mechanical methods (xTB and PySCF). I ran training across several machines.
Accuracy
With roughly 20 times fewer force calls, the Transformer model kept a mean bond-length error of 0.036 Å and an angle error of 3.8° across the 12 molecular-mechanics molecules. Radial distribution functions matched the reference closely, with an L1 error of about 0.034. Correcting less often raised the bond error, from 0.032 Å with a correction every 10 steps to 0.048 Å with one every 40, while the angle error stayed close to 3.6–3.8°.
Speed, honestly
Fewer force calls didn’t always mean a faster simulation. With OpenMM and xTB, running the model cost more time than the force calculations it saved. The one case that came out ahead in wall-clock time was a small quantum chemistry benchmark: ethylamine with PySCF on CPU ran in 51.3 s instead of 142.1 s, about 2.8 times faster. Some quantum mechanical runs also failed often. The method pays off where each force call is expensive, and the project showed where that line is.