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

Wrong neighbors if we set 2nd connections #87

Open
tpyang opened this issue Feb 14, 2023 · 0 comments
Open

Wrong neighbors if we set 2nd connections #87

tpyang opened this issue Feb 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@tpyang
Copy link

tpyang commented Feb 14, 2023

Describe the bug
See below, site 5 is found for site 3 as nearest neighbor, but site 3 is not found for site 5 as nearest neighbor,

To Reproduce
Steps to reproduce the behavior:

import lattpy as lp
import matplotlib.pyplot as plt

latt = lp.Lattice.hexagonal()
latt.add_atom()
latt.add_connections(2)

latt.build((3-0.1, 3-0.1, ), primitive=True)
latt.set_periodic([1, ], primitive=True)

latt.plot(show_indices=True)
plt.show()
print(latt.neighbors(3,distidx=0))
print(latt.neighbors(5,distidx=0))

The resulting error is:

[1 0 4 6 5 8]
[7 4 2 8 0]

Expected behavior
[1 0 4 6 5 8]
[7 4 2 8 0 3]

Environment

  • lattpy version: 0.7.7
  • OS and Python version: MacOs, python3.8

Additional context
Add any other context about the problem here.

@tpyang tpyang added the bug Something isn't working label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant