Skip to content

stb-bader

Bader Charge Analysis · menu code 2.6 · guide: 2.6 Bader Charge Analysis

usage: stb-bader [-h] -l LABEL [-o OUTPUT_DIR] [--ref REF] [--speed {normal,fast}]
                 [--threads N] [--vacuum-tol TOL] [--no-cube] [--export-volumes] [-v]
                 [--no-intro]

Computes Bader (AIM) atomic charges from a SIESTA charge-density grid.
Reads <label>.RHO (charge density) plus <label>.XV or <label>.fdf (geometry),
converts to a .cube file via sisl, and partitions it into atomic basins with
PyBader. Z_val (valence electron count per species) is parsed automatically
from <label>.out when available (or --ref points at a specific SIESTA
output); species it doesn't mention fall back to a hardcoded periodic-table
guess, per species, with a warning. If the .RHO file is spin-polarized, a
per-atom net spin (magnetic moment) is reported alongside the charge
automatically. Dummy/no-element sites (Z<=0) are excluded to match
PyBader's own handling; SIESTA's own ghost/BSSE atoms are unaffected.
Also reports each atom's Bader volume and minimum surface distance, a
per-species mean/std summary, and cross-checks symmetry-equivalent atoms
against each other -- on top of the per-atom warnings for a suspiciously
low (near-zero) population.

options:
  -h, --help            show this help message and exit
  -l LABEL, --label LABEL
                        SystemLabel used in Siesta
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Directory to write the .cube file(s) into (and any --export-volumes files) (default: current directory). Created if it doesn't exist.
  --ref REF             Path to a specific .out file to read Z_val from (overrides <label>.out)
  --speed {normal,fast}
                        'fast' uses PyBader's own bundled speed profile (on-grid charge assignment instead of near-grid) -- quicker, less precise basin boundaries (default: normal)
  --threads N           Worker threads for PyBader, >= 1 (default: $SLURM_CPUS_PER_TASK if set, else every CPU core -- multiprocessing.cpu_count() can overcount under a job scheduler's cgroup limits)
  --vacuum-tol TOL      Charge-density threshold (e/Ang^3) below which a voxel is assigned to a separate 'vacuum' bucket instead of the nearest atom -- useful for slabs/wires/isolated molecules with empty space in the cell (default: disabled, matches PyBader's own default)
  --no-cube             Delete the intermediate .cube file(s) after the calculation (kept by default -- they can be large for dense grids)
  --export-volumes      Also write each atom's individual Bader volume as its own 'Bader-atoms-<N>.cube' file (plus a vacuum one if --vacuum-tol is set) inside --output-dir, for visual inspection in VESTA/VMD -- one file per atom, each as large as the main grid, so this is opt-in (default: off)
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-bader --label siesta
  stb-bader --label siesta --ref relax/siesta.out
  stb-bader --label siesta --speed fast --threads 8
  stb-bader --label slab --vacuum-tol 1e-3
  stb-bader --label siesta --export-volumes