Question about quaternion calculation

Hi,

I was just trying to understand the quaternion calculation procedure in lammps. I just did not understand how it works to convert the lab fixed frame to the body frame? Basically how this quaternion (with Euler’s angle generation w.r.t. simulation box coordinates ) is calculated in lammps? Please elaborate.

Thanks,

Tuhin Samanta

Take a look at molecule.cpp (in the LAMMPS "src" subdirectory). If
memory serves me correction, that file contains code to calculate the
principle axis of inertia of a molecule and convert them into a
quaternion.

The following link is probably not relevant, but I include it anyway.
https://lammps.sandia.gov/threads/msg83122.html

Note that Euler angles and quaternions are different things.
LAMMPS does not use Euler angles to represent
orientations of a body. The code Andrew mentioned as well as
fix_rigid.cpp have the calls to do quaternion operations.
Most of the methods are in math_extra.cpp/h. A description
of the quaternion equations can be found in Allen & Tildesley
as I recall. I also have a nice PDF write-up someone here
at Sandia did years ago. I can email you that if you send me
your email address (send it to me personally rather than
advertise it on the mail list).

Steve