Installation
pip install doped # install doped and dependencies
conda install -c conda-forge spglib # bundle C libraries with spglib
Note that either conda install -c conda-forge spglib
or
pip install git+https://github.com/spglib/spglib --config-settings=cmake.define.SPGLIB_SHARED_LIBS=OFF
should be used after pip install doped
, which ensures that the correct C libraries are bundled with
spglib
, to prevent unnecessary warnings. You can check that the correct C libraries have been bundled
by running the following in Python, and confirming that the same version numbers are printed:
import spglib
print(spglib.__version__)
print(spglib.spg_get_version_full())
Alternatively if desired, doped
can also be installed from conda
with:
conda install -c conda-forge doped
pip install pydefect # pydefect not available on conda, so needs to be installed with pip or otherwise, if using the eFNV correction
If you are installing doped
via conda
and you plan on using the eFNV (Kumagai-Oba) finite-size
correction, you will need to install the pydefect
package with pip
as shown or otherwise, as it is
not available on conda
.
It may be desirable to install doped
in a virtual envionment (e.g. if you encounter package dependency
conflict warnings during installation etc). You can do this with conda
with:
conda create -n doped python=3.11
conda activate doped
pip install doped
Setup POTCAR
s and Materials Project API
To generate VASP
POTCAR
input files, and auto-determine INCAR
settings such as NELECT
for charged defects, your POTCAR
directory needs to be setup to work with pymatgen
(via the
~/.pmgrc.yaml
file).
Instructions:
1. Set the VASP
pseudopotential directory and your Materials Project API key in $HOME/.pmgrc.yaml
(pymatgen
config 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 namedPOT_GGA_PAW_PBE
/potpaw_PBE.54
/POT_GGA_PAW_PBE_54
which containsPOTCAR.X(.gz)
files, generated usingpmg config
.
If you have not previously setup your
POTCAR
directory in this way withpymatgen
, then follow these steps:mkdir temp_potcars # make a top folder to store the unzipped POTCARs mkdir temp_potcars/POT_GGA_PAW_PBE # make a subfolder to store the unzipped POTCARs mv potpaw_PBE.54.tar.gz temp_potcars/POT_GGA_PAW_PBE # copy in your zipped VASP POTCAR source cd temp_potcars/POT_GGA_PAW_PBE tar -xf 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 the shell commands:
pmg potcar -s Na_pv grep PBE POTCAR
Which should then show
PAW_PBE Na_pv {date}
as the output (you can ignore anypymatgen
warnings about recognising thePOTCAR
type).If this does not work, you may need to add this to the
.pmgrc.yaml
file:PMG_DEFAULT_FUNCTIONAL: PBE # whatever functional label your POTCARs have
Note 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.
If you use doped
in your research, please cite:
S. R. Kavanagh et al. doped: Python toolkit for robust and repeatable charged defect supercell calculations. Journal of Open Source Software 9 (96), 6433, 2024
Developer Installation
If you want to use the example files from the tutorials or run the package tests, you will need to clone
the doped
GitHub repository:
Download the
doped
source code using the command:
git clone https://github.com/SMTG-Bham/doped
Navigate to root directory:
cd doped
Install the code, using the command:
pip install -e .
Requirements
The doped
dependencies are listed in the pyproject.toml
file on
the GitHub repository.