https://github.com/wmd-group/pdyna
Python package to analyse the structural dynamics of perovskites
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, wiley.com, nature.com, acs.org, zenodo.org -
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.8%) to scientific vocabulary
Keywords
Repository
Python package to analyse the structural dynamics of perovskites
Basic Info
Statistics
- Stars: 44
- Watchers: 2
- Forks: 4
- Open Issues: 2
- Releases: 2
Topics
Metadata Files
README.md

Perovskite Dynamics Analysis (PDynA) is a Python package for analysis of perovskite structural dynamics.
The Python documentation of PDynA can be found at https://pdyna.readthedocs.io/en/latest/.
Code features
The input to the code is molecular dynamics (MD) trajectories, currently readable formats are VASP-XDATCAR, XYZ, EXTXYZ, PDB (proteindatabank), ASE-Trajectory and LAMMPS dump files. The core class of PDynA is the
Trajectoryclass.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 (for example equivalent to Glazer notation in the 3C corner-sharing polytype).
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
1. From GitHub
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 .
2. From PyPI
Alternatively, PDynA can be installed directly from PyPI, with:
pip install pdyna
Pre-definition of the structure
To start using the code, the user must define the B and X site elements in the BX6 octahedra. This can be done by defining the B and X sites species and their relative distances with the additional entry system_overwrite in the dynamics, for example,
traj.dynamics(..., system_overwrite=user_system)`
The input user_system is a dict with four entries:
{'B-sites': ['Sn'], 'X-sites': ['I','Br'], 'fpg_val_BB': [[a,b], [c,d]], 'fpg_val_BX': [[a,b], [c,d]]}
The four numbers in B-B (fpg_val_BB) and B-X (fpg_val_BX) connectivity are:
c: NN1 distance of the connected pair
d: NN2 distance of the connected pair
a: lower bound of a range of distance that covers both and only NN1 and NN2
b: upper bound of a range of distance that covers both and only NN1 and NN2
If you are not sure about the relative distances in your system, you can run the system_test function with one of your trajectories by calling:
traj = Trajectory(filetype,(file_path, MDtup))
traj.system_test(B_sites=['Sn'],X_sites=['I','Br']) # with Sn(I/Br) system as an example
This will give you two plots as follows:
An alternative way is to directly define the same quantities at the beginning of the Trajectory class if you are working with only one system throughout.
_Xsite_species = ['Cl','Br','I']
_Bsite_species = ['Pb']
_fpg_val_BB = [[5,13.5], [8.2,12]] # the values for above plot
_fpg_val_BX = [[1,8], [3,6.8]] # the values for above plot
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.
Computed Properties
The computed dynamic properties are all stored in the Trajectory object and can all be accessed easily by calling traj.Tilting, traj.Tilting_Corr, traj.Distortion, etc, which are octahedral tilting, octahedral tilting NN1 correlations (effective Glazor notation), octahedral distortions, respectively. The dimension of these arrays are (Nframes,Noctahedra,property_dimension).
Citation
@article{pdyna,
title={Structural dynamics descriptors for metal halide perovskites},
author={Liang, Xia and Klarbring, Johan and Baldwin, William J and Li, Zhenzhu and Cs{\'a}nyi, G{\'a}bor and Walsh, Aron},
journal={J. Phys. Chem. C},
volume={127},
number={38},
pages={19141--19151},
year={2023}
}
Used in
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)
Owner
- Name: Materials Design Group
- Login: WMD-group
- Kind: organization
- Location: London
- Website: https://wmd-group.github.io
- Repositories: 57
- Profile: https://github.com/WMD-group
Research group in computational chemistry & physics led by @aronwalsh at @ImperialCollegeLondon
GitHub Events
Total
- Issues event: 2
- Watch event: 11
- Issue comment event: 2
- Push event: 2
- Pull request event: 1
- Fork event: 2
- Create event: 1
Last Year
- Issues event: 2
- Watch event: 11
- Issue comment event: 2
- Push event: 2
- Pull request event: 1
- Fork event: 2
- Create event: 1
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Xia Liang | 8****l | 57 |
| Xia Liang | 8****e | 22 |
| Aron Walsh | a****h@g****m | 14 |
| Sean Kavanagh | s****9@i****k | 2 |
| Xia Liang | x****1@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 3
- Total pull requests: 6
- Average time to close issues: about 1 month
- Average time to close pull requests: 11 minutes
- Total issue authors: 3
- Total pull request authors: 4
- Average comments per issue: 1.33
- Average comments per pull request: 0.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 3
- Average time to close issues: about 2 months
- Average time to close pull requests: 12 minutes
- Issue authors: 2
- Pull request authors: 3
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mayankaditya (1)
- aronwalsh (1)
- PolyuWeldingSpock (1)
- BianTieyuan (1)
Pull Request Authors
- nukenadal (3)
- JisuJung928 (2)
- ireaml (2)
- kavanase (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 18 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
pypi.org: pdyna
Perovskite dynamics analysis package
- Homepage: https://github.com/WMD-group/PDynA
- Documentation: https://pdyna.readthedocs.io/en/latest/
- License: MIT License Copyright (c) 2022 Xia Liang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.1.1
published over 1 year ago