sisl icon indicating copy to clipboard operation
sisl copied to clipboard

cleaned finder and removed pbc (getting it from Lattice)

Open zerothi opened this issue 3 months ago • 1 comments

The neighbor finder got an overhaul to check for PBC and friends.

  1. Deleted pbc arguments to routines, they now get it from the geometry object contained.
  2. The find_all_unique_pairs changed named to find_unique_pairs (all was superfluous)
  3. I tried to make a test (see final test in the test_finder.py where one is located outside the unit cell. This problem is also inherent to the current way of doing things, but I wanted to give it a try here as well. And I found the same problem. I.e. if one runs this small snippet one also gets:
import sisl as si

geom = si.Geometry([[0, 0, 0], [3, 0, 0]], lattice=[2, 10, 10])
n = si.geom.NeighborFinder(geom, R=1.1)
print(n.find_neighbors())

output

[array([[ 1, -1,  0,  0]]), array([], shape=(0, 4), dtype=int64)]

@pfebrer you have any clue was goes on here?

Also, we need to discuss what should be done. Because the current way things are handled (in both this and the old part of the code) needs to be fixed in one way. I don't know if one should always do a translation to the UC for PB directions, and then special care should be done along non PB directions.

zerothi avatar Mar 12 '24 19:03 zerothi