question about quaternion evolution in LAMMPS

Hello all. I am working on developing orientation-dependent pair potentials. I have a question about the richardson update routine for quaternions.

Within the code (math_extra.cpp), the quaternion velocity is obtained as qdot = 0.5 * omega * q, where omega is the angular velocity and qdot the time derivative of the quaternion. This appears to be inconsistent with textbook definitions (e.g. Allen and Tildesley, p. 88), though this may be reconciled by altering the ‘handedness’ of the quaternion.

This interpretation is important for knowing how to map the quaternion onto a vector for orientation-dependent potentials, so that the forces and torques may be properly computed. If possible, can someone clarify this issue?

-Jonathan K. Whitmer

If you mean eq 3.37 in A&T, I think that is qdot = 1/2 qw.
So that is different than qdot = 1/2 wq which we use. But for
w a vector (not a full quat), the difference is I beleive a sign
change in the cross product of the 2 vector portions of the quats.
So maybe we are using a different sign convention for our
quat than A&T? We didn't follow A&T in developing fix rigid.
I think it's unlikely we have a sign error, i.e. qdot has the
wrong sign ...


My answer below was wrong. I thought we might have
defined the q differntly than A&T, e.g. as the rotation angle from
body to space vs space to body frames.

I went back and looked at our notes for the fix rigid implementation.
I think the right answer is as follows:

The A&T eq 3.37 is for omega in the body frame.
In the Richardson routine we are using omega in the space
frame (fixed frame). In that ref frame, qdot = 1/2 wq is correct.
If the body frame qdot = 1/2 q w_b is correct.

Which you can derive noting that w_space = q w_body q_conj.



I thank you for your reply---this is vital information since interactions between two aspherical (e.g. Gay--Berne) particles require one to obtain the orientation from the quaternion, and the distinction between lab-frame and body-frame quaternions alters the rotation matrix used to do this (by transpose).

-Jonathan K. Whitmer