Giter Club home page Giter Club logo

pycdt's Introduction

PyCDT

Python Charge Defects Toolkit (PyCDT) is a python package aimed at making charged defects modeling simpler, high throughput ready, and also accessible to researchers who don't have the required background. PyCDT can handle thermodynamic calculations and error corrections in the context of periodic boundary condition density functional calculations of charged defects in semiconductors and insulators. It can also generate the inputs for required DFT calculations and can process the output of the DFT calculations. The code is modular and any DFT code can be integrated into PyCDT for defect calculations.

Requirements

PyCDT requires pymatgen (and its dependencies) and optionally sxdefectalign packages.

Source Code

If not available already, use the following steps.

  1. Install git, if not already packaged with your system.

  2. Download the pycdt source code using the command:

    git clone https://bitbucket.org/mbkumar/pycdt.git
    

Installation

  1. (Optional step, but strongly suggested) Download and install anaconda and create a new virtual environment. For example, to create a new anaconda based virtual environment with a name pycdt_venv, run the following steps.:

    conda create -n pycdt_venv
    conda install -n pycdt_venv matplotlib numpy scipy setuptools
    

    Activate this virtual environment, by running the command:

    conda activate pycdt_venv
    

    If everything goes well, you should see pycdt_venv at the command line prompt. Don't forget to activate your virtual environment whenever you are trying to update or use pycdt.

  2. Navigate to pycdt root directory:

    cd pycdt
    
  3. Install the code, using the command:

    python setup.py install
    

    The command tries to obtain the required packages and their dependencies and install them automatically. (Access to root may be needed if virtualenv is not used.) You can run the pycdt now.

  4. (Optional for power users) The package can be installed at non-standard locations using the command:

    python setup.py install --prefix PYCDT_INSTALL_DIR
    

    where PYCDT_INSTALL_DIR is your choice of directory. In UNIX/Linux environments, add PYCDT_INSTALL_DIR to PATH and PYTHONPATH variables by the following commands:

    export PATH=$PATH:PYCDT_INSTALL_DIR
    export PYTHONPATH=$PYTHONPATH:PYCDT_INSTALL_DIR
    
  5. Configure your VASP pseudopotentials for use with pymatgen.:

    pmg config -p <EXTRACTED_VASP_POTCAR> <MY_PSP>
    

    Here <EXTRACTED_VASP_POTCAR> is the folder where your pseudopotentials are present and <MY_PSP> is the directory where the layout of pseudopotentials is organized by pymatgen. For more information refer to pymatgen installation instructions.

  6. Set the VASP pseudopotential directory in $HOME/.pmgrc.yaml using the command:

    pmg config --add PMG_VASP_PSP_DIR <MY_PSP>
    

    where <MY_PSP> is the directory used in the previous step.

  7. Set the Materials Project API key in $HOME/.pmgrc.yaml using the command:

    pmg config -add PMG_MAPI_KEY <Your mapi key obtained from www.materialsproject.org>
    

Documentation

For help on how to use PyCDT, read the article published in Computer Physics Communication.

Examples

From the pycdt root folder, go to examples folder by typing:

cd examples

Questions?

Post your questions on PyCDT forum.

Citation

To support PyCDT development, if you use pycdt in your research, please cite the following Comp Phys Comm article.

  • Danny Broberg, Bharat Medasani, Nils E.R. Zimmermann, Guodong Yu, Andrew Canning, Maciej Haranczyk, Mark Asta, Geoffroy Hautier, PyCDT: A Python toolkit for modeling point defects in semiconductors and insulators, Computer Physics Communications, Volume 226, 2018, Pages 165-179.

pycdt's People

Contributors

dbroberg avatar jmmshn avatar mbkumar avatar nisse3000 avatar sthartman 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pycdt's Issues

Missing ',' in setup.py

>python setup.py install
>error in pycdt setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected end or semicolon (after version specifier)
    matplotlib>=3.1monty>=3.0.2
              ~~~~~^

Seems that on line 16 in 'setup.py' a separator is missing between "matplotlib>=3.1" and "monty>=3.0.2". Adding one fixes the above error.

install_requires=["numpy>=1.18.15", "pymatgen>=2020.6.8,<=2022.7.8", "matplotlib>=3.1""monty>=3.0.2"]

Issue from ChargedDefectsStructures module

Hi,

I'm getting error "cannot import name 'str2unicode' from 'monty.string'" when I try to generate the input using the PbTiO3.json example. I'm using PyCDT-2.0.2 with latest Pymatgen-2020 and python3.8.1

Improved verification of chemical potential usage

Confirm that defects being used have the same metadata as that of the Materials Project. If a different U parameter is used or if a different set of pseudopotentials is used then chemical potentials from Materials Project should likely not be used.

Fix Sublattice index naming in ChargedDefectStructures

With version 2.0, indices included in folder naming from ChargedDefectStructures is not consistent with the sublattice site anymore.

A fix for this can make use of the PointDefectComparator in pymatgen to assign sublattice indices.

ERROR : Illegal instruction (core dumped)

I have download the latest anaconda3(python 3.8) and pycdt(2.0.5), when I try to run the example code, there is a werid ERROR: Illegal instruction (core dumped)
I tried the code on both super computing(Linux AMD roma) and my workstation(Ubuntu18 Intel)

The code:
from pymatgen.ext.matproj import MPRester
with MPRester() as mpr:
mgo_struct = mpr.get_structure_by_material_id('mp-1265')
from pycdt.core.defectsmaker import DefectChargerInsulator
defect_charger = DefectChargerInsulator(mgo_struct)
mg_vac_charges = defect_charger.get_charges('vacancy',site_specie='Mg')

from pycdt.core.defectsmaker import ChargedDefectsStructures
charged_defects_structs = ChargedDefectsStructures(mgo_struct)
from pycdt.utils.vasp import DefectRelaxSet
defect_struct = charged_defects_structs.get_ith_supercell_of_defect_type(0, 'vacancies')
vasp_input = DefectRelaxSet(defect_struct) # defect_struct is defectsupercell
vasp_input.write_input(output_dir)
vasp_input = DefectRelaxSet(defect_struct, potcar_functional="PBE")
user_settings = {'potcar_functional': 'PBE','user_incar_settings': {'EDIFFG': -1e-3, 'EDIFF': 1e-8, 'LASPH': True}}
vasp_input = DefectRelaxSet(defect_struct,**user_settings)

additional interstitial creation features

make use of additional interstitial features. Several exist within pymatgen.analysis.defects.generators right now. Would not be hard to add them to the pycdt command line script.

followup calculation capabilities

Add capabilities for setting up and running follow up calculations (larger supercells or perturbations) based on metadata that exists locally.

This can make use of pymatgen / atomate / emmet features.

Is this package still maintained?

I can see that there have been no new commits to PyCDT for ~1 year. Is the project still actively maintained/will there be any updates?

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.