Special Structures#

Classes to generate special quasi-random structures (SQS).

Special Quasi-Random Structures (SQS).

class SQS(structure, score, feature_distance, supercell_matrix)#

Bases: tuple

Create new instance of SQS(structure, score, feature_distance, supercell_matrix)

feature_distance#

Alias for field number 2

score#

Alias for field number 1

structure#

Alias for field number 0

supercell_matrix#

Alias for field number 3

class StochasticSQSGenerator(cluster_subspace, supercell_size, feature_type='correlation', target_vector=None, target_weights=None, match_weight=1.0, match_tol=1e-05, supercell_matrices=None, processors=None, kernel_kwargs=None, **kwargs)[source]#

Bases: SQSGenerator

StochasticSQSGenertor class.

Generate special quasirandom structures using simulated annealing, based on the following work

https://doi.org/10.1016/j.calphad.2013.06.006

Initialize StochasticSQSGenerator.

Parameters:
  • cluster_subspace (ClusterSubspace) – cluster subspace used to determine feature_distance

  • supercell_size (int) – size of the supercell in multiples of the primitive cell

  • feature_type (str) – optional type of feature_distance to be used to determine SQS. options are: “correlation”

  • target_vector (ndarray) – optional target feature vector to use for distance calculations

  • target_weights (ndarray) – optional weights for each target feature

  • match_weight (float) – optional weight for the in the wL term above. That is how much to weight the largest diameter below which all features are matched exactly. Set to any number >0 to use this term. Default is 1.0. to ignore it set it to zero.

  • match_tol (float) – optional tolerance for matching features. Default is 1e-5.

  • supercell_matrices (list of ndarray) – optional list of supercell matrices to use. If None, all symmetrically distinct supercell matrices are generated.

  • processors (list of Processor) – optional list of processors to use. If None, all processors are generated.

  • kernel_kwargs (dict) – optional keyword arguments for the transition kernel used in each supercell. For example see the documentation for Metropolis kernel.

  • **kwargs – keyword arguments used to initialize the MulticellMetropolis kernel to be used for the simulated annealing.

generate(mcmc_steps, temperatures=None, initial_occupancies=None, clear_previous=True, max_save_num=None, progress=False)[source]#

Generate a SQS structures.

Parameters:
  • mcmc_steps (int) – number of mcmc steps per temperature to perform simulated annealing

  • temperatures (list of float) – optional temperatures to use for the mcmc steps, temperatures are unit-less the recommended range should be only single digits.

  • initial_occupancies (ndarray) – optional initial occupancies to use in the simulated anneal search, an occupancy must be given for each of the supercell shapes, and these occupancies must have the correct compositions.

  • clear_previous (bool) – optional whether to clear previous samples.

  • max_save_num (int) – optional max number of best structures to save, if None a maximum 1% of structures are saved. A structure is only saved if the SQS score is better than the previous best.

  • progress (bool) – if true will show a progress bar.

property sampler#

sampler used to generate SQS.

Type:

Sampler