Skip to content
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

Neighborlist shape changes when updated with 2D box #272

Open
pl-fuchs opened this issue Jul 5, 2023 · 0 comments
Open

Neighborlist shape changes when updated with 2D box #272

pl-fuchs opened this issue Jul 5, 2023 · 0 comments

Comments

@pl-fuchs
Copy link

pl-fuchs commented Jul 5, 2023

When using a box with box.ndim == 2 to update the neighborlist, the error-leaf of the neighbor list changes from uint8[] to uint8[3,3].
I think this is due to a check of the box format returning a matrix instead of a scalar in partition.py:

def is_box_valid(box: Array) -> bool:
  if jnp.isscalar(box) or box.ndim == 0 or box.ndim == 1:
    return True
  if box.ndim == 2:
    return jnp.triu(box) == box
  return False

at

https://github.com/jax-md/jax-md/blob/4861632f1478d9ba3207d0a8bc308969afc1486a/jax_md/partition.py#L587C6-L587C6

Is it possible that there might be missing a jnp.all(...)? I patched this function in my code and now the neighborlist does not change its shape anymore.

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

No branches or pull requests

1 participant