Open rockspore opened 7 years ago
Thank you for reporting this. Can you provide an example script that shows the bug?
Thanks for the response.
cnn = spinw;
lc = [9.551 5.43683 16.75890];
agl = [90 125.6860 90];
cnn.genlattice('lat_const',lc,'angled',agl,'sym',14);
cnn.addatom('r',[0 0 0],'S',1,'label','M');
cnn.gencoupling('maxDistance',15);
The code above will trigger the error message saying index exceeds the dimension of cMat. As I said, my understanding is for certain basis vectors, hMax2 can have negative values and so do nC and cDim. This results in empty atom1 and atom2 which eventually reduces the dimension of cMat.
I fixed the bug in 5a4097ce7c44e85ed69913f148d575a1638ececf using your suggestions, thanks!
I think
hMax2 = sum(obj.basisvector,2);
can be replaced withhMax2 = abs(sum(obj.basisvector,2));
to solve this problem.