"Distance" (or angular magnitude) between two quaternions?
Find the difference quaternion qd = inverse(q1)*q2).
Than find the angle between q1 and q2 by angle = 2 * atan2(qd.vec().length(), qd.w()) // NOTE: signed
The "angle" here, is the angle of rotation from q1 to q2 by shortest arc.
Also you can use this lib function from pyquaternion
.
Quaternion.absolute_distance(q0, q1)