Cluster Spaces#

Implementation of ClusterSubspace and related PottsSubspace classes.

ClusterSubspace is the workhorse for generating the objects and information necessary for a cluster expansion. It contains the finite set of orbits and orbit basis functions to be included in the cluster expansion. The PottsSubspace is an (experimental) class that is similar, but diverges from the CE mathematic formalism.

ClusterSubspace#

class ClusterSubspace(structure, expansion_structure, symops, orbits, supercell_matcher=None, site_matcher=None, num_threads=None, **matcher_kwargs)[source]#

Bases: MSONable

ClusterSubspace represents a subspace of functions of configuration.

A ClusterSubspace is the main work horse used in constructing a cluster expansion. It is necessary to define the terms to be included in a cluster expansion. A cluster subspace holds a finite set of orbits that contain symmetrically equivalent clusters. The orbits also contain the set of orbit basis functions (also known as correlation functions) that represent the terms in the cluster expansion. Taken together the set of all orbit functions for all orbits included span a subspace of the total function space over the configurational space of a given crystal structure system.

The ClusterSubspace also has methods to match fitting structures and determine site mappings for supercells of different sizes in order to compute correlation vectors (i.e. evaluate the orbit functions for a given structure).

You probably want to generate from ClusterSubspace.from_cutoffs, which will auto-generate the orbits from diameter cutoffs.

symops#

Symmetry operations of structure.

Type:

list of SymmOp

num_corr_functions#

Total number of correlation functions (orbit basis functions) included in the subspace.

Type:

int

num_orbits#

Total number of crystallographic orbits included in the subspace. This includes the empty orbit.

Type:

int

num_clusters#

Total number of clusters in the primitive cell that are included in the subspace.

Type:

int

Initialize a ClusterSubspace.

You rarely will need to create a ClusterSubspace using the main constructor. Look at the class method from_cutoffs for the “better” way to instantiate a ClusterSubspace.

Parameters:
  • structure (Structure) – Structure to define the cluster space. Typically the primitive cell. Includes all species regardless of partial occupation.

  • expansion_structure (Structure) – Structure including only sites that will be included in the Cluster space (i.e. only those with partial occupancy)

  • symops (list of Symmop) – list of Symmops for the given structure.

  • orbits (dict) – {size: list of Orbits} Dictionary with size (number of sites) as keys and list of Orbits as values.

  • supercell_matcher (StructureMatcher) – optional StructureMatcher used to find supercell matrices relating the prim structure to other structures. If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures can fail, a lot.

  • site_matcher (StructureMatcher) – optional StructureMatcher used to find site mappings relating the sites of a given structure to an appropriate supercell of the prim structure . If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures can fail, a lot.

  • num_threads (int) – optional Number of threads to use to compute a correlation vector. Note that this is not saved when serializing the ClusterSubspace with the as_dict method, so if you are loading a ClusterSubspace from a file then make sure to set the number of threads as desired.

  • matcher_kwargs – ltol, stol, angle_tol, supercell_size: parameters to pass through to the StructureMatchers. Structures that don’t match to the primitive cell under these tolerances won’t be included in the expansion. Easiest option for supercell_size is usually to use a species that has a constant amount per formula unit. See pymatgen documentation of StructureMatcher for more details.

add_external_term(term)[source]#

Add an external term to the ClusterSubspace.

Adds an external term (e.g. an Ewald term) to the cluster expansion terms. External term classes must be MSONable and implement a method to obtain a “correlation”. See smol.cofe.extern for notebooks.

Parameters:

term (ExternalTerm) – An instance of an external term. Currently only EwaldTerm is implemented.

as_dict()[source]#

Json-serialization dict representation.

Returns:

MSONable dict

property basis_orthogonal#

Check if the orbit basis is orthogonal.

property basis_orthonormal#

Check if the orbit basis is orthonormal.

property basis_type#

Get the type of site basis set used.

change_site_bases(new_basis, orthonormal=False)[source]#

Change the type of site basis used in the site basis functions.

Parameters:
  • new_basis (str) – name of new basis for all site bases

  • orthonormal (bool) – option to orthonormalize all new site basis sets

copy()[source]#

Deep copy of instance.

corr_from_structure(structure, normalized=True, scmatrix=None, site_mapping=None)[source]#

Get correlation vector for structure.

