def __init__(self, structure, oxi_states=None): """ Does initial Valence bond method to initialize oxidation states for user help Overwridden by oxi_state specified by Args: structure pymatgen structure object to determine the oxidation states min_max_oxi: any user specified min/max oxidation ranges for elements in structure oxi_states: any user specified oxidation states of elements in structure """ oxi_states = oxi_states if oxi_states is not None else {} struct_species = structure.types_of_specie if (len(struct_species) == 1) and struct_species[0].symbol not in oxi_states.keys(): oxi_states[struct_species[0].symbol] = 0 else: vir = VIRE(structure) for elt, oxi in vir.valences.items(): strip_key = ''.join([s for s in elt if s.isalpha()]) if strip_key not in oxi_states.keys(): oxi_states[strip_key] = oxi self.oxi_states = oxi_states print( '\nThis is Full-User Charge Generation Mode.\n' 'Options are: (1) Range mode (input min and max of each each type of defect) ' 'or (2) Individual mode (input each charge state you want for each defect)\n' '\nWhen finished with specific defect, press ENTER to continue.') rng_mod = raw_input('Please specify Range (R) or Individual (I) Mode:') if 'R' == rng_mod.upper()[0]: self.rangemode = True else: self.rangemode = False
def __init__(self, structure): """ Conservative defect charge generator based on the oxidation statess determined by bond valence. Targetted materials are wideband semiconductors and insulators. AxBy where A is cation and B is anion will have charge assignments {A: [0:y], B:[-x:0]}. For these systems, antisites typically have very high formation energies and are ignored. Args: structure: pymatgen structure object """ struct_species = structure.types_of_specie if len(struct_species) == 1: oxi_states = {struct_species[0].symbol: 0} else: vir = VIRE(structure) oxi_states = vir.valences self.oxi_states = {} for key, val in oxi_states.items(): strip_key = ''.join([s for s in key if s.isalpha()]) self.oxi_states[strip_key] = val self.min_max_oxi = {} for s in struct_species: if isinstance(s, Specie): el = s.element elif isinstance(s, Element): el = s else: continue max_oxi = max(el.common_oxidation_states) min_oxi = min(el.common_oxidation_states) self.min_max_oxi[el.symbol] = (min_oxi, max_oxi)
def __init__(self, structure): """ Args: structure: pymatgen structure object """ struct_species = structure.types_of_specie if len(struct_species) == 1: oxi_states = {struct_species[0].symbol: 0} else: vir = VIRE(structure) oxi_states = vir.valences self.oxi_states = {} for key, val in oxi_states.items(): strip_key = ''.join([s for s in key if s.isalpha()]) self.oxi_states[strip_key] = val
def __init__(self, structure, min_max_oxi=None, oxi_states=None): """ Charge assignment based on the oxidation states referenced from semiconductor database. Targetted materials are shallow and some wideband semiconductors. For these systems, antisites are common and their charge assignment for antisites follows vacancies Args: structure pymatgen structure object to determine the oxidation states min_max_oxi: any user specified min/max oxidation ranges for elements in structure oxi_states: any user specified oxidation states of elements in structure """ min_max_oxi = min_max_oxi if min_max_oxi is not None else {} oxi_states = oxi_states if oxi_states is not None else {} struct_species = structure.types_of_specie if (len(struct_species) == 1) and struct_species[0].symbol not in oxi_states.keys(): oxi_states[struct_species[0].symbol] = 0 else: vir = VIRE(structure) for elt, oxi in vir.valences.items(): strip_key = ''.join([s for s in elt if s.isalpha()]) if strip_key not in oxi_states.keys(): oxi_states[strip_key] = oxi self.oxi_states = oxi_states self.min_max_oxi_bulk = [0, 0] for s in struct_species: if isinstance(s, Specie): el = s.element elif isinstance(s, Element): el = s else: continue if el.symbol not in min_max_oxi.keys(): max_oxi = max(el.common_oxidation_states) min_oxi = min(el.common_oxidation_states) min_max_oxi[el.symbol] = [min_oxi, max_oxi] if min_max_oxi[el.symbol][0] < self.min_max_oxi_bulk[0]: self.min_max_oxi_bulk[0] = min_max_oxi[el.symbol][0] if min_max_oxi[el.symbol][1] > self.min_max_oxi_bulk[1]: self.min_max_oxi_bulk[1] = min_max_oxi[el.symbol][1] self.min_max_oxi = min_max_oxi