I have a perplexity about how to use the different algorithms implemented within pymatgen to retrieve neighbors (connectivity) of sites within a Structure.
So first of all, if I have a Structure object and I use get_all_neighbors() method, then I return all periodic neighbors (for each site) within a certain distance and I understand that. What if instead, I want to use IsayevNN or CrystalNN modules. These two don’t have a get_all_neighbors() method, but you have to specify the index for each site… I just don’t understand how these things are related to each other, or if I’m missing anything.
The various NearNeighbors implementations differ in their definitions of what a neighbor is. I believe most, if not all, include a DOI for a reference paper about the method (I see 10.1038/ncomms15679 for IsayevNN, for instance), from which you can decide if it fits your use case. If you simply need all sites within a certain cutoff, get_all_neighbors() does the job.
It seems like IsayevNN.get_all_nn_info(structure) gives you what you want. It returns a list with structure.num_sites elements, where the nth element is a list of neighbors of site n, and each neighbor is defined as a dictionary with keys 'site', 'image', 'weight', 'site_index', 'poly_info'.