Correlation Functions

Module for calculating correlation functions.

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

Class for calculating the correlation functions.

Parameters:

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.

check_consistency_of_cf_table_entries()[source]

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.

Parameters:

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.

Parameters:
  • 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().

Yields:

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.

Parameters:
  • 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

reconfigure_inconsistent_cf_table_entries()[source]

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.

Parameters:

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.

Parameters:

atoms (Atoms) – Unrelaxed structure