Pipeline for Formation Energy (Ef) (defect_calculations/formation_energy.md
)
1. Run vc-relax
Structure Optimization
Three calculations need to be performed for the structure optimization:
- Bulk Sb₂Te₃ (pristine system)
- Bulk Cr (reference state)
- Cr-doped Sb₂Te₃ with two configurations:
- Substitutional doping: Cr atom replacing an Sb site (Cr(_\text{Sb})).
- Interstitial doping: Cr atom occupying crystal voids (Cr(_\text{int})).
2. Formation Energy Calculation
Formation Energy of Defects in a Bulk Crystal
The formation energy of a defect in a bulk crystal describes the energy cost (or gain) to introduce a defect into the perfect lattice. This is crucial for understanding the thermodynamics, stability, and electronic properties of defects.
General Equation
For a defect ( D ) in a bulk crystal, the formation energy is given as:
[ E_\mathrm{form}(D,q) = E_\mathrm{tot}(D,q) - E_\mathrm{tot}(\mathrm{bulk}) - \sum_i n_i \mu_i + q(E_F + E_\mathrm{vbm}) + E_\mathrm{corr} ]
Term Definitions:
- ( E_\mathrm{tot} ): Total energy of the doped or pristine system.
- ( n_i ): Number of atoms of species ( i ) added or removed.
- ( \mu_i ): Chemical potential of species ( i ).
- ( E_F ): Fermi energy relative to the valence band maximum (( E_\mathrm{vbm} )).
- ( E_\mathrm{corr} ): Electrostatic correction for charged defects.
Specific Equations for Cr-Doped Sb₂Te₃
Substitutional Doping (( \text{Cr}_\text{Sb} ))
[ E_{\text{form}}(\text{Cr}\text{Sb}, q) = E{\text{tot}}(\text{Cr-Sb}2\text{Te}_3, q) - E{\text{tot}}(\text{Sb}2\text{Te}_3) + \mu\text{Sb} - \mu_\text{Cr} + q (E_F + E_{\text{vbm}}) + E_{\text{corr}} ]
Interstitial Doping (( \text{Cr}_\text{int} ))
[ E_{\text{form}}(\text{Cr}\text{int}, q) = E{\text{tot}}(\text{Cr-Sb}2\text{Te}_3, q) - E{\text{tot}}(\text{Sb}2\text{Te}_3) - \mu{\text{Cr}} + q(E_F + E_{\text{vbm}}) + E_{\text{corr}} ]
Steps to Compute Formation Energy
- Perform DFT Calculations:
- Calculate ( E_{\text{tot}} ) for the doped system.
-
Calculate ( E_{\text{tot}} ) for the pristine bulk system.
-
Determine Chemical Potentials:
- Extract ( \mu_{\text{Cr}} ) from bulk Cr or Cr-rich phases.
-
Determine ( \mu_{\text{Sb}} ) from Sb₂Te₃ phase stability limits.
-
Set Fermi Energy:
-
Use the bandgap of Sb₂Te₃ and adjust for the defect charge state ( q ).
-
Correct for Finite-Size Effects:
- Apply ( E_{\text{corr}} ) for charged defects.
Python Script for Formation Energy Calculation
Below is the Python script to calculate the formation energy based on input files:
Input Files:
- Total energy for Cr-Sb₂Te₃ system:
FR+d3.csv
- Reference energies:
- Bulk Sb₂Te₃:
0-bulk_energy.csv
- Bulk Cr:
0-Cr_energy.csv
# Import required libraries
import pandas as pd
# Read input files
file_path = '2._vdw_corr_DFT-D3/FR+d3.csv'
df_d3 = pd.read_csv(file_path)
# Read reference energies
df_cr = pd.read_csv('0-Cr_energy.csv')
df_bulk = pd.read_csv('0-bulk_energy.csv')
# Extract reference energy values
Cr_energy_d3 = df_cr.loc[df_cr['Name'] == 'Cr_d3']['Energy'].iloc[0]
bulk_energy_d3 = df_bulk.loc[df_bulk['Name'] == 'bulk_d3']['Energy'].iloc[0]
# Calculate Formation Energy
df_d3_energy = df_d3[['File', 'Atoms', 'Energy (eV)']]
df_d3_energy['Formation Energy (eV)'] = df_d3_energy['Energy (eV)'] - bulk_energy_d3 - Cr_energy_d3 * (df_d3_energy['Atoms'] - 60)
# Display the results
print(df_d3_energy)
Notes:
- If the defect is neutral (( q = 0 )), the equations simplify to:
- Substitutional Defect: [ E_{\text{form}}(\text{Cr}\text{Sb}) = E{\text{tot}}(\text{Cr-Sb}2\text{Te}_3) - E{\text{tot}}(\text{Sb}2\text{Te}_3) + \mu\text{Sb} - \mu_\text{Cr} ]
-
Interstitial Defect: [ E_{\text{form}}(\text{Cr}\text{int}) = E{\text{tot}}(\text{Cr-Sb}2\text{Te}_3) - E{\text{tot}}(\text{Sb}2\text{Te}_3) - \mu\text{Cr} ]
-
Adjust ( E_F ) and ( \mu_i ) based on the defect charge state and stability conditions.
Output
The script computes and outputs the formation energy for the Cr-doped system:
File | Atoms | Energy (eV) | Formation Energy (eV) |
---|---|---|---|
Example.xyz | 61 | -123.45 | -0.56 |
... | ... | ... | ... |
Conclusion
This pipeline provides a systematic approach to calculate the formation energy of Cr defects (substitutional and interstitial) in Sb₂Te₃ using DFT data and a Python script.