ParM  parm
A molecular dynamics library
ParM Documentation

The PARticle Molecular dynamics library

![Build Status](


The purpose of this library is to provide methods to produce any MD simulation, with any type of integrator, any type of particles, and any type of force in 2D or 3D.

It is currently single-core only, and provides objects for many different integrators, and many different forces, which can be composed together for simulations from a few particles bouncing around in a box to a full protein simulation.



There are several examples in C++ in the src/bin folder, all with good comments:


See pyparm/examples/ ( for an example of a simple Lennard-Jones simulation, with data analysis included.

See pyparm/ for an example of how to make a packing.

Basic Concepts

Standard Steps

  1. Make a Box. OriginBox is a good standard choice for periodic boundary conditions.
  2. Make an AtomVec.
  3. Set masses, positions and velocities
    1. Positions might be set using box.rand_loc(), for a random point inside the box
    2. Velocities may be set using rand_vec(), which generates a Gaussian distribution, like the expected Boltzmann distribution
  1. Make Interactions. For neighborlisted interactions, make NeighborList first, then make interactions.
    1. NListed<EpsSigAtom, LJRepulsivePair> (LJRepulsive in Python) is a repulsive Lennard-Jones Interaction
    2. NListed<EpsSigExpAtom, RepulsionPair> (Repulsion in Python) is a Repulsion or Harmonic Interaction (exponent can be chosen)
    3. Add atoms / pairs to Interaction
  2. Make a Collection. Note that the NeighborList has to be added to trackers
    1. CollectionVerlet is a good NVE Collection
  3. Run Collection.timestep() many, many times
    1. Use methods such as Collection.kinetic_energy() or Collection.temp() to get statistics
    2. Or use trackers like RsqTracker to track running statistics
  4. Write output to files


On Ubuntu, the following packages should suffice for Python 3:

1 build-essential
2 libeigen3-dev
3 libboost-all-dev
4 swig
5 python3-dev
6 python3-numpy
7 python3-nose
8 python3-setuptools
9 python3-pip

For Python 2, simply use the same packages but with the python- prefix instead of python3-.

Note that you will need to make sure you include Boost and Eigen in you "include" path. On Ubuntu, Boost will be by default, but you may need to add Eigen:

1 export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/eigen3"

Note that the attached .travis.yml file are computer-readable instructions for automatically building and testing this module on an Ubuntu machine, so that should always be up to date.


This library includes a sim.i file for use with SWIG for generating Python bindings.

To Generate Python module

Using the Python module

Use import pyparm.d2 as sim or import pyparm.d3 as sim to import the module. Then use it freely.

Other Notes


This module uses the equation \(V\left(r\right)=\varepsilon\left(1-\frac{\sigma^{6}}{r^{6}}\right)^{2}\)

The other standard form is \(V\left(r\right)=4\varepsilon\left(\frac{\sigma^{\prime12}}{r^{12}}-\frac{\sigma^{12}}{r^{6}}\right)\)

To convert, use \(\sigma=2^{\frac{1}{6}}\sigma^{\prime}\).