Skip to content

stb-sqs

SQS Generator · menu code 4.6 · guide: 4.6 SQS Generator

usage: stb-sqs [-h] -f FILENAME --sublattice SUBLATTICE --composition COMPOSITION
               [--scaling SCALING] [--method {monte_carlo,enumeration}]
               [--instances INSTANCES] [--temperature TEMPERATURE]
               [--mc-steps MC_STEPS] [--cluster-cutoffs CLUSTER_CUTOFFS] [-sp SYMPREC]
               [--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]

Generates a Special Quasirandom Structure (SQS) for a substitutional alloy.
Picks one sublattice (--sublattice) and disorders it with a target
composition, then searches for the atomic arrangement that best mimics an
ideal random alloy (via icet's Monte Carlo or enumeration SQS search).

options:
  -h, --help            show this help message and exit
  -f FILENAME, --file FILENAME
                        Path to the input structure file (.fdf).
  --sublattice SUBLATTICE
                        Existing species whose sites become the disordered alloy sublattice.
  --composition COMPOSITION
                        Target composition on that sublattice, e.g. 'Fe:0.5,Ni:0.5' (must sum to 1.0). Practically limited to 2 species: pymatgen's own SQSTransformation/IcetSQS wrapper (pymatgen/io/icet.py) builds its internal reference structure the same way this tool's minimal_scaling() used to (a replace_species() call that leaves a site's occupancy dict merged rather than collapsed for 3+ species), and raises 'ASE Atoms only supports ordered structures' during the search itself for a 3+ -species composition -- verified upstream in the installed pymatgen, not something this tool can work around without bypassing SQSTransformation entirely.
  --scaling SCALING     icet supercell-size control (positive integer). Multiplies icet's own internally-detected primitive unit, not necessarily the literal input atom count -- read the actual resulting atom count from the output. Default: auto-detect the smallest scaling that gives every species in --composition an exact atom count (a --scaling that doesn't divide evenly is rejected, since icet would otherwise fail to find any candidate structure at that size).
  --method {monte_carlo,enumeration}
                        SQS search method (default: monte_carlo).
  --instances INSTANCES
                        Number of parallel search instances/processes (default: 1, serial). For --method enumeration, icet's own enumeration of candidate structures is single -threaded regardless of this value -- only the (comparatively cheap) scoring of already-generated candidates is split across instances, so raising it rarely helps. For monte_carlo, each instance runs an independent full search and the best is kept, which can help on a machine with real spare cores -- but every instance re-pays icet/pymatgen's startup cost (imports, primitive-cell detection via spglib), so on a loaded or virtualized machine more instances can end up *slower* in wall time despite using more CPU overall. Benchmark before raising this; don't assume it helps.
  --temperature TEMPERATURE
                        Monte Carlo starting temperature (default: 1.0).
  --mc-steps MC_STEPS   Caps the number of Monte Carlo steps (--method monte_carlo only). Default: icet's own default.
  --cluster-cutoffs CLUSTER_CUTOFFS
                        Cluster size:shell pairs, e.g. '2:3,3:2' (default: icet's own {2:3, 3:2, 4:1}).
  -sp SYMPREC, --symprec SYMPREC
                        Symmetry tolerance in Angstroms for the before/after symmetry analysis (default: 0.01).
  --ml-relax            Pre-relax the SQS structure found 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 -- any vacuum-padded 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) comparing the input structure and the final SQS 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: sqs.fdf).
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-sqs -f ni.fdf --sublattice Ni --composition Ni:0.5,Fe:0.5
  stb-sqs -f ni.fdf --sublattice Ni --composition Ni:0.75,Fe:0.25 --scaling 8 --method enumeration
  stb-sqs -f ni.fdf --sublattice Ni --composition Ni:0.5,Fe:0.5 --ml-relax --view