Skip to main content

A simple, fast and cross-platform python library to handle the data generated from molecular dynamics simulations

Project description

https://img.pterclub.com/images/2023/01/06/logo.png

mdapy : Molecular Dynamics Analysis with Python

Overview

The mdapy python library is developed by the Yong-Chao Wu & Jian-Li Shao Group at the Beijing Institute of Technology, which provides an array of powerful, flexible, and straightforward tools to analyze atomic trajectories generated from Molecular Dynamics (MD) simulations. The library is fully cross-platform, making it accessible to users in Windows, Linux, and Mac OS. Benefited by the TaiChi project, we can effectively accelerate the pure python code, bringing it closer to the speed of code written in C++. Furthermore, mdapy is highly parallelized, allowing users to leverage the resources of both multicore CPU and GPU. mdapy can directly handle the DUMP and DATA formats in LAMMPS. Besides, all data in mdapy is stored in NDARRAY format in NumPy, which enables easy integration with the scientific ecosystem in python and facilitates collaboration with other post-progressing tools such as OVITO and freud.

Resources

Dependencies

Optional Dependencies

  • SciencePlots (Optional, for plotting results)

  • tqdm (Optional, for progress bar when reading/saving multi DUMP files)

  • pyfftw (Optional, for fast FFT)

  • pyfnntw>=0.4.1 (Optional, for fast KNN search)

Installation

Install from source code.

  • You should install pybind11 and have a C++ compilation environment (-std=c++11 or newer) and openmp supports. Tested by MSVC in Windows 10, GCC in Ubuntu, Clang in MAC OS M1.

    pip install pybind11
  • Download the source code and installation.

    git clone https://github.com/mushroomfire/mdapy.git
    cd mdapy
    pip install .

Usage

import mdapy as mp
mp.init('cpu') # use cpu, mp.init('gpu') will use gpu to compute.

system = mp.System('./example/CoCuFeNiPd-4M.dump') # read dump file to generate a system class
system.cal_centro_symmetry_parameter() # calculate the centrosymmetry parameters
system.cal_atomic_entropy() # calculate the atomic entropy
system.write_dump() # save results to a new dump file

Main Features

  1. Structure Analysis

  2. Potential Analysis

  3. Melting Analysis

  4. Geometry Structure Creation

  5. Neighbor Search

  6. Other

Citation

If you find mdapy useful, you can start it! If you use mdapy in your scientific publication, because the paper is under review on Computer Physics Communication and you can cite its preprint version as below:

Wu, Yong-Chao and Shao, Jian-Li, Mdapy: A Flexible and Efficient Analysis Software for
Molecular Dynamics Simulations. Available at SSRN: https://ssrn.com/abstract=4360931
or http://dx.doi.org/10.2139/ssrn.4360931.

Trouble Shoot

If you encounter ImportError in Linux:

version 'GLIBCXX_3.4.29' not found.

You can try:

conda install -c conda-forge gxx_linux-64

Release Notes

V0.8.5 (4/9/2023)

  • Compile it on MAC OS with M1. Now mdapy is fully cross-platform.

  • Obviously improve the performance of reading/writing DUMP with pyarrow.

  • Add pyarrow as a dependency package.

  • Fix bug of create_polycrystalline module. One can give box with any number, the old version only works for positive float.

  • Fix bug of spatial_binning module for empty region.

  • Let tqdm as an Optional dependency.

V0.8.4 (3/30/2023)

  • Optimize Pair Distribution module.

  • Optimize Neighbor module.

  • Update many Benchmark cases.

V0.8.3 (3/20/2023)

  • Make Polyhedral Template Mathing parallel.

V0.8.2

  • Fix bugs of unwrap positions.

  • Fix a typo error in msd.

V0.8.1

  • Add Steinhardt Bondorder Parameter method, which can be used to identify the lattice structure and distinguish the solid/liquid phase during melting process.

  • Add Polyhedral Template Mathing method.

  • Add IdentifySFsTBs method to identify the stacking faults (SFs) and twinning boundary (TBs) in FCC lattice.

V0.8.0

  • Add Ackland Jones Analysis (AJA) method.

  • Add Common Neighbor Parameter (CNP) method.

  • Update the nearest neighbor search in CSP method.

V0.7.9

  • Fix bug of create_polycrystalline module in Linux.

V0.7.8

  • Update TaiChi version to 1.4.0.

  • Set SciencePlots as a optional package.

  • Fix bug in create_polycrystalline.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mdapy-0.8.5-cp310-cp310-win_amd64.whl (561.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

mdapy-0.8.5-cp310-cp310-manylinux1_x86_64.whl (811.6 kB view hashes)

Uploaded CPython 3.10

mdapy-0.8.5-cp310-cp310-macosx_10_14_x86_64.whl (706.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.14+ x86-64

mdapy-0.8.5-cp39-cp39-win_amd64.whl (560.6 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

mdapy-0.8.5-cp39-cp39-manylinux1_x86_64.whl (810.4 kB view hashes)

Uploaded CPython 3.9

mdapy-0.8.5-cp39-cp39-macosx_10_14_x86_64.whl (706.9 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

mdapy-0.8.5-cp38-cp38-win_amd64.whl (562.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

mdapy-0.8.5-cp38-cp38-manylinux1_x86_64.whl (860.4 kB view hashes)

Uploaded CPython 3.8

mdapy-0.8.5-cp38-cp38-macosx_10_14_x86_64.whl (714.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

mdapy-0.8.5-cp37-cp37m-win_amd64.whl (563.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

mdapy-0.8.5-cp37-cp37m-manylinux1_x86_64.whl (618.8 kB view hashes)

Uploaded CPython 3.7m

mdapy-0.8.5-cp37-cp37m-macosx_10_14_x86_64.whl (714.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

Supported by

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