A simple, fast, and powerful Python library designed for Molecular Dynamics (MD) simulation data analysis! πͺ
mdapy provides a comprehensive suite of powerful, flexible, and straightforward tools for analyzing atomic trajectories generated from Molecular Dynamics (MD) simulations.
- β¨ 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
- Fixed cutoff distance neighbor
- Fixed number nearest neighbor
- Voronoi neighbor
- 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
- Large scale polycrystalline structure generation
- Standard lattice configuration creation
- High entropy alloy structure
- NEP potential support
- Elastic constant
- Minimization with cell optimization
- Equation of state
- Stacking faults energy
- Phonon dispersion
- 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
Method 1: Install via pip (Recommended)
pip install mdapyMethod 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- Python 3.8+
- C++ compilation environment (C++17 or newer)
- OpenMP support
- Tested platforms: Windows 10 (MSVC), Ubuntu (GCC), Mac OS M1 (Clang)
python -c "import mdapy as mp; print('mdapy version is:', mp.__version__)"π¬ 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()- π 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
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 |
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.
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}
}If you find mdapy useful, please give us a Star β!
Your support is our motivation for continuous improvement! π
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Issues and Pull Requests are welcome!
Let's make mdapy better together! πͺ
If you have any questions or suggestions, feel free to reach us through:
- π¬ Submit an Issue: https://github.com/mushroomfire/mdapy/issues
- π¬ Email to Author: 934313174@qq.com