# Cluster space¶

class hiphive.ClusterSpace(prototype_structure, cutoffs, sum_rules=True, symprec=1e-05, length_scale=0.1)[source]

Primitive object handling cluster and force constants for a structure.

Parameters: prototype_struture (ASE Atoms object) – prototype structure; spglib will be used to find a suitable cell based on this structure. cutoffs (list) – cutoff radii for different orders starting with second order sum_rules (bool) – If True the aucostic sum rules will be enforced by constraining the parameters. symprec (float) – numerical precision that will be used for analyzing the symmetry (this parameter will be forwarded to spglib) length_scale (float) – This will be used as a normalization constant for the eigentensors

Examples

To instantiate a ClusterSpace object one has to specify a prototype structure and cutoff radii for each cluster order that should be included. For example the following snippet will set up a ClusterSpace object for a BCC structure including second order terms up to a distance of 5 A and third order terms up to a distance of 4 A.

>>> from ase.build import bulk
>>> prim = bulk('W')
>>> cs = ClusterSpace(prim, [5.0, 4.0])

atom_list

AtomList – The atoms within the cutoff from the center cell

cluster_list

ClusterList – Contains the clusters possible within the cutoff

copy()[source]
cutoffs

Cutoffs obj – The cutoffs used for construcring the cluster space

get_sum_rule_constraint_matrices(symbolic=True, rotational=False)[source]

Return the constraint matrices needed for imposing the (acoustic=translational) sum rule.

Returns: dictionary of constraint matrices, where the key is the order of the respective constraint matrix dict
length_scale

float – The normalization of the force constants

number_of_dofs

int – The number of free parameters in the model

If the sum rules are not enforced the number of DOF is the same as the total number of eigentensors in all orbits

orbit_data

list – list of dictionaries containing detailed information for each orbit, e.g. cluster radius and atom types.

orbits

list of Orbit objects – The orbits of the structure

permutations

list of vectors – lookup for permutation references

prim

Atoms – the structure of the lattice

print_orbits()[source]

Prints a list of all orbits.

read(f)[source]

Load a ClusterSpace instance from file

Parameters: f (string or file object) – name of input file (string) or stream to load from (file object)
rotation_matrices

list of 3x3 matrices – The rotation for each symmetry

spacegroup

str – The space group of the lattice obtained from spglib

sum_rules

bool – whether the sum rules are enforced

symprec

float – The symprec value used when constructing the cluster space

translation_vectors

list of 3-vectors – the translation for each symmetry

write(fileobj)[source]

Saves to file or to a file-like object

The instance is saved into a custom format based on tar-files. The resulting file will be a valid tar file and can be browsed by by a tar reader. The included objects are themself either pickles, npz or other tars.

Parameters: fileobj (str or file-like obj) – If the input is a string a tar archive will be created in the current directory. If not a string the input must be a valid file like obj.
wyckoff_sites

The wyckoff sites in the primitive cell