Special Quasirandom Structures (SQS and GQS)
SQS and GQS are methods for identifying configurations that best represent random disorder in a solid solution, by comparing short-range ordering statistics to ideal random-mixing values.
Concept
For a disordered solid solution, ideal random mixing produces characteristic
pair probabilities. The sqssod program scores and ranks all configurations
by comparing species-resolved pair probabilities against independent-random
targets. For a pair orbit connecting targets t and u, the target for
species channel alpha,beta is x(t,alpha) * x(u,beta). This target-aware
form covers binary, multinary, multi-target, and multinary multi-target
substitution without allowing species to move onto forbidden sublattices.
SQS (
sqssod): identifies the best-matching configuration at a fixed composition (0 K weighting).GQS (
gqssod): extends SQS to finite temperature by computing Boltzmann-weighted thermal averages of the multi-site cluster correlation functions (orders 1 toMaxOrder) from calculated energies.
Ensemble source: enumeration or random sampling
sqssod and gqssod score whatever configurations are listed in
ENSEMBLE — they do not enumerate or search the configurational space
themselves. The SQS is simply the best-scoring member of the ensemble you
provide. That ensemble can come from either route:
Full enumeration (
sod_comb.sh→nXX/ENSEMBLE): the symmetry-inequivalent configurations at the composition. This guarantees the true best SQS within the supercell is present, but is only feasible when the space is small enough to enumerate.Uniform random sampling (
sod_random.sh→nXX/random/ENSEMBLE): a large random sample of configurations. This is the practical route when the full space is too large to enumerate — generate a big uniform ensemble and extract the best SQS from it. Pointsqssodat therandom/directory (which holds the sampledENSEMBLE) whileEQMATRIX,supercell.cif, andINSODremain in the parent folder. Random sampling needs no reference energies, so this works before any DFT is run; for GQS, supplyENERGIESfor the sampled configurations.
With random sampling the result is the best SQS found in the sample, not provably the global optimum — enlarge the sample to improve it.
Note
Future direction. SOD does not yet perform a directed search for the
SQS (e.g. simulated annealing or basin-hopping that minimises the score
Q as a pseudo-energy to drive the configuration toward ideal
randomness). At present the SQS can only be selected from a pre-generated
ensemble (enumerated or randomly sampled). A directed-search mode is a
planned enhancement.
Workflow
From a full enumeration (sod_comb.sh → nXX/ENSEMBLE):
Prerequisites: sod_comb.sh must have been run to generate EQMATRIX,
supercell.cif, and nXX/ENSEMBLE.
Create an
INSQSfile in SODPROJECT/ (or innXX/for a per-composition override).Run SQS scoring:
sod_sqs.sh # from SODPROJECT/: scores all nXX/ compositions sod_sqs.sh # from nXX/: scores that composition only
Optionally run GQS (requires
ENERGIESandTEMPERATURES):sod_gqs.sh # from SODPROJECT/ or nXX/
From a random sample (sod_random.sh → nXX/random/ENSEMBLE):
Prerequisites: sod_comb.sh must have been run (for EQMATRIX and
supercell.cif); sod_random.sh must have produced nXX/random/ENSEMBLE.
Create
INSQSinnXX/random/(alongsideENSEMBLE).Run SQS scoring from that directory:
cd nXX/random/ sod_sqs.sh # reads ENSEMBLE and INSQS here; writes OUTSQS here
Generate calculator input files for the best configuration (rank 1 is nearest to ideal randomness):
sod_gener.sh -choose bestSQS # still from nXX/random/ # writes cYY/ under nXX/random/
-choosetakes either explicit configuration indices or a selection label naming a rule, optionally followed by how many to take (default 1):sod_gener.sh -choose bestSQS 10 # the ten best SQS, in rank order
bestSQSreadsOUTSQSfrom the same directory as theENSEMBLEbeing generated, so the ranking always belongs to that ensemble, and it fails rather than falling back if noOUTSQSis there. Labels are case-insensitive. The count is bounded by how many rowssqssodwrote:OUTSQSlists the topn_top_sqsconfigurations, 10 by default, so asking for more is an error telling you to raisen_top_sqsinINSQSor set it to0to rank the whole ensemble.lowestENERGYandhighestENERGYreadENERGIESfrom that same directory and are bounded only by the number of entries in it.To generate some other configuration, take the Config column of the row you want and pass it explicitly:
sod_gener.sh -choose <index>
The first
OUTSQScolumn is the rank and the second is the configuration index. They are rarely equal, so-choose 1almost never generates the best SQS – it silently produces a valid but unremarkable configuration. That is the mistake the label removes.Note
There is no
bestGQSlabel.gqssodprints its ranking to the terminal only –OUTGQSholds thermal averages of the cluster correlations, not a ranked list of configurations – and it ranks once per temperature, so “the best GQS” would not name a single structure. Adding the label would mean givinggqssoda ranked output file and the label a temperature.
Input file: INSQS
INSQS controls the pair cutoff and scoring parameters. Example:
# Maximum cluster order (2-6)
4
# Cutoff radii (Angstroms) for orders 2..MaxOrder
8.0 6.0 4.0
# Weights for orders 2..MaxOrder
1.0 1.0 1.0
# omega eps_tol
10 1.0E-8
# n_top_sqs: number of top configurations listed in OUTSQS (0 = rank and list all)
10
Key parameters:
MaxOrder: accepted for backward compatibility. The generalized
sqssodscorer currently uses pair correlations only, so order 2 controls the SQS score and entries for orders 3+ are ignored bysqssod.Cutoff radii: one per order from 2 to MaxOrder, in Å.
sqssoduses the order-2 value as the pair cutoff.Weights: one per order from 2 to MaxOrder.
sqssoduses the order-2 weight in the pair-family error normalization.Scoring: van de Walle matched-diameter scoring,
Q = -omega * L + Error, whereErroris the normalized mean absolute deviation of species-resolved pair probabilities from their target random probabilities.n_top_sqs: number of best-ranked configurations listed in
OUTSQS;0sorts and lists the whole ensemble. Optional line; defaults to 10 if absent.
Output files
sqssod writes two files in each composition or sample folder:
OUTSQS: compact ranked list of then_top_sqsbest configurations (default 10;0= all) with matched distance, total error, score, and target-pair family errors such asE11andE12. Equal-score configurations rank by configuration index.SQS_CORRELATIONS: detailed species-resolved pair-channel probabilities for the best-ranked configuration, includingP_cell,P_random, andDeltafor each pair orbit/channel.
Rank 1 is the best SQS.
gqssod writes two files:
OUTGQS: thermal averages of the cluster correlation functions at each temperature inTEMPERATURES, plus the T → ∞ (equiprobable) limit.wc_parameters.dat: the corresponding Warren-Cowley short-range order parameters αn for each symmetrically distinct pair shell. These are reported as an SRO diagnostic; the SQS/GQS ranking itself is done on the correlation functions, not on αn.
See the repository README.md for full format descriptions of
OUTSQS, SQS_CORRELATIONS and OUTGQS.
Selecting a SQS
Rank 1 is closest to ideal randomness. Prefer the configuration with the lowest weighted van de Walle score,
Q.Degeneracy: higher-degeneracy configurations may be thermodynamically preferred; use judgement when multiple configurations score similarly.
Supercell size: larger supercells generally yield better SQS. For small cells, no configuration may achieve exact π = target.
Further information
The repository README.md contains the full
INSQS/OUTSQS/OUTGQS format specifications and a worked example
using example01/FILER1_gulp.