Skip to content

stb-slab

Slab Builder · menu code 4.3 · guide: 4.3 Slab Builder

usage: stb-slab [-h] -f FILENAME --hkl H K L [--min-slab-size MIN_SLAB_SIZE]
                [--layers N] [--layer-tol ANG] [--min-vacuum-size MIN_VACUUM_SIZE]
                [--lll-reduce] [--center-slab] [--primitive] [--symmetrize]
                [--symprec SYMPREC] [-i | --termination TERMINATION] [--all]
                [--passivate] [--passivant PASSIVANT] [--cutoff CUTOFF]
                [--bond-length BOND_LENGTH] [--ml-relax] [--ml-relax-cell]
                [--model {small,medium,large}] [--custom-model PATH]
                [--custom-model-card JSON] [--device {cpu,cuda}] [--view] [-o OUTPUT]
                [-v] [--no-intro]

Cuts a Miller-index slab from a bulk SIESTA FDF structure.
Adds vacuum along the surface normal; the vacuum axis lands on c.

options:
  -h, --help            show this help message and exit
  -f FILENAME, --file FILENAME
                        Path to the input bulk structure file (.fdf).
  --hkl H K L           Miller index of the surface to cut, e.g. --hkl 1 0 0
  --min-slab-size MIN_SLAB_SIZE
                        Minimum slab thickness in Angstrom (default: 10.0).
  --layers N            Number of atomic layers of the slab, instead of a thickness: the slab is cut thick enough and layers are removed from its top until N are left (the bottom face is the chosen termination), the vacuum unchanged. For a convergence series in the number of layers. --min-slab-size is then ignored. Not with --symmetrize.
  --layer-tol ANG       Atoms whose heights along the surface normal differ by less than this belong to one atomic layer (default: 0.1 Ang). A buckled plane counts as two layers unless this is raised above its buckling.
  --min-vacuum-size MIN_VACUUM_SIZE
                        Minimum vacuum thickness in Angstrom (default: 15.0).
  --lll-reduce          LLL-reduce the slab lattice (pymatgen SlabGenerator option).
  --center-slab         Center the slab in the middle of the vacuum (pymatgen SlabGenerator option).
  --primitive           Reduce the bulk to its primitive cell before cutting the slab. Off by default so the input cell is used as given.
  --symmetrize          Ask pymatgen to symmetrize polar/asymmetric terminations.
  --symprec SYMPREC     Symmetry tolerance, Ang, used for the polar/symmetric diagnostics AND the before/after symmetry table (default: 0.1).
  -i, --interactive     Show all terminations found and prompt for one to keep.
  --termination TERMINATION
                        Directly select a termination index (0-based). Default: index 0 after sorting non-polar/symmetric terminations first.
  --all                 Write every termination found, instead of just one.
  --passivate           Cap dangling bonds on each written termination with a passivating atom (same logic as stb-passivate). Only single-missing-bond sites are auto-passivated; sites missing 2+ bonds are reported instead of guessed.
  --passivant PASSIVANT
                        Element to cap dangling bonds with, only with --passivate (default: H).
  --cutoff CUTOFF       Neighbor-search radius in Angstrom for --passivate. Default: auto-detected (see stb-passivate --help).
  --bond-length BOND_LENGTH
                        Passivant bond length in Angstrom for --passivate. Default: auto per species pair (see stb-passivate --help).
  --ml-relax            Pre-relax each written slab with a MACE potential before writing it out (needs the optional 'ml' extra: pip install stb_suite[ml]) -- positions only by default. Off by default.
  --ml-relax-cell       With --ml-relax, also relax the in-plane cell -- the vacuum axis always stays exactly fixed. Only valid together with --ml-relax.
  --model {small,medium,large}
                        MACE-MP-0 foundation model size for --ml-relax (default: medium).
  --custom-model PATH   Path to a custom fine-tuned .model file for --ml-relax, instead of a MACE-MP-0 foundation size.
  --custom-model-card JSON
                        Model card of the --custom-model file: the mlff_model_card.json that stb-mlffAnalysis wrote next to it (training data, level of theory, accuracy, energy scale). Required with --custom-model -- the card is checked against the model file and used to warn when a structure is outside what the model was trained on.
  --device {cpu,cuda}   Device to run the MACE model on (default: cpu).
  --view                Open an interactive 3D view (via ASE) of the bulk structure and every written slab (page through frames in ase-gui) after writing the output file(s). Needs a display. Off by default.
  -o OUTPUT, --output OUTPUT
                        Output .fdf file name (default: slab.fdf). When more than one termination is written, it is suffixed '_term0', '_term1', ...
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-slab -f bulk.fdf --hkl 1 0 0
  stb-slab -f bulk.fdf --hkl 1 1 1 -i
  stb-slab -f bulk.fdf --hkl 1 1 1 --all -o surface.fdf
  stb-slab -f bulk.fdf --hkl 1 1 1 --passivate
  stb-slab -f bulk.fdf --hkl 1 1 1 --ml-relax --view