extendable molecular dynamics analyzer
Project description
exma
exma is an extendable molecular analyzer.
This project is mainly developed with the objective of analyzing molecular dynamics trajectories using different tools that characterize both the configurational properties and the dynamics of the system. It is intended to analyze monatomic materials or alloys.
Features
With exma you can:
- Read and write MD trajectory frames in .xyz and .lammpstrj format (including charges, image of the particles or some other property).
- Estimate errors with the block average method.
- Initializate positions of atoms in SC, BCC or FCC crystals.
- Apply PBC.
- Calculate:
- clusterization,
- the coordination number (CN), the ligancy or in a shell, for monoatomic or diatomic systems,
- effective neighbors (EN),
- mean square displacement (MSD),
- the radial distribution function (RDF) of monoatomic or diatomic systems,
Requirements
exma requires Python 3.8 to run, the others specific requirements are provided during installation. gcc 9.3 is necesary to compile the shared libreries if you are going to run tox
.
Installation
Stable release
To install the most recent stable release of exma with pip, run the following command in your termninal:
pip3 install exma
From sources
To installing exma from sources you can clone this GitHub repo
git clone https://github.com/fernandezfran/exma.git
and inside your local directory install it in the following way
pip3 install .
or
python3 setup.py install
Usage
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# in this script the coordination numbers of sc, bcc and fcc crystals are
# calculated, the steps are following for each system:
#
# 1. with exma.atoms.positions generate the positions of the atoms
# the first argument is the number of atoms and the second the box size
# 2. with exma.cn.monoatomic initializate the CN calculation
# the first argument is the number of atoms, the second the box size
# in each direction and the third is a cutoff distance
# 3. with CN.accumulate calculate de CN of this "frame"
# the argument is the positions of the atoms
# 4. with CN.end return the CN of each atom
# the first argument is the atom type to be written (not interested here)
# the second are the positions and the third is False to not write an
# output file
#
import numpy as np
import exma
sc = exma.atoms.positions(8, 4.0).sc()
cn_sc = exma.cn.coordination_number.monoatomic(8, 3.0)
cn_sc.accumulate(np.full(3,4.0), sc)
cn_sc = np.mean(cn_sc.end(0, sc, False))
bcc = exma.atoms.positions(16, 4.0).bcc()
cn_bcc = exma.cn.coordination_number.monoatomic(16, 1.8)
cn_bcc.accumulate(np.full(3,4.0), bcc)
cn_bcc = np.mean(cn_bcc.end(0, bcc, False))
fcc = exma.atoms.positions(32, 4.0).fcc()
cn_fcc = exma.cn.coordination_number.monoatomic(32, 1.5)
cn_fcc.accumulate(np.full(3,4.0), fcc)
cn_fcc = np.mean(cn_fcc.end(0, fcc, False))
print("# %d is the coordination number of a sc crystal" % cn_sc)
print("# %d is the coordination number of a bcc crystal" % cn_bcc)
print("# %d is the coordination number of a fcc crystal" % cn_fcc)
There are more examples in the Documentation.
Release History
- 0.1.0
- First realease on PyPI
- 0.0.1
- Work in progress
License
TODO
- triclinic (non-orthogonal) boxes for the different modules.
Contributing
- Fork it: https://github.com/fernandezfran/exma/fork
- Clone your fork locally:
git clone git@github.com:your_name/exma.git
- Install exma and test it to check if everything works fine (you can run
tox
in the main directory after runmake
in each subdirectory ofexma/
). - Create a new branch with your feature:
git checkout -b your_feature
- Commit your changes:
git commit -am 'a detailed description of your feature'
- Push the branch:
git push origin your_feature
- Create a new Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.