Add inner product and distance function for quaternions.