Charge Density, Bader Charge, and ELF

This page documents three VQkit post-processing workflows used to inspect electronic redistribution and localization:

  • Charge-density difference (CDD);

  • Bader charge analysis;

  • Electron localization function (ELF).

These tools are available from the Post-processing menus.

This page is a consolidated reference page. Detailed procedural tutorials for CDD, Bader, and ELF are documented separately under Tutorials.

Charge-density difference

The charge-density difference is commonly defined as:

\[\Delta\rho(\mathbf{r}) = \rho_{\mathrm{combined}}(\mathbf{r}) - \sum_i \rho_i(\mathbf{r})\]

where the fragment densities must be evaluated consistently with the combined system.

VQkit’s current CDD post-processing workflow assumes that the subtraction has already been completed.

It therefore expects a final CDD cube file such as:

*.cube
*.cub

VQkit does not ask for fragment densities and does not perform the fragment subtraction inside this menu.

Preferred CDD filenames

When several cube files are present, VQkit gives preference to filenames containing terms such as:

cdd
charge_diff
charge-diff
charge_difference
charge-density-difference
difference
delta_rho
deltarho

If only one cube file is present, it is selected automatically.

If several candidates are found, VQkit displays a selection menu.

No cube file found

If no .cube or .cub file is present, VQkit reports that no final CDD cube was found.

For Quantum ESPRESSO, the user should first generate the final charge-density difference cube using an appropriate pp.x workflow.

CDD cube parsing

VQkit reads:

  • cube-grid dimensions;

  • atomic positions;

  • voxel vectors;

  • volumetric scalar data.

The cube file itself is retained unchanged.

Density units

For the current QE-oriented CDD workflow, cube density values are converted from:

e/bohr^3

to:

e/Angstrom^3

using the Bohr-to-Angstrom conversion factor.

CDD plotting menu

The current CDD menu provides:

[1] XY center slice
[2] XZ center slice
[3] YZ center slice
[4] All center slices
[5] Custom slice position
[6] Planar average along z

The default is:

[4] All center slices

Center slices

For each selected plane, VQkit uses the center index of the grid along the normal direction.

For example:

  • XY slice -> center of z;

  • XZ slice -> center of y;

  • YZ slice -> center of x.

Custom slice

For a custom slice, VQkit asks:

Plane [YZ]:

and:

Fractional slice position 0-1 [0.5]:

The fractional position is converted into the corresponding volumetric-grid index.

Planar average

The planar-average option averages the CDD over x and y and reports the variation along z.

This is useful for examining charge redistribution across interfaces, slabs, and layered structures.

CDD color convention

The current VQkit CDD plots use a symmetric positive/negative density scale.

The interpretation is:

Red  = charge accumulation
Blue = charge depletion

The zero-density contour is also shown.

Atom positions from the cube file are overlaid when they lie sufficiently close to the selected slice plane.

CDD outputs

Typical outputs are:

VQkit_QE_CDD_XY.png
VQkit_QE_CDD_XY.dat

VQkit_QE_CDD_XZ.png
VQkit_QE_CDD_XZ.dat

VQkit_QE_CDD_YZ.png
VQkit_QE_CDD_YZ.dat

For custom slices:

VQkit_QE_CDD_YZ_CUSTOM.png
VQkit_QE_CDD_YZ_CUSTOM.dat

For planar averaging:

VQkit_QE_CDD_PLANAR_Z.png
VQkit_QE_CDD_PLANAR_Z.dat

Three-dimensional visualization

VQkit does not replace the original cube file.

For full 3D isosurface visualization, use software such as:

  • VESTA;

  • VMD;

  • XCrySDen.

CDD interpretation cautions

CDD results depend critically on how the fragment densities were constructed.

For meaningful subtraction, the fragment calculations should normally use:

  • the same simulation cell;

  • the same atomic positions as in the combined geometry;

  • the same plane-wave settings;

  • the same pseudopotential family;

  • the same FFT/grid conventions where required.

A visually attractive CDD plot is not meaningful if the densities being subtracted are inconsistent.

Bader charge analysis

The current Bader workflow is implemented for VASP charge-density files and uses the external bader executable.

The VQkit menu provides:

BADER CHARGE ANALYSIS

[1] Check Bader executable and required files
[2] Prepare AECCAR0 + AECCAR2 reference density
[3] Run Bader analysis
[4] Analyze an existing ACF.dat
[0] Back

External dependency

VQkit does not implement the Bader partitioning algorithm itself.

The external program:

bader

must be installed and available on PATH.

VQkit can check whether the executable is available.

Bader file-status check

The status workflow checks for:

CHGCAR
AECCAR0
AECCAR2
CHGCAR_sum
POTCAR
ACF.dat

It also reports whether the external Bader executable can be found.

Reference-density preparation

Choose:

[2] Prepare AECCAR0 + AECCAR2 reference density

VQkit constructs:

\[\rho_{\mathrm{ref}} = \rho_{\mathrm{AECCAR0}} + \rho_{\mathrm{AECCAR2}}\]

and writes:

CHGCAR_sum

Before summation, VQkit checks that AECCAR0 and AECCAR2 use:

  • identical FFT-grid dimensions;

  • compatible atom counts / structure definitions.

If the grids differ, VQkit stops instead of creating an invalid reference density.

Running Bader analysis

Choose:

[3] Run Bader analysis

VQkit requires:

CHGCAR

and the external:

bader

program.

Reference-density selection

With the default automatic reference behavior:

  1. If both AECCAR0 and AECCAR2 exist, VQkit generates CHGCAR_sum.

  2. Else, if CHGCAR_sum already exists, VQkit uses it.

  3. Otherwise, the Bader run proceeds without a separate reference density.

