CAlgRank4SFromList:=function(L) local B0,B1,B2,B3,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T; B0:=IdentityMat(4); B1:=[[0,L[10],0,0],[1,L[10]-L[1]-L[4]-1,L[1],L[4],],[0,L[10]-L[2]-L[5],L[2],L[5]],[0,L[10]-L[3]-L[6],L[3],L[6]]]; B2:=[[0,0,L[11],0],[0,L[1],L[11]-L[1]-L[7],L[7]],[1,L[2],L[11]-L[2]-L[8]-1,L[8]],[0,L[3],L[11]-L[3]-L[9],L[9]]]; B3:=[[0,0,0,L[12]],[0,L[4],L[7],L[12]-L[7]-L[4]],[0,L[5],L[8],L[12]-L[8]-L[5]],[1,L[6],L[9],L[12]-L[9]-L[6]-1]]; T1:=B1^2-(L[10]*B0+(L[10]-L[1]-L[4]-1)*B1+(L[10]-L[2]-L[5])*B2+(L[10]-L[3]-L[6])*B3); T1:=Concatenation(T1); T2:=B1*B2-(L[1]*B1+L[2]*B2+L[3]*B3); T2:=Concatenation(T2); T0:=Concatenation(T1,T2); T3:=B1*B3-(L[4]*B1+L[5]*B2+L[6]*B3); T3:=Concatenation(T3); T0:=Concatenation(T0,T3); T4:=B2^2-(L[11]*B0+(L[11]-L[1]-L[7])*B1+(L[11]-L[2]-L[8]-1)*B2+(L[11]-L[3]-L[9])*B3); T4:=Concatenation(T4); T0:=Concatenation(T0,T4); T5:=B2*B3-(L[7]*B1+L[8]*B2+L[9]*B3); T5:=Concatenation(T5); T0:=Concatenation(T0,T5); T6:=B3^2-(L[12]*B0+(L[12]-L[4]-L[7])*B1+(L[12]-L[5]-L[8])*B2+(L[12]-L[6]-L[9]-1)*B3); T6:=Concatenation(T6); T0:=Concatenation(T0,T6); T7:=B1*B2-B2*B1; T7:=Concatenation(T7); T0:=Concatenation(T0,T7); T8:=B1*B3-B3*B1; T8:=Concatenation(T8); T0:=Concatenation(T0,T8); T9:=B2*B3-B3*B2; T9:=Concatenation(T9); T0:=Concatenation(T0,T9); T:=AsSet(T0); return T; end; ######################################## ########################################### EnumerationFromListRank4S:=function(n) local L,k,k1,k2,k3,i1,i2,i3,i4,i5,i6,i7,i8,i9,S,T,t,V,j; L:=[]; S:=[]; for k1 in [1..(n-3)] do k:=Minimum(k1,n-k1-2); for k2 in [1..k] do k3:=n-k1-k2-1; if 02 then G:=TransitiveGroup(Degree(f),GaloisType(f)); if not(IsAbelian(G)) then K:=["Not Cyclotomic",f,G]; fi; fi; if K=[] then D:=[E(2)]; for f in F do d:=Degree(f); if d=2 then d1:=Discriminant(f); Add(D,ER(d1)); fi; if d>2 then v:=Discriminant(f); d1:=AbsoluteValue(v); for d2 in Factors(d1) do Add(D,E(d2)); od; fi; od; L:=Field(D); Print(L,"\n"); d1:=1; for f in F do F1:=Factors(PolynomialRing(L),f); f1:=F1[Length(F1)]; d1:=Maximum(d1,Degree(f1)); od; Print(d1,"\n"); if d1=1 then K1:=[]; for k in [1..r] do Q:=Eigenvectors(L,b[k]); #Print(k,Q,"\n"); d1:=DiagonalOfMat(Q*b[k]*Q^(-1)); Add(K1,d1); od; #Print(K1,"\n"); J:=DiagonalOfMat(IdentityMat(r)); Print(J*K1,"\n"); #if not(J*K1=[n,0,0,0,0]) then if not(J*K1=[n,0,0,0]) then G:=SymmetricGroup([2..r]); L3:=Orbit(G,K1[3],Permuted); L4:=Orbit(G,K1[4],Permuted); # L5:=Orbit(G,K1[5],Permuted); t:=0; for m1 in L3 do for m2 in L4 do # for m3 in L5 do # Q:=[K1[1],K1[2],m1,m2,m3]; Q:=[K1[1],K1[2],m1,m2]; J1:=J*Q; Print(J1,"\n"); # if J1=[n,0,0,0,0] then if J1=[n,0,0,0] then K:=TransposedMat(Q); t:=1; break; fi; od; # if t=1 then # break; # fi; # od; if t=1 then break; fi; od; fi; fi; fi; fi; return K; end; ##################################### DegreesOfTA:=function(b) local r,D,i; r:=Length(b); D:=[]; for i in [1..r] do D[i]:=b[i][1][i]; od; return D; end; ##################################### # Another name for character table of # a commutative table algebra is first # eigenmatrix. ##################################### FirstEigenmatrixOfTA:=function(b) local P; P:=CharTableOfTA(b); return P; end; ##################################### # Note that the second eigenmatrix is # computed from the first eigenmatrix. ##################################### SecondEigenmatrixOfTA:=function(b) local Q,n,P; P:=FirstEigenmatrixOfTA(b); n:=Sum(P[1]); Q:=n*P^(-1); return Q; end; ##################################### MultiplicitiesOfTA:=function(b) local n,P,M,Q; P:=FirstEigenmatrixOfTA(b); n:=Sum(P[1]); Q:=n*P^(-1); M:=Q[1]; return M; end; ##################################### ClosedSubsetsOfTA:=function(b) local r,C0,C1,c,C2,C,i,j,k,a,b1,D; r:=Length(b); a:=Algebra(Rationals,b); b1:=Basis(a,b); C:=[]; C0:=Combinations([2..r]); C1:=[]; for c in C0 do Add(C1,Concatenation([1],c)); od; for c in C1 do D:=[]; for j in c do for k in c do C2:=Coefficients(b1,b1[j]*b1[k]); for i in [1..r] do if not(C2[i]=0) then AddSet(D,i); fi; od; od; od; if D=c then Add(C,D); fi; od; return C; end; ################################### FusionsOfTA:=function(b) local S,P,D,p,p1,b1,p2,d,a,r; S:=[]; r:=Length(b); P:=PartitionsSet([1..r]); for p in P do if not(p=[]) then D:=[]; for p1 in p do b1:=0*b[1]; for p2 in p1 do b1:=b1+b[p2]; od; Add(D,b1); od; a:=Algebra(Rationals,D); d:=Dimension(a); if d=Length(p) then Add(S,p); fi; fi; od; return S; end;