EconNN examples!

Are there any examples of how to use NearNeighbors, EconNN, and VoronoiNN? I’ve read in the pymatgen Manual, but it is a bit vague regarding those options. I would appreciate any help!

from pymatgen.analysis.local_env import NearNeighbors, EconNN, VoronoiNN

Hi @Celso_Rego,

You first need your Structure object (for example, imported from a CIF file or constructed manually), then you instantiate your NearNeighbor class, e.g.:

nn = EconNN()

and then you can call it for neighbors of your structure, e.g. nn.get_all_nn_info(your_structure) or nn.get_bonded_structure(your_structure). The latter returns a StructureGraph object.

The NearNeighbor class itself is not to be called directly, instead it defines a common interface used by all NearNeighbor subclasses like EconNN, VoronoiNN, CrystalNN etc. There is a paper comparing these algorithms:



1 Like

Thanks, @mkhorton, it worked!