This notebook demonstrates how to predict likely n- and p-type dopant atoms using pymatgen. This example uses the Materials API to download the structure of interest but any Structure
object can be used. Two methods for choosing dopants are demonstrated. The first uses a simple Shannon radii comparison, whereas the second is based on the substitution probability of two atoms calculated using the SubstitutionPredictor
utility in pymatgen. This code requires knowledge of the oxidation state of all elements in the structure. These can be guessed using pymatgen but should be checked to ensure the validity of the results.
Written using:
Author: Alex Ganose (10/06/18)
In [1]:
# Imports we need for generating dopant suggestions
from pymatgen.analysis.structure_prediction.dopant_predictor import \
get_dopants_from_shannon_radii, get_dopants_from_substitution_probabilities
from pymatgen.analysis.local_env import CrystalNN
from pymatgen import MPRester
from pprint import pprint
In [2]:
# Establish rester for accessing Materials API
api_key = None # INSERT YOUR OWN API KEY
mpr = MPRester(api_key=api_key)
Here we define a variable -- num_dopants
for how many dopants you wish to explore.
In [3]:
num_dopants = 5 # number of highest probability dopants you wish to see
In [4]:
mp_id = 'mp-856' # Materials Project id for rutile SnO2
structure = mpr.get_structure_by_material_id(mp_id)
The downloaded structure does not contain oxidation state information. There are two ways to add this information. The first is to specify the oxidation state of the elements manually.
In [5]:
structure.add_oxidation_state_by_element({"Sn": 4, "O": -2})
Alternatively, we can use pymatgen to guess the oxidation states. If using this method you should check that the oxidation states are what you expect.
In [6]:
structure.add_oxidation_state_by_guess()
Let's check what oxidation states pymatgen guessed.
In [7]:
species = structure.composition.elements
print(species)
In this section, we use the known Shannon radii to predict likely dopants. We will prefer dopants which have the smallest difference in radius to the host atoms. As the Shannon radii depend on the coordination number of the site, we must first calculate the bonding in the structure. In this example, we do this using the CrystalNN
class.
In [8]:
cnn = CrystalNN()
bonded_structure = cnn.get_bonded_structure(structure)
Pymatgen has a function to take a bonded structure with oxidation states and report the closest n- and p-type dopants, sorted by the difference in Shannon radii. Let's run this on our bonded structure:
In [9]:
dopants = get_dopants_from_shannon_radii(bonded_structure, num_dopants=num_dopants)
pprint(dopants)
The most favoured n-type dopant is U on a Sn site. Unfortunately, this is not a sustainable or safe choice of dopant. The most common industrial n-type dopant for SnO2 is fluorine. While F is present in our list of suggested dopants, it found way down at suggestion number 4.
Another limitation of the Shannon radii approach to choosing dopants is that the radii depend on both the coordination number and charge state. For many elements, the radii for many charge state/coordination number combinations have not been tabulated, meaning this approach is incomplete.
Instead we should use a more robust approach to determine possible dopants.
In this section, we use the statistics provided by SubstitutionPredictor
to predict likely dopants substitutions using a data-mined approach from ICSD data. Based on the species in the structure, we get a list of which species are likely to substitute in but have different charge states. The substitution prediction methodology is presented in:
Hautier, G., Fischer, C., Ehrlacher, V., Jain, A., and Ceder, G. (2011) Data Mined Ionic Substitutions for the Discovery of New Compounds. Inorganic Chemistry, 50(2), 656-663. doi:10.1021/ic102031h
Here, we define a variable -- threshold
for the threshold probability in making substitution/structure predictions.
In [10]:
threshold = 0.001 # probability threshold for substitution/structure predictions
Pymatgen provides a function to filter the predicted substitutions by their charge states and return a list of n- and p-type dopants. Let's run the function on the structure we downloaded earlier:
In [11]:
dopants = get_dopants_from_substitution_probabilities(
structure, num_dopants=num_dopants, threshold=threshold)
pprint(dopants)
The function returns a list of potential dopants sorted by their substitution probability. The most likely n-type dopant is F on a O site. Fluorine doped SnO2 (FTO) is one of the most widely used transparent conducting oxides, therefore validating this approach.