ChargedPointDefect¶
- class ChargedPointDefect(bulk_configuration, filename, object_id, formation_energy_calculator=None, relaxation_calculator=None, band_gap_calculator=None, point_defect=None, charge_states=None, atomic_chemical_potentials=None, supercell_repetitions_list=None, relax_atomic_coordinates=None, dielectric_constant=None, log_filename_prefix=None, number_of_processes_per_task=None, elastic_correction_method=None, optimize_geometry_parameters=None, model_charge_correction=None, random_seed=None, resume=None, use_ghost=None, calculate_defect_symmetry=None)¶
Constructor for the ChargedPointDefect object.
- Parameters:
bulk_configuration (
BulkConfiguration
) – The reference bulk unit cell configuration to be used to generate the supercell configurations.filename (str) – The full or relative filename path the Study object should be saved to. See
nlsave()
.object_id (str) – The name of the study that the Study object should be saved to within the file. This needs to be a unique name in this file. See
nlsave()
.formation_energy_calculator (Calculator) – The calculator used for calculating the formation energy of the defect charge states. All total energies, band positions and finite-size corrections are calculated using this calculator. The calculator must contain a basis set for the elements in both the defect and pristine configurations. Note that the calculator is taken as a reference corresponding to the bulk unit cell given in
bulk_configuration
; thedensity_mesh_cutoff
andk_point_sampling
parameters of theNumericalAccuracyParameters
of the calculator will be scaled consistently with the supercell size. Thek_point_sampling
will be scaled to maintain the k-point density approximately equal to the reference. The k-point grid will always be shifted such that the Gamma point is included, i.e.,shift_to_gamma=True
. Default: The calculator given inrelaxation_calculator
. At least one of the two calculators must be provided.relaxation_calculator (Calculator) – The calculator used for relaxing the atomic coordinates of the defect supercells. The calculator must contain a basis set for the elements in the defect configuration. Note that the calculator is taken as a reference corresponding to the bulk unit cell given in
bulk_configuration
; thedensity_mesh_cutoff
andk_point_sampling
parameters of theNumericalAccuracyParameters
of the calculator will be scaled consistently with the supercell size. Thek_point_sampling
will be scaled to maintain the k-point density approximately equal to the reference. The k-point grid will always be shifted such that the Gamma point is included, i.e.,shift_to_gamma=True
. Default: The calculator given information_energy_calculator
. At least one of the two calculators must be provided.band_gap_calculator – The calculator used for calculating the band gap in which the transition levels will be placed. The calculator is only used for the pristine configuration, so only needs to contain a basis set for the elements in this configuration. Note that the calculator is taken as a reference corresponding to the bulk unit cell given in
bulk_configuration
; thedensity_mesh_cutoff
andk_point_sampling
parameters of theNumericalAccuracyParameters
of the calculator will be scaled consistently with the supercell size. Thek_point_sampling
will be scaled to maintain the k-point density approximately equal to the reference. The k-point grid will always be shifted such that the Gamma point is included, i.e.,shift_to_gamma=True
. Default: The calculator given information_energy_calculator
.point_defect (
Vacancy
|Substitutional
|Interstitial
|DefectCluster
|SplitInterstitial
) – The point defect to embed in the host supercell. Default:Vacancy()
charge_states – The list of charge states of the defect, as a discrete multiple of elementary charge. A charge of
-1
corresponds to one extra electron. Default:0
atomic_chemical_potentials (sequence of
AtomicChemicalPotential
) – The chemical potentials for the atomic species involved in the creation of the defect (i.e., any species for which the number of atoms changes between the pristine and defect supercell). Default: All necessary atomic chemical potentials will be calculated using the pristine configuration (when possible) or a default elemental reference configuration.supercell_repetitions_list (sequence (size 3) of int | sequence of sequence (size 3) of int) – The list of supercells of the bulk unit cell to calculate, each given as the number of repetitions of the bulk unit cell along the (a, b, c) directions. Default:
[(1, 1, 1)]
relax_atomic_coordinates (bool) – Whether to relax the atomic coordinates of the defect supercells. Default:
True
dielectric_constant (float) – The dielectric constant of the host material. Only needed to calculate the finite-size correction terms. Default:
1.0
log_filename_prefix (str |
LogToStdOut
) – Filename prefix for the logging output of charged point defect calculations. IfLogToStdOut
, all logging will instead be sent to standard output. Default:'chargedpointdefect_'
number_of_processes_per_task (int) – The number of processes that will be used to execute each task. If this value is greater than or equal to the total number of available processes, each single task will be executed collaboratively over all processes. Otherwise, a delegator-worker scheme is used; in this case, one process will be set aside as the delegator, and the remaining ones will be grouped into workers and execute tasks concurrently. Default: All available processes execute each task collaboratively.
elastic_correction_method (
ImageStressCorrection
) – Specify a finite size elastic energy correction. If not specified, no finite size elastic energy correction will be applied. Default: Noneoptimize_geometry_parameters (
OptimizeGeometryParameters
) – The parameters to use for optimizing the geometry. Note thatpre_step_hook
andpost_step_hook
must be left unset. Also note thatmax_stress
,target_stress
,restart_strategy
andenable_optimization_stop_file
do not have any effect since stress is not optimized, and the restart mechanism withinOptimizeGeometry()
is disabled. Only constraints of typeFixAtomConstraints
andRigidBody
will be maintained, others will be discarded. Default:OptimizeGeometryParameters()
model_charge_correction (
ModelChargeCorrection
) – Specify a finite size model charge correction. Default: ModelChargeCorrection()random_seed (int | None) – The random seed to rattle atomic coordinates.
None
for the system to pick different ones for you. Default: Noneresume (bool) – Whether rerunning the simulation will resume non converged results. Default: False
use_ghost (bool) – Whether ghost atoms will be used (for LCAO calculators only). Default: True
calculate_defect_symmetry (bool) – Whether to calculate the symmetry of the defect. Default:
False
- atomNumberDifferences()¶
- Returns:
The atom number differences for each element.
- Return type:
dict of type {
PeriodicTableElement
: int}
- atomicChemicalPotentials()¶
- Returns:
The atomic chemical potential for all the required elements. If an element for which the atomic chemical potential needs to be calculated is not present, it is calculated from the pristine cell at each supercell size.
- Return type:
list of
AtomicChemicalPotential
- bandShift(supercell_repetitions, charge_state)¶
Retrieve the band shift for a given defect supercell with respect to the pristine supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The band shift for the supercell. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
- calculateDefectSymmetry()¶
- Returns:
Whether the defect symmetry is calculated.
- Return type:
bool
- calculatedChargeStates(supercell_repetitions=None)¶
Retrieve the list of calculated charge states, either for the entire study or for a given supercell.
- Parameters:
supercell_repetitions (sequence (size 3) of int |
ExtrapolationScheme
) – The supercell given as the number of repetitions of the bulk unit cell along the (a, b, c) directions for which to return the list of calculated charge states. For an extrapolation scheme, the charge states for all supercells are returned. Default: All supercells.- Returns:
The list of calculated charge states. The charge states are ordered from the most positive to the most negative.
- Return type:
list of int
- calculatedSupercells(charge_state=None)¶
Retrieve the list of calculated supercells, either for the entire study or for a given charge state.
- Parameters:
charge_state (int) – The charge state for which to return the list of calculated supercells. Default: All charge states.
- Returns:
The list of calculated supercells, each given as the number of repetitions of the bulk unit cell along the (a, b, c) directions. The supercells are ordered from the smallest to the largest in terms of the number of atoms; if multiple supercells have the same number of atoms they are ordered according to the repetitions in the (a, b, c) directions, in that order.
- Return type:
list of tuple (size 3) of int
- chargeStates()¶
- Returns:
The list of all calculated and not calculated charge states. Any charge state which has not yet been calculated will be calculated the next time the object is updated.
- Return type:
list of int
- conductionBandMinimum(supercell_repetitions)¶
Retrieve the conduction band minimum of the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The conduction band minimum of the pristine unit cell configuration. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
- defectConfiguration(supercell_repetitions, charge_state, symmetry_index=None, unit_cell_translation=None)¶
Retrieve the defect supercell configuration for a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
symmetry_index (int) – The index of the symmetry operation for the pristine unit cell to apply to the defect supercell configuration. Note that this can only be used if the ‘calculate_defect_symmetry’ option has been enabled for the calculation. Default: No transformation (i.e., the identity operation)
unit_cell_translation (sequence (size 3) of int) – An additional translation to apply in terms of the unit cell vectors. Default: No translation
- Returns:
The defect supercell configuration. If not available, returns None.
- Return type:
BulkConfiguration
| None
- defectConfigurationCalculator(supercell_repetitions, charge_state)¶
Retrieve the calculator of the defect supercell configuration for a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The calculator of the defect supercell configuration. If not available, returns None.
- Return type:
Calculator | None
- defectSymmetry(supercell_repetitions, charge_state)¶
Calculate the symmetry information for the defect supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The symmetry information for the defect supercell. If not available, returns None.
- Return type:
dict | None
- defectTotalEnergy(supercell_repetitions, charge_state)¶
Retrieve the total energy of the defect supercell configuration for a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The total energy of the defect supercell configuration. If not available, returns None.
- Return type:
TotalEnergy
| None
- dependentStudies()¶
- Returns:
The list of dependent studies.
- Return type:
list of
Study
- dielectricConstant()¶
- Returns:
The dielectric constant of the host material is updated.
- Return type:
float
- elasticCorrectionEnergy(supercell_repetitions, charge_state)¶
Retrieve the value of the elastic energy correction for a given supercell. This result will only be available after the calculation ran successfully. If no correction was applied, None is returned.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The image stress correction. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
- elasticCorrectionMethod()¶
- Returns:
The method used to evaluate the finite size elastic energy correction.
- Return type:
None |
ImageStressCorrection
- filename()¶
- Returns:
The filename where the study object is stored.
- Return type:
str
- formationEnergy(charge_state, electronic_chemical_potential=None, electronic_chemical_potential_reference=None, defect_type=None, supercell_repetitions=None, enable_finite_size_corrections=None)¶
The formation energy for a given charge state \(q\) of the defect, defined as
\(E_f^q = E^{\mathrm{def}, q} - E^{\mathrm{bulk}, q} - \sum_i \Delta n_i \mu_i + q \left ( \mu_e^\mathrm{ref} + \Delta \mu_e \right )\).
The first two terms are the total energy of the supercell with and without the defect, respectively. \(\Delta n_i\) is the difference in the number of atoms between the two supercells for species \(i\), and \(\mu_i\) is the atomic chemical potential for that species. \(\mu_e^\mathrm{ref}\) is the absolute position of the reference level for the electronic chemical potential (either the valence band maximum or the conduction band minimum), and \(\Delta \mu_e\) is the electronic chemical potential relative to it. Note that correction terms have not been included here (see Notes below for details).
- Parameters:
charge_state (int) – The charge state of the defect.
electronic_chemical_potential (PhysicalQuantity of type energy) – The electronic chemical potential relative to
electronic_chemical_potential_reference
. Default:0.0 * eV
electronic_chemical_potential_reference (
ValenceBandEdge
|ConductionBandEdge
) – The reference level for the electronic chemical potential. Default:ValenceBandEdge
defect_type (
DeepLevelDefect
|ShallowAcceptor
|ShallowDonor
) – The assumption of the type of defect to use for aligning the transition levels in the band gap calculated withband_gap_calculator
; see Notes below for details. Note that this parameter only has an effect ifband_gap_calculator
is different fromformation_energy_calculator
. Default:DeepLevelDefect
supercell_repetitions (sequence (size 3) of int |
ExtrapolationScheme
) – The number of repetitions of the bulk unit cell along the (a, b, c) directions. If ExtrapolationScheme, the extrapolation to the infinite supercell size limit is used. Default: The largest calculated supercell.enable_finite_size_corrections (bool) – Whether to include finite size corrections for the supercell in the calculation of the formation energy. Default:
True
- Returns:
The calculated formation energy.
- Return type:
PhysicalQuantity of type energy
- logFilenamePrefix()¶
- Returns:
The filename prefix for the logging output of the study.
- Return type:
str |
LogToStdOut
- modelChargeCorrection(supercell_repetitions, charge_state)¶
Retrieve the model charge correction parameters for the FNV correction for a given supercell and charge state.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
charge_state (int) – The charge state of the defect.
- Returns:
The parameters used to define the model charge correction. If not available, returns None.
- Return type:
ModelChargeCorrection
| None
- nlprint(stream=None)¶
Print a string containing an ASCII table useful for plotting the Study object.
- Parameters:
stream (python stream) – The stream the table should be written to. Default:
NLPrintLogger()
- numberOfProcessesPerTask()¶
- Returns:
The number of processes to be used to execute each task. If None, all available processes should execute each task collaboratively.
- Return type:
int | None |
ProcessesPerNode
- numberOfProcessesPerTaskResolved()¶
- Returns:
The number of processes to be used to execute each task. Default values are resolved based on the current execution settings.
- Return type:
int
- objectId()¶
- Returns:
The name of the study object in the file.
- Return type:
str
- optimizeGeometryParameters()¶
- Returns:
Parameters required to optimize the geometry.
- Return type:
- periodicChargeCorrection(supercell_repetitions, charge_state)¶
Retrieve the periodic charge correction for a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
- Returns:
The periodic charge correction for the supercell. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
- pointDefect()¶
- Returns:
The point defect associated with the charged point defect study.
- Return type:
Vacancy
|Substitutional
|Interstitial
|DefectCluster
|SplitInterstitial
- pristineConfiguration(supercell_repetitions)¶
Retrieve the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The pristine unit cell configuration. If not available, returns None.
- Return type:
BulkConfiguration
| None
- pristineConfigurationCalculator(supercell_repetitions)¶
Retrieve the calculator of the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The calculator of the pristine unit cell configuration. If not available, returns None.
- Return type:
Calculator | None
- pristineFermiLevel(supercell_repetitions)¶
Retrieve the Fermi level of the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The Fermi level of the pristine unit cell configuration. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
- pristineSymmetryData()¶
Retrieve the symmetry information for the pristine unit cell.
This result will only be available after the calculation ran successfully.
- Returns:
The symmetry information for the pristine unit cell. If not available, returns None.
- Return type:
dict | None
- pristineTotalEnergy(supercell_repetitions)¶
Retrieve the total energy of the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The total energy of the pristine unit cell configuration. If not available, returns None.
- Return type:
TotalEnergy
| None
- randomSeed()¶
- Returns:
The random seed used for rattling coordinates
- Return type:
None | int
- relaxAtomicCoordinates()¶
- Returns:
Whether the atomic coordinates of the defect supercells are relaxed.
- Return type:
bool
- resume()¶
- Returns:
whether the resume option was specified
- Return type:
bool
- saveToFileAfterUpdate()¶
- Returns:
Whether the study is automatically saved after it is updated.
- Return type:
bool
- setModelChargeCorrection(supercell_repetitions, charge_state, model_charge_correction=None)¶
Set the model charge correction parameters for the FNV correction for a given supercell and charge state.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
charge_state (int) – The charge state of the defect.
model_charge_correction (
ModelChargeCorrection
) – The parameters used to define the model charge correction. Default:ModelChargeCorrection()
- stableChargeState(electronic_chemical_potential, electronic_chemical_potential_reference=None, defect_type=None, supercell_repetitions=None, enable_finite_size_corrections=None)¶
The stable charge state at a given electronic chemical potential.
- Parameters:
electronic_chemical_potential (PhysicalQuantity of type energy) – The electronic chemical potential relative to
electronic_chemical_potential_reference
.electronic_chemical_potential_reference (
ValenceBandEdge
|ConductionBandEdge
) – The reference level for the electronic chemical potential. Default:ValenceBandEdge
defect_type (
DeepLevelDefect
|ShallowAcceptor
|ShallowDonor
) – The assumption of the type of defect to use for aligning the transition levels in the band gap calculated withband_gap_calculator
; see Notes below for details. Note that this parameter only has an effect ifband_gap_calculator
is different fromformation_energy_calculator
. Default:DeepLevelDefect
supercell_repetitions (sequence (size 3) of int |
ExtrapolationScheme
) – The number of repetitions of the bulk unit cell along the (a, b, c) directions. If ExtrapolationScheme, the extrapolation to the infinite supercell size limit is used. Default: The largest calculated supercell.enable_finite_size_corrections (bool) – Whether to include finite size corrections for the supercell in the calculation of the formation energy. Default:
True
- Returns:
The calculated stable charge state.
- Return type:
int
- stableTransitions(electronic_chemical_potential_reference=None, defect_type=None, supercell_repetitions=None, enable_finite_size_corrections=None)¶
The list of transitions between stable charge states across the whole range of the electronic chemical potential. The transition levels are given relative to
electronic_chemical_potential_reference
.- Parameters:
electronic_chemical_potential_reference (
ValenceBandEdge
|ConductionBandEdge
) – The reference level for the electronic chemical potential. Default:ValenceBandEdge
defect_type (
DeepLevelDefect
|ShallowAcceptor
|ShallowDonor
) – The assumption of the type of defect to use for aligning the transition levels in the band gap calculated withband_gap_calculator
; see Notes below for details. Note that this parameter only has an effect ifband_gap_calculator
is different fromformation_energy_calculator
. Default:DeepLevelDefect
supercell_repetitions (sequence (size 3) of int |
ExtrapolationScheme
) – The number of repetitions of the bulk unit cell along the (a, b, c) directions. If ExtrapolationScheme, the extrapolation to the infinite supercell size limit is used. Default: The largest calculated supercell.enable_finite_size_corrections (bool) – Whether to include finite size corrections for the supercell in the calculation of the formation energy. Default:
True
- Returns:
The list of transitions between stable charge states in order as the electronic chemical potential is increased.
- Return type:
list of list (size 2) of int
- supercellRepetitionsList()¶
- Returns:
The list of all calculated and not calculated supercells of the bulk unit cell, each given as the number of repetitions of the bulk unit cell along the (a, b, c) directions. Any supercell which has not yet been calculated will be calculated the next time the object is updated.
- Return type:
list of tuple (size 3) of int
- supercellSymmetryData(repetitions)¶
Retrieve the symmetry information for the pristine unit cell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int | None) – The number of repetitions of the bulk unit cell along the (a, b, c) directions. If None returns the symmetry of the pristine unit cell.
- Returns:
The symmetry information for the pristine unit cell. If not available, returns None.
- Return type:
dict | None
- symmetricDefect(supercell_repetitions, charge_state, symmetry_index=None, unit_cell_translation=None)¶
Retrieve the defect supercell configuration for a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
defect_charge_state (int) – The charge state of the defect.
symmetry_index (int) – The index of the symmetry operation for the pristine unit cell to apply to the defect supercell configuration. Note that this can only be used if the ‘calculate_defect_symmetry’ option has been enabled for the calculation. Default: No transformation (i.e., the identity operation)
unit_cell_translation (sequence (size 3) of int) – An additional translation to apply in terms of the unit cell vectors. Default: No translation
- Returns:
The defect supercell configuration. If not available, returns None.
- Return type:
BulkConfiguration
| None
- tasksFinished()¶
- Returns:
finished task, unfinished tasks
- Return type:
tuple of list of str, list of str
- transitionLevel(charge_states, electronic_chemical_potential_reference=None, defect_type=None, supercell_repetitions=None, enable_finite_size_corrections=None)¶
The transition level between two calculated charge states \(m\) and \(n\), defined as
\(E \left ( m/n \right ) = \frac{E_f^n \left ( \Delta \mu_e = 0 \right ) - E_f^m \left ( \Delta \mu_e = 0 \right )}{m - n}\).
The transition level is given relative to
electronic_chemical_potential_reference
.- Parameters:
charge_states (sequence (size 2) of int) – The two charge states to calculate the transition level for.
electronic_chemical_potential_reference (
ValenceBandEdge
|ConductionBandEdge
) – The reference level for the electronic chemical potential. Default:ValenceBandEdge
defect_type (
DeepLevelDefect
|ShallowAcceptor
|ShallowDonor
) – The assumption of the type of defect to use for aligning the transition levels in the band gap calculated withband_gap_calculator
; see Notes below for details. Note that this parameter only has an effect ifband_gap_calculator
is different fromformation_energy_calculator
. Default:DeepLevelDefect
supercell_repetitions (sequence (size 3) of int |
ExtrapolationScheme
) – The number of repetitions of the bulk unit cell along the (a, b, c) directions. If ExtrapolationScheme, the extrapolation to the infinite supercell size limit is used. Default: The largest calculated supercell.enable_finite_size_corrections (bool) – Whether to include finite size corrections for the supercell in the calculation of the formation energy. Default:
True
- Returns:
The calculated transition level.
- Return type:
PhysicalQuantity of type energy
- uniqueString()¶
Return a unique string representing the state of the object.
- update()¶
Run the calculations for the study object.
- useGhost()¶
- Returns:
Whether ghost atoms are used (for LCAO calculations involving vacancies)
- Return type:
bool
- valenceBandMaximum(supercell_repetitions)¶
Retrieve the valence band maximum of the pristine unit cell configuration associated with a given supercell.
This result will only be available after the calculation ran successfully.
- Parameters:
supercell_repetitions (sequence (size 3) of int) – The number of repetitions of the bulk unit cell along the (a, b, c) directions.
- Returns:
The valence band maximum of the pristine unit cell configuration. If not available, returns None.
- Return type:
PhysicalQuantity of type energy | None
Notes¶
Note
Study objects behave differently from analysis objects. See the Study object overview for more details.
The ChargedPointDefect object can be used to perform a detailed study of a single point defect in bulk material in its various charge states. The defect can be a simple vacancy, substitutional, or interstitial, or a more complex defect cluster made from multiple simple defects.
The main results are the formation energy of the defect for different charge states as a function of the electronic chemical potential, and the corresponding stable charge transition levels (sometimes referred to as the thermodynamic transition levels, occupancy levels, or trap levels).
Performing accurate simulations of point defects, especially for non-neutral charge states, can be challenging. In particular, it is generally very important to ensure that the physical quantities of interest are properly converged with respect to the size of the supercell of bulk crystal in which the point defect is placed (as periodic boundary conditions are used, there will be spurious interactions between periodic replicas of the defect site). ChargedPointDefect aims to assist the user in automatically simulating a range of supercell sizes and analyzing the convergence with size for each charge state. It will also apply the correction by Freysoldt, Neugebauer and Van De Walle (FNV) [1] to mitigate the effects of these finite size interactions.
The object is initialized by specifying the primitive unit cell of the host
crystal (without the defect) as a BulkConfiguration, the list of
supercells of this primitive cell to generate for the study, and the defect to
study as an instance of the desired defect class (Vacancy
| Substitutional
| Interstitial
| DefectCluster
| SplitInterstitial
). The defect
will be inserted into each supercell of the bulk material. The list of charge
states of the defect to simulate must also be given.
The calculator which is used to calculate the formation energy is given by
formation_energy_calculator
. The atomic coordinates of the defect supercells
are relaxed by default (this is controlled with relax_atomic_coordinates
);
it is possible to specify a separate calculator to perform the relaxations with
relaxation_calculator
, as these usually represent the most computationally
intensive part of the study. Both calculators are automatically adjusted for
each supercell to ensure a consistent level of accuracy.
One can optionally calculate an elastic strain correction to the formation
energy by using a ImageStressCorrection object as the
elastic_correction_method
. The correction is described is more
detail in Section Finite-size scaling and correction terms.
Finally, it is possible to specify a separate calculator to calculate the band
gap of the host material with band_gap_calculator
, in order to overcome the
underestimation of the band gap from standard DFT functionals.
Note
The calculators must contain a basis/pseudopotential for all species in both the pristine and defect supercells.
Defining the point defect¶
This is specified by point_defect
. The defect is defined in an abstract way,
independently of the material it is embedded in or the supercell size. The study
will combine it with the reference unit cell of the pristine material
(bulk_configuration
) and the various supercell sizes
(supercell_repetitions_list
) to create the defect supercells.
There are three simple point defect types: Vacancy
,
Substitutional
, and Interstitial
. The first two require a
site_index
at which to create the defect; the index refers to the atom index
of the list of atoms of the reference unit cell. The third, instead, is not tied
to a site but is defined by specifying a position in space (either in absolute
coordinates or as fractional coordinates of the reference unit cell).
More complex defects can also be specified by using a DefectCluster
;
this is defined by providing a list of simple defects which will be combined
together to form a composite defect. Examples of this include a divacancy (2
vacancies) or a Frenkel pair (vacancy + interstitial). Larger clusters can also
be defined.
Although a DefectCluster
can still be considered a point defect (it
is not periodic in any direction), it has a size depending on the largest
distance between any of the constituent defects. It is therefore possible for a
cluster to be larger than the reference unit cell. In order to define such
clusters, one can make use of the unit_cell_index
argument for
Vacancy
and Substitutional
, which allows for the
constituent defects to be shifted to different unit cells. Similarly,
Interstitial
defects can be defined by giving a position outside of
the unit cell. When the study generates the actual defect supercell
configuration, the constituent defects are wrapped within the supercell.
Therefore, all supercells used in the study must be large enough to accommodate
the cluster.
Atomic Chemical Potentials¶
The chemical potentials for the atomic species involved in the creation of the defect (i.e., any species for which the number of atoms changes between the pristine and defect supercell) need to be determined in order to calculate the formation energy. Note that the atomic chemical potentials are only used for the final post-processing calculation of the formation energy; although the absolute value of the formation energy is affected, the differences between charge states (and, hence, the transition levels) are not.
The study will automatically try to make a reasonable choice for the values of the atomic chemical potentials. The default choice taken by the study for each element is as follows:
If possible, the atomic chemical potential is calculated as the energy per atom of the pristine configuration at each supercell size. This will be the case if (a) the element is present in the pristine configuration, and (b) all the elements of the pristine configuration are either added or removed in their stoichiometric ratio in the creation of the defect.
Otherwise, the atomic chemical potential is calculated as the energy per atom of a default elemental reference configuration. This default configuration is taken from the \(\Delta\)-test [2] suite of elemental crystals. Note that the calculation is performed with the same calculator parameters as specified in
formation_energy_calculator
.
These automatic values can, however, be changed for one or more elements by
providing an AtomicChemicalPotential object for each element in
atomic_chemical_potentials
. This allows the user to provide either an
explicit hard-coded value of the energy per atom, or an alternative elemental
reference configuration for the study to use in calculating the atomic chemical
potential. In compound materials the class AtomicChemicalPotentialList can be used to
compute heat of formation or rich conditions.
For a detailed physical discussion on the choice of atomic chemical potentials, see Van de Walle and Neugebauer [3].
Results¶
The study provides a number of methods for processing the available results and returning the physical quantities of interest:
formationEnergy
: the formation energy for a given charge state as a function of the electronic chemical potential. The mathematical definition is given in the method description above.stableChargeState
: the stable charge state at a given electronic chemical potential.transitionLevel
: the transition level between two charge states. The mathematical definition is given in the method description above.stableTransitions
: the list of transitions between stable charge states across the whole range of the electronic chemical potential.
Finite-size scaling and correction terms¶
All the post-processing methods given above take two optional arguments,
supercell_repetitions
and enable_finite_size_corrections
. By default,
the largest supercell is used and finite-size corrections are automatically
included.
As previously mentioned, the FNV correction scheme [1] is used. This scheme introduces two additional terms in the definition of the formation energy: a correction for the electrostatic interaction between periodic replicas of the charged defect center, and a band shift correction to the defect supercell to align the bands to a common reference with the neutral bulk. Moreover, we add an optional strain correction, which accounts for the elastic distortion of the surrounding lattice due to the defect.
The first correction term is added to the total energy of the defect supercell \(E^{\mathrm{def}, q}\), while the second is substracted from the absolute position of the reference level for the electronic chemical potential \(\mu_e^\mathrm{ref}\). The complete definition of the formation energy therefore becomes
where \(E^{\mathrm{FNV}, q}_{1, 2}\) are the two FNV correction terms, which depend both on the charge state and the supercell. The term \(E^{\mathrm{strain}, q}\) is the optional strain energy correction, which is given by
where \(V\) is the volume of the supercell, \(K\) is the bulk modulus of the host material, \(P^{\mathrm{def}}\) is the external hydrostatic pressure in the supercell with the defect, and \(P^{\mathrm{bulk}}\) is the external hydrostatic pressure for the pristine system. See equation 57 and related discussion in [4] for a more detailed description of the elastic correction and the underlying approximations.
Note
The elastic strain correction is only calculated if the parameter
elastic_correction_method
is explicitly set. If the parameter is not
specified, \(E^{\mathrm{strain}, q}\) is set to zero in the formation
energy calculation.
Note
The FNV correction terms only apply to non-neutral charge states. The neutral charge state results will be unaffected by the use of the correction.
The FNV correction works by approximating the additional charge on the defect
site with a Gaussian distribution in a dielectric background. The width of this
distribution can be set manually with the setModelChargeCorrection
method;
by default, it is fitted for each charge state and supercell size so as to best
reproduce the long-range electrostatic potential profile of the defect supercell
far away from the defect.
Note
In some cases it is not possible to reproduce the calculated potential profile with a Gaussian charge; the fitting procedure will then set an infinite width, effectively switching off the first correction term.
Extrapolating to infinite size¶
In addition to the finite-size corrections, it is possible to attempt an
extrapolation of the formation energy to the limit of infinite system size.
This can be specified by providing an instance of ExtrapolationScheme
as supercell_repetitions
in the post-processing methods. The extrapolation
scheme will use the available results at different supercell sizes to fit a
polynomial.
The form of the extrapolating function is somewhat empirical; the rationale behind it and its reliability for some practical test cases are discussed by Lany and Zunger [5]. Care should be taken when making use of the extrapolation results.
Band gap correction¶
Standard DFT functionals are known to severely underestimate band gaps; this can be a problem for interpreting defect transition levels, which are typically measured relative to the band edges. One solution is to use the HSE functional, which can predict band gaps very accurately; however, it has a much higher computational cost with respect to the standard functionals, and this will be particularly noticeable when performing defect calculations in large supercells.
Alternatively, one can employ a band-gap correction scheme for
ChargedPointDefect by specifying a separate band_gap_calculator
;
this will perform an additional calculation of the band gap of the host material
with this calculator, and position the defect transition levels within it for
all post-processing methods. The calculation of the host band gap is
computationally inexpensive as it is done only once per study and uses the
primitive unit cell, not the supercell needed for the defect. Therefore, we
suggest using either HSE or other methods available in QuantumATK for accurately
calculating band gaps (DFT-1/2, PPS,
TB09-MGGA or DFT+U).
When using band_gap_calculator
there are three possibilities for how the
transition levels will be aligned to the corrected band gap; this is specified
in all post-processing methods with the defect_type
argument. For deep
defects (the default) the levels will be aligned to the Fermi level of the
pristine host material, while for shallow defects they will be aligned either to
the valence band edge (for acceptors) or the conduction band edge (for donors).
In particular, the default option for deep defects has been shown to work
remarkably well over a large range of defects and host materials
[6] [7] [8], reproducing the
transition levels calculated with HSE at a small fraction of the computational
cost.
Usage Example¶
This example script shows how to perform a simple study of the vacancy in bulk silicon and display a summary of results:
from SMW import *
# Setup the reference bulk unit cell configuration.
lattice = FaceCenteredCubic(5.4306*Angstrom)
elements = [Silicon, Silicon]
fractional_coordinates = [[ 0. , 0. , 0. ],
[ 0.25, 0.25, 0.25]]
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates,
)
# Setup the calculator.
basis_set = getattr(LDABasis, 'Silicon_SingleZeta')
calculator = LCAOCalculator(
basis_set=basis_set,
exchange_correlation=LDA.PZ,
numerical_accuracy_parameters=NumericalAccuracyParameters(
k_point_sampling=MonkhorstPackGrid(1, 1, 1))
)
# Initialize the ChargedPointDefect object.
charged_point_defect = ChargedPointDefect(
bulk_configuration=bulk_configuration,
filename='chargedpointdefect.hdf5',
formation_energy_calculator=calculator,
object_id='Si_vacancy',
point_defect=Vacancy(0),
charge_states=[2, 1, 0, -1, -2],
supercell_repetitions_list=[(1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4)],
relax_atomic_coordinates=False,
dielectric_constant=11.68,
)
# Run the calculation.
charged_point_defect.update()
# Print a summary of results.
nlprint(charged_point_defect)
No stress correction is used in this example. Here is the resulting
output from the nlprint
command:
+------------------------------------------------------------------------------+
| Charged Point Defect Report |
+------------------------------------------------------------------------------+
| Finite size scaling: |
| (Formation energies are given at zero electronic chemical potential and |
| including the correction terms. The band shift correction is given by the |
| band shift multiplied by the charge times minus one.) |
+------------------------------------------------------------------------------+
| Charge: +2 |
+------------------------------------------------------------------------------+
| Number Inverse length Formation Finite size |
| of atoms (1/Angstrom) energy (eV) correction (eV) |
| 2 2.92307e-01 -3.56904e+00 2.86730e+00 |
| 16 1.46153e-01 -1.52429e+00 7.57940e-02 |
| 54 9.74356e-02 1.94982e+00 5.62643e-01 |
| 128 7.30767e-02 3.16854e+00 4.35393e-01 |
| Inf 0.00000e+00 5.70826e+00 (corrected) |
| Inf 0.00000e+00 6.45299e+00 (uncorrected) |
| |
| Finite size correction contributions: |
| |
| Number Band Periodic charge Image stress |
| of atoms shift (eV) correction (eV) correction (eV) |
| 2 -4.01568e-01 2.06417e+00 - |
| 16 -3.78970e-02 0.00000e+00 - |
| 54 5.72778e-02 6.77198e-01 - |
| 128 5.13730e-03 4.45668e-01 - |
+------------------------------------------------------------------------------+
| Charge: +1 |
+------------------------------------------------------------------------------+
| Number Inverse length Formation Finite size |
| of atoms (1/Angstrom) energy (eV) correction (eV) |
| 2 2.92307e-01 -3.55135e+00 1.04229e+00 |
| 16 1.46153e-01 -6.72596e-01 -5.61343e-02 |
| 54 9.74356e-02 2.07451e+00 1.19878e-01 |
| 128 7.30767e-02 3.23208e+00 1.03283e-01 |
| Inf 0.00000e+00 6.23957e+00 (corrected) |
| Inf 0.00000e+00 6.41137e+00 (uncorrected) |
| |
| Finite size correction contributions: |
| |
| Number Band Periodic charge Image stress |
| of atoms shift (eV) correction (eV) correction (eV) |
| 2 -5.27329e-01 5.14962e-01 - |
| 16 5.61343e-02 0.00000e+00 - |
| 54 5.00438e-02 1.69922e-01 - |
| 128 2.67978e-02 1.30081e-01 - |
+------------------------------------------------------------------------------+
| Charge: 0 |
+------------------------------------------------------------------------------+
| Number Inverse length Formation Finite size |
| of atoms (1/Angstrom) energy (eV) correction (eV) |
| 2 2.92307e-01 -2.13008e+00 0.00000e+00 |
| 16 1.46153e-01 7.62129e-01 0.00000e+00 |
| 54 9.74356e-02 2.87491e+00 0.00000e+00 |
| 128 7.30767e-02 3.87204e+00 0.00000e+00 |
| Inf 0.00000e+00 6.73582e+00 (corrected) |
| Inf 0.00000e+00 6.73582e+00 (uncorrected) |
| |
| Finite size correction contributions: |
| |
| Number Band Periodic charge Image stress |
| of atoms shift (eV) correction (eV) correction (eV) |
| 2 -6.41716e-01 0.00000e+00 - |
| 16 1.28916e-01 0.00000e+00 - |
| 54 4.77929e-02 0.00000e+00 - |
| 128 2.66264e-02 0.00000e+00 - |
+------------------------------------------------------------------------------+
| Charge: -1 |
+------------------------------------------------------------------------------+
| Number Inverse length Formation Finite size |
| of atoms (1/Angstrom) energy (eV) correction (eV) |
| 2 2.92307e-01 4.17083e-01 -6.04335e-01 |
| 16 1.46153e-01 2.65180e+00 3.14123e-01 |
| 54 9.74356e-02 4.14399e+00 7.96451e-02 |
| 128 7.30767e-02 5.13477e+00 1.57463e-01 |
| Inf 0.00000e+00 8.63413e+00 (corrected) |
| Inf 0.00000e+00 7.82309e+00 (uncorrected) |
| |
| Finite size correction contributions: |
| |
| Number Band Periodic charge Image stress |
| of atoms shift (eV) correction (eV) correction (eV) |
| 2 -6.04335e-01 0.00000e+00 - |
| 16 6.02071e-02 2.53916e-01 - |
| 54 7.96451e-02 0.00000e+00 - |
| 128 2.98200e-02 1.27643e-01 - |
+------------------------------------------------------------------------------+
| Charge: -2 |
+------------------------------------------------------------------------------+
| Number Inverse length Formation Finite size |
| of atoms (1/Angstrom) energy (eV) correction (eV) |
| 2 2.92307e-01 3.81898e+00 -1.11445e+00 |
| 16 1.46153e-01 4.95059e+00 9.49127e-01 |
| 54 9.74356e-02 6.01975e+00 6.15873e-01 |
| 128 7.30767e-02 6.92347e+00 5.41905e-01 |
| Inf 0.00000e+00 1.04297e+01 (corrected) |
| Inf 0.00000e+00 9.91014e+00 (uncorrected) |
| |
| Finite size correction contributions: |
| |
| Number Band Periodic charge Image stress |
| of atoms shift (eV) correction (eV) correction (eV) |
| 2 -5.57226e-01 0.00000e+00 - |
| 16 -3.31693e-02 1.01547e+00 - |
| 54 7.41950e-02 4.67483e-01 - |
| 128 3.81477e-02 4.65610e-01 - |
+------------------------------------------------------------------------------+
| Transition levels between stable charge states: |
| (All values are calculated using the corrected formation energies.) |
+------------------------------------------------------------------------------+
| Supercell: 2 atoms (1x1x1 unit cells) |
+------------------------------------------------------------------------------+
| Transition Level (eV) |
| +2/+1 1.76875e-02 |
| +1/0 1.42127e+00 |
| 0/-1 2.54716e+00 |
| -1/-2 3.40190e+00 |
+------------------------------------------------------------------------------+
| Supercell: 16 atoms (2x2x2 unit cells) |
+------------------------------------------------------------------------------+
| Transition Level (eV) |
| +2/+1 8.51697e-01 |
| +1/0 1.43472e+00 |
| 0/-1 1.88967e+00 |
| -1/-2 2.29879e+00 |
+------------------------------------------------------------------------------+
| Supercell: 54 atoms (3x3x3 unit cells) |
+------------------------------------------------------------------------------+
| Transition Level (eV) |
| +2/+1 1.24691e-01 |
| +1/0 8.00392e-01 |
| 0/-1 1.26908e+00 |
| -1/-2 1.87577e+00 |
+------------------------------------------------------------------------------+
| Supercell: 128 atoms (4x4x4 unit cells) |
+------------------------------------------------------------------------------+
| Transition Level (eV) |
| +2/+1 6.35398e-02 |
| +1/0 6.39961e-01 |
| 0/-1 1.26272e+00 |
| -1/-2 1.78871e+00 |
+------------------------------------------------------------------------------+
| Extrapolation to infinite limit |
+------------------------------------------------------------------------------+
| Transition Level (eV) |
| +2/0 5.13780e-01 |
| 0/-2 1.84694e+00 |
+------------------------------------------------------------------------------+
It is important to note that this example is only intended to give an overview of the capabilities of ChargedPointDefect; it does not relax the atomic coordinates of the defect supercell, and makes use of a fast calculator.