Correlation Functions

Module for calculating correlation functions.

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

Bases: object

Class for calculating the correlation functions.

Parameters:

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

__init__(settings: ClusterExpansionSettings)[source]
property settings: ClusterExpansionSettings
connect(**kwargs)[source]
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

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.

property cf_table_name: str

Name of the table which holds the correlation functions.

clear_cf_table() None[source]

Delete the external table which holds the correlation functions.

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

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_inconsistent_cf_table_entries()[source]

Find and correct inconsistent correlation functions in table.

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.

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

exception clease.corr_func.ClusterNotTrackedError[source]

Bases: Exception

A cluster is not being tracked