These Oxidation Pool notebooks parallelize the oxidation finding routine for the dataset


In [3]:
import pymatgen_pars as pymt
import numpy as np
import pymatgen.analysis.bond_valence as bv
from collections import Counter

In [5]:
st=pymt.read_unique_data("unique_data.json")

In [6]:
import tqdm
st_masked=[i for i in st if np.all([a in bv.BV_PARAMS for a in i.composition.elements])]
BV=bv.BVAnalyzer()

In [7]:
valency2=[]
True_vals=[]
for i in tqdm.tqdm_notebook(st_masked[5000:10000]):
    try:
        valency2.append(BV.get_valences(i))
        True_vals.append(i)
    except:
        pass




In [18]:
True_vals[0:20]


Out[18]:
[0, 1, 2, 3, 5, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 24, 25]

In [19]:
import pickle

with open("val2.pickle","w") as f:
    pickle.dump(valency2,f)

with open("True2.pickle","w") as f:
    pickle.dump(True_vals,f)

In [22]:
t5=[i+20000 for i in True_vals]

In [24]:
True5=[st_masked[i] for i in t5]

In [26]:
True5[0],valency5[0]


Out[26]:
(Structure Summary
 Lattice
     abc : 5.9283650699999999 5.9283648800000011 6.0646214599999997
  angles : 87.698849909999993 59.417750479999995 58.627065609999995
  volume : 149.1667358540013
       A : 5.1037276445940201 0.0 3.0162023362173298
       B : 3.4443483494253377 4.8192648844152082 0.23803481272881188
       C : 0.0 0.0 6.0646214599999997
 PeriodicSite: Mn (1.7222, 2.4096, 3.1513) [0.0000, 0.5000, 0.5000]
 PeriodicSite: Mn (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000]
 PeriodicSite: Mn (2.5519, 0.0000, 1.5081) [0.5000, 0.0000, 0.0000]
 PeriodicSite: Mn (1.7222, 2.4096, 0.1190) [0.0000, 0.5000, 0.0000]
 PeriodicSite: Ni (4.2740, 2.4096, 1.6271) [0.5000, 0.5000, 0.0000]
 PeriodicSite: O (3.2938, 1.2987, 6.3501) [0.4635, 0.2695, 0.8060]
 PeriodicSite: O (5.9791, 1.3209, 7.8593) [0.9865, 0.2741, 0.7945]
 PeriodicSite: O (5.1378, 3.7641, 6.4508) [0.4796, 0.7811, 0.7945]
 PeriodicSite: O (7.5051, 3.5853, 7.8013) [0.9684, 0.7440, 0.7755]
 PeriodicSite: O (1.0429, 1.2339, 1.5175) [0.0316, 0.2560, 0.2245]
 PeriodicSite: O (3.4103, 1.0551, 2.8680) [0.5204, 0.2189, 0.2055]
 PeriodicSite: O (2.5690, 3.4984, 1.4596) [0.0135, 0.7259, 0.2055]
 PeriodicSite: O (5.2543, 3.5206, 2.9687) [0.5365, 0.7305, 0.1940],
 [3, 3, 4, 4, 2, -2, -2, -2, -2, -2, -2, -2, -2])

In [27]:
with open("val5.pickle","w") as f:
    pickle.dump(valency5,f)

with open("True5.pickle","w") as f:
    pickle.dump(True5,f)

In [28]:
True_vals2=[]
for i in tqdm.tqdm_notebook(st_masked[5000:10000]):
    try:
        BV.get_valences(i)
        True_vals2.append(i)
    except:
        pass




In [29]:
with open("True2.pickle","w") as f:
    pickle.dump(True_vals2,f)

In [30]:
bv.BV_PARAMS


