Defects

class Defects(defects, defect_generators=None, defect_generator_map=None, name='Defects')

A class which describes the list of defects.

Parameters:
  • defects (list of NamedPointDefect) – The list of defects.

  • defect_generators (dict of (key, value) type (str, BaseDefectGenerator)) – Dictionary of defect defect_generators, used to construct the defects.

  • defect_generator_map (dict of (key, value) type (NamedPointDefect, str)) – Mapping between the defects and the defect generators, used to construct them.

  • name (str) – The name.

appendDefectPairsWithDefectConfigurations(defect_pairs_table, required_defects_table, defect_configurations_table)

Append the defect_configurations from the defect_configurations_table into the defect_pairs_table, as two new columns, one for initial and one for final.

Note that the required_defects_table is used as the defect_configurations_table is constructed from this table, and the required_defects_table knows which defects in defect_pairs_table correspond to which defect_configurations in defect_configurations_table.

Parameters:
  • defect_pairs_table (Table) – The defect migration pairs table.

  • required_defects_table (Table) – The required defects table, that knows about the placement.

  • defect_configurations_table (Table) – The defect configurations table.

Returns:

The modified defect migration pairs table.

Return type:

Table

generateDefectMigrationPairs(host_configuration, supercell_repetitions=None, maximum_distance=None)

Method to get the defect pairs table.

Parameters:
  • host_configuration (BulkConfiguration) – The host configuration.

  • supercell_repetitions (3-tuple of int | None) – The supercell repetitions used in the defect material.

  • maximum_distance (PhysicalQuantity of type length) – Maximum allowed distance.

Returns:

The defect pairs table.

Return type:

Table

requiredDefects(defect_pairs_table)

Create a table with a single column consisting of all unique NamedPointDefects in the table, either initial or final.

Parameters:

defect_pairs_table (Table) – The defect pairs table (usually from generateDefectMigrationPairs).

Returns:

The required defects table.

Return type:

Table

totalDefects()

Create a table with just the input named point defects in it. This essentially just converts a Defects object to a table.

Returns:

Table with all the named point defects.

Return type:

Table

uniqueDefects()
Returns:

The list of symmetrically unique point defects.

Return type:

list of NamedPointDefect

uniqueString()

Return a unique string representing the state of the object.

Usage Examples

In this example the total energies of some defects in hexagonal boron nitride defects are calculated. Vacancy, anti-site substitutional and interstitial defects are defined in the Defects block. This is used to generate a table of defect configurations within a supercell. In each table iteration an LCAOCalculator is set, the geometry optimized, and then the total energy is calculated.

A workflow for the calculation can be downloaded here with a corresponding python script Boron_nitride_defects.py.

Notes

The Defects object manages the use of multiple defects for defect formation and diffusion calculations. The object takes at a minimum a sequence of defects in the form of NamedPointDefect. Optionally it also takes two dictionaries used to define the defect generators and which defects are created by which generator. The argument defect_generators takes a dictionary with the defect generators as the value. The argument defect_generator_map takes a second dictionary where the individual defects are the keys, and the keys from the defect_generators dictionary are the values.

The Defects object can create starting tables for different types of calculations. The method totalDefects returns a table of all the defects provided to the object. This is useful in cases where all the defects are to be calculated. For diffusion calculations the object can also generate a table of all of the possible transitions between defects using the generateDefectMigrationPairs method. This takes the compatibility of different defects and the minimum distance between them into account. If the generators are also supplied different symmetrically equivalent representations of the defects can be used to find the minimum distance between two defects. With this table, the minimal set of defects required to model the diffusion can be returned using the method requiredDefects. This method filters out defects that do not have any transition paths in the defect pair table.