Improve handling of non-wrapped positions
Most times when using icet I run into the following error
RuntimeError: Failed to find site by position (findLatticeSiteByPosition)
which is almost always caused by the fact that the atoms objects positions are not inside the cell, i.e. you need to atoms.wrap()
to make it run.
This is such a common error (for me) so I was thinking maybe this could be handled internally. For example this code snippet gets you into trouble (which maybe you should blame ASE for):
import numpy as np
from ase.build import bulk
from icet import ClusterSpace, ClusterExpansion
from mchammer.calculators import ClusterExpansionCalculator
prim = bulk('NaCl', 'rocksalt', a=1.0)
cs = ClusterSpace(prim, [1.8], [['Na', 'N'], ['Cl', 'C']])
ce = ClusterExpansion(cs, np.random.random(len(cs)))
supercell = prim.repeat(2)
calculator = ClusterExpansionCalculator(supercell, ce)
Tasks
-
add a wrap of the input cell inside ClusterExpansionCalculator
edit: MÅ: added task 2019-02-11
Edited by Paul Erhart