Out[30]:
{Element Eu: {'c': 1.01, 'r': 1.62},
 Element Tb: {'c': 1.1, 'r': 1.56},
 Element Yb: {'c': 1.06, 'r': 1.49},
 Element Cs: {'c': 0.86, 'r': 2.05},
 Element K: {'c': 0.91, 'r': 1.73},
 Element Rb: {'c': 0.89, 'r': 1.84},
 Element Ba: {'c': 0.97, 'r': 1.88},
 Element Na: {'c': 1.01, 'r': 1.36},
 Element Sr: {'c': 0.99, 'r': 1.66},
 Element Li: {'c': 0.97, 'r': 1.0},
 Element Ca: {'c': 1.04, 'r': 1.5},
 Element La: {'c': 1.08, 'r': 1.71},
 Element Ce: {'c': 1.08, 'r': 1.68},
 Element Pr: {'c': 1.07, 'r': 1.66},
 Element Nd: {'c': 1.07, 'r': 1.64},
 Element Sm: {'c': 1.07, 'r': 1.61},
 Element Gd: {'c': 1.11, 'r': 1.58},
 Element Dy: {'c': 1.1, 'r': 1.54},
 Element Y: {'c': 1.11, 'r': 1.52},
 Element Ho: {'c': 1.1, 'r': 1.53},
 Element Er: {'c': 1.11, 'r': 1.51},
 Element Tm: {'c': 1.11, 'r': 1.5},
 Element Lu: {'c': 1.14, 'r': 1.47},
 Element Hf: {'c': 1.23, 'r': 1.42},
 Element Th: {'c': 1.11, 'r': 1.7},
 Element Mg: {'c': 1.23, 'r': 1.21},
 Element Zr: {'c': 1.22, 'r': 1.43},
 Element Sc: {'c': 1.2, 'r': 1.34},
 Element U: {'c': 1.22, 'r': 1.59},
 Element Ta: {'c': 1.33, 'r': 1.39},
 Element Ti: {'c': 1.32, 'r': 1.27},
 Element Mn: {'c': 1.6, 'r': 1.17},
 Element Be: {'c': 1.47, 'r': 0.81},
 Element Nb: {'c': 1.23, 'r': 1.4},
 Element Al: {'c': 1.47, 'r': 1.13},
 Element Tl: {'c': 1.44, 'r': 1.62},
 Element V: {'c': 1.45, 'r': 1.21},
 Element Zn: {'c': 1.66, 'r': 1.07},
 Element Cr: {'c': 1.56, 'r': 1.16},
 Element Cd: {'c': 1.46, 'r': 1.28},
 Element In: {'c': 1.49, 'r': 1.34},
 Element Ga: {'c': 1.82, 'r': 1.14},
 Element Fe: {'c': 1.64, 'r': 1.16},
 Element Co: {'c': 1.7, 'r': 1.09},
 Element Cu: {'c': 1.75, 'r': 0.87},
 Element Re: {'c': 1.46, 'r': 1.37},
 Element Si: {'c': 1.58, 'r': 1.12},
 Element Ni: {'c': 1.75, 'r': 1.04},
 Element Ag: {'c': 1.42, 'r': 1.12},
 Element Sn: {'c': 1.72, 'r': 1.37},
 Element Hg: {'c': 1.44, 'r': 1.32},
 Element Ge: {'c': 1.51, 'r': 1.21},
 Element Bi: {'c': 1.67, 'r': 1.54},
 Element B: {'c': 1.6, 'r': 0.79},
 Element Sb: {'c': 1.72, 'r': 1.41},
 Element Te: {'c': 2.72, 'r': 1.4},
 Element Mo: {'c': 1.3, 'r': 1.37},
 Element As: {'c': 2.23, 'r': 1.21},
 Element P: {'c': 1.96, 'r': 1.09},
 Element H: {'c': 0.89, 'r': 0.38},
 Element Ir: {'c': 1.55, 'r': 1.37},
 Element Pd: {'c': 1.35, 'r': 1.11},
 Element Ru: {'c': 1.42, 'r': 1.21},
 Element Rh: {'c': 1.54, 'r': 1.18},
 Element Pb: {'c': 1.55, 'r': 1.53},
 Element W: {'c': 1.4, 'r': 1.38},
 Element C: {'c': 2.0, 'r': 0.78},
 Element Se: {'c': 2.51, 'r': 1.18},
 Element S: {'c': 2.35, 'r': 1.03},
 Element I: {'c': 2.38, 'r': 1.33},
 Element Br: {'c': 2.58, 'r': 1.13},
 Element N: {'c': 2.61, 'r': 0.72},
 Element Cl: {'c': 2.74, 'r': 0.99},
 Element O: {'c': 3.15, 'r': 0.63},
 Element F: {'c': 3.98, 'r': 0.58}}

In [31]:
from pymatgen import Element

In [32]:
[e for e in Element if e not in bv.BV_PARAMS.keys()]


Out[32]:
[Element Ac,
 Element Am,
 Element Ar,
 Element At,
 Element Au,
 Element Bk,
 Element Cf,
 Element Cm,
 Element Es,
 Element Fm,
 Element Fr,
 Element He,
 Element Kr,
 Element Lr,
 Element Md,
 Element Ne,
 Element No,
 Element Np,
 Element Os,
 Element Pa,
 Element Pm,
 Element Po,
 Element Pt,
 Element Pu,
 Element Ra,
 Element Rn,
 Element Tc,
 Element Xe]

In [ ]: