Skip to content

stb-crystalcast

Random Crystal Generator · menu code 4.12 · guide: 4.12 Random Crystal Generator

usage: stb-crystalcast [-h] [--substitute OLD:NEW [OLD:NEW ...]] [--subgroup]
                       [--supergroup] [--target-group TARGET_GROUP]
                       [--group-type {t,k,t+k}] [--eps EPS] [--d-tol D_TOL] [-f FILE]
                       [--dim {3,2,1,0}] [--group GROUP] [--molecular]
                       [--list-molecules] [--species SPECIES [SPECIES ...]]
                       [--num-ions NUM_IONS [NUM_IONS ...]]
                       [--volume-factor VOLUME_FACTOR] [--thickness THICKNESS]
                       [--area AREA] [--vacuum VACUUM]
                       [--lattice A B C ALPHA BETA GAMMA] [--sites SITES [SITES ...]]
                       [--max-attempts MAX_ATTEMPTS] [--count COUNT] [--seed SEED]
                       [--ml-rank] [--model {small,medium,large}]
                       [--custom-model PATH] [--custom-model-card JSON]
                       [--device {cpu,cuda}] [--symprec SYMPREC]
                       [--angle-tolerance ANGLE_TOLERANCE] [--view] [-o OUTPUT] [-v]
                       [--no-intro]

Casts one or more random structures compatible with a given symmetry group.
Give a symmetry group and a composition (species + how many of each) -- pyxtal
places the atoms on randomly chosen, symmetry-compatible Wyckoff positions
for you. This is the inverse of stb-crystalbuilder: use crystalbuilder when
you already know the exact Wyckoff sites you want, use crystalcast when you
want valid candidate structures generated for you (e.g. as starting guesses
for structure prediction). --molecular packs whole rigid molecules (instead
of bare atoms) into the symmetry group. --ml-rank pre-screens generated
candidates by MACE relaxed energy. --substitute/--subgroup/--supergroup
all instead operate on an existing structure read via -f/--file:
--substitute swaps elements while preserving the symmetry framework,
--subgroup/--supergroup search for related lower/higher-symmetry
structures. (To inspect an existing structure's own symmetry/Wyckoff
decomposition instead of generating or transforming one, use
stb-symmetry or stb-unitcell.)

