1

It is well known that the rotation matrix has the formula described here. I wonder how can I express these matrices in GAP with arbitrary rotating angles.

Edit:

  1. Dear Max Horn, thank you for your comments. But based on the description here:

enter image description here

I think your code snippet should be written as follows:

gap> n:=5;z:=E(n);a:=RealPart(z);b:=ImaginaryPart(z);
5
E(5)
1/2*E(5)+1/2*E(5)^4
1/2*E(20)-1/2*E(20)^9
gap> M:=[[a,-b],[b,a]];
[ [ 1/2*E(5)+1/2*E(5)^4, -1/2*E(20)+1/2*E(20)^9 ], [ 1/2*E(20)-1/2*E(20)^9, 1/2*E(5)+1/2*E(5)^4 ] ]
gap> Order(z);
5
gap> Order(M);
5
  1. As for the problem of "the added factor 4 in the order of the final matrix" represented by [[b,-a],[a,b]], I can only come up with the following interpretation: [[b,-a],[a,b]] is an 18-degree rotation, while [[a,-b],[b,a]] is a 72-degree rotation as shown by the following test:
gap> n:=5;;z:=E(n);;a:=RealPart(z);;b:=ImaginaryPart(z);;
gap> M1:=[[a,-b],[b,a]];;
gap> M2:=[[b,-a],[a,b]];;
gap> Order(z);
5
gap> Order(M1);
5
gap> Order(M2);
20
gap> M2^4=M1;
true

Regards, HZ

1 Answers1

3

It is unclear what you really want to know. Since your other questions are about group representations, I am assuming you want to know about rotations by "rational" angles. Then you can use primitive roots of unity to describe the matrix entries using Euler's formula.

Here's an example (I'll leave it as an exercise to deal with the added factor 4 in the order of the final matrix)

gap> RotMat := function(n)
>    local z, a, b;
>    z:=E(n);
>    a:=RealPart(z);
>    b:=ImaginaryPart(z);
>    return [[a,-b],[b,a]];
>  end;;
gap> M := RotMat(5);
gap> Order(M);
5
gap> Display(M);
[ [     1/2*E(5)+1/2*E(5)^4,  -1/2*E(20)+1/2*E(20)^9 ],
  [   1/2*E(20)-1/2*E(20)^9,     1/2*E(5)+1/2*E(5)^4 ] ]
Max Horn
  • 1,832
  • Thank you for the trick. My concern is mainly for rotational symmetry of crystallographic group, in this case, the above tip is enough due that there are only 1, 2, 3, 4, and 6 order of rotations are allowed. As for general rotations by "rational" or "irrational" angles, I think it can be dealt with the Floats numbers (https://www.gap-system.org/Manuals/doc/ref/chap19.html), e.g., by the method discussed here (https://math.stackexchange.com/questions/4450209/compute-e2-pi-i-3-in-gap/4450239#4450239). – Hongyi Zhao May 14 '22 at 13:36
  • According to the description here, I think it should be computed like this: gap> M:=[[a,-b],[b,a]];; gap> Order(M); 5. – Hongyi Zhao May 14 '22 at 14:48
  • Floating point numbers are not useful for algebraic purposes. They do not even form a ring (e.g. floating point addition and multiplication is not associative). – Max Horn May 14 '22 at 23:33
  • Also, it's really weird to edit your question by copying most of my answer. And, asking follow up questions this ways is frowned upon. – Max Horn May 14 '22 at 23:36
  • Then what's the preferable way to ask follow-up questions? – Hongyi Zhao May 15 '22 at 00:06
  • Do you mean that the transcendental numbers related algebra must be treated by decomposing them into polynomials represented by algebraic numbers in GAP?
  • According to the descritpion here, I think your statement "floating point addition and multiplication is not associative" should be phrased as "Multiplication is distributive with respect to addition".
  • – Hongyi Zhao May 15 '22 at 00:16
  • No, my statement is phrased correctly as it is: addition of floating point numbers is not associative. Neither is multiplication. Floating point numbers do not form a ring – Max Horn May 15 '22 at 07:54
  • 1
    For follow ups, use comments, when it works, or ask new question when comments are not sufficient. Otherwise, first it's not even guaranteed that the author of the answer will notice your question asked in the edited OP; second, a new reader will struggle to read it in a non-sequential order. – Olexandr Konovalov May 15 '22 at 15:31