Skip to main content

MC Bond Exchange for LAMMPS Simulations

Project description

MC-Exchange Python Package

The MC-Exchange Python package has been developed to support the dynamic bond exchange reactions (BERs) during a molecular dynamics (MD) simulation run using LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) software. Using the LAMMPS Python package, a MD simulation can be run directly from a Python script, allowing an interface between Python and LAMMPS. The MC-Exchange Python package uses this to gather the necessary data from the LAMMPS MD simulation, analyze the data, determine which bonds to exchanged, and finally communicate the altered bond data back to LAMMPS, where the actual bond exchange can take place.

The package is written with the ease of use in mind. However, users must be warned that a thorough understanding of the LAMMPS Python package is necessary to be able to gather the necessary bits of data prior to performing bond exchange reactions using the MC-Exchange Python library.

General Use

The package can be installed from PyPI distribution archive using:

pip install MC-exchange

After successful installation of the MC-Exchange Python package, it can be imported into a script as follows:

import MC_exchange as mc

The above statement imports all functionalities of the package.

Package organization

The MC-Exchange Python package is organized into modules. Currently, there are three modules dedicated to the base functionalities, and one module where these functionalities are combined to perform bond exchange reactions. The three base modules are calculations.py, data.py and neigh_list.py.

Base modules

Currently, three base modules are responsible for the primary functionalities of the package. data.py is the module responsible for gathering data from the LAMMPS simulations. calculations.py contains calculations that use the data obtained by the functions of data.py to compute properties that can be necessary during bond exchange reactions. Lastly, neigh_list.py contain the functionalities required to construct spacial neighbor lists using atom data.

Functionalities

Currently, in version 1.0.0, there is a single function that the user should learn how to use called evaluate_bond_exchange(). This single function combines the functionalities of the base modules into one easy to use function for evaluating associative bond exchange reactions. Users are encouraged the take a closer look at the scripts under the src/example/ to learn how the integration between LAMMPS and Python works.

The software is designed such that it works when LAMMPS simulations are run parallel (i.e., on multiple processors). Communication between processes is handled by the mpi4py Python package.

Example script

Users are encouraged to clone the repository of this project to access all source files and example code.

To run the example script, make sure that the Python environment into which MC-Exchange was installed is activated and you are located in the src/example/ directory. To run the example script simply run the following command in the terminal:

mpiexec -np {n_procs} python3 loop.py

where {n_procs} is the number of parallel processes the user wishes to launch.

Note, this requires that the user has installed OpenMPI or MPICH to the local machine.

Developer

Balint Magyari: PhD Student at University of Naples Federico II

For any questions please contact balint.magyari@unina.it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mc_exchange-1.0.1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mc_exchange-1.0.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file mc_exchange-1.0.1.tar.gz.

File metadata

  • Download URL: mc_exchange-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for mc_exchange-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f5563ff0c444c3cb768e74ef4ea3cd11915e963eed558140511e4a1acd7144b9
MD5 cc1de3711848c1f61389388ecab74f9f
BLAKE2b-256 e6f951932854b0437666cf3eb379910281f20496c97aa0e8da1da39c767bde61

See more details on using hashes here.

File details

Details for the file mc_exchange-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: mc_exchange-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for mc_exchange-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4789830c698331a539e991aaf2fbc4abd5dda3af5c15bd49f9f4d7af19fd8867
MD5 d1bacf8ca99659c982b1657070373e8f
BLAKE2b-256 996fd7444c3c894733458f6993d42dc2b6f2d685d78c998370841a423c3fffa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page