Returns the correlation vector for a given structure. To do this, the correct supercell matrix of the prim needs to be found to then determine the mappings between sites to create the occupancy string and also determine the orbit mappings to evaluate the corresponding cluster functions.

Parameters:
  • structure (Structure) – Structure to compute correlation from

  • normalized (bool) – return the correlation vector normalized by the prim cell size. In theory correlation vectors are always normalized, but getting them without normalization allows to compute the “extensive” values.

  • scmatrix (ndarray) – optional supercell matrix relating the prim structure to the given structure. Passing this if it has already been matched will make things much quicker. You are responsible that the supercell matrix is correct.

  • site_mapping (list) – optional Site mapping as obtained by StructureMatcher.get_mapping such that the elements of site_mapping represent the indices of the matching sites to the prim structure. If you pass this option, you are fully responsible that the mappings are correct!

Returns:

correlation vector for given structure

Return type:

array

property cutoffs#

Return dict of orbit cluster cutoffs.

These are “tight” cutoffs, as in the maximum diameter for each cluster size, which is <= the input to from_cutoffs.

property evaluator#

Get the instance of cluster space evaluator extension type.

The evaluator is used to compute correlations quickly. You should not use this directly, instead use the corr_from_structure() method. If you do attempt to use directly make sure you understand the code, otherwise you will crash your python interpreter. You have been warned…

property expansion_structure#

Get the primitive expansion structure (excludes inactive sites).

property external_terms#

Get external terms to be fitted together with the correlations.

External terms are those represented by pair interaction Hamiltonians (i.e. Ewald electrostatics).

classmethod from_cutoffs(structure, cutoffs, basis='indicator', orthonormal=False, use_concentration=False, supercell_matcher=None, site_matcher=None, num_threads=None, **matcher_kwargs)[source]#

Create a ClusterSubspace from diameter cutoffs.

Creates a ClusterSubspace with orbits of the given size and diameter smaller than or equal to the given value. The diameter of an orbit is the maximum distance between any two sites of a cluster of that orbit.

This is the best (and the only easy) way to create a ClusterSubspace.

Parameters:
  • structure (Structure) – disordered structure to build a cluster expansion for. Typically the primitive cell

  • cutoffs (dict) – dict of {cluster_size: diameter cutoff}. Cutoffs should be strictly decreasing. Typically something like {2:5, 3:4}. The empty orbit is always included. Singlets are by default included, with the exception below. To obtain a subspace with only an empty and singlet terms use an empty dict {}, or {1: 1}. Adding a cutoff term for point terms, i.e. {1: 0} is useful to exclude point terms. Any other value for the cutoff will simply be ignored.

  • basis (str) – a string specifying the site basis functions

  • orthonormal (bool) – whether to enforce an orthonormal basis. From the current available bases only the indicator basis is not orthogonal out of the box

  • use_concentration (bool) – if True, the concentrations in the prim structure sites will be used to orthormalize site bases. This gives a cluster subspace centered about the prim composition.

  • supercell_matcher (StructureMatcher) – optional StructureMatcher used to find supercell matrices relating the prim structure to other structures. If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures will fail, a lot.

  • site_matcher (StructureMatcher) – optional StructureMatcher used to find site mappings relating the sites of a given structure to an appropriate supercell of the prim structure . If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures will fail, a lot.

  • num_threads (int) – optional Number of threads to use to compute a correlation vector. Note that this is not saved when serializing the ClusterSubspace with the as_dict method, so if you are loading a ClusterSubspace from a file then make sure to set the number of threads as desired.

  • matcher_kwargs – ltol, stol, angle_tol, supercell_size: parameters to pass through to the StructureMatchers. Structures that don’t match to the primitive cell under these tolerances won’t be included in the expansion. Easiest option for supercell_size is usually to use a species that has a constant amount per formula unit.

Returns:

ClusterSubspace

classmethod from_dict(d)[source]#

Create ClusterSubspace from an MSONable dict.

function_hierarchy(level=1, min_size=2, invert=False)[source]#

Get the correlation function hierarchy.

