BadELF: Electride Charges
The Badelf class includes several methods for calculating oxidation states in materials combining principles from Bader's Quantum Theory of Atoms in Molecules with the Electron Localization Function (ELF). This is useful for calculating oxidation states in systems with localized electrons that sit far from atomic sites such as in electride systems. This tutorial walks through this process for the common Ca2N electride.
VASP¶
-
Create your Ca2N POSCAR file.
Ca2 N1 1.0 3.537074 0.051133 5.740763 1.665193 3.120999 5.740763 0.083858 0.051133 6.742420 Ca N 2 1 direct 0.731317 0.731317 0.731317 Ca 0.268683 0.268683 0.268683 Ca 0.000000 0.000000 -0.000000 N -
Create your INCAR file. Below is a minimal example that writes the required CHGCAR and ELFCAR files. In general, the grid density should be at least 10 pts/Å along each lattice vector for well converged Bader analysis.
Global Parameters LELF = True # Write ELFCAR file LAECHG = True # Write AECCAR files EDIFF = 1E-06 # SCF energy convergence, in eV ENCUT = 520 Grid Size # Moderately grid density NGX = 70 NGY = 70 NGZ = 70 "Fine" Grid Size # Must Match Standard Grid NGXF = 70 NGYF = 70 NGZF = 70 -
Create your
POTCAR. We cannot provide an example for this as the files are proprietary. -
Run VASP. Depending on your system how you do this may vary. On our system we use the following command.
mpirun -np 12 vasp_std
BaderKit¶
-
If you would like to follow along, open your preferred IDE in an environment with BaderKit installed. Alternatively, the complete python script from this tutorial is available at the end of this page.
-
Import the Badelf class
from baderkit.elf_analysis import Badelf -
Now create the Badelf class instance.
badelf = Badelf.from_vasp( charge_grid="CHGCAR", reference_grid="ELFCAR", total_charge_grid="CHGCAR_sum", pseudopotential_filename="POTCAR" ) -
Finally, print some useful information to the console.
electride_structure = badelf.nna_structure electrides_per_formula = badelf.nnas_per_reduced_formula electride_dimensionality = badelf.nna_dimensionality # structure including electride site print(f"Electride Structure: {electride_structure}") # print electron counts print(f"Electron Count: {electrides_per_formula}") # print dimensionality print(f"Electride Dimensionality: {electride_dimensionality}")You should see logging information as BaderKit runs, then outputs similar to the following:
Electride Structure: Full Formula (Xmc1 Ca2 N1) Reduced Formula: XmcCa2N abc : 6.743135 6.743134 6.743135 angles: 30.925110 30.925113 30.925113 pbc : True True True Sites (4) # SP a b c label --- ----- -------- -------- -------- ------- 0 Ca 0.731317 0.731317 0.731317 Ca 1 Ca 0.268683 0.268683 0.268683 Ca 2 N 0 0 0 N 3 Xmc0+ 0.5 0.5 0.5 Xmc Electron Count: 1.0358152597 Electride Dimensionality: 2
-
If you are using an environment manager, load your baderkit environment. For conda:
conda activate baderkit -
We recommend using the reconstructed total charge density as a reference for Bader partitioning when possible. In VASP we can construct this from the AECCAR files.
baderkit sum AECCAR0 AECCAR2 -
Run the Badelf analysis.
baderkit badelf CHGCAR ELFCAR -tot CHGCAR_sumYou should see logging information printed to the console and once complete a
badelf.jsonfile will be written which summarizes the results of the calculation.
And that's it! Try playing around with what else the Badelf class offers.
Download Resources¶
Tutorial Script: electrides_charge.py
VASP Inputs/Outputs: Ca2N.zip
Warnings for VASP¶
Low Valence Pseudopotentials¶
VASP only includes the valence electrons in the ELFCAR. This means that for pseudopotentials with relatively few valence electrons, it is possible for the ELF to be zero at atom centers. We recommend using VASP's GW potentials, with additional valence electrons.
Mismatched Grids¶
By default, VASP writes the CHGCAR and ELFCAR to different grid shapes (the "fine" and standard FFT meshes). The Badelf and ElfLabeler classes require the grid sizes match. This can be achieved by setting the NGX(YZ) and NGX(YZ)F tags in the INCAR to match. Alternatively, one can set the PREC tag to single, but this should be done with caution as it generally lowers the quality of the calculation unless the ENCUT and NGX(YZ) tags are set as well.