The CorrelationsCalculator class

Initialization and methods

class clusterx.correlations.CorrelationsCalculator(*args, **kwargs)

Correlations calculator object.

Parameters:

basis: string
cluster basis to be used. Possible values are: indicator-binary, trigonometric, polynomial, and chebyshev.
indicator-binary: highly interpretable, non-orthogonal basis functions for binary compounds (also binary-linear, deprecated)
trigonomentric: orthonormal basis; constructed from sine and cosine functions; based on: Axel van de Walle, CALPHAD 33, 266 (2009)
polynomial: orthonormal basis; uses orthogonalized polynomials
chebyshev: orthonormsl basis; chebyshev polynomials for symmetrized sigmas (sigma in {-m/2, …, 0, …, m/2 }); based on: J.M. Sanchez, Physica 128A, 334-350 (1984)
parent_lattice: ParentLattice object

the parent lattice of the cluster expansion.

clusters_pool: ClustersPool object

The clusters pool to be used in the calculator.

lookup: boolean

Switches if a lookup table for the single-site basis functions should be used. Default is True. Reduces performance in case of ‘binary-linear’ basis.

filepath: string (default:None)

Initialize object from file generated by the CorrelationsCalculator.serialize(filepath) method. Overrides json_db_filepath (deprecated).

json_db_filepath: (DEPRECATED) string (default: None)

Overrides all the above. Used to initialize from file. Path of a json file containing a serialized CorrelationsCalculator object, as generated by the CorrelationsCalculator.serialize() method.

Notes for developers: For implementing pickle serialization, hints were used from the following link: https://stackoverflow.com/questions/36458221/unpickling-object-of-type-x-in-the-new-method-of-class-x-calls-init-on-r

get_basis()

Return basis set name

get_binary_random_structure_correlations(concentration)

Return cluster correlations for binary quasirandom structure

get_cluster_correlations(structure, verbose=False)

Get cluster correlations for a structure Parameters:

structure: Structure object

structure for which to calculate the correlations.

mc: Boolean

Set to True when performing Monte-Carlo simulations, to use an optimized version of the method.

get_cluster_orbit_pools_for_scell(scell)

Return array of cluster_pool objects, containing cluster orbits for a given supercell

Parameters

scell: ParentLattice, SuperCell, or Structure object

Object containing the lattice definition to determine the orbit of the clusters in the CorrelationsCalculator.

get_cluster_orbits_for_scell(scell, verbose=False)

Return array of cluster orbits for a given supercell

Parameters

scell: ParentLattice, SuperCell, or Structure object

Object containing the lattice definition to determine the orbit of the clusters in the CorrelationsCalculator.

get_correlation_matrix(structures_set, outfile=None, verbose=False)

Return correlation matrix for a structures set.

Parameters:

structures_set: StructuresSet object

a 2D numpy matrix is returned. every row in the matrix corresponds to a structure in the StructuresSet object.

get_cpool()

Return ClustersPool object of the calculator

get_orbit_lengths(structure)

Return integer array of orbit lenghts

structure: ParentLattice, SuperCell, or Structure object

Object containing the lattice definition to determine the orbit of the clusters in the CorrelationsCalculator.

serialize(filepath=None, fmt=None, db_name=None)

Write correlations calculator to Atoms Json database

Parameters:

filepath: string

Name of the file to store the correlations_calculator object. It can contain the relative or absolute path. If not given, and if db_name (deprecated) is None, filepathh is set to “CCALC.pickle” and fmt is overriden (set to pickle).

fmt: string

It can take the values "pickle" or "json". So far, object can only be re-initiated from a "pickle" file, therefore this is the preferred format. If not given, it is inferred from the filepathh.

db_name: (DEPRECATED) string

Name of the json file containing the database

site_basis_function(alpha, sigma, m)

Calculates the site basis function.

Evaluation of the single site basis functions using different basis sets.

Parameters:

alpha: integer

integer number between 0 and m - 1; represents the index of the basis function

sigma: integer

integer number between 0 and m - 1; represents the occupation variable

m: integer

number of components of the sublattice