ClusterSpace failure for short cutoffs
By mistake I stumbled upon an error when constructing a ClusterSpace when the cutoffs are shorter than NN distance. Altough it works when including third-order terms.
Maybe some error handling could be added for this case?
Example
from ase.build import bulk
from hiphive import ClusterSpace
from hiphive.cutoffs import estimate_maximum_cutoff
atoms = bulk('Al', 'fcc', a=4.0).repeat(2)
max_cutoff = estimate_maximum_cutoff(atoms)-1e-5
cs = ClusterSpace(atoms, [5.0, max_cutoff]) # works
cs = ClusterSpace(atoms, [max_cutoff, 5.0]) # works
cs = ClusterSpace(atoms, [max_cutoff]) # crashes
with error
cs = ClusterSpace(atoms, [max_cutoff])
File "/home/erik/projects/hiphive/hiphive/cluster_space.py", line 116, in __init__
build_cluster_space(self, prototype_structure)
File "/home/erik/projects/hiphive/hiphive/core/cluster_space_builder.py", line 89, in build_cluster_space
_create_constraint_map(cluster_space)
File "/home/erik/projects/hiphive/hiphive/core/translational_constraints.py", line 117, in create_constraint_map
cs._cvs = coo_matrix((data, (row, col)), shape=(len(vec), len(nullspace)))