mlchem.chem.calculator.tools.pairwise_euclidean_distance

pairwise_euclidean_distance(matrix: ndarray) ndarray

Calculate the pairwise Euclidean distances between rows of a matrix.

Uses SciPy’s pdist and squareform functions.

Parameters:

matrix (np.ndarray) – Input 2D array of shape (N, D) where N is the number of points.

Returns:

2D array of pairwise Euclidean distances.

Return type:

np.ndarray

Examples

>>> pairwise_euclidean_distance(np.array([[0, 0], [1, 0], [0, 1]]))