2 stable releases
Uses new Rust 2024
| 1.0.2 | Mar 20, 2026 |
|---|---|
| 1.0.0 | Mar 17, 2026 |
#396 in Simulation
1.5MB
19K
SLoC
hoomd-rs is a collection of Rust crates that implement particle simulations and related methods. It performs Monte Carlo simulations of hard shapes and interacting particles (both isotropic and anisotropic) as well as molecular dynamics simulations (coming soon!) with a variety of particle interaction. hoomd-rs provides public APIs for vector math, geometric primitives, spatial data structures, energy calculations, and all other components of the simulation that users can employ in their own analysis and simulation methods. You can use hoomd-rs to create real-time interactive visualizations of simulations, execute long-running simulations in batch mode on high performance computing resources, and analyze the results of those simulations.
hoomd-rs is the spiritual successor to the Python package HOOMD-blue. While the two share many common features, hoomd-rs provides many capabilities that HOOMD-blue cannot, such as:
- Custom per-particle attributes.
- Custom particle interactions that can depend on custom per-particle attributes.
- Custom vector representations, including curved spaces.
- Custom MC trial moves and acceptance criteria.
- Custom simulation box geometries (including non-periodic simulation boxes).
- Custom visual representations of simulation elements.
- Build native command line applications on Linux, macOS, and Windows.
- Run real-time interactive simulations on desktop platforms or embedded in a web page.
hoomd-rs does not come with batteries included. It provides built-in implementations only for the most commonly used methods. At the same time, hoomd-rs makes it straightforward for you to customize everything about the simulation while maintaining a high level of performance. Through the use of generics, Rust will inline your custom code all the way to the innermost simulation loops and compile it to optimized machine code.
hoomd-rs lacks GPU parallelization, so it is best for small to moderate sized simulations or when customization is important. For most typical Monte Carlo benchmarks, hoomd-rs is faster than HOOMD-blue when run on a single CPU core. The current hoomd-rs does not scale as well as HOOMD-blue to multiple CPU cores. Future releases will improve multi-core scaling.
HOOMD-blue is best for large simulations of models that rely only on built-in functionality.
Examples
The examples directory contains many files that demonstrate how to use hoomd-rs. To see them live in your browser, navigate to the relevant tutorial in the documentation. The documentation also describes how to run the examples locally.
Resources
- Documentation: User guide and tutorial.
- hoomd-rs discussion board: Ask the hoomd-rs user community for help.
- Template workflow: Start here to use hoomd-rs with row and signac.
Related tools
- Ovito: Visualize simulation trajectories with Ovito.
- gsd: Read simulation trajectories with the gsd Python library.
- freud: Analyze simulation results with the freud Python library.
- signac: Manage your workspace with signac.
- row: Automate your HPC workflow using row.
License
hoomd-rs is available under the 3-clause BSD license.
Dependencies
~18MB
~344K SLoC