find_coordinate_matching_permutation
find_coordinate_matching_permutation(coords, new_coords, return_row_ordering=False, tol=None):
LLM Docstring
Find the permutation that best matches one set of coordinates to another by iterative nearest-neighbour assignment.
Builds the coordinate distance matrix and greedily pairs up the closest
remaining atoms, optionally enforcing a maximum-deviation tol. Either the
combined column permutation or the separate row/column orderings can be returned.
coords:np.ndarraythe source coordinates
new_coords:np.ndarraythe target coordinates
return_row_ordering:boolreturn separate row/column orderings
tol:float | Nonemaximum allowed matching deviation (raises if exceeded)
:returns:np.ndarray | tuplethe matching permutation (or the row/column orderings)