I defined 24 quaternions using the Quaternions package and i create the list of all possible 4-tuples using
ListQuad = Tuples[ListQuaternions, 4]
where ListQuaternions
is the list of the 24 elements I defined.
Now I would like to select all the 4-tuples such that the product of the four quaternions is equal to Quaternion[1, 0, 0, 0]
.
I tried to use this:
Select[ListQuad,{x_, y_, z_, w_} /; x ** y ** z ** w == Quaternion[1, 0, 0, 0] &]
but this gives me an empty list, which I'm sure it can't be true because I know that some 4-tuples satisfy that condition.
I don't understand what I'm doing wrong. Probably the condition I put in the Select
command?
Select[ListQuad, (x ** y ** z ** w == Quaternion[1, 0, 0, 0]) &]
instead. In general, you have to decide whether to useSelect
(function based selection) orCases
(pattern based selection). $\endgroup$