stb-chargediffPrep¶
Stage 1 - Prep of the 5.16 Charge Density Difference workflow · menu code 5.16.1
usage: stb-chargediffPrep [-h] [-s STRUCTURE]
(--fragment-manifest PATH | --fragment-sizes N1,N2,...,NK | --fragment-species El_a,El_b;El_c;...)
[--calc CALC] [--mesh-cutoff RY] [-p PSEUDO_DIR]
[--force-spin] [--no-force-spin] [--force-dipole]
[--no-force-dipole] [--force-vdw] [--no-force-vdw]
[-o OUTPUT_DIR] [--view] [--show] [--png] [--no-intro] [-v]
Stage 1 of the Charge Density Difference workflow: writes a 'combined/' SIESTA input folder (every atom real, no ghosting) plus one fragment folder per fragment of an N-fragment system (bilayer, molecule-on-slab, etc.) -- ALL of them sharing the identical cell/mesh/level of theory, forced by this tool itself. Every fragment folder ALWAYS includes every other fragment as ghost atoms (no opt-out) so every calculation shares the same basis set.
options:
-h, --help show this help message and exit
-s STRUCTURE, --structure STRUCTURE
Path to the combined system's own .fdf structure file -- taken directly as the REAL, authoritative geometry to be split into fragments (structure_io.read_fdf, no directory scanning, no automatic preference for a relaxed '*.XV' that might sit alongside it -- point this at whichever file you consider the real geometry, e.g. a fresh structure.fdf written from a converged '*.XV' via stb-translate). Default: 'structure.fdf'.
--fragment-manifest PATH
Reuse an existing fragment_manifest.json (written by stb-adsorb) to recover its slab/adsorbate split -- exactly 2 fragments. Pass an empty value ('') to default to 'fragment_manifest.json' next to --structure itself.
--fragment-sizes N1,N2,...,NK
General split by ATOM COUNT: comma-separated atom counts, in the order fragments appear in the structure file (fragment 1 = first N1 atoms, fragment 2 = next N2, ...). Must sum to the combined structure's total atom count. K >= 2.
--fragment-species El_a,El_b;El_c;...
General split by CHEMICAL SPECIES, independent of atom order: ';'-separated groups, each a comma-separated list of element symbols belonging to that fragment (e.g. 'C;B,N' for a graphene/h-BN heterostructure). Every species present in the structure must appear in exactly one group. LIMITATION: cannot be used when two fragments physically share a species (e.g. MoS2 on WS2, sulfur in both layers) -- use --fragment-sizes or --fragment-manifest instead in that case.
--calc CALC SIESTA input template (.fdf) used for every fragment folder -- same basis/SCF/k-grid as the combined system (default: 'calc.fdf').
--mesh-cutoff RY Explicit MeshCutoff (Ry) to force in every fragment folder -- the SAME value on all of them, never auto-detected from --calc/the combined system's own calc.fdf (a per-run SIESTA default can silently differ between calculations with different atoms/pseudopotentials, which would corrupt the point-by-point subtraction). Default: 400 Ry -- raise it for a finer grid (recommended for a production CDD map) or type a different value here.
-p PSEUDO_DIR, --pseudo-dir PSEUDO_DIR
Pseudopotentials source: a bundled bank (dojo[-sr|-fr|-sr3plus][-pbe|-pbesol|-pw][-standard|-stringent], virtual_vault) or a folder path (same convention as stb-adsorb/stb-her/stb-hubbardu). Default: reuse the directory --structure lives in, which already has every pseudopotential the combined calculation needed. For each species label the file named after the label (without a '_ghost' suffix: 'Ag_slab.psml' for Ag_slab and Ag_slab_ghost) is used when the folder has one, else the element's ('Ag.psml').
--force-spin Force spin-polarized SCF in every fragment folder (default: inherited from the combined system's own config_extra.fdf, if any).
--no-force-spin Force spin-restricted SCF, overriding the combined system's own setting.
--force-dipole Force the slab dipole correction (default: inherited from the combined system's own config_extra.fdf, if any).
--no-force-dipole Disable the slab dipole correction, overriding the combined system's own setting.
--force-vdw Force the DFT-D3 dispersion correction (default: inherited from the combined system's own config_extra.fdf, if any).
--no-force-vdw Disable the DFT-D3 dispersion correction, overriding the combined system's own setting.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Root directory to write the fragment folders into (default: chargediff_run).
--view After writing them, open ONE ASE interactive 3D viewer window with the combined structure followed by every fragment as navigable movie frames -- ghost atoms render as mostly-hollow circles (see structure_to_view_atoms's docstring). Needs a display. Off by default.
--show Open a matplotlib figure on screen: the combined system projected on the xy/xz/yz planes, atoms coloured by fragment. Needs a display. Off by default.
--png Save that figure as <output-dir>/chargediff_fragments.png. Off by default.
--no-intro Do not show the introduction
-v, --version show program's version number and exit
Example usage:
stb-chargediffPrep -s water_dimer.fdf --fragment-sizes 3,3 --calc calc.fdf -p dojo --mesh-cutoff 320 --png
stb-chargediffPrep -s bilayer.fdf --fragment-species "C;B,N" -p dojo -o bilayer_cdd
stb-chargediffPrep -s li_graphene.fdf --fragment-sizes 18,1 --force-spin --force-dipole -p dojo
stb-chargediffPrep -s adsorption_run/sites/site_1/structure.fdf --fragment-manifest adsorption_run/sites/site_1/fragment_manifest.json