Skip to content

stb-crystalbuilder

Crystal Builder · menu code 4.8 · guide: 4.8 Crystal Builder

usage: stb-crystalbuilder [-h] --spacegroup SPACEGROUP --a A [--b B] [--c C]
                          [--alpha ALPHA] [--beta BETA] [--gamma GAMMA] --site SYMBOL
                          X Y Z [--symprec SYMPREC]
                          [--angle-tolerance ANGLE_TOLERANCE]
                          [--reduce {primitive,conventional,refined}] [--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]

Builds a structure from a space group and Wyckoff positions.
Give only the symmetrically-distinct sites (e.g. one per Wyckoff letter) --
pymatgen expands the rest via the space group's own symmetry operations.

Bulk (3D) crystals only: the 230 space groups accepted by --spacegroup are
the international crystallographic groups for 3D-periodic crystals -- there
is no 2D/1D analog (layer/rod groups) here. To get a 2D or 1D structure,
build the 3D bulk crystal with this tool first, then cut it down with
stb-slab (a surface slab), stb-nanotube (rolled into a tube/ribbon), or
stb-2Dstacking (an isolated monolayer) -- e.g. build bulk graphite
(space group P6_3/mmc) here, then stb-slab --hkl 0 0 1 it into a graphene
monolayer.

options:
  -h, --help            show this help message and exit
  --spacegroup SPACEGROUP
                        Space group as an international symbol (e.g. 'Fm-3m') or number (e.g. '225', must be between 1 and 230).
  --a A                 Lattice constant a (Ang).
  --b B                 Lattice constant b (Ang). Default: same as --a.
  --c C                 Lattice constant c (Ang). Default: same as --a.
  --alpha ALPHA         Lattice angle alpha, degrees (default: 90).
  --beta BETA           Lattice angle beta, degrees (default: 90).
  --gamma GAMMA         Lattice angle gamma, degrees (default: 90).
  --site SYMBOL X Y Z   One symmetrically-distinct Wyckoff site: element symbol and fractional x y z. Repeat --site for each distinct site.
  --symprec SYMPREC     Symmetry precision, used both for the post-build symmetry detection and for --reduce (default: 0.01, pymatgen's own default, matches stb-symmetry/stb-unitcell).
  --angle-tolerance ANGLE_TOLERANCE
                        Symmetry angle tolerance in degrees (default: 5.0, pymatgen's own default).
  --reduce {primitive,conventional,refined}
                        Reduce the space-group-expanded structure to its primitive/conventional/refined cell (via stb-unitcell's own reduction) before writing. Off by default -- the raw space-group-expanded structure is written as-is.
  --ml-relax            Pre-relax the final structure with a MACE potential (needs the optional 'ml' extra: pip install stb_suite[ml]) before writing it out -- positions only by default. Off by default.
  --ml-relax-cell       With --ml-relax, also relax the cell. 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) comparing the raw space-group-expanded structure and the final structure (page through frames in ase-gui) after writing the output file. Needs a display. Off by default.
  -o OUTPUT, --output OUTPUT
                        Output .fdf file name (default: crystal.fdf).
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-crystalbuilder --spacegroup Fm-3m --a 3.52 --site Ni 0 0 0
  stb-crystalbuilder --spacegroup 225 --a 3.52 --site Ni 0 0 0 -o fcc_ni.fdf
  stb-crystalbuilder --spacegroup Fd-3m --a 8.396 \
      --site Fe 0.125 0.125 0.125 --site Fe 0.5 0.5 0.5 \
      --site O 0.2548 0.2548 0.2548
  stb-crystalbuilder --spacegroup Fm-3m --a 3.52 --site Ni 0 0 0 \
      --reduce primitive --ml-relax --view

Notes:
  - Bulk (3D) crystals only -- see the description above for how to get
    a 2D/1D structure out of this tool's output.