[math-fun] Quaternion GCD and canonical associates
A earlier comment observed that GCD is defined only up to unit association, which led me to reconsider the problem of defining a canonical representative among the (left or right) unit associates of a quaternion. This is not the sort of question which would normally concern a mathematician, who is liable to snort that one should simply deal with the class of associates in its own right. Nor is it likely to worry a computer programmer, for whom an adequate solution comprises sorting the set and extracting its first member. [It might though come within the ambit of a maverick like Don Knuth; but as far as I am aware, he has not concerned himself with quaternions to date.] Dealing with classes rather than individual quaternions is certainly feasible in mainstream computer algebra systems, though somewhat clumsier to program and slower to execute. Sorting is dependent on the convention adopted to order quadruplets, leading to incompatible results between multiple systems. For Q = w + x i + y j + z k a Lipschitz integer (say), a representative may be designated based on the fact that there is in general a unique member with 0 < w > |x|,|y|,|z| ; or alternatively with x,y,z > 0 . For both definitions, further arrangements must be made to deliver a unique result in subcases where the inequalities degenerate to equality. While such straightforward algorithms are adequate for integers, they are less satisfactory for real components, on the grounds of discontinuity in the presence of small rounding errors when component values are approximately equal. As a result, it becomes complicated to decide whether two such classes are approximately equal. I attempt to resolve this difficulty as follows. Define the "separation" of component to be the minimum difference between its absolute value and that of any other component. Then the canonical associate has real part equal to the largest component having maximum separation. This associate is unique unless (a) that component vanishes, in which case select the associate for which the largest component with submaximum separation also is positive; or (b) all components have equal size and separation zero, in which case select (1 + i + j + k)|w| or its conjugate. Both subcases deliver a unique result unless the quaternion vanishes, when there is anyway only 1 associate instead of the usual 8. Examples (canonical right-associates): Q = 3 i - 7 j - 6 k , separation 3, 3, 1, 1 , Q (-i) = 3 + 6 j - 7 k general case; Q = 3 i - 4 j - 6 k , separation 3, 1, 1, 2 , Q (-1) = -3 i + 4 j + 6 k subcase (a); Q = 1 - i + j - k , separation 0, 0, 0, 0 , Q k = 1 + i + j + k subcase (b). Subcase (b) remains the focus of a weakness with respect to continuity, since eg. Q = (1 + i + j + k) + E where ||E|| is small will inevitably be re-equipped with spurious random "canonical" signs depending on the errors E . There seems no simple corrective available, short of specifying the error bound as a parameter of the separation function; in which case one might as well adopt a less elaborate scheme as for integers. Fred Lunnon
participants (1)
-
Fred Lunnon