Using doper

Using doper#

The Doper module includes the get_dopants function. This function requires an input, which is a tuple of strings representing the ionic species of the material.

By default, the top five p-type and n-type candidates are reported. Use the num_dopants input to modify the number of outputs.

Output Format

The output is a dictionary with keys:

  • “n_type_cation”

  • “p_type_cation”

  • “n_type_anion”

  • “p_type_anion”

Each key contains a list of possible dopants, ordered by probability (Highest → Lowest). Each possible dopant is represented as a tuple: ('substituted dopant', 'original species', 'probability').

from smact.dopant_prediction.doper import Doper

# Define the material using its ionic species.
# Here, we are creating a material object with titanium in the 4+ oxidation state (Ti4+) and oxygen in the 2- oxidation state (O2-).
material = Doper(("Ti4+", "O2-"))

# Use the `get_dopants` function to predict potential dopants.
# By default, it returns the top 5 p-type and n-type dopants, but this can be adjusted with the `num_dopants` parameter.
# The output will be a dictionary with possible n-type and p-type cation and anion dopants.
dopants = material.get_dopants(num_dopants=5)

# Print the dopant predictions.
# Each entry in these lists is a tuple: ('substituted dopant', 'original species', 'probability').
print(dopants)

The results can be presented in a table format using the to_table attribute.

material.to_table

Ternary and multicomponent systems can also be dealt with.

quaternary = Doper(("Cu1+", "Zn2+", "Ge4+", "S2-"))
quaternary.get_dopants()

If you want to plot the results in the form of heatmap, use plot_dopants method.

The default heatmap is ‘YlOrRd’. Refer to the matplotlib documentation for other options using “cmap” parameter.

quaternary.plot_dopants(cmap="Reds")

Alternative metrics#

The probability values for the dopants are calculated based on the algorithm 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

In SMACT, we can also provide alternative ways for determining the possible dopants based on alternative probability or similarity metrics.

For example, we have a similarity metric based on distributed representations of the ions, which we call skipspecies. This metric is based on the idea that similar ions should have similar embeddings. The similarity is calculated based on the cosine similarity of the embeddings of the ions.

doper_skipspecies = Doper(("Ti4+", "O2-"), embedding="skipspecies", use_probability=False)
doper_skipspecies.get_dopants(5)
# Present results in a table
doper_skipspecies.to_table