otmol.tl.cluster_alignment

otmol.tl.cluster_alignment(X_A, X_B, T_A=None, T_B=None, method='emd', p_list=None, case='same element', reg=0.01, numItermax=1000, n_atoms=None, n_trials=500, representative_option='center', reflection=False, save_path=None)

Compute alignment between two clusters with optimal transport.

Parameters
  • X_A (numpy.ndarray) – Coordinates of cluster A.

  • X_B (numpy.ndarray) – Coordinates of cluster B.

  • T_A (numpy.ndarray, optional) – Atom labels of cluster A, by default None.

  • T_B (numpy.ndarray, optional) – Atom labels of cluster B, by default None.

  • method (str, optional) – Method to use for optimal transport, by default ‘emd’.

  • p_list (list, optional) – Only used when case is ‘same element’. List of power values for distance matrix, by default None.

  • case (str) – Cluster type (‘same element’ or ‘molecule cluster’), by default ‘same element’.

  • reg (float, optional) – Regularization parameter for sinkhorn and sOT, by default 1e-2.

  • numItermax (int, optional) – Maximum number of iterations for sinkhorn and sOT, by default 1000.

  • n_atoms (int, optional) – Number of atoms in a molecule in a molecule cluster, by default None.

  • representative_option (str, optional) – The representative coordinate for a molecule in a molecule cluster, by default ‘center’. For water clusters, one may choose “O” (oxygen).

Returns

  • assignment (numpy.ndarray) – Optimal assignment between clusters.

  • rmsd (float) – Best RMSD value.

  • p (float) – Best p value (for ‘same element’ case).