/symd

N-Dimensional MD engine with symmetry group constraints written in C

Primary LanguageJupyter NotebookMIT LicenseMIT

Symmetric Molecular Dynamics Engine

GitHub PyPI version

This is a simple MD engine written in C that can be constrained to obey given symmetry groups at every frame. It can be compiled for any dimension, but scaffolding only exists for 2 and 3D lattices. It supports the following features:

  • NVE, NVT (BAOAB, CSVR thermostats), NPT
  • LJ, harmonic, cosine potentials
  • Neighbor lists (use nlj instead of lj for potential)
  • Symmetry constraints and all Bravais Lattices in 2D/3D

Purpose

traj.mp4

This is not really intended to be a production-ready simulation engine. Instead, it is a reference implementation of symmetric MD. I hope then the algorithm can be incorporated into other engines, or this engine can be extended, for others to use the algorithm. The Python package (see below) should make implementing the method as easy as possible. With that said, the most important files are box.c and group.c, which contain the key algorithms: fold_particles and the NPT algorithms: make_box, and try_rescale.

Python Package

There is a companion python package (symd) that can be installed via:

pip install symd

This does not include the MD engine, but instead includes necessary details to set-up symmetry constraints like getting affine matrices and Bravais lattice tensors.

Docs & Examples

See the docs which includes the python API, examples of running simulations, and shows how the figures from the manuscript were generated.

Compiling

mkdir build && cd build
cmake ..
make && [sudo] make install

The executable is symdX where X is the number of spatial dimensions

Dependencies

  • libgsl-dev (GNU Scientific Library headers)
  • CMake

Python Interface

It is recommended to use the python interface, which simplifies building the input files and parsing output files. See the examples in the docs.

Example

An example can be found in the examples/lj-symm-example directory.

Citation

See paper

@article{cox2022symmetric,
author = {Cox, Sam and White, Andrew D.},
title = {Symmetric Molecular Dynamics},
journal = {Journal of Chemical Theory and Computation},
year = {2022},
doi = {10.1021/acs.jctc.2c00401},
}