Pymatgen extension for defects analysis
Maintained. Last release 5 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install pymatgen-analysis-defectspymatgen-analysis-defects
This package is an extension to pymatgen for performing defect
analysis. The package is designed to work with VASP inputs and output
files and is meant to be used as a namespace package extension to the
main pymatgen library. The new module has been redesigned to work
closely with atomate2.
While the atomate2 automation framework is not required for this code
to be useful, users are strongly encouraged to to adopt the atomate2
framework as it contains codified "best practices" for running defect
calculations as well as orchestrating the running of calculations and
storing the results.
The package serves as an object-oriented interface to defect physics and is capable of generating a list of non-equivalent defect objects directly from the Materials Project API.
from pymatgen.analysis.defects.generators import ChargeInterstitialGenerator, generate_all_native_defects
from mp_api.client import MPRester
with MPRester() as mpr:
chgcar = mpr.get_charge_density_from_material_id("mp-804")
for defect in generate_all_native_defects(chgcar):
print(defect)
Non-exhaustive list of features:
Reproducible definition of defects
Defects are defined based on the physical concept they represent, independent of the calculation details such as simulation cell size. As an example, a Vacancy defect is defined by the primitive cell of the pristine material plus a single site that represents the vacancy site in the unit cell.