Skip to main content

Collection of Python modules & functions to perform and process solid-state defect calculations

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.


doped requires pymatgen (and its dependencies).


  1. doped can be installed from PyPI with pip install doped.

  2. (If not set) Set the VASP pseudopotential directory in $HOME/.pmgrc.yaml as follows::

  PMG_VASP_PSP_DIR: <Path to VASP pseudopotential top directory>

Within your VASP pseudopotential top directory, you should have a folder named POT_GGA_PAW_PBE which contains the POTCAR.X(.gz) files (in this case for PBE POTCARs).

(Necessary to generate POTCAR files, auto-determine INCAR settings such as NELECT for charged defects...)

3(Optional) Set the Materials Project API key in $HOME/.pmgrc.yaml as follows::

  MAPI_KEY: <Your mapi key obtained from>

(For pulling structures and comparing properties with the Materials Project database).


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: ShakeNBreak Summary

SnB CLI Usage: ShakeNBreak CLI

Note that while ShakeNBreak is built to be compatible with the latest pymatgen version, the defects corrections code has been removed from the current pymatgen version, so when installing ShakeNBreak the 2022.11.1 version should be used, with: pip install shakenbreak==2022.11.1.

Developer Installation

  1. Download the doped source code using the command:
  git clone
  1. Navigate to root directory:
  cd doped
  1. Install the code, using the command:
  pip install -e .

This 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.

Word of Caution

There is quite possibly a couple of bugs in this code, as it is very much still experimental and in development. If you find any, please let us know!


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, Katarina Brlec and Sabrine Hachmiouane. Code to efficiently identify defect species from input supercell structures was contributed by Dr Alex Ganose.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

doped-0.2.0-py3-none-any.whl (130.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page