Git Product home page Git Product logo

pdyna's Introduction

made-with-python License: MIT DOI

Perovskite Dynamics Analysis (PDynA) is a Python package for analysis of perovskite structural dynamics.

Code features

  • The input to the code is molecular dynamics (MD) trajectories, currently readable formats are VASP-XDATCAR, XYZ, PDB (proteindatabank), ASE-Trajectory and LAMMPS dump files. The core class of PDynA is the Trajectory class.

  • The structure recognition functions will automatically detect the constituent octahedral network and organic A-site molecules, and process the analysis.

  • The output is a selected set of the following properties: (pseudo-cubic) lattice parameter, octahedral distortion and tilting, time-averaged structure, A-site molecular orientation, A-site spatial displacement, radial distribution functions.

  • The octahedral distortion and tilting calculation is the core feature of this package, which can quantitatively examine the dynamic behaviour of perovskite in terms of how octahedra tilt and distort, as well as the spatial correlation of these properties (Glazer notation).

  • The octahedral distortion and tilting calculation can be accelerated with parallelization by joblib, this can be tuned with the input parameter multi_thread.

List of modules

  • pdyna library containing:
    • core.py: Contains the dataclass Trajectory and Frame as well as their related functions.
    • structural.py: Handles structure recognition and property calculations.
    • analysis.py: A collection of tools for computing and visualizing the output.
    • io.py: The IO to input data files.

Requirements

The main language is Python 3 and has been tested using Python 3.8+, with the following dependencies:

  • Numpy
  • Matplotlib
  • Pymatgen
  • Scipy
  • ASE

Installation

PDynA can be installed with the following commands:

Clone the repository (or download manually)

git clone https://github.com/WMD-group/PDynA.git

cd to PDynA directory with the setup.py file

cd pdyna

Install the package with pip

pip install .

Usage

Two molecular dynamics trajectories are given in the examples folder.

We encourage users to run orthogonal (the vectors connecting adjacent B-atoms are parallel to the principal axes) perovskite structures with corner-sharing connectivity to get the best performance of structure matching, when possible.

1. VASP-XDATCAR trajectory

The minimal example is based on a VASP-XDATCAR format trajectory, containing about 100 atoms.

Copy all the files under examples/minimal to your working directory and run the script pdyna_example.py.

2. LAMMPS trajectory

The second example is a larger LAMMPS trajectory (about 20,000 atoms), covering more functions in PDynA.

Copy all the files under examples/lammps to your working directory, unzip lammps_example_mapbbr3.out.gz and run the script example_lammps.py.

For your own LAMMPS trajectory, please use a custom dump style with this command: dump dump_name all custom dump_frequency ./dump.out id element x y z

3. XYZ/PDB/ASE trajectory

Reading of these file types can be done similarly by running traj = Trajectory(filetype,(file_path, MDtup)), where filetype is one of "xyz", "pdb" or "ase-traj", the MD settings MDtup = (Ti, Tf, timestep, nblock) (timestep is MD time step in femtosecond, nblock is the frequency of frame saving).

4. Parameters explained

A full list of all the parameters is shown in the examples/full.py.

Citation

"Structural dynamics descriptors for metal halide perovskites" Journal of Physical Chemistry C (2023)

Used in

"Phase transitions, dielectric response, and nonlinear optical properties of aziridinium lead halide perovskites" Chemistry of Materials (2023)

License and attribution

Python code and original data tables are licensed under the MIT License.

Development notes

Bugs, features and questions

Please use the Issue Tracker to report bugs or request features in the first instance. For other queries about any aspect of the code, please contact Xia Liang by e-mail: xia.liang16[at]imperial.ac.uk.

Lead developer

  • Xia Liang (Department of Materials, Imperial College London)

pdyna's People

Contributors

aronwalsh avatar kavanase avatar nukenadal avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

raolixiang-up

pdyna's Issues

How to analyze trajectories containing hybrid perovskite and other elements

Hi developers of PDynA,

Recently I saw this code on arxiv and I thought this code was very useful. I tried to use this code analyze my trajectories which composed of FAPbI and water. However I found that this code seems only support several elements mainly perovskite.

    def __post_init__(self):
        
        Xsite_species = ['Cl','Br','I'] # update if needed
        Bsite_species = ['Pb','Sn'] # update if needed
        known_elem = ("I", "Br", "Cl", "Pb", "C", "H", "N", "Cs")

As a result, I could not analyze the tilting of FA or octahedral. I want to know that is there any solution to solve this problem, i.e. parse the perovskite part to analyze. Since many research with MD simulation do not only contain perovskite also other elements.

Thanks in advance.

Regards.

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.