doped Schematic of a doped (defect-containing) crystal, inspired by the biological analogy to (semiconductor) doping.

doped is a Python package for managing solid-state defect calculations, with functionality to generate defect structures and relevant competing phases (for chemical potentials), interface with ShakeNBreak for defect structure-searching, write VASP input files for defect supercell calculations, and automatically parse and analyse the results.

Example Outputs:

Chemical potential/stability region plots and defect formation energy (a.k.a. transition level) diagrams:

_images/doped_chempot_plotting.png _images/doped_TLD_plot.png

Tutorials showing the code functionality and usage are provided on the Tutorials page.

doped can be installed via PyPI (pip install doped) or conda if preferred, and further instructions for setting up POTCAR files with pymatgen (needed for input file generation), if not already done, are provided on the Installation page.


As shown in the tutorials, it is highly recommended to use the ShakeNBreak approach when calculating point defects in solids, to ensure you have identified the ground-state 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 tutorials, with a more in-depth explanation and tutorial given on the ShakeNBreak docs.

Summary GIF:

SnB CLI Usage:


doped (née DefectsWithTheBoys #iykyk) has benefitted from feedback from many users, in particular members of the Scanlon and Walsh research groups who are using it in their work. Direct contributors are listed in the GitHub Contributors sidebar; 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 Alex Ganose, and the colour scheme for defect formation energy plots was originally templated from the aide package, developed by Adam Jackson and Alex Ganose.

The docs website setup was templated from the ShakeNBreak docs set up by Irea Mosquera-Lois 🙌

doped was originally based on the excellent PyCDT (no longer maintained), but transformed and morphed over time as more and more functionality was added. After breaking changes in pymatgen, the package was rewritten to operate using the new pymatgen-analysis-defects package.

Studies using doped