def get_radius_indexes(self, radius, max_ranges=None):
if max_ranges is None:<EOL><INDENT>max_ranges = np.array([-<NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>])<EOL><DEDENT>ranges = self.get_radius_ranges(radius)*<NUM_LIT:2>+<NUM_LIT:1><EOL>mask = (max_ranges != -<NUM_LIT:1>) & (max_ranges < ranges)<EOL>ranges[mask] = max_ranges[mask]<EOL>max_size = np.product(self.get_radius_ranges(radius)*<NUM_LIT:2> + <NUM_LIT:1>)<EOL>indexes = np.zeros((max_size, <NUM_LIT:3>), int)<EOL>from molmod.ext import unit_cell_get_radius_indexes<EOL>reciprocal = self.reciprocal*self.active<EOL>matrix = self.matrix*self.active<EOL>size = unit_cell_get_radius_indexes(<EOL>matrix, reciprocal, radius, max_ranges, indexes<EOL>)<EOL>return indexes[:size]<EOL>
Return the indexes of the interacting neighboring unit cells

           Interacting neighboring unit cells have at least one point in their
           box volume that has a distance smaller or equal than radius to at
           least one point in the central cell. This concept is of importance
           when computing pair wise long-range interactions in periodic systems.

           Argument:
            | ``radius``  --  the radius of the interaction sphere

           Optional argument:
            | ``max_ranges``  --  numpy array with three elements: The maximum
                                  ranges of indexes to consider. This is
                                  practical when working with the minimum image
                                  convention to reduce the generated bins to the
                                  minimum image. (see binning.py) Use -1 to
                                  avoid such limitations. The default is three
                                  times -1.