Warning Found two shells within 2 * dist_tol

Dear developers,

When running mc_rattle in hiphive, I get this warning

Found two shells within 2 * dist_tol

Can this be safely ignored. Should I test the various tolerance to suppress this.


Are you sure that warning is coming from mc rattle and not ClusterSpace?

Thanks! Yes it is coming from cluster space.:

Actually I am using get_neighbor_shells function for auto estimation of dmin in mc_rattle. This is what throws the warning.

the code snippet is below:

from hiphive.structure_generation import generate_mc_rattled_structures
from numpy.random import randint
from hiphive.utilities import get_neighbor_shells
seed = randint(1)
#Getting min distance between atoms
lista = get_neighbor_shells(sc,4)
dmin= lista[0].distance -0.10 # Just in case potential numerical errors
structures = generate_mc_rattled_structures(sc, rat_n, rat_std*0.15, dmin, seed=seed, n_iter=20)"

When we are at it, can I pick your brain on more cofusion I have:
In the hiphive doc for mc_rattle it is stated that:

“Please note that calling functions that rely on the generation of pseudo- random numbers repeatedly with the same seed (i.e., repeatedly falling back to the default value) is strongly discouraged as it will lead to correlation. To circumvent this problem one can for example seed a sequence of random numbers and then use these numbers in turn as seeds.”

That means the way I using this function now the generated displacement may be correlated. The better way could be; say for 100 displacements - I should use 100 different random numbers. Is my understanding correct?


aha ok if the warning is coming from get_neighbor_shells then there is nothing to worry about.

If you’re only using it to determine the minimum distance in a structure it might be easier to useatoms.get_all_distances(mic=True).

Iirc the rattle functions take a seed as input, which has a default value.
This means that if you call this function twice it will produce the same set of structures (you can easily check this), this is what means with correlation.

Thanks Erik.