defects

Contents

defects#

Core defect objects

Classes

Defect([specie, defect_site, ...])

Abstract class for a single point defect

DefectComplex(defects[, bulk_structure, ...])

Class to describe defect complexes

Interstitial([specie, defect_site, ...])

Subclass of Defect for interstitial defects.

Polaron([specie, defect_site, ...])

Subclass of Defect for polarons.

Substitution([specie, bulk_specie, ...])

Subclass of Defect for substitutional defects.

Vacancy([specie, defect_site, ...])

Subclass of Defect for single vacancies.

Functions

format_legend_with_charge_kv

Get label in latex format with charge written with Kröger and Vink notation.

format_legend_with_charge_number

Get label in latex format with charge written as a number.

get_defect_from_string

Get defect object from a string (Defect or DefectComplex).

get_delta_atoms

Build delta_atoms dictionary starting from Pymatgen Structure objects.

get_delta_atoms_from_comp

Build delta_atoms dictionary starting from Composition objects.

class Defect(specie=None, defect_site=None, bulk_structure=None, charge=None, multiplicity=None, bulk_volume=None, label=None)[source]#

Bases: MSONable

Abstract class for a single point defect

Base class for defect objets.

Parameters:
  • specie (str) – Defect element symbol.

  • defect_site (Site) – Pymatgen Site object of the defect.

  • bulk_structure (Structure) – Pymatgen Structure without defects.

  • charge (int or float) – Charge of the defect.

  • multiplicity (int) – Multiplicity of defect within the simulation cell.

  • bulk_volume (float) – Volume of bulk cell in A°^3.

  • label (str) – Defect label.

property bulk_structure#

Structure without defects.

property bulk_volume#

Volume of bulk cell in A°^3.

property charge#

Charge of the defect.

abstract property defect_composition#

Defect composition as a Composition object

abstract property defect_site_index#

Index of the defect site in the structure

property defect_structure#

Structure of the defect.

property defects#
property delta_atoms#

Dictionary with defect element symbol as keys and difference in particle number between defect and bulk structure as values

static from_string(string, **kwargs)[source]#
abstractmethod get_multiplicity()[source]#
property label#

Defect label.

property multiplicity#

Multiplicity of a defect site within the structure

abstract property name#

Name of the defect.

set_bulk_volume(new_volume)[source]#

Sets the volume of bulk cell

set_charge(new_charge=0.0)[source]#

Sets the charge of the defect.

set_label(new_label)[source]#

Sets the label of the defect

set_multiplicity(new_multiplicity=None)[source]#

Sets the Multiplicity of the defect. If new_multiplicity is not provided it is determined with self.get_multiplicity

property site#

Defect position as a Site object

property site_concentration_in_cm3#

Site concentration (multiplicity/volume) expressed in cm^-3.

property specie#

Defect species.

property symbol#

Latex formatted name of the defect.

property symbol_with_charge#

Name in latex format with charge written as a number.

property symbol_with_charge_kv#

Name in latex format with charge written with Kröger and Vink notation.

property type#

Defect type.

class DefectComplex(defects, bulk_structure=None, charge=None, multiplicity=None, bulk_volume=None, label=None)[source]#

Bases: MSONable

Class to describe defect complexes

Parameters:
  • defects (list) – List of Defect objects.

  • bulk_structure (Structure) – Pymatgen Structure of the bulk material.

  • charge (int or float) – Charge of the defect.

  • multiplicity (int) – Multiplicity of the defect.

property bulk_structure#

Structure without defects.

property bulk_volume#

Volume of bulk cell in A°^3.

property charge#

Charge of the defect.

property defect_composition#

Composition of defect structure.

property defect_names#

List of names of the single defects.

property defect_structure#

Structure containing the defect.

property defects#

List of single defects consituting the complex.

property delta_atoms#

Dictionary with Element as keys and particle difference between defect structure and bulk structure as values.

static from_string(string, **kwargs)[source]#

Get DefectComplex object from string.

generate_defect_structure(bulk_structure=None)[source]#

Generate a structure containing the defect starting from a bulk structure. If not provided self.bulk_structure is used.

get_multiplicity()[source]#
property label#

Defect label.

property multiplicity#

Multiplicity of a defect site within the structure

property name#

Name of the defect. Behaves like a string with additional attributes.

set_charge(new_charge)[source]#

Sets the charge of the defect.

set_label(new_label)[source]#

Sets the label of the defect

set_multiplicity(new_multiplicity)[source]#

Sets the charge of the defect.

property site_concentration_in_cm3#

Site concentration (multiplicity/volume) expressed in cm^-3.

property sites#

Site objects of single defects.

property symbol#

Latex formatted name of the defect.

property symbol_with_charge#

Name in latex format with charge written as a number.

property symbol_with_charge_kv#

Name in latex format with charge written with kroger and vink notation.

property type#

Defect type.

class Interstitial(specie=None, defect_site=None, bulk_structure=None, charge=None, multiplicity=None, bulk_volume=None, label=None)[source]#

Bases: Defect

Subclass of Defect for interstitial defects.

Base class for defect objets.

Parameters:
  • specie (str) – Defect element symbol.

  • defect_site (Site) – Pymatgen Site object of the defect.

  • bulk_structure (Structure) – Pymatgen Structure without defects.

  • charge (int or float) – Charge of the defect.

  • multiplicity (int) – Multiplicity of defect within the simulation cell.

  • bulk_volume (float) – Volume of bulk cell in A°^3.

  • label (str) – Defect label.

property defect_composition#

Composition of the defect.

property defect_site_index#

Index of the defect site in the defect structure

property delta_atoms#

Dictionary with element symbol as keys and difference in particle number between defect and bulk structure as values

generate_defect_structure(bulk_structure=None)[source]#

Generate a structure containing the defect starting from a bulk structure.

Parameters:

bulk_structure (Structure) – Bulk Structure. If not provided self.bulk_structure is used.

Returns:

structure – Structure containing the defect.

Return type:

Structure

get_multiplicity()[source]#
property name#

Name of the defect.

property symbol#

Latex formatted name of the defect.

class Polaron(specie=None, defect_site=None, bulk_structure=None, charge=None, multiplicity=None, label=None, bulk_volume=None, defect_structure=None)[source]#

Bases: Defect

Subclass of Defect for polarons.

defect_structure: Structure

Structure containing the polaron. If not provided the site index is searched in the bulk structure, and defect_structure is set equal to the bulk structure.

property defect_composition#

Composition of the defect.

property defect_site_index#

Index of the defect site in the structure.

property delta_atoms#

Dictionary with delement as keys and difference in particle number between defect and bulk structure as values.

generate_defect_structure(bulk_structure=None)[source]#

Structure containing the polaron. If not provided the site index is searched in the bulk structure, and defect_structure is set equal to the bulk structure.

get_multiplicity(**kwargs)[source]#

Get multiplicity of the defect in the structure.

Parameters:

**kwargs (dict) – Kwargs to pass to SpacegroupAnalyzer (“symprec”, “angle_tolerance”)

property name#

Name of the defect.

property symbol#

Latex formatted name of the defect.

class Substitution(specie=None, bulk_specie=None, defect_site=None, bulk_structure=None, charge=None, multiplicity=None, bulk_volume=None, label=None, site_in_bulk=None)[source]#

Bases: Defect

Subclass of Defect for substitutional defects.

Parameters:

site_in_bulk (PeriodicSite) – Original Site in bulk structure were substitution took place.

property bulk_specie#
property defect_composition#

Composition of the defect.

property defect_site_index#

Index of the defect site in the bulk structure.

property delta_atoms#

Dictionary with element symbol as keys and difference in particle number between defect and bulk structure as values

generate_defect_structure(bulk_structure=None, defect_site_index=None)[source]#

Generate a structure containing the defect starting from a bulk structure.

Parameters:
  • bulk_structure (Structure) – Bulk Structure. If not provided self.bulk_structure is used.

  • defect_site_index (Structure) – Index of the defect site in the bulk structure. If not provided self.defect_site_index is used.

Returns:

structure – Structure containing the defect.

Return type:

Structure

get_multiplicity(**kwargs)[source]#

Get multiplicity of the defect in the structure

Parameters:

**kwargs (dict) – Kwargs to pass to SpacegroupAnalyzer (“symprec”, “angle_tolerance”)

get_site_in_bulk()[source]#
property name#

Name for this defect.

property site_in_bulk#
property symbol#

Latex formatted name of the defect.

class Vacancy(specie=None, defect_site=None, bulk_structure=None, charge=None, multiplicity=None, bulk_volume=None, label=None)[source]#

Bases: Defect

Subclass of Defect for single vacancies.

Base class for defect objets.

Parameters:
  • specie (str) – Defect element symbol.

  • defect_site (Site) – Pymatgen Site object of the defect.

  • bulk_structure (Structure) – Pymatgen Structure without defects.

  • charge (int or float) – Charge of the defect.

  • multiplicity (int) – Multiplicity of defect within the simulation cell.

  • bulk_volume (float) – Volume of bulk cell in A°^3.

  • label (str) – Defect label.

property defect_composition#

Composition of the defect.

property defect_site_index#

Index of the defect site in the bulk structure

property delta_atoms#

Dictionary with element symbol as keys and difference in particle number between defect and bulk structure as values

generate_defect_structure(bulk_structure=None, defect_site_index=None)[source]#

Generate a structure containing the defect starting from a bulk structure.

Parameters:
  • bulk_structure (Structure) – Bulk Structure. If not provided self.bulk_structure is used.

  • defect_site_index (Structure) – Index of the defect site in the bulk structure. If not provided self.defect_site_index is used.

Returns:

structure – Structure containing the defect.

Return type:

Structure

get_multiplicity(**kwargs)[source]#

Get multiplicity of the defect in the structure.

Parameters:

**kwargs (dict) – Kwargs to pass to SpacegroupAnalyzer (“symprec”, “angle_tolerance”)

property name#

Name of the defect.

property symbol#

Latex formatted name of the defect.

format_legend_with_charge_kv(label, charge)[source]#

Get label in latex format with charge written with Kröger and Vink notation.

Parameters:
  • label (str) – Original name of the defect.

  • charge (int or float) – Charge of the defect. Floats are converted to integer.

Returns:

string – Formatted defect name with Kröger and Vink notation.

Return type:

str

format_legend_with_charge_number(label, charge)[source]#

Get label in latex format with charge written as a number.

Parameters:
  • label (str) – Original name of the defect.

  • charge (int or float) – Charge of the defect. Floats are converted to integers.

Returns:

string – Formatted defect name with charge.

Return type:

str

get_defect_from_string(string, **kwargs)[source]#

Get defect object from a string (Defect or DefectComplex).

get_delta_atoms(structure_defect, structure_bulk)[source]#

Build delta_atoms dictionary starting from Pymatgen Structure objects.

Parameters:
  • structure_defect (Structure) – Defect structure.

  • structure_bulk (Structure) – Bulk structure.

Returns:

delta_atoms – Dictionary with Element as keys and delta n as values.

Return type:

dict

get_delta_atoms_from_comp(comp_defect, comp_bulk)[source]#

Build delta_atoms dictionary starting from Composition objects.

Parameters:
  • comp_defect (Composition) – Defect structure.

  • comp_bulk (Composition) – Bulk structure.

Returns:

delta_atoms – Dictionary with Element as keys and delta n as values.

Return type:

dict