-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix neighbour calc #207
Fix neighbour calc #207
Conversation
apax/data/preprocessing.py
Outdated
cell.flat[:: cell.shape[1] + 1] += 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this line do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as cell[np.diag_indices_from(cell)] += 1
idk why I used that.
apax/data/preprocessing.py
Outdated
cell[idx, idx] = 1.0 | ||
|
||
cell.flat[:: cell.shape[1] + 1] += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be replaced by something clearer
extend diagonal elements of cell
@@ -119,7 +119,7 @@ def get_shrink_wrapped_cell(positions): | |||
if cell[idx, idx] < 10e-1: | |||
cell[idx, idx] = 1.0 | |||
|
|||
cell.flat[:: cell.shape[1] + 1] += 1 | |||
cell[np.diag_indices_from(cell)] += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the purpose of this line is to increase the cell by 1 Angstrom in all directions.
is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If the cell is too tight some atoms will be counted as being in a adjacent cell and the neighbour list will be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 0.1 A would also be sufficient but I did not tested it.
Addresses the problem that the shrink wrapped cell was too tight. Fix by adding a little layer if the shrink wrapped cell is created.