Correlation Functions

Module for calculating correlation functions.

class clease.corr_func.CorrFunction(settings: ClusterExpansionSettings)[source]

Class for calculating the correlation functions.


settings (ClusterExpansionSettings) – The settings object which defines the cluster expansion parameters.

property cf_table_name: str

Name of the table which holds the correlation functions.


Get IDs of the structures with inconsistent correlation functions.

Note: consisent structures have the exactly the same list of cluster names as stored in settings.cf_names.

clear_cf_table() None[source]

Delete the external table which holds the correlation functions.

get_cf(atoms) Dict[str, float][source]

Calculate correlation functions for all possible clusters and return them in a dictionary format.


atoms (Atoms) – The atoms object

get_cf_by_names(atoms, cf_names) Dict[str, float][source]

Calculate correlation functions of the specified clusters and return them in a dictionary format.

  • atoms – Atoms object

  • cf_names – list names of correlation functions that will be calculated for the structure provided in atoms

iter_reconfigure_db_entries(select_cond=None) Iterator[Tuple[int, int, int]][source]

Iterator which reconfigures the correlation function values in the DB, which yields after each reconfiguration and reports on the progress.

For more information, see reconfigure_db_entries().


Tuple[int, int, int] – (row_id, count, total) A tuple containing the ID of the row which was just reconfigured, current count which has been reconfigured, as well as the total number of reconfigurations which will be performed. The percentage-wise progress is thus (count / total) * 100.

reconfigure_db_entries(select_cond=None, verbose=False)[source]

Reconfigure the correlation function values of the entries in DB.

  • select_cond

    One of either:

    • None (default): select every item in DB with struct_type='initial'

    • Select based on the condictions provided (struct_type='initial' is not automatically included)

  • verbose (bool) – print the progress of reconfiguration if set to True


Find and correct inconsistent correlation functions in table.

reconfigure_single_db_entry(row_id: int) None[source]

Reconfigure a single DB entry. Assumes this is the initial structure, and will not check that.


row_id – int The ID of the row to be reconfigured.

set_template(atoms: Atoms) None[source]

Check the size of provided cell and set as the currently active template in the settings object.


atoms (Atoms) – Unrelaxed structure