Skip to content

Automatic identification of rings in sisl.Geometry() #688

Description

@ialcon

The idea of this feature would be to have an automated search of rings of a particular number of atoms (that is, squares, pentagons, hexagons, etc) within a sisl.Geometry() object. Such a feature would be extremely useful to further analyze/categorize the inner fragments of a given geometry. For example, say you have a nanoporous graphene structure, such as in this open-access paper (Fig. 1 in https://onlinelibrary.wiley.com/doi/full/10.1002/adfm.202104031), which is formed as a 2D array of (1D) graphene nanoribbons (GNRs). By getting the hexagons within the NPG, one could probably find a relatively simple (and general) manner to classify the atoms within the NPG as belonging to one GNR or the other, which would be something much harder to do (in a general way) without having that prior classification of atoms as within hexagons.

The way that I implemented this thing (outside sisl, of course) was focused exclusively on hexagonal rings in organic systems (i.e. benzene or aryl rings). I find that using the connections (or bonds) information is the most general way to do this. I attach a snipped of that implementation I made, where this is done within a polymer class that I made myself, so the "self" is a polymer instance.
rings_snipped.py.txt

As you will see, this is just 7 for loops over all atomic indices, and for each index we loop over the bonds of that atom (via "for id_3 in self.bonds[id_2]", for example) and we keep this going on until we find a closed 6-atoms ring. Of course, this is not a very efficient implementation, but for small unit cells of a few hundreds of atoms this takes absolutely nothing in a regular laptop. Of course, such implementation would be more problematic for large-scale structures, I guess, but for regular periodic or molecular structures this works fine.

Another important question is how to treat the hexagon (or pentagon, or whatever) structure (i.e. atomic indices): that is, if you treat them as a list of atoms, or as a geometry object in itself, or, if I understand it correctly, as a geometry.category - obviously, the more things we could do with that object the better, however, the complexity of the thing could explode quite easily. But that might be subject for another issue/discussion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions