26.6 Orienting Rigid Bodies: Quaternions

When a rigid body is placed into a crystal structure, one must define where in the structure the body will be placed and also how the Cartesian axes of the body will be defined relative to the crystal axes. Understanding how to locate the rigid body is straightforward. That position (in fractional coordinates) is referred to as the rigid body origin, since this is the location of the rigid body’s Cartesian coordinate system origin. The mechanism used to orient the rigid body Cartesian axes with the crystal axes is a bit more complex, as will be discussed next.

There are two commonly used mathematical methods for orienting objects, Euler angles and quaternions. Quaternions are newer, dating back only to the mid-1800’s, in contrast to Euler’s work in the mid-1700’s. Quaternions are significantly preferable for computational use, but this was not discovered until the past few decades and probably due to needs for video game programming. (GSAS used Euler angles for rigid bodies.) I have read somewhere that “a quaternion is simply a scalar and a vector combined together into a complex number.” I’d question the use of “simply” in that sentence, but the basic idea is that quaternions use four numbers \(q_0\), \(q_1\), \(q_2\) and \(q_3\) but these are normalized so that \(\sqrt {q_0^2 + q_1^2 + q_2^2 + q_3^2} = 1\), so that in fact only three of the four values are unique.

As was seen in the previous section, instead of displaying the quaternion values, they are converted to a related form, with a unit vector and an azimuthal rotation angle. This unit vector is usually shown in fractional coordinates. This is done in most places where GSAS-II uses quaternions. The math for the conversion is pretty simple, and can be seen in routine GSASIImath.Q2AV(), with the angle in radians, and GSASIImath.Q2AVdeg(), in degrees. The inverse operations are in GSASIImath.AV2Q() (radians) and GSASIImath.AVdeg2Q() (degrees). When GSAS-II refines quaternions, it does so with two refinement flags, one for the vector part of the quaternion and one for the azimuthal angle. Thus, there are four modes for refinement of the orientation quaternion:

  1. AV mode: In this mode, all of the three degrees of freedom are refined. The name is chosen to indicate that both the azimuth and the vector are fit.
  2. V mode: In this mode, only two degrees of freedom are refined. The name is chosen to indicate that only the vector is fit.
  3. A mode: In this mode, only one degree of freedom, that of the azimuthal rotation, is refined. The name is chosen to indicate that only the azimuth is fit.
  4. None: In this mode, there are no orientational degrees of freedom.

Symmetry will determine which of these modes is allowed, as will be discussed in the next section.