options:
  -h, --help            show this help message and exit
  --substitute OLD:NEW [OLD:NEW ...]
                        Substitute elements in an existing structure (read via -f/--file), preserving its symmetry framework: one or more OLD:NEW pairs, e.g. --substitute Cl:F Na:K. Mutually exclusive with --subgroup/--supergroup and the generation options below.
  --subgroup            Generate lower-symmetry subgroup variant(s) of an existing structure (read via -f/--file) -- a symmetry-breaking distortion. Up to --count candidates are written (numbered like --count > 1 in generation mode). Optionally narrow the search with --target-group/--group-type/--eps. Mutually exclusive with --substitute/--supergroup and the generation options.
  --supergroup          Search for higher-symmetry supergroup structure(s) of an existing structure (read via -f/--file) towards --target-group (required -- the installed pyxtal doesn't support auto-searching all possible supergroups). Mutually exclusive with --substitute/--subgroup and the generation options below.
  --target-group TARGET_GROUP
                        Target space group number. Optional filter for --subgroup (only search towards this specific subgroup); required destination for --supergroup.
  --group-type {t,k,t+k}
                        --subgroup only: 't' (translationengleiche), 'k' (klassengleiche), or 't+k' relation to search (default: t).
  --eps EPS             --subgroup only: perturbation applied to atomic coordinates when breaking symmetry (default: 0.05).
  --d-tol D_TOL         --supergroup only: maximum atomic-displacement tolerance allowed when searching for a higher-symmetry parent (default: 1.0).
  -f FILE, --file FILE  Input .fdf structure file. Required with --substitute/--subgroup/--supergroup, unused otherwise.
  --dim {3,2,1,0}       Structure dimensionality: 3 = bulk (space group, default), 2 = layer (layer group, periodic in a/b with vacuum along c), 1 = rod/wire (rod group, periodic along c with vacuum in a/b), 0 = isolated cluster (point group, no periodicity). --molecular does not support --dim 0 (upstream pyxtal limitation). Generation mode only.
  --group GROUP         Symmetry group identifier, meaning depends on --dim: space group number/symbol (dim 3, e.g. 225 or 'Fm-3m'), layer group number 1-80 (dim 2), rod group number 1-75 (dim 1), or point group number/Schoenflies symbol 1-32 (dim 0, e.g. 20 or 'D3d'). Required in generation mode.
  --molecular           Treat each --species entry as a whole rigid molecule instead of a bare element: a name from pyxtal's bundled collection (see --list-molecules), a path to a .xyz/.gjf/.g03/.json file, or a SMILES string as 'SMILES.smi' (needs the optional 'rdkit' package).
  --list-molecules      Print the molecule names bundled with pyxtal (usable directly as --species with --molecular) and exit.
  --species SPECIES [SPECIES ...]
                        Element symbols (or, with --molecular, molecule identifiers) in the structure, e.g. --species Ni O. Required in generation mode.
  --num-ions NUM_IONS [NUM_IONS ...]
                        Number of atoms (or, with --molecular, molecules) of each --species, same order and count, e.g. --num-ions 4 8. Required in generation mode.
  --volume-factor VOLUME_FACTOR
                        Scales the estimated cell volume before placing atoms; raise it if generation keeps failing to fit atoms without overlap (default: 1.1, pyxtal's own default).
  --thickness THICKNESS
                        Layer thickness in Ang (--dim 2 only; default: chosen automatically by pyxtal).
  --area AREA           Rod cross-sectional area in Ang^2 (--dim 1 only; default: chosen automatically by pyxtal).
  --vacuum VACUUM       Vacuum padding in Ang around the cluster, on every side (--dim 0 only, matches stb-molecule's --vacuum; default: 10.0).
  --lattice A B C ALPHA BETA GAMMA
                        Fix the cell instead of estimating it from --volume-factor, e.g. for matching a known experimental cell: A B C ALPHA BETA GAMMA (Ang/degrees). Not valid with --dim 0 (use --vacuum instead). For --dim 2/1, only the periodic direction(s) are actually honored -- the vacuum direction(s) are still sized by --thickness/--area/pyxtal's own default, same as without --lattice.
  --sites SITES [SITES ...]
                        Pre-assign Wyckoff positions instead of leaving every site random: one entry per --species, each a comma-separated list of Wyckoff labels summing to that species' --num-ions, e.g. --species Na O --num-ions 4 8 --sites 4a 4b,4c. Default: fully random assignment.
  --max-attempts MAX_ATTEMPTS
                        Internal retries pyxtal allows itself per structure to find a non-overlapping placement before giving up on it (default: 10).
  --count COUNT         Number of independent random structures to generate in generation mode, or number of candidates to keep in --subgroup/--supergroup mode (default: 1).
  --seed SEED           Random seed. Same seed + same inputs reproduces the same batch of structures (default: not seeded, different every run). With --molecular, only the lattice is reproduced this way -- molecule orientations are not (an upstream pyxtal limitation). Unused outside generation mode.
  --ml-rank             Generation mode only. After generating --count structures, quickly relaxes each one's positions with a MACE potential, prints them ranked by relaxed energy, and writes each output file with its relaxed geometry. A relative comparison from a fast ML potential, not an absolute DFT formation energy.
  --model {small,medium,large}
                        MACE-MP-0 foundation model size for --ml-rank (default: medium). Only valid together with --ml-rank.
  --custom-model PATH   Path to a custom fine-tuned .model file for --ml-rank, instead of a MACE-MP-0 foundation size. Only valid together with --ml-rank.
  --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).
  --symprec SYMPREC     Symmetry precision: for generation, used to re-detect each --dim 3 candidate's actual space group; for --substitute/--subgroup/--supergroup, the tolerance passed to pyxtal's own symmetry detection (default: 0.01, pymatgen's own default, matches stb-symmetry/stb-unitcell).
  --angle-tolerance ANGLE_TOLERANCE
                        Angle tolerance in degrees for symmetry detection (default: 5.0, matches stb-symmetry/stb-unitcell).
  --view                Open an interactive 3D view (via ASE) of every structure written by this run (for --substitute/--subgroup/--supergroup, the input structure is shown first, as frame 0) -- page through frames in ase-gui. Needs a display. Off by default.
  -o OUTPUT, --output OUTPUT
                        Output .fdf file name (default: crystalcast.fdf). With --count > 1 (generation, --subgroup, or --supergroup), each structure is written as '<output>_<N>.fdf'; the tool refuses to run if any of those numbered names already exist, to avoid silently overwriting unrelated files.
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-crystalcast --group 225 --species Ni O --num-ions 4 8
  stb-crystalcast --group Fd-3m --species Fe O --num-ions 8 16 \
      --count 5 --seed 42 -o spinel.fdf
  stb-crystalcast --group 225 --species Ni O --num-ions 4 8 --count 5 \
      --ml-rank --model medium
  stb-crystalcast --group 225 --species Na Cl --num-ions 4 4 \
      --lattice 5.64 5.64 5.64 90 90 90
  stb-crystalcast --group 225 --species Na Cl --num-ions 4 4 --sites 4a 4b
  stb-crystalcast --dim 2 --group 65 --species C --num-ions 6 --thickness 3.4
  stb-crystalcast --dim 0 --group D3d --species C --num-ions 6 --vacuum 12
  stb-crystalcast --molecular --group 19 --species H2O --num-ions 4
  stb-crystalcast --molecular --group 14 --species aspirin --num-ions 4 -o aspirin.fdf
  stb-crystalcast --list-molecules
  stb-crystalcast --substitute Cl:F -f rocksalt.fdf -o rocksalt_f.fdf
  stb-crystalcast --subgroup -f spinel_1.fdf --count 5 -o distorted.fdf
  stb-crystalcast --supergroup --target-group 225 -f distorted_1.fdf -o parent.fdf
  stb-crystalcast --group 225 --species Ni O --num-ions 4 8 --view