Skip to content

BadELF: Spin Separated Charge

It is common for systems to have differing ELF topologies in the spin-up and spin-down electron systems. In these cases, it is useful to perform separate analyses on each spin system. Here we use the classic magnetic system of Fe as an example.

VASP

  1. Create your Fe POSCAR file.

    Fe1
    1.0
    -1.4315177494749578    1.4315177494749580    1.4315177494749580
    1.4315177494749578   -1.4315177494749580    1.4315177494749580
    1.4315177494749582    1.4315177494749580   -1.4315177494749578
    Fe
    1
    direct
    0.0000000000000000    0.0000000000000000    0.0000000000000000 Fe
    
  2. 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
    ISPIN = 2             # Spin-polarized
    LELF = True           # Write ELFCAR file
    EDIFF  = 1E-06        # SCF energy convergence, in eV
    ENCUT  = 520
    
    Grid Size             # Moderately grid density
    NGX    = 30
    NGY    = 30
    NGZ    = 30
    "Fine" Grid Size      # Must Match Standard Grid
    NGXF   = 30
    NGYF   = 30
    NGZF   = 30
    
  3. Create your POTCAR. We cannot provide an example for this as the files are proprietary. You MUST use a POTCAR with extra valence electrons such as 'Fe_sv' to ensure the ELF contains some core electrons or you will overestimate the electron counts.

  4. 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

  1. 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.

  2. Import the Grid and Badelf class

    from baderkit import Grid
    from baderkit.elf_analysis import Badelf
    
  3. Load the spin polarized grids

    polarized_charge = Grid.from_vasp("CHGCAR", total_only=False)
    polarized_elf = Grid.from_vasp("ELFCAR", total_only=False)
    
  4. Split the polarized grids into their spin-up and spin-down components

    charge_up, charge_down = polarized_charge.split_to_spin()
    elf_up, elf_down = polarized_elf.split_to_spin()
    
  5. Create the polarized BadELF objects.

    badelf_up = Badelf(
        charge_grid=charge_up,
        reference_grid=elf_up,
        )
    badelf_down = Badelf(
        charge_grid=charge_down,
        reference_grid=elf_down,
        )
    
  6. Finally, print some useful information to the console.

    metal_bonds_up = badelf_up.nnas_per_reduced_formula
    metal_bonds_down = badelf_down.nnas_per_reduced_formula
    
    print(f"Spin-up metal bond population: {metal_bonds_up}")
    print(f"Spin-down metal bond population: {metal_bonds_down}")
    

    You should see logging information as BaderKit runs, then outputs similar to the following:

    Spin-up metal bond population: 0.9585707826
    Spin-down metal bond population: 1.317401248
    

  1. If you are using an environment manager, load your baderkit environment. For conda:

    conda activate baderkit
    
  2. Split the charge density and ELF into spin-up and spin-down systems

    baderkit split CHGCAR
    baderkit split ELFCAR
    

  3. Run the Badelf analysis on each system separately. Make sure to change the name of the output .json file to avoid overwriting it.

    baderkit badelf CHGCAR_up ELFCAR_up
    mv badelf.json badelf_up.json
    baderkit badelf CHGCAR_down ELFCAR_down
    mv badelf.json badelf_down.json
    

And that's it! Try playing around with what else the Badelf class offers.

Download Resources

Tutorial Script: spin_badelf.py

VASP Inputs/Outputs: Fe.zip