Skip to content
/ avbmc Public

Monte Carlo package for simulating atoms interacting with non-bonded potentials

License

Notifications You must be signed in to change notification settings

evenmn/avbmc

Repository files navigation

build build docs tests License: GPL v3

AVBMC

Python library for non-bonded Monte Carlo simulations. Open (uVT) and closed systems (NVT) are supported thought various move types, including translational moves and insertation/deletion moves (AVBMC). Additionally, a groups of particles can be inserted/removed, allowing non-bonded molecule to be inserted/removed. The library is entirely written in C++ for performance reasons, and binded to Python using pybind11.

Prerequisites

The code depends on several features that were introduced in C++11. GCC 4.8.1 or any later version needed. Python 3.5 or later is required.

Installation

As this library is still under development and can be seen as experimental, it is not yet uploaded to PyPi. Meanwhile, install from source using

pip install git+https://github.com/evenmn/avbmc

It might takes some time, as the entire library is built.

Basic usage

import avbmc as mc

system = mc.System()

system.set_temp(1.4)
system.set_forcefield("lennardjones", "params.lj")

system.add_particle("Ar", [0, 0, 0])
system.add_particle("Ar", [1, 0, 0])
system.add_move("trans", dx=0.1)

system.run_mc(100)

For more example usage, see the documentation.

File formats

We try to stick to standard input file formats. For datafiles, the xyz-format is supported both to initialize the system and for dump files. The parameter files follow the LAMMPS standard. Both xyz-files and LAMMPS parameter files are oriented around chemical symbols (in contrast to for instance LAMMPS data files, which are oriented around particle types). This means that the user never needs to deal with the particle type indices, only the chemical symbols. Particles with the same chemical symbol will have the same properties (mass, charge and other properties given by the parameter file).

Build without Python interface

The code can also be built without the Python interface, with src/main.cpp as the configuration file. Build with make and release or debug mode:

make release
make debug

Then the code is built with g++. One can also use CMake with all its advantages in the standard fashion:

mkdir build
cd build
cmake ..
make -j4

License

AVBMC is available under the GPL v3 license. See the LICENSE file for more info.