pymatgen.analysis.defects.defect_compatibility module

class DefectCompatibility(plnr_avg_var_tol=0.1, plnr_avg_minmax_tol=0.1, atomic_site_var_tol=0.1, atomic_site_minmax_tol=0.1, tot_relax_tol=1.0, perc_relax_tol=20.0, defect_tot_relax_tol=0.1, preferred_cc=’freysoldt’, free_chg_cutoff=2.0, use_bandfilling=True, use_bandedgeshift=True)[source]

Bases: monty.json.MSONable

The DefectCompatibility class combines a list of DefectEntries for a given system and applies corrections / suggests failed jobs that should not be considered :param defect_entries: List of defect_entries to consider. :param user_defect_qualifiers: a dictionary for specifying the dictionary of qualifiers

for corrections and delocalization analysis. Defaults are in dictionary above
required settings for defect_entry.parameters:

freysoldt: [“axis_grid”, “bulk_planar_averages”, “defect_planar_averages”, “dielectric”] kumagai: [“dim”, “bulk_atomic_site_averages”, “defect_atomic_site_averages”, “site_matching_indices”,


bandfilling: [“eigenvalues”, “kpoint_weights”, “potalign”, “vbm”, “cbm”] bandshifting: [“hybrid_cbm”, “hybrid_vbm”, “num_hole_vbm”, “num_elec_cbm”, “vbm”, “cbm”] defect relaxation/structure analysis: [“final_defect_structure”, “initial_defect_structure”, “sampling_radius”]

Do delocalization analysis. To do this, one considers:
  1. sampling region of planar averaged electrostatic potential (freysoldt approach)
  2. sampling region of atomic site averaged potentials (kumagai approach)
  3. structural relaxation amount outside of radius considered in kumagai approach (default is wigner seitz radius)
  4. if defect is not a vacancy type -> track to see how much the defect has moved

calculations that fail delocalization get “is_compatibile” set to False in parameters also parameters recieves a “delocalization_meta” with following dict:

plnr_avg = {‘is_compatible’: True/False, ‘metadata’: metadata used for determining this} atomic_site = {‘is_compatible’: True/False, ‘metadata’: metadata used for determining this} structure_relax = {‘is_compatible’: True/False, ‘metadata’: metadata used for determining this} defectsite_relax = {‘is_compatible’: True/False, ‘metadata’: metadata used for determing this}

Process a given Defect entry with qualifiers given from initialization of class. Order of processing is:

  1. perform all possible defect corrections with information given

2) consider delocalization analyses based on qualifier metrics given initialization of class. If delocalized, flag entry as delocalized 3) update corrections to defect entry and flag as del

Corrections are applied based on:
  1. if free charges are more than free_chg_cutoff then will not apply charge correction,
    because it no longer is applicable
  2. use charge correction set by preferred_cc
  3. only use BandFilling correction if use_bandfilling is set to True
  4. only use BandEdgeShift correction if use_bandedgeshift is set to True