Code Monkey home page Code Monkey logo

sitator's Introduction

sitator

A modular framework for conducting and visualizing site analysis of molecular dynamics trajectories.

Visualizations of complete landmark site analyses, created with sitator, of the superionic conductors (a) LGPS, (b) LLZO, and (c) LASO. Source: figures 11, 14, and 18 from our paper, linked below.

sitator contains an efficient implementation of our method, landmark analysis, as well as visualization tools, generic data structures for site analysis, pre- and post-processing tools, and more.

For details on landmark analysis and its application, please see our paper:

L. Kahle, A. Musaelian, N. Marzari, and B. Kozinsky
Unsupervised landmark analysis for jump detection in molecular dynamics simulations
Phys. Rev. Materials 3, 055404 โ€“ 21 May 2019

If you use sitator in your research, please consider citing this paper. The BibTeX citation can be found in CITATION.bib.

Installation

sitator is built for Python >=3.2 (the older version, v1.0.1, supports Python 2.7). We recommend the use of a virtual environment (virtualenv, conda, etc.). sitator has a number of optional dependencies that enable various features:

  • Landmark Analysis
  • The network executable from Zeo++ is required for computing the Voronoi decomposition. (It does not have to be installed in PATH; the path to it can be given with the zeopp_path option of VoronoiSiteGenerator.)
  • Site Type Analysis
  • For SOAP-based site types: either the quip binary from QUIP with GAP or the DScribe Python library.
    • The Python 2.7 bindings for QUIP (quippy) are not required. Generally, DScribe is much simpler to install than QUIP. Please note, however, that the SOAP descriptor vectors differ between QUIP and DScribe and one or the other may give better results depending on the system you are analyzing.
  • For coordination environment analysis (sitator.site_descriptors.SiteCoordinationEnvironment), we integrate the pymatgen.analysis.chemenv package; a somewhat recent installation of pymatgen is required.

After downloading, the package is installed with pip:

# git clone ... OR unzip ... OR ...
cd sitator
pip install .

To enable site type analysis, add the [SiteTypeAnalysis] option (this adds two dependencies -- Python packages pydpc and dscribe):

pip install ".[SiteTypeAnalysis]"

Examples and Documentation

Two example Jupyter notebooks for conducting full landmark analyses of LiAlSiO4 and Li12La3Zr2O12 as in our paper, including data files, can be found on Materials Cloud.

Full API documentation can be found at ReadTheDocs.

sitator generally assumes units of femtoseconds for time, Angstroms for space, and Cartesian (not crystal) coordinates.

Global Options

sitator uses the tqdm.autonotebook tool to automatically produce the correct fancy progress bars for terminals and iPython notebooks. To disable all progress bars, run with the environment variable SITATOR_PROGRESSBAR set to false.

The SITATOR_ZEO_PATH and SITATOR_QUIP_PATH environment variables can set the default paths to the Zeo++ network and QUIP quip executables, respectively.

License

This software is made available under the MIT License. See LICENSE for more details.

sitator's People

Contributors

lekah avatar linux-cpp-lisp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sitator's Issues

The lost example information

Hi, when I try to open the shared link to Jupyter notebooks for conducting full landmark analyses of LiAlSiO4 and Li12La3Zr2O12 as in our paper, it shows the page could not be found, would you check that?

Thanks

Error with `PBCCalculator`

The notebook got errors when running landmark analysis. I found that it is due to PBCCalculator. The PBCCalculator require an np.array like input. When running the code, it reports an error that the input is atoms.cell.

I guess this is due to the change of ase package. So I change all PBCCalculator(atoms.cell) to PBCCalculator(atoms.cell.array) in the 'sitator' package and the error is fixed.

An example is shown below:

line 91 in util/zeo.py:     real_pbcc = PBCCalculator(structure.cell)
              update ->     real_pbcc = PBCCalculator(structure.cell.array)

Suggestion for read and transform trajectory

It takes quite a long time to read and transfrom the 'trajectory.xyz' file. I would suggest to use the method provided by pymatgen/ase, which is faster. The code example is shown below:

from ase.io import read, write  
import numpy as np
from pymatgen.io.ase import AseAtomsAdaptor
from ase import Atoms
from pymatgen.io.lammps.outputs import parse_lammps_dumps
confs = parse_lammps_dumps('trajectory.xyz') # this is a generator
symbols = ['La'] *24 +['Zr'] * 16 + ['O'] *96 + ['Li']*56
ats = [Atoms(symbols=symbols, positions=conf.data.values[:, :3],
             cell=conf.box.to_lattice().matrix, pbc=True) for conf in confs]
write('LLZO.xyz', ats)
ats = read('LLZO.xyz', ':100')

Besides, I suggest to rename the 'trajectory.xyz' as 'dump.trajectory'. For it is more like a lammps-dump output rather than '.xyz' type file. Because '.xyz' hints the user to use ase.io.read to load the data.

ImportError: No module named visualization

After installing the package using pip install ".[SiteTypeAnalysis]", I get the following error:

Traceback (most recent call last):
File "", line 1, in
File "/home/azeeshan/install/miniconda2/envs/pymatgen2-env/lib/python2.7/site-packages/sitator/init.py", line 2, in
from SiteNetwork import SiteNetwork
File "/home/azeeshan/install/miniconda2/envs/pymatgen2-env/lib/python2.7/site-packages/sitator/SiteNetwork.py", line 15, in
from sitator.visualization import SiteNetworkPlotter
ImportError: No module named visualization

I checked my /home/azeeshan/install/miniconda2/envs/pymatgen2-env/lib/python2.7/site-packages/sitator/ directory and found that indeed there was no directory named visualization. There are util and landmark directories though. Maybe something to do with setup.py or __init__.py?

No `samos` package

The jupyter notebook example use the package samos but I cannot find it. Is that an personal package?

PBCCalculator fails on instantiation with Atoms.cell

With python3.5 or python3.6, and ase==3.19.3 or 3.20.1, when calling the PBCCalculator:
PBCCalculator(atoms.cell)
the following error occurs:
File "sitator/util/PBCCalculator.pyx", line 31, in sitator.util.PBCCalculator.PBCCalculator.__init__ File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__ TypeError: a bytes-like object is required, not 'Cell'

I suspect this is some special case of how an ase.Cell is treated.
Replacing the call with
PBCCalculator(atoms.cell[:])
alleviates this issue. There are however many calls to PBCCalculator in the sitator package, so there might be a different solution to this problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.