- class hiphive.ClusterSpace(prototype_structure, cutoffs, config=None, cluster_filter=None, **kwargs)¶
Primitive object for handling clusters and force constants of a structure.
prototype_structure (ase.Atoms) – prototype structure; spglib will be used to find a suitable cell based on this structure unless the cell is already a primitive cell.
cutoffs (list or Cutoffs) – cutoff radii for different orders starting with second order
cluster_filter (ClusterFilter) – accepts a subclass of hiphive.filters.BaseClusterFilter to further control which orbits to include.
config (Config object) – a configuration object that holds information on how the cluster space should be built, e.g., values for tolerances and specifications regarding the handling of acoustic sum rules; if
configis not given then the keyword arguments that follow below can be used for configuration.
acoustic_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
To instantiate a
ClusterSpaceobject 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
ClusterSpaceobject 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 >>> from hiphive import ClusterSpace >>> prim = bulk('W') >>> cs = ClusterSpace(prim, [5.0, 4.0])
- property acoustic_sum_rules¶
True if acoustic sum rules are enforced
- property atom_list¶
atoms inside the cutoff relative to the of the center cell
- property cluster_list¶
clusters possible within the cutoff
Returns number of degrees of freedom for the given order.
order (int) – order for which to return the number of dofs
number of degrees of freedom
- Return type
Returns a list of the parameter indices associated with the requested order.
order (int) – order for which to return the parameter indices
list of parameter indices associated with the requested order
- Return type
ValueError – if the order is not included in the cluster space
- property length_scale¶
normalization constant of the force constants
- property n_dofs¶
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.
- property orbit_data¶
detailed information for each orbit, e.g., cluster radius and atom types.
- property orbits¶
orbits associated with the lattice structure.
Prints a list of all orbits.
Prints information concerning the underlying cluster space to stdout,including, e.g., the number of cluster, orbits, and parameters by order and number of bodies.
Reads a cluster space from file.
f (str or file object) – name of input file (str) or stream to load from (file object)
- property rotation_matrices¶
symmetry elements (3x3 matrices) representing rotations
- property spacegroup¶
space group of the lattice structure obtained from spglib
- property symprec¶
symprec value used when constructing the cluster space
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.
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.
- property wyckoff_sites¶
wyckoff sites in the primitive cell
- class hiphive.cutoffs.BaseClusterFilter¶
Base cluster filter class.
This filter simply accepts all proposed clusters. A proper subclass must implement the same methods.
- class hiphive.cutoffs.CutoffMaximumBody(cutoff_list, max_nbody)¶
Specify cutoff-list plus maximum body
Usefull when creating e.g. 6th order expansions but with only 3-body interactions.
cutoff_list (list) – list of cutoffs for order 2, 3, etc. Must be in decresing order
max_nbody (int) – No clusters containing more than max_nbody atoms will be generated
- class hiphive.cutoffs.Cutoffs(cutoff_matrix)¶
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.
cutoff_matrix (numpy.ndarray) – the matrix element ij provides to the cutoff for order j+2 and nbody i+2; elements with i>j will be ignored
- get_cutoff(order, nbody)¶
Returns cutoff for a given body and order.
order (int) –
nbody (int) –
ValueError – if order is not in orders
ValueError – if nbody is not in nbodies
ValueError – if nbody is larger than order
- Return type
- property max_cutoff¶
- property max_nbody¶
Return maximum cutoff for a given body.
Returns maximum order for a given body
- property max_order¶
- property nbodies¶
- property orders¶
Reads an instance from file.
fileobj (file-like object) – input file to read from
Simple function turning cutoffs into a string to be used in e.g. filenames.
Writes instance to file.
fileobj (file-like object) – file-like object to which the cutoffs will be written to
- hiphive.cutoffs.estimate_maximum_cutoff(atoms, max_iter=11)¶
Estimates the maximum possible cutoff given the atoms object
atoms (ase.Atoms) – structure used for checking compatibility with cutoff
max_iter (int) – number of iterations in binary search