class mchammer.calculators.ClusterExpansionCalculator(atoms, cluster_expansion, name='Cluster Expansion Calculator', scaling=None)

Cluster expansion calculator.

Class for efficiently calculating the cluster expansion property for a specific structure

  • atoms (ASE Atoms object) – the structure that the calculator can use to optimize the calculate functions.
  • cluster_expansion (icet ClusterExpansion object) –
  • name (str) – human readable identifier for this calculator
  • scaling (float (default len(atoms))) – this scales the property that is gotten from cluster vector times ECIs. By default the cluster vector times ECIs is assumed to give property/atom and thus the default value is multiplied by number of atoms.


  • add the real occupation constraints when that is setup in the cluster space.

ASE Atoms object.

calculate_local_contribution(local_indices=None, occupations=None)

Returns the sum of the contributions from the indices in the input list. local_indices refers to the lattice sites from which the local contributions should be summed up from. Occupations is the entire occupation vector.

  • local_indices (list of int) – the lattice indices for which to obtain the local contribution
  • occupations (list of int) – the entire occupation vector

Return type:

sum of contributions

Return type:


calculate_total(*, occupations)

Calculates the total property of the current configuration.

Parameters:occupations (list of int) – the entire occupation vector (i.e. list of atomic species)
Return type:total value of the property
Return type:float

icet ClusterExpansion object.


A map from site to allowed species.

update_occupations(indices, elements)

Set elements on the atoms object.

  • indices (list of int) – The list refer to indice on the lattice.
  • elements (list of int) – The elements to put on the corresponding lattice site.