def __iter__(self):
for key0, bin0 in self.bins:<EOL><INDENT>for key1, bin1 in self.bins.iter_surrounding(key0):<EOL><INDENT>for i0, c0 in bin0:<EOL><INDENT>for i1, c1 in bin1:<EOL><INDENT>if i1 >= i0:<EOL><INDENT>continue<EOL><DEDENT>delta = c1 - c0<EOL>if self.unit_cell is not None:<EOL><INDENT>delta = self.unit_cell.shortest_vector(delta)<EOL><DEDENT>distance = np.linalg.norm(delta)<EOL>if distance <= self.cutoff:<EOL><INDENT>yield i0, i1, delta, distance<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
Iterate over all pairs with a distance below the cutoff