-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow cell vectors to have length zero if pbc is False #7
Comments
I think we should use some sort of shrink-wrapped cell in that case. The neighbor list needs a cell because it uses cell subdivision internally to look for neighbor. The shrink-wrapped cell should be fastest, because it minimizes the number of cells with no atoms in them. (The neighbor list will not necessarily loop over those, but it needs to initialize them and they may destroy cache coherency.) |
Sounds good, but if the shrink-wrapped lengths are zero (as they would be in x and y here) we will still get zero volume and the subdivision will fail. Round up to at least cutoff? |
Yes, set to at least cutoff. Any small values should do but cutoff is probably reasonable. |
Part of this could involve changing |
+1 - I have been seeing the same issue with LJ clusters. I can manually set the cell to some shrink-wrapped version though. |
may relate te usability in ACEsuit/mace#52 as well |
Consider a dimer:
The
ase.Atoms
constructor correctly setspbc=False
for the zero-length vectors.The current implementation fails with a
LinAlgError
when trying to invert the cell.Since the inverse shouldn't be needed when
pbc=False
, I tried the following patch:However, we need to think about this a bit more, as this leads to zero cell volume, and would screw up the division of box into cells within C neighbour list code.
The text was updated successfully, but these errors were encountered: