10 unstable releases (3 breaking)

0.4.2 Feb 12, 2021
0.4.1 Feb 12, 2021
0.3.3 Dec 19, 2020
0.2.1 Dec 15, 2020
0.1.0 Dec 6, 2020

#766 in Science

Download history 16/week @ 2023-10-25 19/week @ 2023-11-01 26/week @ 2023-11-08 17/week @ 2023-11-15 26/week @ 2023-11-22 28/week @ 2023-11-29 19/week @ 2023-12-06 23/week @ 2023-12-13 22/week @ 2023-12-20 21/week @ 2023-12-27 19/week @ 2024-01-03 11/week @ 2024-01-10 11/week @ 2024-01-17 19/week @ 2024-01-24 26/week @ 2024-01-31 16/week @ 2024-02-07

75 downloads per month
Used in 4 crates

MIT license



Crates.io Crates.io Crates.io

Velvet is a classical atomistic simulation engine with a focus on user-friendliness and extensibility. This project is largely a learning exercise, but as development continues I hope to accomplish the following goals:

  • Extensibility via user-defined plugin modules
  • Optimized single CPU performace with multithreading and SIMD support
  • Implement a wide variety of interatomic potentials
  • Molecular dynamics, Monte Carlo, and energy minimization routines
  • Visualization tools to analyze simulation results
  • Support importing and exporting data in popular external formats

Getting Started


To build Velvet you will need to have Rust's compiler and package manager installed on your machine. Instructions for most platforms can be found here.

  • rustc - Compiler for the Rust programming language
  • Cargo - Package manager for the Rust programming language

Velvet has optional support to write HDF5 formatted results. If this is your preferred format, you will need a local installation of libhdf5. The library can be installed with your package manager of choice or downloaded directly from source here.


If you're interested in contributing or modifying the code for personal use you can install a local copy with the following instructions. Users who don't need to modify the code can skip ahead to the usage section.

  1. Clone the repo.
$ git clone https://github.com/seatonullberg/velvet && cd velvet
  1. Build in release mode.
$ cargo build --release --workspace
  1. Check that all tests pass. Release mode is required to run the integration tests efficiently.
$ cargo test --release --workspace

Optional Features

Velvet supports a number of compile time options that can be opted into by using the --features flag when building with Cargo.

  • f64 - Sets the underlying storage type to a 64 bit floating point number. Default is 32 bit.
  • hdf5-output - Enables HDF5 formatted output. Requires a local installation of libhdf5.
  • quiet - Hides the simulation progress bar. Recommended when running benchmarks.
  • rayon - Enables multithreading with rayon parallel iterators.


Velvet is designed to be easy for developers to hack on and extend. With this goal in mind, Velvet forgoes support for static configuration files or input scripts, which can limit flexibility and complicate backend logic, in favor of defining simulations directly in code using the high-level velvet crate. While this may sound daunting to researchers who are more familiar with mainstream atomistic simulation software, the samples in the examples directory show that this can be a rather elegant solution.


Refer to the open issues, FEATURES.md, and CHANGELOG.md to see planned or proposed features (and bug fixes).


  • Why is it called "Velvet"?

    • "Velvet" is a concatenation of Velocity Verlet which is a foundational algorithm in the field of molecular dynamics.


Distributed under the MIT License. See LICENSE for more information.


  • LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
  • Lumol - Universal extensible molecular simulation engine


Core feature library for the Velvet simulation engine.

Internal unit system:

  • Distance - Angstrom (A)
  • Time - Femtosecond (fs)
  • Mass - Atomic mass unit (amu)
  • Temperature - Kelvin (K)
  • Quantity - Number of particles
  • Angle - Radians (rad)


~197K SLoC