plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
364 stars 289 forks source link

Derivatives of RMSD #1138

Closed lizhuzh closed 1 month ago

lizhuzh commented 1 month ago

Hi PLUMED developers,

In the definition of RMSD:

image

there is a M matrix calculated from Kearsley algorithm. When calculating the derivative of RMSD, there should be a term containing

eq

I took a look at the source code OptimalRMSD.cpp and I did not find the code is calculating terms containing this derivative. Am I understanding the source code wrong? Or is this derivative automatically zero after the minimization in Kearsley algorithm?

Thanks, Lizhu

HanatoK commented 1 month ago

RMSD is probably a special case where the derivatives of rotation matrix with respect to the coordinates vanish (see also https://github.com/Colvars/colvars/pull/570#issuecomment-2075781892).

GiovanniBussi commented 1 month ago

@lizhuzh one easy way of seeing this is this: M is defined as the matrix that minimizes the MSD. Hence, the derivative of the MDS with respect to M is zero.

The term that seems to be missing is: d(MSD) / dM times dM / dX.

dM / dX (derivatives of rotation matrix with respect to the coordinates) is not zero. However, d(MSD) / dM (derivatives of the MSD with respect to the rotational matrix) is zero. So the product is zero as well.

The term is instead present when the groups (or weights) used for alignment and for displacement calculations differ.

I hope this helps

lizhuzh commented 1 month ago

@lizhuzh one easy way of seeing this is this: M is defined as the matrix that minimizes the MSD. Hence, the derivative of the MDS with respect to M is zero.

The term that seems to be missing is: d(MSD) / dM times dM / dX.

dM / dX (derivatives of rotation matrix with respect to the coordinates) is not zero. However, d(MSD) / dM (derivatives of the MSD with respect to the rotational matrix) is zero. So the product is zero as well.

The term is instead present when the groups (or weights) used for alignment and for displacement calculations differ.

I hope this helps

This helps a lot! Thanks for clarifying it!