Skip to content

mushroomfire/mdapy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ mdapy - Molecular Dynamics Analysis with Python

PyPI version Python versions License ReadTheDocs GitHub stars

A simple, fast, and powerful Python library designed for Molecular Dynamics (MD) simulation data analysis! πŸ’ͺ


πŸ“– Introduction

mdapy provides a comprehensive suite of powerful, flexible, and straightforward tools for analyzing atomic trajectories generated from Molecular Dynamics (MD) simulations.

🎯 Why Choose mdapy?

✨ Cross-Platform Support
Fully compatible with Windows, Linux, and Mac OS - run anywhere seamlessly
⚑ Blazing Fast Performance
  • Accelerated by C++ using Nanobind
  • Highly parallelized, fully utilizing multicore CPU resources
  • Lightning-fast file I/O for large datasets
πŸ”§ Comprehensive Format Support

Native support for mainstream MD formats:

  • LAMMPS (DUMP/DATA)
  • VASP (POSCAR)
  • Universal XYZ format
  • Custom MP format
πŸ”— Seamless Integration
  • All data stored in Polars DataFrame and transfer with NumPy NDARRAY format
  • Easy integration with Python scientific ecosystem
  • Perfect compatibility with post-processing tools like OVITO, ASE and freud

🎨 Core Features

πŸ”¬ Neighbor Search

  • Fixed cutoff distance neighbor
  • Fixed number nearest neighbor
  • Voronoi neighbor

πŸ“Š Structural Analysis

  • Ackland Jones Analysis
  • Common Neighbor Parameter
  • CentroSymmetry Parameter
  • Common Neighbor Analysis
  • Polyhedral Template Matching
  • Identify Fcc Planar Faults
  • Identify Diamond Structure
  • Structure Entropy
  • AtomicStrain
  • Steinhardt Bond Orientation
  • Radial Distribution Function
  • Bond Analysis
  • Angular Distribution Function
  • Structure Factor

πŸ“¦ Model Building

  • Large scale polycrystalline structure generation
  • Standard lattice configuration creation
  • High entropy alloy structure

πŸ€– Machine Learning Potential

  • NEP potential support
  • Elastic constant
  • Minimization with cell optimization
  • Equation of state
  • Stacking faults energy
  • Phonon dispersion

πŸ“š Miscellaneous

  • Generate EAM potential
  • Average EAM potential
  • Mean Square Displacement
  • Lindemann Parameter
  • Cluster Analysis
  • Void Analysis
  • Warren Cowley Parameter
  • Average Atomic Temperature
  • Average by Neighbor
  • Atomic Voronoi Volume
  • Multi-dimensional Spatial Binning
  • Parallelly Compress file to .gz format

πŸš€ Quick Start

πŸ’Ύ Installation

Method 1: Install via pip (Recommended)

pip install mdapy

Method 2: Install with all optional features

# Install with matplotlib
pip install mdapy[plot]
# Install with k3d
pip install mdapy[k3d]
# Install all optional packages (matplotlib, k3d, phonopy, pyfftw), except lammps
pip install mdapy[all]

Method 3: Install from source

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

Method 4: Install directly from GitHub

pip install https://github.com/mushroomfire/mdapy/archive/master.zip --force-reinstall

πŸ“‹ System Requirements for Method 3 and 4

  • Python 3.8+
  • C++ compilation environment (C++17 or newer)
  • OpenMP support
  • Tested platforms: Windows 10 (MSVC), Ubuntu (GCC), Mac OS M1 (Clang)

βœ… Verify Installation

python -c "import mdapy as mp; print('mdapy version is:', mp.__version__)"

πŸ’‘ Usage Examples

🎬 Basic Usage

import mdapy as mp

# Load LAMMPS DUMP file
system = mp.System('your_file.dump')

# View system information
print(system)

# Calculate radial distribution function
rdf = system.cal_radial_distribution_function(rc=5.0)
rdf.plot()

# Identify crystal structures
system.cal_polyhedral_template_matching()

πŸ“š Documentation & Resources

πŸ“– Full Documentation
https://mdapy.readthedocs.io/
πŸŽ“ Tutorial Repository
https://github.com/mushroomfire/mdapy-tutorial
πŸ’¬ Issue Tracker
https://github.com/mushroomfire/mdapy/issues
🏠 Project Homepage
https://github.com/mushroomfire/mdapy

πŸ“¦ Dependencies

Core Dependencies

Package Version Purpose
numpy latest Array computations
polars latest Data processing

Optional Dependencies

Package Version Purpose
matplotlib latest Data visualization
k3d latest Atom 3D visualization
pyfftw latest Fast Fourier Transform
phonopy latest Phonon calculations
lammps latest Potential calculations

πŸ”„ Version Updates

⚠️ Important Notice

We have undergone a major upgrade from mdapy 1.0 (almost rewriting everyting). The old version of mdapy (≀0.11.5) can be found in this branch.


πŸ“œ Citation

If you use mdapy in your scientific publications, please cite the following paper:

@article{mdapy2023,
  title = {mdapy: A flexible and efficient analysis software for molecular dynamics simulations},
  journal = {Computer Physics Communications},
  pages = {108764},
  year = {2023},
  issn = {0010-4655},
  doi = {https://doi.org/10.1016/j.cpc.2023.108764},
  url = {https://www.sciencedirect.com/science/article/pii/S0010465523001091},
  author = {Yong-Chao Wu and Jian-Li Shao},
  keywords = {Simulation analysis, Molecular dynamics, Polycrystal, TaiChi, Parallel computing}
}

⭐ Support the Project

If you find mdapy useful, please give us a Star ⭐!

Your support is our motivation for continuous improvement! πŸ™


πŸ“„ License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.


🀝 Contributing

Issues and Pull Requests are welcome!

Let's make mdapy better together! πŸ’ͺ


πŸ“§ Contact

If you have any questions or suggestions, feel free to reach us through:


About

A simple and fast python library to handle the data generated from molecular dynamics simulations

Topics

Resources

License

Stars

Watchers

Forks