sisl icon indicating copy to clipboard operation
sisl copied to clipboard

Classification of atoms using categories

Open pfebrer opened this issue 4 months ago • 13 comments

Following discussion in #688

I think it would be nice that categories facilitated classification. Imagine you have three categories cat1, cat2 and cat3. There could be a nice way of grouping atoms based on whether they belong to those categories or not. I.e. if I have a geometry, I could do something like:

geometry.classify((cat1, cat2, cat3))

And I would get an array saying to which group each atom belongs:

[0, 0, 0, 2, 1, 2, ..., -1, 0]

This I think is basically what the "Or" category does, but returning indices instead of the categories themselves.

Another thing that would be useful for classification is to provide some property and ask for the creation of groups based on that property:

geometry.classify(AtomNneighbors)

and you get maybe a tuple with the group indices and the meaning of each group:

[0, 0, 0, 1, 0, 2, 0, 1, 2], (AtomNneighbors(0), AtomNneighbors(1), AtomNneighbors(2) )

pfebrer avatar Feb 23 '24 10:02 pfebrer