Skip to content

Fix small cutoff neighbor#2277

Merged
shyuep merged 5 commits into
materialsproject:masterfrom
chc273:fix_small_cutoff_neighbor
Oct 26, 2021
Merged

Fix small cutoff neighbor#2277
shyuep merged 5 commits into
materialsproject:masterfrom
chc273:fix_small_cutoff_neighbor

Conversation

@chc273
Copy link
Copy Markdown
Contributor

@chc273 chc273 commented Oct 23, 2021

Summary

In the current cell list implementation for finding neighbors, the space is divided into ~O((cell length / cutoff)^3) cubes for fast neighbor finding. This causes issues when the user chooses unrealistic small or even zero cutoffs.

In this PR, I am doing the following:

  1. For reasonable cutoff (default to > 1.0 Angstrom), I am calculating the neighbors directly using the algorithm.
  2. For small cutoffs (e.g., < 1.0 Angstrom, including neg cutoffs), I am calculating the 1.0-cutoff neighbor list, and use a boolean mask to keep those neighbors having distances less than the cutoff afterward. This will also make sure that if the users input negative cutoff, the returned neighbors will be empty.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.6%) to 83.101% when pulling 00ecc46 on chc273:fix_small_cutoff_neighbor into 71c8ab8 on materialsproject:master.

@shyuep shyuep merged commit 5cdae05 into materialsproject:master Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants