stb-xrdsearch¶
Stage 1 - Prep of the 5.6 Structure Solution (XRD) workflow · menu code 5.6.1
usage: stb-xrdsearch [-h] --species SPECIES [SPECIES ...] --num-ions NUM_IONS
[NUM_IONS ...] --groups GROUPS
[--count-per-group COUNT_PER_GROUP] [--molecular]
[--volume-factor VOLUME_FACTOR] [--max-attempts MAX_ATTEMPTS]
[--seed SEED] [--ml-rank] [--keep-top-per-group N] [--mace-relax]
[--mace-model {small,medium,large}] [--mace-custom-model PATH]
[--mace-custom-model-card JSON] [--mace-device {cpu,cuda}]
[--mace-fmax MACE_FMAX] [--mace-max-steps MACE_MAX_STEPS]
[-c PATH] [--d3] [-s] [-p PATH_OR_BANK] [--view] [-o OUTPUT_DIR]
[-v] [--no-intro]
Casts candidate structures across a set of space groups (Stage 1 - Prep).
Part of the Structure Solution (XRD) workflow: given a composition and a
list of space groups to try, casts --count-per-group random candidates in
each (by driving stb-crystalcast once per group), and puts each candidate
in its own folder as '<folder>/structure.fdf'. Optionally pre-relaxes every
final candidate with a MACE potential (--mace-relax, positions + cell) --
a fast cleanup of pyxtal's raw random placement, not a substitute for a
real SIESTA relaxation. By default, also generates the standard relaxation
calc.fdf (same as stb-inputfile -t relax) in every folder -- use --calc to
supply your own template instead -- and links pseudopotentials if
--pseudo-dir is given, so every folder is ready for a real SIESTA
relaxation as-is. Follow up with stb-xrdrank to score every candidate
against an experimental XRD pattern (either now, on these raw candidates,
or later, on your relaxed .STRUCT_OUT results).
options:
-h, --help show this help message and exit
--species SPECIES [SPECIES ...]
Element symbols in the structure, e.g. --species Ni O.
--num-ions NUM_IONS [NUM_IONS ...]
Number of atoms of each --species, same order and count, e.g. --num-ions 4 8.
--groups GROUPS Comma- or space-separated space group numbers to try, e.g. '225,227,229' or '225 227 229'.
--count-per-group COUNT_PER_GROUP
Random candidates to generate per space group (default: 1).
--molecular Passed through to stb-crystalcast: treat --species as whole rigid molecules instead of bare elements.
--volume-factor VOLUME_FACTOR
Passed through to stb-crystalcast (default: 1.1).
--max-attempts MAX_ATTEMPTS
Passed through to stb-crystalcast (default: 10).
--seed SEED Base random seed; each space group's batch uses seed+group so groups don't share identical draws (default: not seeded).
--ml-rank Passed through to stb-crystalcast: quickly relax each candidate with MACE-MP-0 and rank by energy (needs the optional 'ml' extra: pip install stb_suite[ml]) -- a fast, local pre-screen, not a substitute for the real SIESTA relaxation. Folders are then named '<group>_rank<N>' (most stable first) instead of by attempt order.
--keep-top-per-group N
Only keep the N most stable candidates per group (requires --ml-rank; default: keep all --count-per-group candidates).
--mace-relax Pre-relax every FINAL candidate structure (positions + cell) with a MACE potential before generating calc.fdf -- a fast heuristic cleanup of pyxtal's raw random placement, not a substitute for the real SIESTA relaxation. The relaxed geometry overwrites each candidate's structure.fdf. Distinct from --ml-rank, which only relaxes (positions-only, transiently) to RANK/select candidates during casting -- the geometry it uses for that is discarded, not kept. Needs the optional 'ml' extra (pip install stb_suite[ml]).
--mace-model {small,medium,large}
MACE-MP-0 model size for --mace-relax (default: medium). Ignored if --mace-custom-model is given. Only valid together with --mace-relax.
--mace-custom-model PATH
Path to a custom fine-tuned .model file for --mace-relax, instead of a MACE-MP-0 foundation size. Only valid together with --mace-relax.
--mace-custom-model-card JSON
Model card of the --mace-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 --mace-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.
--mace-device {cpu,cuda}
Device to run the MACE model on (default: cpu) -- used for both --mace-relax (here) and --ml-rank (passed through to the stb-crystalcast subprocess).
--mace-fmax MACE_FMAX
Force convergence threshold for --mace-relax, eV/Ang (default: 0.05).
--mace-max-steps MACE_MAX_STEPS
Maximum optimizer steps for --mace-relax (default: 200).
-c PATH, --calc PATH Custom calc.fdf template, copied (as 'calc.fdf') into every candidate folder -- should %include 'structure.fdf' by name. If omitted (default), the standard relaxation calc.fdf -- the same default stb-inputfile -t relax produces -- is auto-generated for every candidate instead (see --d3/--spin-polarized).
--d3 Auto-generate mode only (--calc not given): enable the DFT-D3 (Grimme) van der Waals correction in the generated calc.fdf. Rejected together with --calc.
-s, --spin-polarized Auto-generate mode only (--calc not given): enable spin polarization in the generated calc.fdf. Rejected together with --calc.
-p PATH_OR_BANK, --pseudo-dir PATH_OR_BANK
Pseudopotentials source (optional): a bundled bank (dojo[-sr|-fr|-sr3plus][-pbe|-pbesol|-pw][-standard|-stringent], virtual_vault) or a folder path. If given, the required pseudopotential for every species actually present in the cast candidates is copied into every candidate folder.
--view After generating, open one interactive 3D view (via ASE) paging through every candidate structure. Needs a display. Off by default.
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Folder to write candidate structures into (default: xrd_search); each candidate gets its own '<output-dir>/<name>/'. Created if it doesn't exist; refuses to run if it already has any content, to avoid mixing batches.
-v, --version show program's version number and exit
--no-intro Do not show the introduction
Usage examples:
stb-xrdsearch --species Ni O --num-ions 4 8 --groups 225,227,229
stb-xrdsearch --species Na Cl --num-ions 4 4 --groups 225,221,62 \
--count-per-group 3 -o candidates --pseudo-dir dojo
stb-xrdsearch --species Na Cl --num-ions 4 4 --groups 225,221,62 \
--count-per-group 5 --ml-rank --keep-top-per-group 1
stb-xrdsearch --species Ni O --num-ions 4 8 --groups 225,227 \
--calc my_calc_template.fdf --pseudo-dir /path/to/pps --view
stb-xrdsearch --species Ni O --num-ions 4 8 --groups 225,227 \
--mace-relax --mace-model medium --pseudo-dir dojo