WMD-group/SMACT

SMACT Composition templates

AntObi opened this issue · 1 comments

Related to issue #56 .

A proposed feature that we can include in SMACT would be a function which can generate lists of compositions based off templates. The pseudocode below should demonstrate some potential functionality

Function: composition_templater(template = 'ABO3', element_set=smact.ordered_elements(1,83))

Creates all the possible combinations of the elements in the element set (the number of elements in each combination should be the same as the supplied template formula)

Then the smact filter can be applied to the combinations with the stoichiometry fixed in accordance with the template 

Output: A list of [elements,stoichiometry,oxidation_states]

The user can supply a template formula, and the set of elements that they want to be considered, the function could then act as a wrapper to the smact_filter function and then produce the list of SMACT-allowed compositions.

The template argument could either be names of common materials (e.g. perovskites) or strings of semi/anonymised formula (e.g. ABO3, ABX3). The first implementation could have pre-defined templates to check if the function works and then the function could be extended so that any anonymous formula could be used as a template.

This function would probably be suited to fit within the core of the SMACT class.

AntObi commented

I've implemented a more general solution to this problem with PR #122 in the smact_filter.

Rather than having the user supply formula prototypes, they can specify the stoichiometric ratio to the stoichs argument in smact_fitler and return only charge-neutral compositions for the supplied ratios.

This is a more efficient implementation than using formula prototypes, but if there is any interest in using them, feel free to re-open this issue and poke me.