This paper proposes AccelNet, an exact, backward-compatible method for accelerating already-trained aenet and n2p2 neural network potentials without retraining. By replacing explicit neighbor-pair loops with a Cartesian-moment factorization, it reproduces the original model's descriptors, energies, and analytical forces to floating-point rounding precision.
In the descriptor computation pipelines of mainstream neural network potentials, the radial accumulation cost grows linearly with the number of neighbors of a central atom, while the direct angular accumulation scales quadratically with the number of neighbors and requires repeated neighbor-pair traversal loops for each required polynomial order and channel.
The existing public API for Chebyshev angular descriptors offers three evaluation modes: direct, moment, and automatic. The current automatic selection strategy uses the direct enumeration path when the number of angular neighbors is below 16, and switches to the moment evaluation path when the number of neighbors reaches 16 or above. For the supported n2p2 angular functions, moment evaluation is used by default when the positive integer order satisfies ζ≤10, while unsupported orders automatically fall back to direct enumeration mode; as a result, a single model may run both computation paths simultaneously during inference.
The core positioning of this work is not to design a new descriptor family, but to identify and exploit the hidden finite-rank structure in widely used polynomial angular descriptors, thereby constructing a fully exact, backward-compatible evaluation acceleration algorithm.
The method targets angular terms with separable per-neighbor weights and finite polynomial dependence on cosθ, mining their hidden finite-rank structure and replacing the explicit loop over all neighbor pairs in the original computation with accumulations of per-neighbor Cartesian moments. AccelNet directly reads the native model files trained by both frameworks; its output descriptors, system energies, and analytical forces differ from the original implementation only at the level of floating-point rounding error, fully preserving all precision characteristics of the original models.
In the Cartesian moment factorization, the neighbor-pair summands of the traditional implementation and the rewritten moment expressions contain exactly the same set of terms, with no additional approximations introduced.
For a fixed polynomial order, the transformed Cartesian moments need only be accumulated in a single loop over all neighbors of the target atom; the total number of moments is determined by the maximum polynomial order and is independent of the total number of neighbors of the target atom. This converts the original quadratic-complexity operation of enumerating all neighbor pairs into a moment accumulation whose cost grows only linearly with the number of neighbors, achieving a reduction in complexity order.
The Cartesian separation operation used by Chebyshev angular descriptors can be applied term by term to each term of the expansion, constructing the corresponding per-species Cartesian moments.
There is no absolute, universal superiority between the two computation schemes. When the cutoff radius is enlarged or the local atomic density increases, the number of neighbors of a target atom rises accordingly: the cost of direct neighbor-pair enumeration grows quadratically with , while the cost of moment accumulation grows only linearly with . Conversely, when the maximum polynomial order is increased, the cost of direct enumeration rises approximately linearly, while the number of three-dimensional Cartesian moments grows with on the order of . Ignoring implementation-dependent constant factors, the ratio of the dominant costs of the two schemes is approximately proportional to .
For the tested Chebyshev models, after replacing the explicit pair summation with moment contraction, the energy results differ from the original implementation only within the precision of the comparison output, with a maximum force difference of about eV/Å; the n2p2 model comparison results also fully match the precision of the LAMMPS log and dump files. These differences arise entirely from changes in floating-point reduction order and cause no detectable alteration to the learned potential energy surface. You can use the figure immediately following to visually compare the wall-time differences of 500-step molecular dynamics simulations across the three test systems under different implementation schemes.
Backward compatibility requires far more than numerical equality of the angular kernel itself: the replacement evaluator must fully preserve the entire mapping from atomic configurations to model energies and forces, covering all computational conventions surrounding the angular expressions. This equivalence verification compared the loaded models at four levels: descriptors, derivatives, energies, and forces. Results differing only at rounding level demonstrate that the rewritten implementation can serve directly as a plug-and-play evaluator for trained aenet and n2p2 models, rather than merely reproducing isolated angular summation results.
The study decomposes the total speedup ratio into an engine-optimization gain and the moment-contraction gain of the algorithm itself. For the TiO2 Chebyshev test system, the moment-contraction path is 3.629x faster than the optimized direct evaluation scheme; the initial configuration of this system has on average 92 angular neighbors and 4187 angular pairs per atom, and the end-to-end speedup relative to the native aenet implementation is 11.618x, decomposable into the product of a 3.201x gain from engine optimization and a 3.629x gain from the moment-contraction algorithm. You can use the figure immediately following to view the log-scale wall-time speedup distributions corresponding to different optimization combinations across the three test systems.
AccelNet's exact factorization has clear applicability prerequisites: the two-neighbor dependence must be introduced through a finite polynomial in cos , and the remaining neighbor weights must be separable between j and k. Chebyshev angular descriptors and the supported n2p2 functions with positive integer powers satisfy this condition, whereas angular functions with non-separable dependence on , non-integer angular power functions, and general non-polynomial kernel functions do not. For such unsupported terms, AccelNet does not replace the original function with an approximation; instead, it retains the direct computation logic, fully preserving all behavior of the original model.
AccelNet's source code, model conversion tools, and LAMMPS interface have been publicly released. The main code is distributed under the MIT license, while the retained cell-list source code derived from aenet and the LAMMPS pair-potential source code retain their respective MPL-2.0 and GPL-2.0 licenses, with complete license statements included in the repository.