Cluster space

ClusterSpace

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

Primitive object for handling clusters and force constants of a structure.

Parameters:
  • prototype_structure (ase.Atoms) – prototype structure; spglib will be used to find a suitable cell based on this structure.
  • cutoffs (list or Cutoffs) – 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 body-centered-cubic (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

BiMap – atoms inside the cutoff relative to the of the center cell

cluster_list

BiMap – clusters possible within the cutoff

cutoffs

Cutoffs – cutoffs used for constructing the cluster space

get_parameter_indices(order)[source]

Returns a list of the parameter indices associated with the requested order.

Parameters:order (int) – order for which to return the parameter indices
Returns:list of parameter indices associated with the requested order
Return type:list(int)
Raises:ValueError – if the order is not included in the cluster space
length_scale

float – normalization constant of the force constants

n_dofs

int – number of free parameters in the model

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

orbit_data

list(dict) – detailed information for each orbit, e.g., cluster radius and atom types.

orbits

list(Orbit) – orbits associated with the lattice structure.

permutations

list(numpy.ndarray) – lookup for permutation references

primitive_structure

ase.Atoms – structure of the lattice

print_orbits()[source]

Prints a list of all orbits.

print_tables()[source]

Prints table data, i.e. information as a function of order and n-body for the clusterspace.

read(f)[source]

Reads a cluster space from file.

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

list(numpy.ndarray) – symmetry elements (3x3 matrices) representing rotations

spacegroup

str – space group of the lattice structure obtained from spglib

sum_rules

bool – True if sum rules are enforced

symprec

float – symprec value used when constructing the cluster space

translation_vectors

list(numpy.ndarray) – symmetry elements representing translations

write(fileobj)[source]

Writes cluster space to file.

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 object) – If the input is a string a tar archive will be created in the current directory. Otherwise the input must be a valid file like object.
wyckoff_sites

list – wyckoff sites in the primitive cell

Cutoffs

class hiphive.cluster_filter.Cutoffs(cutoff_matrix)[source]

This class maintains information about the cutoff configuration, i.e. which clusters will be included (=”inside cutoff”). It also encapsulates functionality that is used e.g., during cluster space construction.

Here, n-body refers to number of atoms in a cluster. For example the cluster (0011) is a two-body cluster of fourth order and the cluster (123) is a three-body cluster of third order.

Parameters:cutoff_matrix (numpy.ndarray) – the matrix element ij provides to the cutoff for order i+2 and nbody j+2; elements with j>i will be ignored
cutoff_matrix

numpy.ndarray – copy of cutoff matrix

get_cutoff(order, nbody)[source]

Returns cutoff for a given body and order.

Parameters:

float

Raises:
  • ValueError – if order is not in orders
  • ValueError – if nbody is not in nbodies
  • ValueError – if nbody is larger than order
max_cutoff

float – maximum cutoff

max_nbody

int – maximum body

max_nbody_cutoff(nbody)[source]

Return maximum cutoff for a given body.

max_nbody_order(nbody)[source]

Returns maximum order for a given body

max_order

int – maximum order

nbodies

list(int) – allowed bodies

orders

list(int) – allowed orders

read(fileobj)[source]

Reads an instance from file.

Parameters:fileobj (file-like object) – input file to read from
write(fileobj)[source]

Writes instance to file.

Parameters:fileobj (file-like object) – file-like object to which the cutoffs will be written to