Using oxidation states#
Here, we will demonstrate the main functionalities of the oxidation_states submodule of SMACT.
# Imports
from pymatgen.core import Structure, Lattice
from smact import Species
from smact.oxidation_states import Oxidation_state_probability_finder
Getting started with the oxidation_states submodule#
The main class of the smact.oxidation_states submodule is Oxidation_state_probability_finder. We will demonstrate the usage of the methods of this class below.
# Instantiate the oxidation state probability finder class with the default table
ox_prob_finder = Oxidation_state_probability_finder()
After instantiating the class, we can examine what species are included in the probability table through the get_included_species method.
included_species = ox_prob_finder.get_included_species()
print(
f"The species included in the probability table for the oxidation states model are show below \n{included_species}"
)
The species included in the probability table for the oxidation states model are show below
['Cl-1', 'Te-2', 'S-2', 'F-1', 'O-2', 'I-1', 'Br-1', 'Se-2', 'Li1', 'Ga3', 'Nb5', 'Co4', 'Ga1', 'Cr3', 'Ge2', 'Sr2', 'Ce2', 'Sc3', 'Sm3', 'Bi2', 'Hf2', 'Ni1', 'In2', 'Ce4', 'Ge4', 'Pd4', 'W2', 'Ta5', 'Ho3', 'Sn2', 'Mn4', 'Gd2', 'Tl3', 'Fe1', 'Zn2', 'Nd2', 'Cr4', 'Rb1', 'Bi5', 'Be2', 'W3', 'Nb2', 'Re5', 'Ti3', 'Co2', 'W5', 'Fe2', 'Re6', 'Pr3', 'Sm2', 'U3', 'U4', 'Ni2', 'K1', 'Bi1', 'Ho2', 'Nb4', 'Tm2', 'Pb4', 'Nd3', 'W4', 'Gd3', 'Rh1', 'Mn6', 'Y3', 'Bi3', 'Mn1', 'Al3', 'Ta2', 'Er3', 'Eu2', 'Ir4', 'Hg1', 'Ag1', 'Sn4', 'Ta1', 'Ta3', 'U5', 'U6', 'V5', 'Tb3', 'Rh3', 'Ta4', 'Mo2', 'Nb1', 'Nb3', 'Mg2', 'Hg2', 'Ru2', 'Ag3', 'Mn5', 'Ce3', 'Pr2', 'Re3', 'Ag2', 'Mo3', 'Cu2', 'Y2', 'Cr2', 'Dy3', 'Zr4', 'Zr1', 'Mo5', 'Sn3', 'Ba2', 'Th4', 'Co1', 'Cs1', 'Ru3', 'U2', 'Rh4', 'Tb2', 'Mn2', 'La3', 'Mn3', 'Cr5', 'Zr2', 'Ti4', 'Ni4', 'Ni3', 'Ru6', 'V2', 'Re4', 'Pb2', 'Y1', 'W6', 'Tl1', 'Ru4', 'La1', 'Ga2', 'Re7', 'Sb5', 'Tb4', 'Mo4', 'Fe4', 'In3', 'Dy2', 'Sc1', 'Lu3', 'In1', 'Yb3', 'Pd2', 'Pd3', 'Ti2', 'Ge3', 'Ir6', 'Cd2', 'Sc2', 'Re2', 'Sb3', 'Tb1', 'Ir5', 'Ca2', 'Th3', 'Zr3', 'Cu3', 'Yb2', 'Ir3', 'Sb4', 'V4', 'Mo6', 'Fe3', 'Mn7', 'Co3', 'Cu1', 'Na1', 'Ru5', 'Eu3', 'V3', 'Hf4', 'Tm3', 'Cr6', 'La2']
We can compute the probability of a cation-anion pair appearing together using the method pair_probability as demonstrated below for Al3+ and O2-. The pair probability for a species-anion pair (\(P_{SA}\)) is given by:
\(P_{SA} = \frac{N_{SX}}{N_{MX}}\)
where \(N_{MX}\) is the total number of compounds containing the metal element M, and X is the most electronegative anion.
Al = Species("Al", oxidation=3, coordination=6)
O = Species("O", oxidation=-2, coordination=6)
print(
f" The probability of Al existing in a 3+ oxidation state with O in a 2- oxidation state is {ox_prob_finder.pair_probability(Al, O)}"
)
The probability of Al existing in a 3+ oxidation state with O in a 2- oxidation state is 1.0
We can also compute the compound probability which for a ternary compound, AaBbXx, is given by:
\(P_{A_{a}B_{b}X_{x}} = P_{AX}P_{BX} = \frac{N_{AX}}{N_{M_{A}X}} \times \frac{N_{BX}}{N_{M_{B}X}}\)
We will calculate \(P_{CaAl_{2}O_{4}}\).
# Create a list of species for our compound of interest
CaAl2O4 = [Species("Ca", 2), Species("Al", 3), Species("O", -2)]
prob_compound = ox_prob_finder.compound_probability(CaAl2O4)
print(f"The compound probability for CaAl2O4 is {prob_compound}.")
The compound probability for CaAl2O4 is 1.0.
We can compute this compound probability for a pymatgen Structure as well.
# Create the structure
CsPbI3 = Structure.from_spacegroup(
"Pm-3m", # Spacegroup for a cubic perovskite
Lattice.cubic(6.41), # Cubic spacing of 6.41 Å
["Pb2+", "Cs+", "I-"], # Unique species of the ABX3 compound
[[0.0, 0.0, 0.0], [0.5, 0.5, 0.5], [0.0, 0.0, 0.5]], # Fractional atomic coordinates of each site
)
print("The structure of CsPbI3:\n")
print(CsPbI3)
# Get the compound probability for CsPbI3
prob = ox_prob_finder.compound_probability(CsPbI3)
print(f"\nThe compound probability for CsPbI3 is {prob_compound}.")
The structure of CsPbI3:
Full Formula (Cs1 Pb1 I3)
Reduced Formula: CsPbI3
abc : 6.410000 6.410000 6.410000
angles: 90.000000 90.000000 90.000000
pbc : True True True
Sites (5)
# SP a b c
--- ---- --- --- ---
0 Pb2+ 0 0 0
1 Cs+ 0.5 0.5 0.5
2 I- 0 0.5 0
3 I- 0.5 0 0
4 I- 0 0 0.5
The compound probability for CsPbI3 is 1.0.