DeePMD-kit is a comprehensive, production-grade deep learning package for many-body interatomic potential energy representation and molecular dynamics simulation. It provides a unified framework for training and deploying machine learning interatomic potentials (MLIPs) across multiple backends: TensorFlow, PyTorch, JAX, and PaddlePaddle, with a backend-agnostic core (dpmodel) that ensures numerical consistency. The package supports a wide range of descriptor architectures (SeA, SeR, SeT, DPA1/2/3/4, attention-based, hybrid) and fitting targets (energy, force, virial, dipole, polarizability, density of states, spin, property). It integrates tightly with LAMMPS via custom pair styles and plugins, and also supports ASE, i-PI, GROMACS, and other MD engines. The codebase is highly modular, with a plugin registration system for models, descriptors, and losses, and offers extensive serialization capabilities for model export and compression. Pretrained models (DPA-3, DPA-4) are available for direct download and fine-tuning. The project is actively maintained with a large community, comprehensive test suites, and continuous integration across CPU and GPU platforms.
The Allegro package implements the Allegro E(3)-equivariant machine learning interatomic potential as an extension for the NequIP framework. It provides a neural network architecture that predicts energies and forces in atomic systems while being invariant to translations, rotations, and reflections. The model is built using a combination of scalar and tensor feature tracks, interacting through tensor product layers, and is designed to be strictly local with a configurable cutoff radius. The architecture centers around the `AllegroModel` function, which constructs a graph neural network. Input atomic data (positions, types, and optionally cell) is processed through embedding layers to generate initial scalar and tensor features. These features then pass through multiple Allegro layers, each consisting of tensor product operations (via the `Contracter` module) and mixing layers (MLPs). The final features are reduced to per-atom energies, summed to get the total energy, and forces and stresses are computed via automatic differentiation if requested. Key entry points include the `AllegroModel` function and the package's entry point for NequIP integration. The package relies on external dependencies such as NequIP, PyTorch, and e3nn, with optional accelerations via NVIDIA's CuEquivariance library or custom Triton kernels for GPU performance. The codebase demonstrates strong engineering practices, including performance optimizations for the tensor product bottleneck (through both the base `Contracter` implementation and GPU-accelerated variants), a clear modular structure, and comprehensive testing. Reusable components such as the `Contracter` and `MakeWeightedChannels` modules showcase efficient tensor product handling and feature weighting strategies that could be adapted to other equivariant neural network architectures with minimal modification.