Minimum supercell size for training structures

Hello, I am new to cluster expansions and computational materials science in general. I have a question on determining the necessary range of sizes for supercells when generating the set of training structures for a cluster expansion based on the cutoff distances. Specifically, does the range of supercells need to include supercells with dimensions that are at least twice that of the largest cutoff distance given?

When creating a ClusterExpansionCalculator if the longest cutoff of the cluster expansion is larger than half of the shortest distance between periodic images of the supercell a warning that the system is self-interacting is given. However, when creating the cluster expansion itself there is no check between the longest given cutoff distance and the supercells of the training structures given. So one can train a cluster expansion on training structures that violate the warning that would be given when creating a ClusterExpansionCalculator and then use that cluster expansion in creating a ClusterExpansionCalculator and just increasing the size of the supercell given to the ClusterExpansionCalculator and no warning will be given.

So my whole question is whether for creating cluster expansions it is necessary that the supercell of the largest training structures are at least twice in length (in all dimensions) than the max cutoff distance?

Yes, I think you have understood this correctly, but with one important distinction.

If you only use training structures based on one fixed supercell size, and the cutoff is large enough that this supercell self-interacts, then you will not be able to distinguish all the corresponding interactions independently. And if u make a big supercell and use the calculator and run MC you can likely get strange unphysical results.
In practice this makes the fitting problem ill-conditioned, and you should get a condition-number warning from the optimizer.

However, it is not necessary that each individual training structure, or even one particular “largest” training structure, has a shortest periodic repeat distance larger than twice the maximum cutoff.
What is commonly done is instead to use many smaller supercells with different sizes and shapes.
Even if one such supercell cannot distinguish all interactions, the different supercells have different periodicities and together can span the full cluster space.
This allows you to fit interactions that extend beyond half the cell size of any one of the training structures.

See the icet-tutorials for how training sets are usually generated.

So if all your training structures use one fixed supercell, then yes, that supercell needs to be sufficiently large for the cutoff you want to resolve.
But if the training set contains different supercell sizes and shapes, there is no requirement that each individual training supercell satisfies this condition by itself. So long as your fitting problem `Ax=y` is well conditioned there should be no problem (regarding this issue) with resulting CE.

Thank you for your thorough answer, this helped a lot!

To confirm what you’re saying regarding the condition number, I should use that as a measure of whether the training structure set is appropriate for a cluster expansion with given cutoff distances?

Yes , you can even check this , i.e. the condition number of the fitting problem, directly from the structure container via

sc.get_condition_number()

see documentation Structure containers — icet documentation

if condition number is large e.g. 1e16 the problem is ill defined and your structures are not enough to resolve the interactions within the chosen cutoff.