When a reference is available, the external command is run in the equivalent form:

bader CHGCAR -ref CHGCAR_sum

Without a reference:

bader CHGCAR

After a successful calculation, VQkit expects:

ACF.dat

to exist.

If ACF.dat is not generated, the run is treated as failed.

Analyzing an existing ACF.dat

Choose:

[4] Analyze an existing ACF.dat

This option is useful when the external Bader program was run separately.

VQkit parses atom-resolved information including:

  • atom index;

  • x, y, z;

  • Bader electron count;

  • minimum distance to basin boundary;

  • Bader atomic volume.

POTCAR ZVAL and net charge

If POTCAR is available, VQkit extracts the VASP ZVAL value for each species.

The net charge is then calculated as:

\[q_i = ZVAL_i - N_i^{\mathrm{Bader}}\]

where:

  • \(ZVAL_i\) is the valence-electron count from POTCAR;

  • \(N_i^{\mathrm{Bader}}\) is the Bader electron count.

The sign convention is:

positive net charge = electron depletion
negative net charge = electron accumulation

Example

Suppose:

ZVAL = 6.0
Bader electrons = 6.35

then:

\[q = 6.0 - 6.35 = -0.35\ e\]

which indicates electron accumulation.

Bader output

VQkit writes:

VQkit_BADER_CHARGES.csv

The columns are:

index
element
x
y
z
bader_electrons
zval
net_charge
min_dist
atomic_volume

This file can be used directly in spreadsheet or plotting software.

Additional ACF information

If available, VQkit also reads:

  • total number of electrons;

  • vacuum charge;

  • vacuum volume.

These values are reported from ACF.dat but are not substitutes for manual charge-conservation checks.

Bader interpretation cautions

Bader charge is a real-space partitioning quantity.

It should not be interpreted as a unique formal oxidation state.

Use Bader charges mainly for:

  • relative charge transfer;

  • comparing chemically related sites;

  • tracking adsorption-induced redistribution;

  • comparing before/after reaction states.

For robust comparison, use consistent:

  • pseudopotentials;

  • charge-density settings;

  • grids;

  • computational parameters.

Electron localization function

The electron localization function (ELF) is a dimensionless quantity commonly used to visualize electron localization.

The current VQkit workflow expects a final ELF cube file.

Preferred filenames

If several cube files are present, VQkit gives preference to filenames containing:

elf
localization

If only one cube file exists, it is selected automatically.

ELF range

ELF is plotted in the physical range:

0.0 to 1.0

Numerical values outside this range due to noise are clipped for plotting.

A qualitative interpretation is:

ELF -> 1.0 : strong electron localization
ELF ~ 0.5  : electron-gas-like behavior

Interpretation near zero depends on the local electronic environment and should not be reduced to a single bonding label.

ELF plotting menu

The current ELF menu provides:

[1] XY center slice
[2] XZ center slice
[3] YZ center slice
[4] All center slices
[5] Custom slice position

The default is:

[4] All center slices

Custom ELF slice

For a custom slice, VQkit asks:

Plane [YZ]:

and:

Fractional slice position 0-1 [0.5]:

The selected fractional position is converted into the nearest volumetric-grid index.

ELF contours

The current ELF plotting routine uses contour levels at approximately:

0.5
0.7
0.8
0.9

These contours help distinguish moderately and strongly localized regions.

Atoms near the slice plane are overlaid and labeled.

QE ELF preparation

If no ELF cube is found and VQkit detects Quantum ESPRESSO, it creates:

VQkit_QE_ELF_pp.in

The generated template uses:

plot_num = 8

A representative template is:

&INPUTPP
   prefix = 'CHANGE_ME'
   outdir = 'CHANGE_ME'
   filplot = 'VQkit_QE_ELF'
   plot_num = 8
/
&PLOT
   nfile = 1
   filepp(1) = 'VQkit_QE_ELF'
   weight(1) = 1.0
   iflag = 3
   output_format = 6
   fileout = 'VQkit_QE_ELF.cube'
/

The user must edit:

prefix
outdir

to match the completed QE SCF calculation.

Then run:

pp.x < VQkit_QE_ELF_pp.in > VQkit_QE_ELF_pp.out

After VQkit_QE_ELF.cube has been generated, run the ELF option again.

ELF outputs

Typical outputs include:

VQkit_QE_ELF_XY.png
VQkit_QE_ELF_XY.dat

VQkit_QE_ELF_XZ.png
VQkit_QE_ELF_XZ.dat

VQkit_QE_ELF_YZ.png
VQkit_QE_ELF_YZ.dat

For a custom slice:

VQkit_QE_ELF_YZ_CUSTOM.png
VQkit_QE_ELF_YZ_CUSTOM.dat

The .dat files contain:

  • two in-plane coordinates;

  • ELF value;

  • selected slice index;

  • physical slice coordinate.

Three-dimensional ELF

The original cube is left unchanged.

For 3D ELF isosurfaces, use a volumetric-data viewer such as:

  • VESTA;

  • VMD;

  • XCrySDen.

Relationship between CDD, Bader, and ELF

These three analyses provide complementary information.

CDD

Shows where charge redistributes when systems interact.

Useful questions include:

  • Where does charge accumulate?

  • Where is charge depleted?

  • How is the interface polarized?

Bader charge

Provides a quantitative real-space partitioning of electron density among atoms.

Useful questions include:

  • Which atoms gain electron density?

  • Which atoms lose electron density?

  • How much relative charge transfer occurs?

ELF

Shows where electrons are localized.

Useful questions include:

  • Are there localized lone-pair-like regions?

  • Are electrons localized around bonds or atomic centers?

  • How does localization change after adsorption or reaction?