The function hierarchy is the relationship between specific correlation functions and “sub” correlation functions (i.e. a correlation function is a “sub” correlation factor or included in higher degree correlation function if it is a factor of a higher degree correlation function.

Parameters:
  • level (int) – optional how many levels down to look for suborbits. If all suborbits are needed make level large enough or set to None.

  • min_size (int) – optional minimum size of clusters in sub orbits to include

  • invert (bool) – optional Default is invert=False which gives the high to low bit combo hierarchy. Invert= True will invert the hierarchy into low to high

Returns:

each element of the inner lists is the bit id for all correlation functions corresponding to the corr function at the given outer list index.

Return type:

list of list

property function_inds_by_size#

Get correlation function indices by cluster sizes.

function_inds_from_cutoffs(upper, lower=0)[source]#

Get indices of correlation functions by cluster cutoffs.

Parameters:
  • upper (float or dict) – upper diameter for clusters to include. If a single float is given then that cutoff is used for all orbit sizes. Otherwise a dict can be used to specify the cutoff for the orbit cluster sizes, i.e. {2: cutoff_pairs, 3: cutoff_trips, …}

  • lower (float) – optional lower diameter for clusters to include. If a single float is given then that cutoff is used for all orbit sizes. Otherwise a dict can be used to specify the cutoff for the orbit cluster sizes, i.e. {2: cutoff_pairs, 3: cutoff_trips, …}

Returns:

list of correlation function indices for clusters within cutoffs

Return type:

list

property function_orbit_ids#

Get Orbit IDs corresponding to each correlation function.

If the ClusterSubspace includes external terms, these are not included in the list since they are not associated with any orbit.

property function_ordering_multiplicities#

Get array of ordering multiplicity of each correlation function.

The length of the array returned is the total number of correlation functions in the subspace for all orbits. The ordering multiplicity of a correlation function is the number of symmetrically equivalent bit orderings (function-labeled orbit configurations) that result in the product of the same single site functions.

property function_total_multiplicities#

Get array of total multiplicity of each correlation function.

The length of the array returned is the total number of correlation functions in the subspace for all orbits. The total multiplicity of a correlation function is the number of symmetrically equivalent bit orderings (or function-labeled orbit configurations) that result in the product of the same single site functions times the (crystallographic) multiplicity of the orbit.

gen_orbit_list(**kwargs)#
get_aliased_orbits(sc_matrix)[source]#

Get the aliased orbits for a given supercell shape.

Detect the orbits that will be aliased due to translational symmetry imposed by the supercell lattice. Orbits i and j are aliased when a geometric cluster in orbit i is identically mapped to another geometric cluster in orbit j. It can be shown through a group theoretical argument that any cluster in orbit i then must be identical to a corresponding cluster in orbit j.

The implication of aliasing is that correlation functions of these orbits will evaluate to the same value, leading to feature matrix rank deficiency and potentially unphysical ECI.

This method will detect most cases of orbit degeneracy, but not some edge cases.

Parameters:

sc_matrix – (array): array relating a supercell with the primitive matrix

Returns:

(orbit_id i, orbit_id j, …) list of tuples containing the orbits that are aliased.

Return type:

list of tuples

get_orbit_indices(scmatrix)[source]#

Get the OrbitIndices named tuple for a given supercell matrix.

If the indices have not been cached then they are generated by generating the site mappings for the given supercell.e

get_sub_function_ids(corr_id, level=1, min_size=1)[source]#

Get the bit combo ids of all sub correlation functions.

A sub correlation function of a given correlation function means that the sub correlation function is a factor of the correlation function (with the additional requirement of acting over the sites in sub clusters of the clusters over which the given corr function acts on).

In other words, think of it as an orbit of function-labeled subclusters of a given orbit of function-labeled clusters…a mouthful…

Parameters:
  • corr_id (int) – id of orbit to get sub orbit id for

  • level (int) – optional how many levels down to look for suborbits. If all suborbits are needed make level large enough or set to None.

  • min_size (int) – optional minimum size of clusters in sub orbits to include

Returns:

list containing ids of sub correlation functions

Return type:

list of ints

get_sub_orbits(orbit_id, level=1, min_size=1)[source]#

Get sub orbits of the orbit for the corresponding orbit_id.

Parameters:
  • orbit_id (int) – id of orbit to get sub orbit id for

  • level (int) – optional how many levels down to look for suborbits. If all suborbits are needed make level large enough or set to None.

  • min_size (int) – optional minimum size of clusters in sub orbits to include

Returns:

list containing ids of suborbits

Return type:

list of ints

property num_functions_per_orbit#

Get the number of correlation functions for each orbit.

The list returned has length equal to the total number of orbits, and each entry is the total number of correlation functions associated with that orbit.

static num_prims_from_matrix(scmatrix)[source]#

Get number of prim structures in a supercell for a given matrix.

num_threads#

A descriptor used to set threads of an attributed object that has multi-threading.

Right now it’s only used for the Evaluator class.

occupancy_from_structure(structure, scmatrix=None, site_mapping=None, encode=False)[source]#

Occupancy string for a given structure.

Returns a list of occupancies of each site in the structure in the appropriate order set implicitly by the supercell matrix that is found.

This function is used as input to compute correlation vectors for the given structure.

This function is also useful to obtain an initial occupancy for a Monte Carlo simulation. (Make sure that the same supercell matrix is being used here as in the instance of the processor class for the simulation. Although it is recommended to use the similar function in Processor classes.)

Parameters:
  • structure (Structure) – structure to obtain a occupancy string for

  • scmatrix (array) – optional supercell matrix relating the given structure and the primitive structure. If you pass the supercell, you fully are responsible that it is the correct one! This prevents running the _scmatcher (supercell structure matcher)

  • site_mapping (list) – optional site mapping as obtained by StructureMatcher.get_mapping such that the elements of site_mapping represent the indices of the matching sites to the prim structure. If you pass this option, you are fully responsible that the mappings are correct! This prevents running _site_matcher to get the mappings.

  • encode (bool) – optional if True, the occupancy string will have the index of the species in the expansion structure site spaces, rather than the species itself.

Returns:

occupancy string for structure.

Return type:

list

orbit_hierarchy(level=1, min_size=1)[source]#

Get orbit hierarchy by IDs.

The orbit hierarchy represents in inclusion relationships between orbits and their suborbits.

Parameters:
  • level (int) – optional how many levels down to look for suborbits. If all suborbits are needed make level large enough or set to None.

  • min_size (int) – optional minimum size of clusters in sub orbits to include

Returns:

each element of the inner lists is the orbit id for all suborbits corresponding to the orbit at the given outer list index.

Return type:

list of list

property orbit_multiplicities#

Get the crystallographic multiplicities for each orbit.

property orbits#

Return a list of all orbits sorted by size.

orbits_by_cutoffs(upper, lower=0)[source]#

Get orbits with clusters within given diameter cutoffs (inclusive).

Parameters:
  • upper (float) – upper diameter for clusters to include.

  • lower (float) – optional lower diameter for clusters to include.

Returns:

list of Orbits

property orbits_by_diameter#

Get dictionary of orbits with key being the orbit diameter.

Diameters are rounded to 6 decimal places.

property orbits_by_size#

Get dictionary of orbits with key being the orbit size.

orbits_from_cutoffs(upper, lower=0)[source]#

Get orbits with clusters within given diameter cutoffs (inclusive).

Parameters:
  • upper (float or dict) – upper diameter for clusters to include. If a single float is given then that cutoff is used for all orbit sizes. Otherwise a dict can be used to specify the cutoff for the orbit cluster sizes, i.e. {2: pair_cutoff, 3: triplet_cutoff, …}

  • lower (float) – optional lower diameter for clusters to include. If a single float is given then that cutoff is used for all orbit sizes. Otherwise a dict can be used to specify the cutoff for the orbit cluster sizes, i.e. {2: pair_cutoff, 3: triplet_cutoff, …}

Returns:

list of Orbits

refine_structure(structure, scmatrix=None, site_mapping=None)[source]#

Refine a (relaxed) structure.

Refine a (relaxed) structure to a perfect supercell structure of the the prim structure (aka the corresponding “unrelaxed” structure).

Parameters:
  • structure (Structure) – structure to refine to a perfect multiple of the prim

  • scmatrix (ndarray) – optional supercell matrix relating the prim structure to the given structure. Passing this if it has already been matched will make things much quicker. You are responsible for correctness.

  • site_mapping (list) – optional site mapping as obtained by StructureMatcher.get_mapping such that the elements of site_mapping represent the indices of the matching sites to the prim structure. Again you are responsible.

Returns:

the refined structure

Return type:

Structure

remove_corr_functions(corr_ids)[source]#

Remove correlation functions by their ID’s.

This allows more granular removal of terms involved in fitting/evaluating a cluster expansion. Similar to remove_orbits this is useful to prune a cluster expansion and actually allows to remove a single term (ie one with small associated coefficient/ECI).

This procedure is perfectly well posed mathematically. The resultant CE is still a valid function of configurations with all the necessary symmetries from the underlying structure. It is also practically justified if we allow “in group” orbit eci sparsity…which everyone in the field does anyway. In terms of physical/chemical interpretation it is not obvious what it means to remove certain combinations of an n-body interaction term, and not the whole term itself…so tread lighlty with your model interpretations.

Parameters:

corr_ids (list) – list of correlation function ids to remove

remove_orbits(orbit_ids)[source]#

Remove whole orbits by their ids.

Remove orbits from cluster spaces. It is helpful to print a ClusterSubspace or ClusterExpansion to obtain orbit ids. After removing orbits, orbit ID’s and orbit bit ID’s are re-assigned.

This is useful to prune a ClusterExpansion by removing orbits with small associated coefficients or ECI. Note that this will remove a full orbit, which for the case of sites with only two species is the same as removing a single correlation vector element (only one ECI). For cases with sites having more than 2 species allowed per site there is more than one orbit functions (for all the possible bit orderings or function- labeled orbit configurations) and removing an orbit will remove more than one element in the correlation vector.

Parameters:

orbit_ids (list) – list of orbit ids to be removed

rotate_site_basis(singlet_id, angle, index1=0, index2=1)[source]#

Apply a rotation to a site basis.

The rotation is applied around an axis normal to the span of the two site functions given by index1 and index 2 (the constant function is not included, i.e. index 0 corresponds to the first non constant function)

Read warnings in SiteBasis.rotate when using this method. TLDR: Careful when using this with non-orthogonal or biased site bases.

Parameters:
  • singlet_id (int) – Orbit id of singlet function. Only singlet function ids are valid here.

  • angle (float) – Angle to rotate in radians.

  • index1 (int) – index of first basis vector in function_array

  • index2 (int) – index of second basis vector in function_array

scmatrix_from_structure(structure)[source]#

Get supercell matrix from a given structure.

Obtain the supercell structure matrix to convert the prim structure to a supercell equivalent to given structure.

Parameters:

structure (Structure) – a pymatgen Structure.

Returns:

matrix relating given structure and prim structure.

Return type:

ndarray

property site_rotation_matrix#

Get change of basis matrix from site function rotations.

Note

this is meant only for rotations using orthonormal site bases. Using it otherwise will not work as expected.

property structure#

Get the underlying primitive structure including inactive sites.

structure_site_mapping(supercell, structure)[source]#

Get structure site mapping.

Returns the mapping between sites in the given structure and a prim supercell of the corresponding size.

Parameters:
  • supercell (Structure) – supercell of prim structure with same size as other structure.

  • structure (Structure) – Structure to obtain site mappings to supercell of prim

Returns:

site mappings of structure to supercell

Return type:

list

supercell_orbit_mappings(scmatrix)[source]#

Get orbit mappings for a structure from supercell of prim.

Return the orbit mappings for a specific supercell of the prim structure represented by the given matrix

Parameters:

scmatrix (array) – array relating a supercell with the primitive matrix

Returns:

tuple of 2D ndarrays where each array has the site indices for all equivalent orbits in a supercell obtained from the given matrix. First dimension are clusters and 2nd dimensiuon are site indices for that cluster

Return type:

tuple of ndarray

PottsSubspace#

A PottsSubspace implements the following expansion:

\[H(\sigma) = \sum_{\alpha\in D[N]} m_{\alpha}\mathbf{1}_{\alpha}(\sigma)\]
class PottsSubspace(structure, expansion_structure, symops, orbits, without_last_cluster=True, supercell_matcher=None, site_matcher=None, **matcher_kwargs)[source]#

Bases: ClusterSubspace

PottsSubspace represents a subspace of functions using only indicator functions.

A PottsSubspace is a related model to a standard ClusterSubspace used to build a standard cluster expansion. The only difference is that the single site functions for any orbit are only made up of indicator functions (and there is no constant function). As such it is more closely related to a generalized Ising model or better yet an extension of the q-state Potts Model (hence the name).

The orbit functions in a PottsSubspace represent the concentrations of all possible decorations (species occupancies) of clusters in the given orbit. Similar to a ClusterSubspace with site indicator basis functions. But in contrast, the Potts subspace includes the concentration of all possible decorations (minus 1).

Although quite similar to a ClusterSubspace, there is no mathematical formalism guaranteeing that the orbit basis functions generated in a PottsSubspace are a linear independent set spanning configuration space. Actually if all orbits up to any size (or infinite size) are included, the corresponding orbit function set is an overcomplete/ highly redundant.

A PottsSubspace can be created directly with a ClusterSubspace object by using the constructor and providing the appropriately constructed orbits, but that is a bit more painful that just using the class method here.

Initialize a PottsSubspace.

You rarely will need to create a ClusterSubspace using the main constructor. Look at the class method from_cutoffs for the “better” way to instantiate a ClusterSubspace.

Parameters:
  • structure (Structure) – Structure to define the cluster space. Typically the primitive cell. Includes all species regardless of partial occupation.

  • expansion_structure (Structure) – Structure including only sites that will be included in the Cluster space. (only those with partial occupancy)

  • symops (list of Symmop) – list of Symmops for the given structure.

  • orbits (dict) – {size: list of Orbits} Dictionary with size (number of sites) as keys and list of Orbits as values.

  • without_last_cluster (bool) – optional whether last cluster labeling is removed from each orbit.

  • supercell_matcher (StructureMatcher) – (optional) StructureMatcher used to find supercell matrices relating the prim structure to other structures. If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures can fail, a lot.

  • site_matcher (StructureMatcher) – (optional) StructureMatcher used to find site mappings relating the sites of a given structure to an appropriate supercell of the prim structure . If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures can fail, a lot.

  • matcher_kwargs – ltol, stol, angle_tol, supercell_size: parameters to pass through to the StructureMatchers. Structures that don’t match to the primitive cell under these tolerances won’t be included in the expansion. Easiest option for supercell_size is usually to use a species that has a constant amount per formula unit. See pymatgen documentation of StructureMatcher for more details.

as_dict()[source]#

Json-serialization dict representation.

Returns:

MSONable dict

classmethod from_cutoffs(structure, cutoffs, remove_last_cluster=False, supercell_matcher=None, site_matcher=None, **matcher_kwargs)[source]#

Create a PottsSubspace from diameter cutoffs.

Creates a PottsSubspace with orbits of the given size and diameter smaller than or equal to the given value. The diameter of an orbit is the maximum distance between any two sites of a cluster of that orbit.

Parameters:
  • structure (Structure) – disordered structure to build a cluster expansion for. Typically the primitive cell

  • cutoffs (dict) – dict of {cluster_size: diameter cutoff}. Cutoffs should be strictly decreasing. Typically something like {2:5, 3:4}. The empty orbit is always included. Singlets are by default included, with the exception below. To obtain a subspace with only an empty and singlet terms use an empty dict {}, or {1: 1}. Adding a cutoff term for point terms, i.e. {1: None} is useful to exclude point terms, any other value for the cutoff will simply be ignored.

  • remove_last_cluster (bool) – optional if True, will remove the last cluster labeling (decoration) from each orbit. Since sum of corr for all labelings = 1, removing the last is similar to working in concentration space.

  • supercell_matcher (StructureMatcher) – (optional) StructureMatcher used to find supercell matrices relating the prim structure to other structures. If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures will fail, a lot.

  • site_matcher (StructureMatcher) – (optional) StructureMatcher used to find site mappings relating the sites of a given structure to an appropriate supercell of the prim structure . If you pass this directly you should know how to set the matcher up, otherwise matching your relaxed structures will fail, a lot.

  • matcher_kwargs – ltol, stol, angle_tol, supercell_size: parameters to pass through to the StructureMatchers. Structures that don’t match to the primitive cell under these tolerances won’t be included in the expansion. Easiest option for supercell_size is usually to use a species that has a constant amount per formula unit.

Returns:

PottsSubSpace

classmethod from_dict(d)[source]#

Create ClusterSubspace from an MSONable dict.

get_function_decoration(index)[source]#

Get the decoration/labeling of a specific orbit function.

When using an indicator site basis there is 1 to 1 equivalence between correlation functions and species decorations.

Parameters:

index (int) – index of orbit function in correlation vector

Returns:

list of tuples of symmetrically equivalent Species/Elements.

Return type:

list of tuples

get_orbit_decorations(orbit_id)[source]#

Get all decorations/labellings of species in an orbit.

Parameters:

orbit_id (int) – ID of orbit

Returns:

list of lists of symmetrically equivalent Species/Elements.

Return type:

list of list