Giter Club home page Giter Club logo

pyrovskite's Introduction

Perovskite_Analysis

  1. Extract structural features of 2D, 3D, and 2D/3D double perovskite systems.
  2. Build and analyze bulk perovskites, double perovskites, 2D perovskites, and 2D double perovskites.
  3. Generate elctronic structure input files for xTB/GPAW

Requirements

Installation

The package can be installed via

pip install pyrovksite

or you can clone the repository locally and obtain an editable install with:

git clone https://github.com/r2stanton/pyrovskite.git .
pip install -e .

With this method you'll download the tests and example jupyter notebooks. Tests can be run with pytest by navigating to the tests/ folder and running pytest .

A collection of organic A'-site and A-site cations will be added in the near future.

Usage

A brief overview of code usage is discussed here, however a much more detailed explanation is contained in the Jupyter notebooks found in /examples.

Example usage, from structure creation to analysis.

Example of building a bulk MAPbI3 perovskite:

from pyrovskite.builder import make_bulk
import ase.io
A = ase.io.read("path/to/methylammonium.xyz")
MAPbI3 = make_bulk(A, "Pb", "I", 3.1)

Similar such methods exist for 2D phases, and double perovskites. These are returned as an Atoms object, allowing for all the I/O methods supported by ASE.

One can write an input file, for example to do a variable cell xTB optimization with:

MAPbI3.write_xTB()

The optimized geometry could then be obtained and loaded back into a Perovksite object for further analysis:

from pyrovskite.perovskite import Perovskite
MAPbI3 = Perovskite("path/to/optimized_MAPbI3.cif")

Structural properties such as octahedral distortions can be computed with MAPbI3.compute_delta() MAPbI3.compute_sigma() MAPbI3.compute_lambda() and plots of relevant distributional quantities such as bond angle, bond length, and pRDFs can be computed with MAPbI3.plot_angles() MAPbI3.plot_distances() MAPbI3.plot_rdf()

Sensible defaults are selected for these functions, but please refer to the in-built documentation with help(function) or to the example notebooks to ensure the default behavior is what you want.

Note on xTB input file generation

xTB input files are for use with CP2K. Additionally, openbabel is required to convert files to a CP2K readable format. You can install both of these things with the command.

conda install -c conda-forge cp2k openbabel

Additionally, if you plan on using the xTB optimizations frequently, it may be worth setting

export XTB_D3_PATH=/path/to/dftd3.dat
export XTB_PARAMS_PATH=/path/to/xTB_parameters

to your shell profile, as the xTB calculation requires these parameters. If they are declared as environment variables, then they will be automatically parsed for you, otherwise you need to make a custom input file template, or pass the paths to these parameter files as keyword arguments to the relevant functions.

pyrovskite's People

Contributors

dharatrivedi avatar r2stanton avatar

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.