1#############################################################################
2##
3#W  ckforms.gi                  NoCK Package
4##
5##  Installation file for functions of the NoCK package.
6##
7
8InstallGlobalFunction( AllZeroDH, function(arg)
9local G, typeG, rankG, idRealFormG, A, rankRG, dimG, dimPG, K, dimK, rankK, pi, qi, permPi, t, Pt, j, i, List1, List2, List3,List4,ListD,deg,isOK,Coeff;
10    typeG:=arg[1];
11    rankG:=arg[2];
12    idRealFormG:=arg[3];
13    G:=RealFormById(typeG,rankG,idRealFormG);
14    A:=CartanSubspace(G);
15    rankRG:=Dimension(A);
16    dimG:=Dimension(G);
17    K:=CartanDecomposition( G ).K;
18    dimK:= Dimension(K);
19    rankK:= Dimension(CartanSubalgebra(K));
20    pi:=PCoefficients(typeG,rankG);
21    if typeG="A" then
22        if rankG=1 and idRealFormG=2 then
23            qi:=PCoefficients("A",0);
24        elif idRealFormG=2 then
25            qi:=PCoefficients("A",rankG-idRealFormG+1);
26            Append(qi,[1]);
27        elif RemInt(rankG,2)=0 then
28            if idRealFormG>2 and idRealFormG<=rankG/2+1 then
29                qi:=PCoefficients("A",idRealFormG-2);
30                Append(qi,PCoefficients("A",rankG-idRealFormG+1));
31                Append(qi,[1]);
32            elif idRealFormG=rankG/2+2 then
33                qi:=PCoefficients("B",rankG/2);
34            fi;
35        else
36            if idRealFormG>2 and idRealFormG<=(rankG+3)/2 then
37                qi:=PCoefficients("A",idRealFormG-2);
38                Append(qi,PCoefficients("A",rankG-idRealFormG+1));
39                Append(qi,[1]);
40            elif idRealFormG=(rankG+5)/2 then
41                qi:=PCoefficients("C",(rankG+1)/2);
42            elif idRealFormG=(rankG+7)/2 then
43                qi:=PCoefficients("D",(rankG+1)/2);
44            fi;
45        fi;
46    elif typeG="B" then
47        qi:=PCoefficients("D",idRealFormG-1);
48        if idRealFormG<=rankG then
49            Append(qi,PCoefficients("B",rankG-idRealFormG+1));
50        fi;
51    elif typeG="C" then
52        if RemInt(rankG,2)=0 then
53            if idRealFormG>=2 and idRealFormG<=rankG/2+1 then
54                qi:=PCoefficients("C",idRealFormG-1);
55                Append(qi,PCoefficients("C",rankG-idRealFormG+1));
56            elif idRealFormG=rankG/2+2 then
57                qi:=PCoefficients("A",rankG-1);
58                Append(qi,[1]);
59            fi;
60        else
61            if idRealFormG>=2 and idRealFormG<=(rankG+1)/2 then
62                qi:=PCoefficients("C",idRealFormG-1);
63                Append(qi,PCoefficients("C",rankG-idRealFormG+1));
64            elif idRealFormG=(rankG+3)/2 then
65                qi:=PCoefficients("A",rankG-1);
66                Append(qi,[1]);
67            fi;
68        fi;
69    elif typeG="D" then
70        if rankG=4 then
71            if idRealFormG=2 then
72                qi:=PCoefficients("A",3);
73                Append(qi,[1]);
74            elif idRealFormG=3 then
75                qi:=PCoefficients("D",2);
76                Append(qi,PCoefficients("D",2));
77            elif idRealFormG=4 then
78                qi:=PCoefficients("B",1);
79                Append(qi,PCoefficients("B",2));
80            elif idRealFormG=5 then
81                qi:=PCoefficients("B",3);
82            fi;
83        elif RemInt(rankG,2)=0 then
84            if idRealFormG>=2 and idRealFormG<=rankG/2+1 then
85                qi:=PCoefficients("D",idRealFormG-1);
86                Append(qi,PCoefficients("D",rankG+1-idRealFormG));
87            elif idRealFormG=rankG/2+2 then
88                qi:=PCoefficients("A",rankG-1);
89                Append(qi,[1]);
90            elif idRealFormG=rankG/2+3 then
91                qi:=PCoefficients("B",rankG-1);
92            elif idRealFormG>=rankG/2+4 and idRealFormG<=rankG+2 then
93                qi:=PCoefficients("B",idRealFormG-rankG/2-3);
94                Append(qi,PCoefficients("B",3*rankG/2+2-idRealFormG));
95            fi;
96        else
97            if idRealFormG>=2 and idRealFormG<=(rankG+1)/2 then
98                qi:=PCoefficients("D",idRealFormG-1);
99                Append(qi,PCoefficients("D",rankG+1-idRealFormG));
100            elif idRealFormG=(rankG+3)/2 then
101                qi:=PCoefficients("A",rankG-1);
102                Append(qi,[1]);
103            elif idRealFormG=(rankG+5)/2 then
104                qi:=PCoefficients("B",rankG-1);
105            elif idRealFormG>=(rankG+7)/2 and idRealFormG<=rankG+2 then
106                qi:=PCoefficients("B",idRealFormG-(rankG-1)/2-3);
107                Append(qi,PCoefficients("B",3*(rankG-1)/2+3-idRealFormG));
108            fi;
109        fi;
110    elif typeG="E" then
111        if rankG=6 then
112            if idRealFormG=2 then
113                qi:=PCoefficients("C",4);
114            elif idRealFormG=3 then
115                qi:=PCoefficients("A",1);
116                Append(qi,PCoefficients("A",5));
117            elif idRealFormG=4 then
118                qi:=PCoefficients("D",5);
119                Append(qi,[1]);
120            elif idRealFormG=5 then
121                qi:=PCoefficients("F",4);
122            fi;
123        elif rankG=7 then
124            if idRealFormG=2 then
125                qi:=PCoefficients("A",7);
126            elif idRealFormG=3 then
127                qi:=PCoefficients("E",6);
128                Append(qi,[1]);
129            elif idRealFormG=4 then
130                qi:=PCoefficients("A",1);
131                Append(qi,PCoefficients("D",6));
132            fi;
133        elif rankG=8 then
134            if idRealFormG=2 then
135                qi:=PCoefficients("D",8);
136            elif idRealFormG=3 then
137                qi:=PCoefficients("A",1);
138                Append(qi,PCoefficients("E",7));
139            fi;
140        fi;
141    elif typeG="F" then
142        if idRealFormG=2 then
143            qi:=PCoefficients("A",1);
144            Append(qi,PCoefficients("C",3));
145        elif idRealFormG=3 then
146            qi:=PCoefficients("B",4);
147        fi;
148    elif typeG="G" then
149        qi:=PCoefficients("B",1);
150        Append(qi,PCoefficients("B",1));
151    fi;
152    permPi:=List(SymmetricGroup(rankG), p -> Permuted(pi, p));
153    t:=Indeterminate(Rationals,"t");
154    List1:=List(permPi, i -> PCalculate(i,qi));
155    List2:=List(List1, i -> IsPolynomial(i));
156    List3:=[];
157    for i in [1..Length(List1)] do
158        if List2[i]=true then
159            Add(List3,List1[i]);
160        fi;
161    od;
162    deg:=DegreeOfLaurentPolynomial(List3[1]);
163    ListD:=[];
164    isOK:=true;
165    for i in [1..deg] do
166        isOK:=true;
167        for j in [1..Length(List3)] do
168            Coeff:=CoefficientsOfUnivariatePolynomial(List3[j]);
169            if Coeff[i+1] <> 0 then
170                isOK:=false;
171            fi;
172        od;
173        if isOK=true then
174            Add(ListD,i);
175        fi;
176    od;
177    return ListD;
178end);
179
180###############################################################################
181InstallGlobalFunction( PCoefficients, function(arg)
182local typeG, rankG, pi, i;
183    typeG:=arg[1];
184    rankG:=arg[2];
185    if typeG = "A" then
186        pi:=[0];
187        for i in [1..rankG] do
188            pi[i]:= i+1;
189        od;
190        if rankG=0 then
191            pi:=[1];
192        fi;
193        return pi;
194    elif typeG = "B" then
195        pi:=[0];
196        for i in [1..rankG] do
197            pi[i]:= 2*i;
198        od;
199        return pi;
200    elif typeG = "C" then
201        pi:=[0];
202        for i in [1..rankG] do
203            pi[i]:= 2*i;
204        od;
205        return pi;
206    elif typeG = "D" then
207        pi:=[0];
208        for i in [1..rankG-1] do
209            pi[i]:= 2*i;
210        od;
211        pi[rankG]:=rankG;
212        return pi;
213    elif typeG = "E" then
214        if rankG=6 then
215            return [2, 5, 6, 8, 9, 12];
216        elif rankG=7 then
217            return [2, 6, 8, 10, 12, 14, 18];
218        elif rankG=8 then
219            return [2, 8, 12, 14, 18, 20, 24, 30];
220        fi;
221    elif typeG = "F" and rankG=4 then
222            return [2, 6, 8, 12];
223    elif typeG = "G" and rankG=2 then
224            return [2, 6];
225    fi;
226end);
227
228###############################################################################
229InstallGlobalFunction( PCalculate, function(arg)
230local pi,qi, Pt , t, i, j;
231    t:=Indeterminate(Rationals,"t");
232    Pt:=1;
233    pi:=arg[1];
234    qi:=arg[2];
235    for j in [Length(qi)+1..Length(pi)] do
236        Pt:=Pt*(1+t^(2*pi[j]-1));
237    od;
238    for i in [1..Length(qi)] do
239        Pt:=Pt*(1-t^(2*pi[i]))/(1-t^(2*qi[i]));
240    od;
241    return Pt;
242end);
243
244###############################################################################
245InstallGlobalFunction( NonCompactDimension, function(arg)
246local G, dimG, K, dimK, dG;
247    G:=arg[1];
248    dimG:=Dimension(G);
249    K:=CartanDecomposition( G ).K;
250    dimK:= Dimension(K);
251    dG:=dimG-dimK;
252    return dG;
253end);
254
255#E  ckforms.gi  . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
256