load "Subgroups/functions.txt";

q:=151;
m:=(q-1)/2;
n:=2;
F:=GF(q);
w:=PrimitiveElement(F);
//n:=(q-1) div m;
G:=GroupOfLieType("F4",q);
V:=VectorSpace(GF(q),4);
rho1:=StandardRepresentation(G);
rho2:=AdjointRepresentation(G);
Over1:=GL(26,q);
Over2:=GL(52,q);
g1:=elt<G|V![w^n,1,1,1]>;
g2:=elt<G|V![1,w^n,1,1]>;
g3:=elt<G|V![1,1,w^n,1]>;
g4:=elt<G|V![1,1,1,w^n]>;
W:=Reflections(G);
Mats1:=[rho1(i):i in [g1,g2,g3,g4]];
Mats2:=[rho2(i):i in [g1,g2,g3,g4]];
MatsE:=[rho1(i):i in W];
NGT:=sub<Over1|Mats1 cat MatsE>;
T:=sub<NGT|Mats1>;
E:=sub<NGT|MatsE>;
V1:=GModule(T,Mats1);
V2:=GModule(T,Mats2);

T15:=sub<T|[T.i^5:i in [1..4]]>;

w15:=w^(5*n);

F<u>:=GF(16);
G2:=PSU(3,4);
Irr:=IrreducibleModules(G2,GF(16));
S31:=Irr[2];
S31d:=Dual(S31);
S32:=GModule(G2,FrobeniusImage(S31,1));
S32d:=Dual(S32);
S81:=OrderByDimension(CompositionFactors(TensorProduct(Irr[2],Dual(Irr[2]))))[2];
S921:=TensorProduct(S31,S32d);
S921d:=Dual(S921);
MF4:=DirectSum([S81,S921,S921d]);
CC:=ConjugacyClasses(G2);
for i in [19..22] do if(<u,1> in EigenvaluesOfElement(S31,CC[i,3])) then x:=CC[i,3]; break i; end if; end for;
E0:=EigenvaluesOfElement(MF4,x);
Eigs0:={<w15^(Log(i[1])),i[2]>:i in E0};

// Here are the two classes of elements of order 15 with the correct trace on an element of order 15.

El1:=[ 6, 3, 2, 3 ];
El2:=[ 4, 11, 9, 2 ];

Ell1:=[ 36, 3, 47, 3 ];
Ell2:=[ 49, 26, 24, 2 ];

g1:=ProduceGroupElement(T15,El1);
g2:=ProduceGroupElement(T15,El2);
gg1:=ProduceGroupElement(T,Ell1);
gg2:=ProduceGroupElement(T,Ell2);

#Eigenvalues(gg1) eq #Eigenvalues(g1) and Order(gg1) eq 75 and gg1^5 eq g1 and Eigenvalues(g1) eq Eigs0;
#Eigenvalues(gg2) eq #Eigenvalues(g2) and Order(gg2) eq 75 and gg2^5 eq g2 and Eigenvalues(g1) eq Eigs0;
// But they have different traces on the Lie algebra
EigenvaluesOfElement(V2,g1) ne EigenvaluesOfElement(V2,g2);

Els1:=ConstructPreimages([5*i:i in El1],75,5);
Els2:=ConstructPreimages([5*i:i in El2],75,5);

for i in [1..#Els1] do gg:=ProduceGroupElement(T,Els1[i]); if(#Eigenvalues(gg) eq 15 and Order(gg) ne 15) then "blueprint",Els1[i]; break i; end if; end for;
for i in [1..#Els2] do gg:=ProduceGroupElement(T,Els2[i]); if(#Eigenvalues(gg) eq 15 and Order(gg) ne 15) then "blueprint",Els2[i]; break i; end if; end for;
