Python package to setup, process and analyse solid-state defect calculations with VASP
Project description
Defect Oriented Python Environment Distribution (doped)
This is a (mid-development) Python package for managing solid-state defect calculations,
geared toward VASP. Much of it is a modified version of the excellent PyCDT.
See this link for the original PyCDT paper.
Defect formation energy plots are templated from AIDE and follow the aesthetics philosopy of sumo, both developed by the dynamic duo Adam Jackson and Alex Ganose.
Example Jupyter notebooks (the .ipynb files) are provided in examples to show the code functionality and usage.
Example Outputs:
Chemical potential/stability region plots and defect formation energy (a.k.a. transition level) diagrams:
Requirements
doped requires pymatgen<2022.8.23 and its dependencies.
Installation
- Because of breaking changes made to the
pymatgendefects code in version2022.8.23,dopedrequirespymatgen<2022.8.23, which is installed automatically when installingdoped. However, as discussed briefly below and in the example notebooks, theShakeNBreakapproach is highly recommended when calculating defects in solids, and this package has been updated to be compatible with the latest version ofpymatgen. As such, it is recommended to installdopedin a virtual python environment as follows:
- Create virtual environment and install:
conda create -n doped python=3.10 # create conda environment named doped
conda activate doped # activate doped conda environment
pip install doped # install doped and dependencies, can also
pip install --force --no-cache-dir numpy==1.23 # install numpy after doped to avoid binary incompatibility
And then use this environment whenever using doped.
Alternatively if desired, doped can also be installed from conda with:
conda install -c conda-forge doped
If you want to use the example files,
you should clone the repository and install with pip install -e . from the doped directory, but still make sure to pip install numpy --upgrade.
- (If not set) Set the VASP pseudopotential directory and your Materials Project API key in
$HOME/.pmgrc.yaml(pymatgenconfig file) as follows:
PMG_VASP_PSP_DIR: <Path to VASP pseudopotential top directory>
PMG_MAPI_KEY: <Your MP API key obtained from https://legacy.materialsproject.org/open>
Within your VASP pseudopotential top directory, you should have a folder named
POT_GGA_PAW_PBE/potpaw_PBE.54/POT_GGA_PAW_PBE_54 which contains POTCAR.X(.gz) files, generated using pmg config.
If you have not previously setup your POTCAR directory in this way with pymatgen, then follow these steps:
mkdir temp_potcars # make a top folder to store the unzipped POTCARs
mkdir temp_potcars/POT_PAW_GGA_PBE # make a subfolder to store the unzipped POTCARs
mv potpaw_PBE.54.tar.gz temp_potcars/POT_PAW_GGA_PBE # copy in your zipped VASP POTCAR source
cd temp_potcars/POT_PAW_GGA_PBE
tar -xzf potpaw_PBE.54.tar.gz # unzip your VASP POTCAR source
cd ../.. # return to the top folder
pmg config -p temp_potcars psp_resources # configure the psp_resources pymatgen POTCAR directory
pmg config --add PMG_VASP_PSP_DIR "${PWD}/psp_resources" # add the POTCAR directory to pymatgen's config file (`$HOME/.pmgrc.yaml`)
rm -r temp_potcars # remove the temporary POTCAR directory
If this has been successful, you should be able to run pmg potcar -s Na_pv, and grep PBE POTCAR should show
PAW_PBE Na_pv {date} (you can ignore any pymatgen warnings about recognising the POTCAR).
If it does not work check that the PMG_DEFAULT_FUNCTIONAL is set to whatever your functionals are (e.g. PBE or PBE_54)
This is necessary to generate POTCAR input files, and auto-determine INCAR settings such as NELECT for charged
defects.
The Materials Project API key is required for determining the necessary competing phases to calculate in order to determine the chemical potential limits (required for defect formation energies). This should correspond to the legacy MP API, with your unique key available at: https://legacy.materialsproject.org/open.
ShakeNBreak
As shown in the example notebook, it is highly recommended to use the ShakeNBreak approach when calculating point defects in solids, to ensure you have identified the groundstate structures of your defects. As detailed in the theory paper, skipping this step can result in drastically incorrect formation energies, transition levels, carrier capture (basically any property associated with defects). This approach is followed in the doped example notebook, with a more in-depth explanation and tutorial given on the ShakeNBreak website.
Summary GIF:
SnB CLI Usage:
Developer Installation
- Download the
dopedsource code using the command:
git clone https://github.com/SMTG-UCL/doped
- Navigate to root directory:
cd doped
- Install the code, using the command:
pip install -e .
Acknowledgments
doped has benefitted from feedback from many users, in particular members of the Walsh and Scanlon research groups who have used / are using it in their work. Direct contributors are listed in the Contributors sidebar above; including Seán Kavanagh, Bonan Zhu, Katarina Brlec, Adair Nicolson, Sabrine Hachmioune and Savya Aggarwal. Code to efficiently identify defect species from input supercell structures was contributed by Dr Alex Ganose.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doped-1.1.2.tar.gz.
File metadata
- Download URL: doped-1.1.2.tar.gz
- Upload date:
- Size: 103.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
511cbabf678401bb724d7c29db1870a5f827abf73f212d8b4573d9962e249aed
|
|
| MD5 |
4a956946e05414144a6afae8d791d4b0
|
|
| BLAKE2b-256 |
88465ff207665a3972221cab5da5c3ff4525c70a89b0412256459ed0adb9dbc4
|
File details
Details for the file doped-1.1.2-py3-none-any.whl.
File metadata
- Download URL: doped-1.1.2-py3-none-any.whl
- Upload date:
- Size: 109.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2229f714a4d0ca0d9ff8d44598ca7fe005a1a413b2f53aa13108d13925a4cea8
|
|
| MD5 |
9bc3f4891145844d34303adee355306b
|
|
| BLAKE2b-256 |
01e786c12b7c718ec08d915657e945cc3e0a7cfad12f537acca68aba4386e9c5
|