Abstract: Rigid bodies, made of smaller composite beads, are commonly used to simulate anisotropic particles with molecular dynamics or Monte Carlo methods. To accurately represent the particle shape and to obtain smooth and realistic effective pair interactions between two rigid bodies, each body may need to contain hundreds of spherical beads. Given an interacting pair of particles, traditional MD methods calculate the inter-body distances between the beads of the rigid bodies within a certain distance. For a system containing many anisotropic particles, distance calculations are computationally costly and limit the attainable system size and simulation time. However, the effective interaction between two rigid particles only depends on the distance between their center of masses and their relative orientation. Therefore, a function directly mapping the center of mass distance and orientation to the interaction energy between the two rigid bodies, would completely bypass inter-bead distance calculations. It is challenging to derive such a general function analytically for most non-spherical rigid bodies. We have trained neural nets, powerful tools to fit nonlinear functions to complex datasets, to achieve this task. The pair configuration is taken as input and the energy, forces and torques between two rigid particles are predicted directly. We show that MD simulations of cubes and cylinders performed with forces and torques obtained from the gradients of the energy neural-nets quantitatively match traditional simulations that uses composite rigid bodies. Both structural quantities and dynamic measures are in agreement, while achieving up to 23 times speed up over traditional molecular dynamics, depending on hardware and system size. The method can, in principle, be applied to any irregular shape with any pair interaction, provided that sufficient training data can be obtained.
Introduction
In the field of molecular simulation, particles are frequently modeled as perfect spheres for computational simplicity. However, many systems of interest—ranging from microplastics and colloidal building blocks to complex biological proteins—are inherently anisotropic. To simulate these non-spherical particles, researchers often employ a composite bead approach, where a rigid body is constructed by "gluing" together hundreds of small spherical beads to approximate shapes like cubes or cylinders.
The primary challenge with this approach is the computational bottleneck of distance calculations. To determine the force between two such particles, a simulator must calculate the distance between every bead in particle A and every bead in particle B. For particles composed of 100 beads each, this results in 10,000 distance calculations for a single pair. This $O(N^2)$ scaling significantly limits the attainable system size and simulation time for complex anisotropic models.
Methodology: The Neural Network Shortcut
To overcome this limitation, this research proposes a machine learning framework that bypasses bead-by-bead calculations. Since the interaction between two rigid bodies depends solely on their relative center-of-mass distance and orientation, a function exists that maps these geometric inputs directly to the resulting energy and forces.
Data Generation and Training
The researchers generated a massive dataset of $5 \times 10^7$ samples using traditional, high-fidelity MD simulations (via the HOOMD-blue engine). These simulations utilized a "half-power half-cosine" potential for bead-to-bead interactions, creating a Lennard-Jones-like attraction between the larger composite shapes. The training data spanned temperatures from $0.2 \epsilon/k_B$ to $2.0 \epsilon/k_B$ to capture a wide range of interaction states, from high-energy collisions to low-energy "sticky" configurations.
Architecture and Energy Conservation
Fully connected feed-forward neural networks were trained using the relative position vector and orientation (represented by quaternions) as inputs. A critical innovation in the model for cubes was the use of the gradient trick: instead of training separate networks for force and torque, the authors trained a single network to predict interaction energy ($U$). Forces ($f$) and torques ($\tau$) were then derived by taking the analytical gradients of the predicted energy. This approach ensures that the model strictly obeys the laws of thermodynamics and maintains energy conservation throughout the simulation, preventing the "energy drift" common in direct force-prediction models.
Key Results and Performance
Accuracy and Structural Fidelity
The neural network (NN) models demonstrated remarkable accuracy in capturing the complex, orientation-dependent interaction landscapes of non-spherical particles. As shown in the energy curve comparisons, the NN predictions (squares) quantitatively match the "ground truth" analytical curves (lines) across various orientations.
Furthermore, the NN-assisted simulations quantitatively matched traditional simulations in both structural measures, such as the pair correlation function $g(r)$, and dynamic measures, such as mean square displacement (MSD) and mean rotation. This confirms that the NN effectively "coarse-grains" the interaction without losing essential physical characteristics.
Computational Speedup
The most significant advantage of the NN approach is its speed. On an NVIDIA RTX 2070 GPU, the NN method achieved a 15x to 23x speedup over traditional composite-bead MD. While the speedup on high-end hardware like the A100 was more modest (up to 2.6x), the NN approach also proved to be more memory-efficient, enabling the simulation of larger systems that would otherwise exceed GPU memory limits using traditional rigid-body algorithms.
Conclusion and Future Outlook
This machine learning approach provides a powerful tool for accelerating the study of anisotropic particles. While there is a significant upfront cost in generating training data and training the models, the method is highly beneficial for researchers performing extensive simulations of specific particle geometries. Future work may involve extending this method to long-range interactions, such as electrostatics, and developing more efficient geometric descriptors to further reduce the computational overhead of calculating relative orientations.
Summary updated