This is a simple implementation of molecular dynamics simulation in Rust. This code is by no means highly optimized for performance, but it is a good starting point for learning about molecular dynamics and Rust.
This was craeted as a process to learn Rust and how to implement a molecular dynamics simulation. The reference code for the same implementation in C. More details on the original code will be added later after confirmation from the original author.
- OS: macOS Sequoia 15.4
- CPU: Apple M3 Pro
- RAM: 34 GB
- Rust: 1.86.0 (05f9846f8 2025-03-31)
- Cargo: 1.86.0 (adf9b6ad1 2025-02-28)
The code is complete and runs a simple molecular dynamics simulation. The code is optimised to a certain extent, but there might be some performance improvements that can be made. This code is not intended to be a high-performance implementation, but rather a simple and easy to understand implementation of molecular dynamics.
- Clone the repository
cd mol_dyn_rust
- Build the code
cargo build --release
- The code requires an input file called
input.dat
in the current directory.
cp input.dat mol_dyn_rust/target/release
- Run the code
cd target/release
./mol_dyn_rust input.dat
- The code will generate files called
output.dat*00
in the current directory. The * is a number from 0 to 9. The files contain the current state of the simulation at each time step.
Amartya Yadav,
MSc High Performance Computing,
EPCC, University of Edinburgh, UK.
This code is licensed under the MIT License. The original code and its license details will be added later.