| {"text": "#\n# cls 66: A_2\n#\nhandle66char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[66];\n info:=infos[66];\n \n rep:=Representative(o);\n #pr[19]=[0,0,1,1,1,0,0,0]\n #pr[17]=[0,1,1,1,0,0,0,0]\n #pr[37]=[1,1,1,2,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[19,17,37]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1]]);\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[19,17,37]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1]]);\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n#\n# cls 64: A_2A_1\n#\nhandle64char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[64];\n info:=infos[64];\n \n rep:=Representative(o);\n #pr[53]=[1,1,1,2,1,1,1,0]\n #pr[52]=[1,1,1,2,2,1,0,0]\n #pr[93]=[1,2,3,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[53,52,93]);\n uu:=Unipotent(chevalleyAdj(rep),[[1,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[53,52,93]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n#\n# cls 60: A_2^2\n#\nhandle60char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[60];\n info:=infos[60];\n \n rep:=Representative(o);\n #pr[43]=[0,0,1,1,1,1,1,1]\n #pr[41]=[0,1,1,1,1,1,1,0]\n #pr[79]=[1,1,1,2,2,2,2,1]\n tmp1:=ApplyRootsReflections(rep,[43,41,79]);\n uu:=Unipotent(chevalleyAdj(rep),[[1,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[43,41,79]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 57: D_4(a_1)\n#\nhandle57char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[57];\n info:=infos[57];\n \n rep:=Representative(o);\n #pr[4] =[0,0,0,1,0,0,0,0]\n #pr[51]=[1,1,2,2,1,1,0,0]\n #pr[52]=[1,1,1,2,2,1,0,0]\n tmp1:=ApplyRootsReflections(rep,[4,51,52]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[5,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,1,2,6],[-1,-1,-1,-1]);\n\n #pr[26]=[0,1,0,1,1,1,0,0]\n #pr[27]=[0,0,1,1,1,1,0,0]\n tmp3:=ApplyRootsReflections(rep,[26,27]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[2,4],[-1,-1,-1,-1]);\n \n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[4,51,52]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[5,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,1,2,6],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ApplyRootsReflections(cent,[26,27]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[2,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 53: D_4(a_1)A_1 Ross' rep\n#\nhandle53char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[53];\n info:=infos[53];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0]\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n tmp1:=ConjNegUa(tmp1,4,1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1]],Ordering(rep)); \n tmp1:=Conj(tmp1,uu); \n tmp1:=ConjugateByTori(tmp1,[2],[-1,-1,-1,-1]);\n\n #pr[65]=[1,1,2,2,1,1,1,1]\n #pr[67]=[1,1,1,2,2,1,1,1]\n tmp3:=ApplyRootsReflections(rep,[65,67,4]);\n uu:=Unipotent(chevalleyAdj(rep),[[12,-1],[11,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[1,2,4,6,8],[-1,-1,-1,-1,-1,-1]); \n \n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n tmp2:=ConjNegUa(tmp2,4,1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ApplyRootsReflections(cent,[65,67,4]);\n uu:=Unipotent(chevalleyAdj(cent),[[12,-1],[11,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[1,2,4,6,8],[-1,-1,-1,-1,-1]); \n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 52: A_3A_2 [3,4,2,6,7]\n#\nhandle52char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[52];\n info:=infos[52];\n \n rep:=Representative(o);\n\n #pr[26]=[0,1,0,1,1,1,0,0]\n #pr[27]=[0,0,1,1,1,1,0,0]\n #pr[55]=[0,1,1,2,2,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[26,27,55]);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[3,1],[6,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,6],[-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[26,27,55]);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[3,1],[6,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,6],[-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 51: A_4 [1,2,3,4]\n#\nhandle51char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[51];\n info:=infos[51];\n \n rep:=Representative(o);\n\n #pr[33]=[0,1,1,1,1,1,0,0]\n #pr[31]=[1,0,1,1,1,1,0,0]\n #pr[64]=[1,1,2,2,2,1,1,0]\n #pr[89]=[1,2,2,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,3],[2,2],[10,2],[11,-1],[17,2]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,3],[2,2],[10,2],[11,-1],[17,2]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[2]:=vals[1]+2*One(APR);\n#vals[3]:=-(vals[1]-One(APR));\n#vals[4]:=-(-vals[2]-One(APR));\n#vals[10]:=vals[1]^2+2*vals[1]+vals[9]+3*One(APR);\n#vals[11]:=-(-vals[1]-vals[9]+One(APR));\n#vals[17]:=-(-vals[1]^2+3*vals[1]+vals[16]+3*One(APR));\n# nu am terminat dar am gasit elementul\n\n\n#\n# cls 48: D_4(a_1)A_2\n#\nhandle48char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[48];\n info:=infos[48];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0] asta merge si cu rep=[2,3,10,12,7,8] urmat de ConjNegUa(tmp1,4,1)\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n tmp1:=ConjNegUa(tmp1,4,1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n tmp2:=ConjNegUa(tmp2,4,1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 47: A_4A_1\n#\nhandle47char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[47];\n info:=infos[47];\n\n rep:=Representative(o);\n\n #pr[41]=[0,1,1,1,1,1,1,0]\n #pr[39]=[1,0,1,1,1,1,1,0]\n #pr[57]=[1,1,2,2,2,1,0,0]\n #pr[89]=[1,2,2,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[41,39,57,89]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,2],[2,2],[10,3],[11,-1],[17,2]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[41,39,57,89]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,2],[2,2],[10,3],[11,-1],[17,2]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[2]:=vals[1]+2*One(APR);\n#vals[3]:=-(-vals[1]+One(APR));\n#vals[4]:=-(vals[2]+One(APR));\n#vals[10]:=-(vals[1]^2+2*vals[1]-vals[9]+3*One(APR));\n#vals[11]:=-(-vals[1]+vals[9]+One(APR));\n#vals[17]:=-(-vals[1]^2+3*vals[1]+vals[16]+3*One(APR));\n#\n# nu e gata dar am gasit elementul\n\n\n#\n# cls 45: D_5(a_1)\n#\nhandle45char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[45];\n info:=infos[45];\n \n rep:=Representative(o);\n\n #pr[82]=[1,1,2,3,3,2,1,0]\n #pr[80]=[1,2,2,3,2,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[82,80]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[12,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[82,80]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 44: A_4A_1^2\n#\nhandle44char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[44];\n info:=infos[44];\n\n rep:=Representative(o);\n\n #pr[71]=[1,1,2,2,2,2,1,0]\n #pr[72]=[1,1,2,2,2,1,1,1]\n #pr[112]=[1,3,3,5,4,3,2,1]\n #pr[111]=[2,2,3,5,4,3,2,1]\n tmp1:=ApplyRootsReflections(rep,[71,72,112,111]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,3],[2,3],[10,3],[11,-1],[17,3]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,7],[-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[71,72,112,111]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,3],[2,3],[10,3],[11,-1],[17,3]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,7],[-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[2]:=-(-vals[1]+2*One(APR));\n#vals[3]:=vals[1]+One(APR);\n#vals[4]:=-vals[2]+One(APR);\n#vals[10]:=-vals[1]^2+2*vals[1]+vals[9]+2*One(APR);\n#vals[11]:=-vals[1]-vals[9]-One(APR);\n#vals[17]:=-vals[1]^2+2*vals[1]-vals[16]+3*One(APR);\n#\n# nu e gata dar am gasit elementul\n\n#\n# cls 39: D_4A_2\n#\nhandle39char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[39];\n info:=infos[39];\n\n rep:=Representative(o);\n\n #pr[34]=[0,1,0,1,1,1,1,0]\n #pr[35]=[0,0,1,1,1,1,1,0]\n #pr[68]=[0,1,1,2,2,2,1,1]\n tmp1:=ApplyRootsReflections(rep,[34,35,68]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,2],[4,-1],[5,-1],[8,-1],[11,-1],[12,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,6,7,8],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[34,35,68]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,2],[4,-1],[5,-1],[8,-1],[11,-1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,6,7,8],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[3]:=-(-vals[2]+3*One(APR));\n#vals[4]:=-(vals[2]+One(APR));\n#vals[5]:=vals[4];\n#vals[8]:=-vals[7]-One(APR);\n#vals[11]:=-(vals[2]*vals[3]+vals[10]+One(APR));\n#vals[12]:=-(-vals[2]+vals[10]-One(APR));\n#\n# nu e gata dar am gasit elementul\n\n\n#\n# cls 38: E_6(a_3) [1,4,6,17,18,19] this doesn't work in char2\n#\nhandle38char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[38];\n info:=infos[38];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 33: D_6(a_2) \n#\nhandle33char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[33];\n info:=infos[33];\n\n rep:=Representative(o);\n\n #pr[42]=[0,1,0,1,1,1,1,0]\n #pr[43]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[42,43]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[10,1],[13,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,5,8],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[42,43]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[10,1],[13,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,5,8],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 32: E_6(a_3)A_1 [1,4,6,8,17,18,19] this doesn't work in char2\n#\nhandle32char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[32];\n info:=infos[32];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 31: E_7(a_5)\n#\nhandle31char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[31];\n info:=infos[31];\n \n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[2,3,5]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3,4],[-1,-1]);\n\n tmp3:=ConjugateByTori(rep,[2,3,5],[bbb,bbb,bbb]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[2,3,5]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3,4],[-1,-1]);\n\n tmp4:=0;\n tmp4:=ConjugateByTori(cent,[2,3,5],[bbb,bbb,bbb]);\n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n#\n# cls 29: E_8(a_7) # NOT FINISHED IN CHARACTERISTIC 5\n#\nhandle29char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[29];\n #info:=infos[29];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n #cent:=FromPositiveBorel(o,info[2]);\n #tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 27: D_6(a_1) \n#\nhandle27char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[27];\n info:=infos[27];\n\n rep:=Representative(o);\n\n #pr[42]=[0,1,0,1,1,1,1,0]\n #pr[43]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[42,43]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[42,43]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 25: E_7(a_4) [1,4,7,14,17,18,19,26] this doesn't work in char2 \n#\nhandle25char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[25];\n info:=infos[25];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 24: E_6(a_1)\n#\nhandle24char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[24];\n info:=infos[24];\n\n #pr[58]=[1,1,2,2,1,1,1,0]\n #pr[59]=[1,1,1,2,2,1,1,0]\n #pr[61]=[0,1,1,2,2,2,1,0]\n\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[58,59,61]);\n tmp1:=ConjNegUa(tmp1,4,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1],[11,-1],[12,3],[10,-1],[5,2],[6,3],[13,3],[18,-1],[19,-1],[20,2],[26,2],[27,2],[32,1],[40,3],[48,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2],[-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[58,59,61]);\n tmp2:=ConjNegUa(tmp2,4,-1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,1],[11,-1],[12,3],[10,-1],[5,2],[6,3],[13,3],[18,-1],[19,-1],[20,2],[26,2],[27,2],[32,1],[40,3],[48,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2],[-1,-1]);\n \n return [tmp1,tmp2,uu];\nend;\n#vals[2]:=vals[1]+One(APR);\n#vals[4]:=0;\n#vals[3]:=0;\n#vals[5]:=-(-vals[1]+3*One(APR));\n#vals[6]:=vals[5]+One(APR);\n#vals[10]:=-(-vals[1]+vals[5]-One(APR));\n#vals[11]:=-vals[1]-One(APR);\n#vals[12]:=-vals[2]+vals[10];\n#vals[13]:=-(2*vals[1]^2+2*vals[9]+2*One(APR));\n#vals[16]:=-(2*One(APR))^-1*(vals[1]^2+vals[1]-vals[9]);\n#vals[17]:=-vals[1]^2-vals[1]-vals[16];\n#vals[18]:=-(3*vals[1]^2+3*vals[1]+2*vals[9]-One(APR));\n#vals[19]:=vals[1]-vals[16]+One(APR);\n#vals[20]:=vals[1]^2+3*vals[1]+vals[18]+2*One(APR);\n#\n#vals[24]:=-(3*One(APR))^-1*(vals[1]^3+3*vals[1]*vals[9]-vals[1]+vals[23]);\n#vals[25]:=vals[1]^3-vals[1]*vals[9]-vals[1]+2*vals[9]+vals[23]-vals[24];\n#vals[26]:=-(2*vals[1]^2-vals[1]-vals[9]+vals[23]-One(APR));\n#vals[27]:=-vals[1]^3+vals[1]*vals[9]+2*vals[1]+2*vals[9]+vals[24]+One(APR);\n#\n#vals[30]:=-vals[1]^4+3*vals[1]^3+2*vals[1]^2*vals[9]-vals[1]^2+2*vals[1]*vals[9]-vals[9]^2-vals[23];\n#vals[32]:=vals[1]^3+2*vals[1]^2+vals[9]+vals[23]-One(APR);\n#vals[33]:=2*vals[1]^4+vals[1]^3-vals[1]^2*vals[9]+2*vals[1]*vals[9]+2*vals[1]-vals[23]+vals[24]+vals[25]-vals[27]+vals[30]-vals[31]+One(APR);\n#vals[37]:=-(vals[1]^4+3*vals[1]^3+2*vals[1]^2*vals[9]+vals[1]^2-vals[1]*vals[9]+vals[9]^2-vals[1]-vals[9]+2*vals[23]+vals[31]);\n#\n#vals[40]:=2*vals[1]^4-vals[1]^3+3*vals[1]^2*vals[9]+3*vals[1]*vals[9]+2*vals[1]-vals[9]+vals[37]-One(APR);\n#vals[44]:=-(vals[1]^4+3*vals[1]^3*vals[9]+2*vals[1]^3+2*vals[1]^2*vals[9]+2*vals[1]*vals[9]^2+vals[1]^2-vals[1]*vals[9]+vals[23]-vals[38]);\n#vals[48]:=3*vals[1]^5+3*vals[1]^3*vals[9]+3*vals[1]^3+vals[1]^2*vals[9]+vals[1]*vals[9]+vals[9]^2+2*vals[1]+2*vals[9]+vals[23]+vals[37]-vals[38]+vals[45]+3*One(APR);\n#\n#vals[51]:=-(3*vals[1]^3*vals[9]+2*vals[1]^3*vals[23]-vals[1]^2*vals[9]^2+3*vals[1]^2*vals[9]-vals[1]*vals[23]-vals[9]^2+2*vals[9]*vals[23]-vals[23]^2+vals[38]);\n#\n# nu e gata dar am gasit elementul\n\n\n#\n# cls 23: D_5A_2 \n#\nhandle23char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[23];\n info:=infos[23];\n\n rep:=Representative(o);\n\n #pr[87]=[1,1,2,3,3,2,1,1]\n #pr[86]=[1,2,2,3,2,2,1,1]\n #pr[119]=[2,3,4,6,5,4,3,1]\n tmp1:=ApplyRootsReflections(rep,[87,86,119]);\n uu:=Unipotent(chevalleyAdj(rep),[[8,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,4,7],[-1,-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[87,86,119]);\n uu:=Unipotent(chevalleyAdj(cent),[[8,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,4,7],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 20: D_7(a_2)\n#\nhandle20char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[20];\n info:=infos[20];\n\n rep:=Representative(o);\n\n #pr[113]=[2,3,3,5,4,3,2,1]\n #pr[114]=[2,2,4,5,4,3,2,1]\n tmp1:=ApplyRootsReflections(rep,[113,114]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[11,-1],[13,-1],[20,-1],[27,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[5,6],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[113,114]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[11,-1],[13,-1],[20,-1],[27,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[5,6],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 18: E_6(a_1)A_1\n#\nhandle18char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[18];\n info:=infos[18];\n\n #pr[106]=[1,2,2,4,4,3,2,1]\n #pr[105]=[1,2,3,4,3,3,2,1]\n #pr[104]=[2,2,3,4,3,2,2,1]\n\n # this is for E_6(a_1)A_1\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[106,105,104]);\n tmp1:=ConjNegUa(tmp1,4,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1],[11,1],[12,2],[5,3],[10,-1],[6,2],[13,3],[18,-1],[19,-1],[20,2],[26,1],[27,3],[32,1],[40,2]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,2,3,5,6],[-1,-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[106,105,104]);\n tmp2:=ConjNegUa(tmp2,4,-1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,1],[11,1],[12,2],[5,3],[10,-1],[6,2],[13,3],[18,-1],[19,-1],[20,2],[26,1],[27,3],[32,1],[40,2]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,2,3,5,6],[-1,-1,-1,-1,-1]);\n \n return [tmp1,tmp2,uu];\nend;\n#vals[2]:=-(vals[1]-One(APR));\n#vals[4]:=0;\n#vals[3]:=0;\n#vals[5]:=vals[1]+3*One(APR);\n#vals[6]:=-(-vals[5]+One(APR));\n#vals[10]:=-(vals[1]-vals[5]-One(APR));\n#vals[11]:=-(vals[1]-One(APR));\n#vals[12]:=vals[2]-vals[10];\n#vals[13]:=-(2*One(APR))^-1*(-vals[1]^2-vals[9]-One(APR));\n#\n#vals[16]:=3*vals[1]+vals[9]-vals[13]+3*One(APR);\n#vals[17]:=-(-vals[1]^2+vals[1]-vals[16]);\n#vals[18]:=-vals[16]-One(APR);\n#vals[19]:=-(-vals[1]^2+2*vals[1]+vals[9]-vals[16]-One(APR));\n#vals[20]:=vals[1]^2+2*vals[1]-vals[18]+2*One(APR);\n#vals[23]:=-(3*One(APR))^-1*(vals[1]^3+2*vals[1]^2+3*vals[1]*vals[9]-vals[1]+2*vals[9]+vals[13]+2*One(APR));\n#vals[24]:=-(3*One(APR))^-1*(3*vals[1]^3-vals[1]*vals[9]+2*vals[1]);\n#vals[25]:=-(vals[1]^3+vals[1]^2-vals[1]*vals[9]-vals[1]+vals[9]-vals[16]+vals[17]+vals[19]-vals[23]-vals[24]-One(APR));\n#vals[26]:=-vals[1]+3*vals[9]+vals[13]-vals[23]+3*One(APR);\n#vals[27]:=-(vals[1]^3-vals[1]*vals[9]+3*vals[1]+2*vals[9]-vals[24]+One(APR));\n#\n#vals[30]:=-(2*vals[1]^3-vals[1]^2*vals[9]+vals[1]^2*vals[13]+vals[1]^2+3*vals[1]*vals[9]+vals[9]*vals[13]-vals[13]^2+2*vals[9]+vals[13]-vals[23]+One(APR));\n#vals[32]:=-(vals[1]^3+3*vals[1]^2-vals[9]-vals[23]+One(APR));\n#vals[33]:=-(-vals[1]^4+vals[1]^3+vals[1]^2*vals[9]+vals[1]^2*vals[13]+2*vals[1]^2+2*vals[1]*vals[9]-vals[1]*vals[13]+2*vals[1]+2*vals[9]+vals[27]-vals[30]-vals[31]+One(APR));\n#vals[37]:=vals[1]^4+3*vals[1]^3+2*vals[1]^2*vals[9]+vals[1]^2-vals[1]*vals[9]+vals[9]^2-vals[9]-vals[23]+vals[31];\n#\n#vals[40]:=-(2*vals[1]^3+vals[1]^2*vals[9]-vals[1]^2*vals[13]-vals[1]^2+3*vals[1]*vals[9]+3*vals[1]*vals[13]-vals[1]+3*vals[13]-vals[37]);\n#\n#vals[44]:=-vals[1]^4+3*vals[1]^3*vals[9]-vals[1]^3+3*vals[1]^2*vals[9]+2*vals[1]*vals[9]^2-vals[1]^2+3*vals[1]+3*vals[23]+vals[38];\n#\n#vals[48]:=-(3*vals[1]^5+3*vals[1]^3*vals[9]-vals[1]^2*vals[9]+2*vals[1]*vals[9]-vals[9]^2+3*vals[9]+3*vals[23]+vals[37]+vals[38]-vals[45]+2*One(APR));\n#\n#vals[51]:=-vals[1]^6+2*vals[1]^4*vals[9]-vals[1]^4+3*vals[1]^3*vals[9]+2*vals[1]^3*vals[23]+3*vals[1]^3*vals[24]-vals[1]^2*vals[9]^2+2*vals[1]^2*vals[9]+3*vals[1]*vals[9]^2+3*vals[1]*vals[9]*vals[23]-vals[1]*vals[9]*vals[24]+2*vals[1]^2-vals[1]*vals[9]+vals[1]*vals[23]+2*vals[1]*vals[24]-vals[9]^2-vals[9]*vals[23]+3*vals[23]*vals[24]-vals[24]^2+vals[38];\n#\n# nu e gata dar am gasit elementul\n\n\n#\n# cls 17: E_7(a_3) ([1,4,6,7,15,16,17] in E_7) [1,4,6,7,17,18,19] in E_8 this doesn't work in char2 \n#\nhandle17char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[17];\n info:=infos[17];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 16: E_8(b_6)\n#\nhandle16char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[16];\n info:=infos[16];\n \n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[1,2,5]);\n uu:=Unipotent(chevalleyAdj(rep),[[23,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,3,4,8],[-1,-1,-1,-1]);\n\n tmp3:=ConjugateByTori(rep,[1,2,5],[bbb,bbb,bbb^2]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[1,2,5]);\n uu:=Unipotent(chevalleyAdj(cent),[[23,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,3,4,8],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ConjugateByTori(cent,[1,2,5],[bbb,bbb,bbb^2]);\n \n return [tmp1,tmp3,tmp2,tmp2];\nend;\n\n#\n# cls 15: D_7(a_1)\n#\nhandle15char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[15];\n info:=infos[15];\n\n rep:=Representative(o);\n\n #pr[113]=[2,3,3,5,4,3,2,1]\n #pr[114]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[113,114]);\n #uu:=Unipotent(chevalleyAdj(rep),[[4,1],[10,-1]],Ordering(rep)); si asta merge\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,3,4],[3*One(APR),3*One(APR),-1]);\n #tmp1:=ConjugateByTori(tmp1,[2,3,4],[ccc,ccc,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[113,114]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,3,4],[3*One(APR),3*One(APR),-1]);\n #tmp2:=ConjugateByTori(tmp2,[2,3,4],[ccc,ccc,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 12: E_8(a_6)\n#\nhandle12char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu,vars;\n o:=Classes(orbs)[12];\n info:=infos[12];\n\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[2,3,8,13]);\n uu:=Unipotent(chevalleyAdj(rep),[[18,-1],[29,-1],[31,1],[33,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,3,4,5,7,8],[-1,-1,-1,-1,-1,-1]);\n\n #tmp3:=ConjugateByTori(rep,[2,3,5,6,8],[aaa,aaa,aaa,aaa,aaa^2]);\n tmp3:=ConjugateByTori(rep,[2,3,5,6,8],[bbb,bbb,bbb,bbb,bbb^2]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[2,3,8,13]);\n uu:=Unipotent(chevalleyAdj(cent),[[18,-1],[29,-1],[31,1],[33,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,3,4,5,7,8],[-1,-1,-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ConjugateByTori(cent,[2,3,5,6,8],[bbb,bbb,bbb,bbb,bbb^2]);\n\t \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n#\n# cls 10: E_8(b_5)\n#\nhandle10char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[10];\n info:=infos[10];\n\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[1,2,5]);\n uu:=Unipotent(chevalleyAdj(rep),[[19,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,3,4],[-1,-1,-1]);\n\n tmp3:=ConjugateByTori(rep,[1,2,5],[bbb,bbb,bbb^2]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[1,2,5]);\n uu:=Unipotent(chevalleyAdj(cent),[[19,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,3,4],[-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ConjugateByTori(cent,[1,2,5],[bbb,bbb,bbb^2]);\n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n# For representative deduced from Seitz' E_8(a_6) used in proof\n#\n# cls 8: E_8(a_5)\n#\nhandle8char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[8];\n info:=infos[8];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[4,6,7],[-1,-1,-1,-1]);# should be Z(D_8)\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[4,6,7],[-1,-1,-1,-1]);# should be Z(D_8)\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 7: E_8(b_4) [1,4,7,8,14,17,19,26] this doesn't work in char2\n#\nhandle7char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[7];\n info:=infos[7];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 5: E_8(a_4) [1,4,6,8,17,18,19,21] this doesn't work in char2 \n#\nhandle5char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[5];\n info:=infos[5];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[4,8],[-1,-1]);# h_4, h_8\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[4,8],[-1,-1]); # h_4, h_8\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 4: E_8(a_3) [1,4,6,7,8,17,18,19] this doesn't work in char2 \n#\nhandle4char5:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[4];\n info:=infos[4];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n", "meta": {"hexsha": "76811d19fe00ba63e261650130e4096f6194bfee", "size": 28648, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/E8char5.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/E8char5.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/E8char5.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 29.9979057592, "max_line_length": 357, "alphanum_fraction": 0.5865330913, "num_tokens": 12683, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5813030906443133, "lm_q2_score": 0.4225046348141882, "lm_q1q2_score": 0.24560325002903452}} |
| {"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nFunctionEquality:=(a,b)-> (a=b) or (a.n=b.n and a.N=b.N and let(func1:=a.lambda(), func2:=b.lambda(), \n\tForAll([1..a.N],e->func1.at(e).ev()=func2.at(e).ev())));\n\n#######################################################\n######## Redesigning the ruleset \n#######################################################\n\nClass(OLScatFuseRules, RuleSet);\nRewriteRules(OLScatFuseRules, rec(\n Scat_ScatAcc := ARule(Compose,[@(1,[Scat, ScatAcc]),@(2,ScatAcc)],\n e->[ScatAcc(fCompose(@(1).val.func,@(2).val.func))]),\n\n ScatAcc_Scat := ARule(Compose,[@(1,ScatAcc),@(2,[Scat, ScatAcc])],\n e->[ScatAcc(fCompose(@(1).val.func,@(2).val.func))]),\n\n \n ICScatAcc_Scat := ARule(Compose,[@(1,ICScatAcc),@(2,[Scat, ICScatAcc])],\n e->[ICScatAcc(fCompose(@(1).val.func,@(2).val.func))]),\n\n Prm_ScatQuestionMark := ARule(Compose, [ @(1, Prm), @(2, ScatQuestionMark) ],\n e -> [ ScatQuestionMark(fCompose(@(1).val.inverse, @(2).val.func)) ]),\n\n\n Prm_ICScatAcc := ARule(Compose, [ @(1, Prm), @(2, ICScatAcc) ],\n e -> [ ICScatAcc(fCompose(@(1).val.inverse, @(2).val.func)) ]),\n\n\n ScatQuestionMark_ScatQuestionMark := \n ARule(Compose, [ @(1, ScatQuestionMark), @(2, ScatQuestionMark) ], \n e -> [ ScatQuestionMark(fCompose(@(1).val.func, @(2).val.func)) ]),\n\n Kill_NoPullId :=\n ARule(Compose,[[NoPull,[Prm,@,fId,fId]]],e->[]),\n\n Kill_ComposeIdL :=\n ARule(Compose,[@(1),[Prm,@,fId,fId]],e->[@(1).val]),\n\n Kill_ComposeIdR :=\n ARule(Compose,[[Prm,@,fId,fId],@(1).val],e->[@(1).val]),\n\n# Rule([@(1,Compose,e->Length(e.rChildren())>1),...,[Prm,@,fId,fId],...],e->Error(\"kill id\")),\n\n \n\n));\n\nClass(OLVectorScatFuseRules, RuleSet);\nRewriteRules(OLVectorScatFuseRules, rec(\n VScat_VConstruct := \n ARule(Compose, [ @(1, VScat), @(2, [VScatAcc,VScatQuestionMark], e->@(1).val.v=e.v) ], \n e -> [ ObjId(@(2).val)(fCompose(@(1).val.func, @(2).val.func), @(1).val.v) ]),\n\n VScatQuestionMark_VConstruct := \n ARule(Compose, [ @(1, VScatQuestionMark), @(2, [VScat,VScatAcc,VScatQuestionMark], e->@(1).val.v=e.v) ], \n e -> [ ObjId(@(1).val)(fCompose(@(1).val.func, @(2).val.func), @(1).val.v) ]),\n \n VScatAcc_VConstruct := \n ARule(Compose, [ @(1, VScatAcc), @(2, [VScat,VScatAcc], e->@(1).val.v=e.v) ], \n e -> [ VScatAcc(fCompose(@(1).val.func, @(2).val.func), @(1).val.v) ]),\n \n ##The following rules are copies of the ones in the subvector system\n ScatQuestionMark_VConstruct := ARule(Compose, [ @(1, ScatQuestionMark), @(2, [VScat,VScatQuestionMark]) ],\n e -> [ VScat_svQuestionMark(@(1).val.func, getV(@(2).val), 1), @(2).val ]),\n\n ScatAcc_VConstruct := ARule(Compose, [ @(1, ScatAcc), @(2, [VScat,VScatAcc, VScatQuestionMark]) ],\n e -> [ VScat_svAcc(@(1).val.func, getV(@(2).val), 1), @(2).val ]),\n\n VScat_svQuestionMark__VScat := ARule(Compose, [@(1,[VScat_svQuestionMark,VScat_svAcc]), @(2,VScat)],\n e -> let(func := @(1).val.func, vfunc := @(2).val.func,\n v := getV(@(1).val), sv := @(1).val.sv,\n [ ObjId(@(1).val)(fCompose(func, fTensor(vfunc, fId(v/sv))), v, sv) ])),\n\n GathScat_svQuestionMark_fTensor := Rule([@(1, [VGath_sv, VScat_svQuestionMark,VScat_svAcc]),\n [@(2,fTensor), ..., [fId, @(3).cond(e -> Gcd(@(1).val.v/\n@(1).val.sv, e) = @(1).val.v)]]],\n e -> let(v := @(1).val.v, sv := @(1).val.sv,\n n := @(3).val, gcd := Gcd(v / sv, n),\n ObjId(@(1).val)(fTensor(DropLast(@(2).val.children(), 1), fId(n/gcd)), v, sv*gcd))),\n\n GathScat_sv_H := Rule([@(1, [VGath_sv, VScat_sv, VScat_svAcc]), [H, @(2),@(3).cond(e -> Gcd(@(1).val.v/\n@(1).val.sv, e) = @(1).val.v),@(4),@(5)]],\n e->let(v := @(1).val.v, sv := @(1).val.sv,\n n := @(3).val, gcd := Gcd(v / sv, n),\n mydiv:=When(IsSymbolic(@(4).val),idiv(@(4).val,gcd),@(4).val/gcd),\n ObjId(@(1).val)(H(@(2).val/gcd,n/gcd,mydiv,@(5).val), v, sv*gcd))),\n \n VScat_svQuestionMark__VScatQuestionMark := ARule(Compose, [@(1,[VScat_svQuestionMark,VScat_svAcc]), @(2,VScatQuestionMark)],\n e -> let(func := @(1).val.func, vfunc := @(2).val.func,\n v := getV(@(1).val), sv := @(1).val.sv,\n [ ObjId(@(1).val)(fCompose(func, fTensor(vfunc, fId(v/sv))), v, sv) ])),\n \n VScat_svAcc__VScatAcc := ARule(Compose, [@(1,[VScat_svQuestionMark,VScat_svAcc]), @(2,VScatAcc)],\n e -> let(func := @(1).val.func, vfunc := @(2).val.func,\n v := getV(@(1).val), sv := @(1).val.sv,\n [ VScat_svAcc(fCompose(func, fTensor(vfunc, fId(v/sv))), v, sv) ])),\n\n\n VScat_svQuestionMark_to_VScatQuestionMark := \n Rule(@(1,VScat_svQuestionMark,e->getV(e)=e.sv), e->VScatQuestionMark(@(1).val.func, @(1).val.v)), \n\n VScat_svAcc_to_VScatAcc := \n Rule(@(1,VScat_svAcc,e->getV(e)=e.sv), e->VScatAcc(@(1).val.func, @(1).val.v)), \n\n));\n\nClass(OLVectorPropagateRules, RuleSet);\nRewriteRules(OLVectorPropagateRules, rec(\n VTensorOL_ScatAcc := \n Rule([@(1,VTensor_OL),[@(2,Compose),@(3,ScatAcc),...]],\n e->VScatAcc(@(3).val.func,@(1).val.vlen)*\n VTensor_OL(Compose(Drop(@(2).val._children,1)),@(1).val.vlen)),\n\n VTensorOL_ScatQuestionMark := \n Rule([@(1,VTensor_OL),[@(2,Compose),@(3,ScatQuestionMark),...]],\n e->VScatQuestionMark(@(3).val.func,@(1).val.vlen)*\n VTensor_OL(Compose(Drop(@(2).val._children,1)),@(1).val.vlen)),\n \n VTensorOL_Cross := \n Rule([@(1,VTensor_OL),[@(2,Compose),...,@(3,Cross)]],\n e->VTensor_OL(Compose(DropLast(@2.val._children,1)),@(1).val.vlen)*\n Cross(List(@(3).val._children,t->VTensor(t,@(1).val.vlen)))),\n \n VTensorOL_ISum := Rule([@(1, VTensor_OL), @(2, [ISum])],\n e -> let(s := @(2).val, CopyFields(s,\n rec(_children := List(s.children(), c->VTensor_OL(c, @(1).val.vlen)))))),\n\n VTensor_I :=\n Rule([@(1,VTensor),@(2,I)],\n e->VTensor(Prm(fId(@(2).val.dimensions[1])),@(1).val.vlen)),\n\n));\n\nOLVectorPropagateRuleset := MergedRuleSet(OLVectorPropagateRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\nClass(OLPushScatQuestionMarkInRules, RuleSet);\nRewriteRules(OLPushScatQuestionMarkInRules, rec(\n ScatQuestionMark_NoPullRight := ARule(Compose, [@(1, [ScatQuestionMark,VScatQuestionMark]),@(2,NoPullRight)],\n e -> [ NoPullRight(@(1).val * @(2).val.rChildren()[1])]),\n\n ScatQuestionMark_Isum := ARule(Compose, [@(1, [ScatQuestionMark,VScatQuestionMark]), @(2,ISum)],\n e-> [ ISum(@(2).val.var,@(2).val.domain,Compose(@(1).val,@(2).val._children))]),\n));\n\nOLPushScatQuestionMarkInRuleset := MergedRuleSet(OLPushScatQuestionMarkInRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\nClass(OLAlreadyInitializedScatQuestionMarkRules, RuleSet);\nRewriteRules(OLAlreadyInitializedScatQuestionMarkRules, rec(\n AlreadyInitializedScatQuestionMark := Rule(@(1, [ScatQuestionMark]),\n e-> ScatAcc(@(1).val.func)),\n\n AlreadyInitializedVScatQuestionMark := Rule(@(1, [VScatQuestionMark]),\n e-> VScatAcc(@(1).val.func,@(1).val.v)),\n));\n\nClass(OLScatQuestionMarkToScat, RuleSet);\nRewriteRules(OLScatQuestionMarkToScat, rec(\n ScatQuestionMarkToScat := Rule(@(1, [ScatQuestionMark]),\n e-> Scat(@(1).val.func)),\n\n VScatQuestionMarkToScat := Rule(@(1, [VScatQuestionMark]),\n e-> VScat(@(1).val.func,@(1).val.v)),\n));\n\n\n\n\nClass(OLQuickAndDirtyHackForCodelet, RuleSet);\nRewriteRules(OLQuickAndDirtyHackForCodelet, rec(\n ScatAcc_NoPullRight := ARule(Compose, [@(1, [ScatAcc,VScatAcc]),@(2,NoPullRight)],\n e -> [ NoPullRight(@(1).val * @(2).val.rChildren()[1])]),\n\n ScatAcc_Isum := ARule(Compose, [@(1, [ScatAcc, VScatAcc]), @(2,ISum)\n],\n e-> [ ISum(@(2).val.var,@(2).val.domain,Compose(@(1).val,@(2).val._children))]),\n));\n\nOLAlreadyInitializedScatQuestionMarkRuleset := MergedRuleSet(OLAlreadyInitializedScatQuestionMarkRules,\n StandardSumsRules, OLScatFuseRules, OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\nClass(OLSplitScatQuestionMarkRules, RuleSet);\nRewriteRules(OLSplitScatQuestionMarkRules, rec(\n\n SplitScatQuestionMark := Rule(@(1, [ScatQuestionMark]),\n e-> ScatInit(@(1).val.func , [],ScatAcc(@(1).val.func))),\n\n PullScatInitOutOfCompose := Rule([@(1,Compose),@(2,ScatInit),...],\n e-> ScatInit(@(2).val.func,@(2).val.cond,\n Compose(@(2).val._children,Drop(@(1).val._children,1)))),\n\n PullScatInitOutOfISum := Rule([@(1,ISum),@(2,ScatInit)],\n e->When(@(1).val.var in @(2).val.func.free(), \n ScatInitProbe(@(2).val.func,@(2).val.cond,\n ISum(@(1).val.var,@(1).val.domain,\n ScatInitFixed(@(2).val.func,@(2).val.cond,@(2).val._children))), \n ScatInit(@(2).val.func,@(2).val.cond,\n ISum(@(1).val.var,@(1).val.domain,@(2).val._children)))),\n\n PullScatInitProbeOutOfCompose := Rule([@(1,Compose),@(2,ScatInitProbe),...],\n e-> ScatInitProbe(@(2).val.func,@(2).val.cond,\n Compose(@(2).val._children,Drop(@(1).val._children,1)))),\n\n PullScatInitProbeOutOfISum := Rule([@(1,ISum),@(2,ScatInitProbe)],\n e->When(@(1).val.var in @(2).val.func.free(),\n ScatInitProbe(@(2).val.func,@(2).val.cond,\n ISum(@(1).val.var,@(1).val.domain,@(2).val._children)),\n ScatInitProbe(@(2).val.func,Concatenation([@(1).val.var],@(2).val.cond),\n ISum(@(1).val.var,@(1).val.domain,@(2).val._children)))),\n\n\n));\nOLSplitScatQuestionMarkRuleset := MergedRuleSet(OLSplitScatQuestionMarkRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\nClass(OLScatProbeMergeRules, RuleSet);\nRewriteRules(OLScatProbeMergeRules, rec(\n\n PushScatInitProbeInsideSum := Rule([@(1,ScatInitProbe),@(2,ISum),@],\n e->ISum(@(2).val.var,@(2).val.domain,\n ScatInitProbe(@(1).val.func,@(1).val.cond,Compose(@(2).val._children)))),\n\n PushScatInitProbeInsideCompose := Rule([@(1,ScatInitProbe),@(2,Compose),@],\n e-> Compose([ScatInitProbe(@(1).val.func,@(1).val.cond,@(2).val._children[1]),\n Drop(@(2).val._children,1)])),\n\n ScatInit_Cross := ARule(Compose, [@(1,[ScatInit]), @(2, [Cross])],\n e-> [ ScatInit(@(1).val.func,@(1).val.cond,Compose(@(1).val._children,@(2).val))]),\n\n ScatInitProbe_ScatInitFixed := Rule([@(1,ScatInitProbe),@(2,ScatInitFixed),@],\n e->When(@(1).val.func=@(2).val.func, \n ScatInit(@(1).val.func,@(1).val.cond,@(2).val._children),\n Error(\"ScatInitProbe doesn t remerge with ScatInitFixed, how did that happen?\"))),\n\n PushScatInitInsideCompose := Rule([@(1,ScatInit),@(2,Compose),@],\n e-> Compose([ScatInit(@(1).val.func,@(1).val.cond,@(2).val._children[1]),\n Drop(@(2).val._children,1)])),\n\n ScatInit_ScatAcc := \n Rule([@(1,ScatInit,e->ObjId(e._children)=ScatAcc and e.func=e._children.func and e.cond=[]),@(2,ScatAcc),@],\n e-> Scat(@(1).val.func)),\n));\n\nOLScatProbeMergeRuleset := MergedRuleSet(OLScatProbeMergeRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\nClass(OLScatAccPeelRules, RuleSet);\nRewriteRules(OLScatAccPeelRules, rec(\n ScatInitPeel := Rule(\n [@(1,ScatInit, e->e.cond=[]),\n [@(2,ISum), [@(3,Compose), \n @(4,ScatAcc,e->FunctionEquality(e.func,@(1).val.func)), ... ]],@],\n\n\te-> let(v := @(2).val.var, newv := Ind(v.range-1), \n#x Buf(Scat(fId(@(1).val.dims()[1]))) * \n SUM(SubstVars(\n Scat(@(4).val.func) * Compose(Drop(Copy(@(3).val.children()),1)),\n rec((v.id) := V(0))),\n Cond(@(2).val.domain=2,\n SubstVars(@(2).val.child(1),rec((v.id) := V(1))),\n SubstVars(\n ISum(newv, @(2).val.domain-1, @(2).val.child(1)),\n rec((v.id) := newv+1)))\n )))\n));\n\nOLScatAccPeelRuleset := MergedRuleSet(OLScatAccPeelRules,StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\n\nClass(OLCrossPullInRules, RuleSet);\nRewriteRules(OLCrossPullInRules, rec(\n PullInSMPSumRight := ARule( Compose, [ @(1, [Prm, Scat]), @(2, [SMPSum]) ],\n e -> [ CopyFields(@(2).val, rec(\n _children := List(@(2).val._children, c -> @(1).val * c),\n dimensions := [Rows(@(1).val), Cols(@(2).val)] )) ]),\n\n SMPSum_Cross := ARule(Compose, [ @(1, [SMPSum]), @(2, [Cross]) ],\n e -> [ ObjId(@(1).val)(@(1).val.p,@(1).val.var, @(1).val.domain, @(1).val.child(1) * @(2).val) ]),\n\n ISum_Cross := ARule(Compose, [ @(1, [ISum, ISumAcc]), @(2, [Cross]) ],\n e -> [ ObjId(@(1).val)(@(1).val.var, @(1).val.domain, @(1).val.child(1) * @(2).val) ]),\n\n SUM_Cross := ARule(Compose, [ @(1, [SUM]), @(2, [Cross]) ],\n e -> [ ObjId(@(1).val)(List(@(1).val._children,x->x*@(2).val)) ]),\n\n ScatAcc_RecursStep := ARule(Compose, [ @(1, [ScatAcc]), @(2, [RecursStep]) ],\n e -> [ RecursStep(@2.val.yofs, @2.val.xofs, \n @(1).val* @2.val.child(1)).attrs(@(1).val) ]),\n\n RecursStep_Cross := ARule(Compose, [ @(1, [RecursStep]), @(2, [Cross]) ],\n e -> [ RecursStep(@1.val.yofs, @1.val.xofs, \n @1.val.child(1) * @(2).val).attrs(@(1).val) ]),\n\n Cross_Cross := ARule(Compose, [ @(1, [Cross, CrossBlockTop]), @(2, [Cross]) ],\n e -> [ ObjId(@(1).val)(@(1).val.child(1) * @(2).val.child(1),\n @(1).val.child(2) * @(2).val.child(2)).attrs(@(1).val) ]),\n\n CrossBlockTopPass := Rule(@(1,CrossBlockTop,e->not((ObjId(e.rChildren()[2])=Prm) and \n ObjId(e.rChildren()[2].rChildren()[2])=fId and \n ObjId(e.rChildren()[2].rChildren()[3])=fId)),\n e->Cross(Prm(fId(@(1).val.rChildren()[1].dims()[1])),@(1).val.rChildren()[2])*\n CrossBlockTop(@(1).val.rChildren()[1],\n Prm(fId(@(1).val.rChildren()[2].dims()[2])))\n )\n));\n\nOLCrossPullInRuleset := MergedRuleSet(OLCrossPullInRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate);\n\n\nClass(OLAfterCrossPullInRuleset, RuleSet);\nRewriteRules(OLAfterCrossPullInRuleset, rec(\n Cross_CompatibleISum := Rule([Cross, @(1, ISum), @(2, ISum,e->e.domain=@(1).val.domain) ],\n function(e)\n local varmap, var;\n varmap:=tab();\n var:=@(2).val.var;\n varmap.(var.id):=@(1).val.var;\n return ISum(@(1).val.var, @(1).val.domain, \n Cross(@(1).val.rChildren()[1],SubstVars(@(2).val.rChildren()[1],varmap)));\n end)\n));\n\n\nClass(OLTearCrossRules, RuleSet);\nRewriteRules(OLTearCrossRules, rec(\n# FullTearVGath_dup:=ARule(Cross,[@(1,VGath_dup)],e->[VGath(@(1).val.func,@(1).val.v)*VGath_dup(fId(@(1).val.func.range()),@(1).val.v)]),\n\n#HACK, of course\n HalfTearVGath_dup:=Rule([@(1,VGath_dup),[@(2,fTensor),@(3,fBase),fBase,...]],e->\n let(func:=fTensor(Drop(Copy(@(2).val.rChildren()),1)),\n VGath(func,@(1).val.v)*\n VGath_dup(fTensor(@(3).val,fId(func.range())),@(1).val.v))),\n\n\n TearCross:=ARule(Compose,[@(1,Cross,e->e.hasRightScat() and e.hasLeftGath())],\n e->[Copy(@(1).val.splitCross()[1]),Copy(@(1).val.splitCross()[2])]),\n\n PushCrossOutOfIsum := \n Rule([@(1,ISum), @(2,Compose,e->ObjId(Last(e.rChildren()))=Cross and\n Last(e.rChildren()).hasRightScat() and not Last(e.rChildren()).hasLeftGath())],\n e->Compose(ISum(@(1).val.var, @(1).val.domain, \n Compose(DropLast(@(2).val.rChildren(),1))),Last(@(2).val.rChildren()))),\n\n# PushCrossOutOfSMPSum := \n# Rule([@(1,SMPSum), @(2), @(3,Compose,e->ObjId(Last(e.rChildren()))=Cross and\n# Last(e.rChildren()).hasRightScat() and not Last(e.rChildren()).hasLeftGath())],\n#\n# e->Compose(SMPSum(@(2).val,@(1).val.var, @(1).val.domain, \n# Compose(DropLast(@(3).val.rChildren(),1))),Last(@(3).val.rChildren()))),\n\n CrossConditionalMerge := \n ARule(Compose, [ @(1, Cross), @(2, Cross, e->e.hasRightScat() and \n @(1).val.hasRightScat() and not(@(1).val.hasLeftGath()) and not(e.hasLeftGath())) ],\n e -> [ ObjId(@(1).val)(@(1).val.child(1) * @(2).val.child(1),@(1).val.child(2) * \n @(2).val.child(2)).attrs(@(1).val) ]),\n));\n\nOLTearCrossRuleset := MergedRuleSet(OLTearCrossRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec);\n\nClass(OLSingleComposeRuleset, RuleSet);\nRewriteRules(OLSingleComposeRuleset, rec(\n SingleCompose := Rule([@(1,Compose),@(2)],e->@(2).val),\n));\n\nClass(OLDropVGath_dupRuleset, RuleSet);\nRewriteRules(OLDropVGath_dupRuleset, rec(\n DropVGath_dup := Rule(@(1,VGath_dup),e->VGath(@(1).val.func,@(1).val.v))\n));\n\nClass(OLDropSMPSumRuleset, RuleSet);\nRewriteRules(OLDropSMPSumRuleset, rec(\n DropSMPSum := Rule(@(1,SMPSum),e->ISum(@(1).val.var,@(1).val.domain,@1.val.rChildren()[2]))\n));\n\n\n######### HACCCK !!!\nClass(OLMagicVUnrollDupRuleset, RuleSet);\nRewriteRules(OLMagicVUnrollDupRuleset, rec(\n# MagicVGath_dup := Rule(@(1,VGath_dup,e->e.func.domain()>128 and e.func.domain() mod (32*4)=0),\n# e->let(itid:=Ind(4),idx:=Ind(@(1).val.func.domain()/(32*4)),\n# SMPSum(4,itid,4,\n# ISum(idx,@(1).val.func.domain()/(32*4),\n# VScat(fTensor(fBase(itid),fBase(idx),fId(32)), 2)*\n# VGath_dup(fTensor(fBase(itid),fBase(idx),fId(32)), 2))),\n\n MagicVGath_dup := Rule(@(1,VGath_dup,e->e.func.domain()>32),\n e->@(1).val.toloop(32))\n));\n\n \n\n#Class(OLLiftBarrierRuleset, RuleSet);\n#RewriteRules(OLLiftBarrierRuleset, rec(\n# EliminateBarrier := ARule(Compose, [@(1,RewriteBarrier),@(2)],\n# e->[@(2).val]),\n#));\n\nOLDefaultStrategy := [TerminateSymSPL,RulesTerm];\n\n#################################################################\nClass(OLRulesCode, RuleSet);\nRewriteRules(OLRulesCode, rec(\n\n #Cross must not be BBized without neighbours if it has some identities \n CrossBB_in := Rule([BB,[@(1,Cross),...,[Prm,@,fId,fId],...]],\n e->Cross(List(@(1).val.rChildren(),x->BB(x)))\n ),\n\n DoubleBB := Rule([BB,@(1,BB)],e->@(1).val),\n\n #BB should go out if the inner are not Ids (simplified to perms in this case)\n Cross_BB_out := Rule([Cross, @(1, BB,e->not(ObjId(e.rChildren()[1])=Prm)), @(2, BB,e->not(ObjId(e.rChildren()[1])=Prm)) ], \n e -> BB(Cross(@(1).val.child(1),@(2).val.child(1)))),\n\n Drop_NoPull := Rule(@(1,NoPull),e->@(1).val.rChildren()[1]),\n\n));\n\n\n\nClass(OLRulesBufferFinalize, RuleSet);\nRewriteRules(OLRulesBufferFinalize, rec(\n FinalizeNoPull := Rule(@(1, [NoPull, NoPullLeft, NoPullRight]), i->@1.val.child(1)),\n DropCrossBlockTop := Rule(@(1,CrossBlockTop), e->Cross(@1.val.rChildren()))\n));\n\n\n#RewriteRules(RulesStrengthReduce, rec(\n# vdupmultsR:= Rule([mul, @(1), @(2).cond(e->ObjId(e.t)=TVect and ObjId(@(1).val.t)<>TVect)], e->mul(vdup(@(1).val, @(2).val.t.size), @(2).val)),\n#\n#vdupmultsL:= Rule([mul, @(1), @(2).cond(e->ObjId(@(1).val.t)=TVect and ObjId(e.t)<>TVect)], e->mul(@(1).val,vdup(@(2).val, @(1).val.t.size))),\n#\n#));\n\n\n\nClass(OLPushScatAccRules,RuleSet);\n\n#ScatAcc that are pushed inside sums MUST merge or else things get added twice or more...\nRewriteRules(OLPushScatAccRules, rec(\n PushScatAccInsideISum := ARule(Compose, [@(1, ScatAcc), @(2,ISum)],\n e-> [ ISum(@(2).val.var,@(2).val.domain,Compose(@(1).val,@(2).val._children))]),\n\n PushScatAccInsideSUM := ARule(Compose, [@(1, ScatAcc), @(2,SUM)],\n e-> let(childs:=List(@(2).val._children,e->@(1).val*e), [ SUM(childs)])),\n\n PushICScatAccInsideISum := ARule(Compose, [@(1, ICScatAcc), @(2,ISum)],\n e-> [ ISum(@(2).val.var,@(2).val.domain,Compose(@(1).val,@(2).val._children))]),\n\n PushICScatAccInsideSUM := ARule(Compose, [@(1, ICScatAcc), @(2,SUM)],\n e-> let(childs:=List(@(2).val._children,e->@(1).val*e), [ SUM(childs)])),\n\n\n));\nOLPushScatAccRuleset := MergedRuleSet(OLPushScatAccRules, StandardSumsRules, OLScatFuseRules, \n OLVectorScatFuseRules, RulesVec, RulesPropagate); \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "meta": {"hexsha": "45308c4332f092e274631b3a6c3ad5b0c1c12fb2", "size": 21027, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/nontransforms/ol/rewrite.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/nontransforms/ol/rewrite.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/nontransforms/ol/rewrite.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 43.8977035491, "max_line_length": 145, "alphanum_fraction": 0.5617063775, "num_tokens": 6845, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5273165233795671, "lm_q2_score": 0.4649015713733885, "lm_q1q2_score": 0.24515028033031291}} |
| {"text": "InstallGlobalFunction(MitM_ATPToRec,\nfunction(atp)\n local i, res;\n\n res := rec();\n\n for i in [1,3..Length(MitM_Content(atp))-1] do\n res.( MitM_Name(MitM_Content(atp)[i]) ) :=\n EvalString(MitM_OMRecToGAPNC(MitM_Content(atp)[i+1]).result);\n od;\n return res;\nend);\n\nInstallGlobalFunction(MitM_RecToATP,\nfunction(r)\n return Objectify(MitM_OMRecType,\n rec( name := \"OMATP\"\n , content := Concatenation(\n List( NamesOfComponents(r)\n , n -> [ OMS(\"scscp1\", n)\n , MitM_GAPToOMRec(r.(n)) ] ) ) ));\nend);\n\nInstallGlobalFunction(OMATP,\nfunction(r)\n return Objectify(MitM_OMRecType,\n rec( name := \"OMATP\"\n , content := Concatenation(\n List( NamesOfComponents(r)\n , n -> [ OMS(\"scscp1\", n)\n , r.(n) ] ) ) ));\nend);\n\nInstallGlobalFunction(OMOBJ,\nfunction(obj)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMOBJ\"\n , attributes := rec( version := \"2.0\" )\n , content := [obj] ) );\nend);\n\nInstallGlobalFunction(OMA,\nfunction(oms, args...)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMA\"\n , content := Concatenation( [ oms ], args ) ) );\nend);\n\nInstallGlobalFunction(OMS,\nfunction(args...)\n local res;\n\n res := rec( name := \"OMS\"\n , attributes := rec( ) );\n\n if Length(args) = 2 then\n res.attributes.cd := args[1];\n res.attributes.name := args[2];\n elif Length(args) = 3 then\n res.attributes.cdbase := args[1];\n res.attributes.cd := args[2];\n res.attributes.name := args[3];\n else\n return fail;\n fi;\n return Objectify(MitM_OMRecType, res);\nend);\n\nInstallGlobalFunction(MitM_SimpleOMS,\nobj_name -> OMS(MitM_cdbase, \"lib\", obj_name));\n\nInstallGlobalFunction(OMATTR,\nfunction(attr, content)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMATTR\"\n , content := [ MitM_RecToATP(attr)\n , content ] ) );\nend);\n\nInstallGlobalFunction(OMSTR,\nfunction(string)\n if IsEmptyString(string) then\n return Objectify( MitM_OMRecType\n , rec( name := \"OMSTR\"\n , content := [ ] ) );\n else\n return Objectify( MitM_OMRecType\n , rec( name := \"OMSTR\"\n , content := [ string ] ) );\n fi;\nend);\n\nInstallGlobalFunction(OMI,\nfunction(int)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMI\"\n , content := [ String(int) ] ) );\nend);\n\nInstallGlobalFunction(OMF,\nfunction(float)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMF\"\n , attributes := rec( dec := String(float) ) ) );\nend);\n\nInstallGlobalFunction(OME,\nfunction(oms, content)\n return Objectify( MitM_OMRecType\n , rec( name := \"OME\"\n , content := Concatenation( [oms], content ) ) );\nend);\n\nInstallGlobalFunction(OMV,\nfunction(name)\n return Objectify( MitM_OMRecType\n , rec( name := \"OMV\"\n , attributes := rec( name := name )\n , content := [] ) );\nend);\n\nInstallMethod(ViewString, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n local attr, i, content;\n if r!.name = \"OMS\" then\n if IsBound(r!.attributes.cdbase) then\n return StringFormatted( \"OMS(cd=\\\"{}\\\", cdbase=\\\"{}\\\", name=\\\"{}\\\")\"\n , r!.attributes.cd, r!.attributes.cdbase, r!.attributes.name );\n else\n return StringFormatted( \"OMS(cd=\\\"{}\\\", name=\\\"{}\\\")\"\n , r!.attributes.cd, r!.attributes.name );\n fi;\n elif r!.name = \"OMA\" then\n return StringFormatted( \"OMA({})\"\n , JoinStringsWithSeparator(List(r!.content, ViewString), \", \") );\n elif r!.name = \"OMSTR\" then\n if IsEmpty(MitM_Content(r)) then\n return \"OMSTR(\\\"\\\")\";\n else\n return StringFormatted( \"OMSTR(\\\"{}\\\")\", MitM_Content(r)[1] );\n fi;\n elif r!.name = \"OMI\" then\n return StringFormatted( \"OMI({})\", r!.content[1] );\n elif r!.name = \"OMF\" then\n # TODO: this is not really right yet\n return StringFormatted( \"OMF({})\", r!.attributes.dec );\n elif r!.name = \"OMATP\" then\n attr := [];\n for i in [1, 3 .. Length(r!.content) - 1] do\n Add(attr, Concatenation(r!.content[i]!.attributes.name,\n \" := \", ViewString(r!.content[i+1])));\n od;\n return StringFormatted( \"OMATP( rec( {} ) )\", \n JoinStringsWithSeparator(attr, \", \") );\n elif r!.name = \"OMATTR\" then\n content := MitM_Content(r);\n return StringFormatted( \"OMATTR( {}, {} )\",\n MitM_ATPToRec(content[1]),\n ViewString(content[2]) );\n elif r!.name = \"OMOBJ\" then\n return StringFormatted( \"OMOBJ({})\", ViewString(MitM_Content(r)[1]) );\n elif r!.name = \"OME\" then\n return StringFormatted( \"OME({}, {})\",\n ViewString(MitM_Content(r)[1]),\n ViewString(MitM_Content(r)[2]) );\n else\n return StringFormatted( \"ViewString for {} not implemented\", r!.name );\n fi;\nend);\n\nInstallMethod(ViewObj, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n Print(ViewString(r));\nend);\n\nInstallMethod( MitM_Tag, \"for an omrec\",\n [MitM_OMRecRep],\nr -> r!.name);\n\nInstallMethod(MitM_Attributes, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n if IsBound(r!.attributes) then\n return r!.attributes;\n else\n return rec();\n fi;\nend);\n\nInstallMethod(MitM_Name, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n if IsBound(r!.attributes) and IsBound(r!.attributes.name) then\n return r!.attributes.name;\n else\n return fail;\n fi;\nend);\n\nInstallMethod(MitM_CD, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n if r!.name = \"OMS\" then\n return r!.attributes.cd;\n else\n return fail;\n fi;\nend);\n\nInstallMethod(MitM_CDBase, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n if r!.name = \"OMS\" and IsBound(r!.attributes.cdbase) then\n return r!.attributes.cdbase;\n else\n return fail;\n fi;\nend);\n\nInstallMethod(MitM_Content, \"for an omrec\",\n [MitM_OMRecRep],\nfunction(r)\n if IsBound(r!.content) then\n return r!.content;\n else\n return fail;\n fi;\nend);\n\nInstallMethod(\\=, \"for omrec and omrec\",\n [MitM_OMRecRep, MitM_OMRecRep],\n{x, y} -> (x!.name = y!.name and\n IsBound(x!.content) = IsBound(y!.content) and\n ((not IsBound(x!.content)) or x!.content = y!.content)));\n\nInstallMethod(\\<, \"for omrec and omrec\",\n [MitM_OMRecRep, MitM_OMRecRep],\nfunction(x, y)\n if x!.name < y!.name then\n return true;\n elif x!.name = y!.name then\n if (not IsBound(x!.content)) and IsBound(y!.content) then\n return true;\n elif IsBound(x!.content) and IsBound(y!.content) then\n if x!.content < y!.content then\n return true;\n fi;\n fi;\n fi;\n return false;\nend);\n", "meta": {"hexsha": "c8c1519ea6c150bd5dbda712ac0c617829f9d133", "size": 7686, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "gap/OMRec.gi", "max_stars_repo_name": "markuspf/MathsInTheMiddle", "max_stars_repo_head_hexsha": "3a4a3c74ee4611233186bdb76f721458584d8611", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 1, "max_stars_repo_stars_event_min_datetime": "2019-04-23T00:34:49.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-23T00:34:49.000Z", "max_issues_repo_path": "gap/OMRec.gi", "max_issues_repo_name": "markuspf/MathsInTheMiddle", "max_issues_repo_head_hexsha": "3a4a3c74ee4611233186bdb76f721458584d8611", "max_issues_repo_licenses": ["BSD-3-Clause"], "max_issues_count": 18, "max_issues_repo_issues_event_min_datetime": "2018-09-10T10:03:23.000Z", "max_issues_repo_issues_event_max_datetime": "2019-04-06T15:16:30.000Z", "max_forks_repo_path": "gap/OMRec.gi", "max_forks_repo_name": "markuspf/MathsInTheMiddle", "max_forks_repo_head_hexsha": "3a4a3c74ee4611233186bdb76f721458584d8611", "max_forks_repo_licenses": ["BSD-3-Clause"], "max_forks_count": 2, "max_forks_repo_forks_event_min_datetime": "2018-08-20T16:32:35.000Z", "max_forks_repo_forks_event_max_datetime": "2018-10-08T10:18:20.000Z", "avg_line_length": 30.2598425197, "max_line_length": 97, "alphanum_fraction": 0.5134009888, "num_tokens": 1949, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5273165233795671, "lm_q2_score": 0.4571367168274948, "lm_q1q2_score": 0.2410557442266242}} |
| {"text": "#\n# cls 14: \\tilde A_1\n#\nhandle14char3:=function()\n local tmp1,tmp2,o,info,rep,cent;\n o:=AllClasses(orbs)[14];\n info:=infos[14];\n \n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[12]);#pr[12]=[1,0,2,1]-->[0,1,2,1]\n tmp1:=ConjugateByTorus(tmp1,3,-1);\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[12]);#pr[12]=[1,0,2,1]-->[0,1,2,1]\n tmp2:=ConjugateByTorus(tmp2,3,-1);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 12: A_2\n#\nhandle12char3:=function()\n local tmp1,tmp2,o,info,rep,cent,u;\n o:=AllClasses(orbs)[12];\n info:=infos[12];\n \n rep:=Representative(o);\n #pr[7]=[0,0,1,1]-->[0,1,1,0]\n #pr[13]=[0,1,2,1]-->[1,1,2,0]\n tmp1:=ApplyRootsReflections(rep,[7,13]);\n u:=Unipotent(algebraicU(orbs),[[4,-1]]);\n tmp1:=Conj(tmp1,u);\n tmp1:=ConjugateByTorus(tmp1,2,-1);\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[7,13]);\n tmp2:=Conj(tmp2,u);\n tmp2:=ConjugateByTorus(tmp2,2,-1);\n\n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 9: B_2\n#\nhandle9char3:=function()\n local tmp1,tmp2,o,info,rep,cent;\n o:=AllClasses(orbs)[9];\n info:=infos[9];\n \n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[9]);#pr[9]=[0,1,1,1]-->[1,1,1,0]\n tmp1:=ConjugateByTorus(tmp1,4,-1);# merge si cu 1\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[9]);#pr[9]=[0,1,1,1]-->[1,1,1,0]\n tmp2:=ConjugateByTorus(tmp2,4,-1);# merge si cu 1\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 7: C_3(a_1)\n#\nhandle7char3:=function()\n local tmp1,tmp2,o,info,rep,cent;\n o:=AllClasses(orbs)[7];\n info:=infos[7];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,1,-1);# h_1 --> h_4\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,1,-1);# h_1 --> h_4\n return [tmp1,tmp2];\nend;\n\n#\n# cls 6: F_4(a_3) [4,6,10,18] (finished?)\n#\nhandle6char3:=function()\n local tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,o,info,rep,cent,uu;\n o:=AllClasses(orbs)[6];\n info:=infos[6];\n \n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[3]);#pr[3]=[0,0,1,0]-->[0,0,1,0]\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[6,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,2,3,4],[1,-1,aaa,aaa^2]);\n\n tmp3:=ApplyRootsReflections(rep,[5,1]);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1]],Ordering(rep));#[1..24]);\n tmp3:=Conj(tmp3,uu);\n uu:=Unipotent(chevalleyAdj(rep),[[16,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjNegUa(tmp3,2,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[13,1],[2,-1],[4,1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[3],[aaa]);\n\n tmp5:=ConjugateByTori(rep,[3],[-1]);\n \n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[3]);#pr[3]=[0,0,1,0]-->[0,0,1,0]\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[6,1]]);\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,2,3,4],[1,-1,aaa,aaa^2]);\n\n tmp4:=ApplyRootsReflections(cent,[5,1]);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1]],Ordering(cent));#[1..24]);\n tmp4:=Conj(tmp4,uu);\n uu:=Unipotent(chevalleyAdj(rep),[[16,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjNegUa(tmp4,2,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[13,1],[2,-1],[4,1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[3],[aaa]);\n\n tmp6:=ConjugateByTori(cent,[3],[-1]);\n\n \n return [tmp1,tmp3,tmp5,tmp2,tmp4,tmp6];\nend;\n\n#\n# cls 3: F_4(a_2) (not finished)\n#\nhandle3char3:=function()\n local tmp1,tmp2,o,info,rep,cent;\n o:=AllClasses(orbs)[3];\n info:=infos[3];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[4],[-1]);# h_1 --> h_4\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[4],[-1]);# h_1 --> h_4\n return [tmp1,tmp2];\nend;\n\n#\n# cls 2: F_4(a_1)\n#\nhandle2char3:=function()\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=AllClasses(orbs)[2];\n info:=infos[2];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[3,1],[-1,-1]);# h_1 --> h_4, h_3 --> h_3\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1]],Ordering(rep));#pr[3]=[0,0,1,0]-->[0,0,1,0]\n tmp1:=Conj(tmp1,uu);\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[3,1],[-1,-1]);# h_1 --> h_4, h_3 --> h_3\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1]],Ordering(cent));#pr[3]=[0,0,1,0]-->[0,0,1,0]\n tmp2:=Conj(tmp2,uu);\n \n return [tmp1,tmp2];\nend;\n\n", "meta": {"hexsha": "6c74d0ca452390badd028f61707641882b9c84e9", "size": 4502, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/F4char3.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/F4char3.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/F4char3.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 27.1204819277, "max_line_length": 90, "alphanum_fraction": 0.5935139938, "num_tokens": 1859, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5583269943353744, "lm_q2_score": 0.4263215925474903, "lm_q1q2_score": 0.2380268533873104}} |
| {"text": "#\n# cls 67: A_2\n#\nhandle67char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[67];\n info:=infos[67];\n \n rep:=Representative(o);\n #pr[19]=[0,0,1,1,1,0,0,0]\n #pr[17]=[0,1,1,1,0,0,0,0]\n #pr[37]=[1,1,1,2,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[19,17,37]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1]]);\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[19,17,37]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1]]);\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n#\n# cls 65: A_2A_1\n#\nhandle65char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[65];\n info:=infos[65];\n \n rep:=Representative(o);\n #pr[53]=[1,1,1,2,1,1,1,0]\n #pr[52]=[1,1,1,2,2,1,0,0]\n #pr[93]=[1,2,3,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[53,52,93]);\n uu:=Unipotent(chevalleyAdj(rep),[[1,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[53,52,93]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n#\n# cls 61: A_2^2\n#\nhandle61char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[61];\n info:=infos[61];\n \n rep:=Representative(o);\n #pr[43]=[0,0,1,1,1,1,1,1]\n #pr[41]=[0,1,1,1,1,1,1,0]\n #pr[79]=[1,1,1,2,2,2,2,1]\n tmp1:=ApplyRootsReflections(rep,[43,41,79]);\n uu:=Unipotent(chevalleyAdj(rep),[[1,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3],[-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[43,41,79]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3],[-1]);\n\n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 58: D_4(a_1)\n#\nhandle58char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[58];\n info:=infos[58];\n \n rep:=Representative(o);\n #pr[4] =[0,0,0,1,0,0,0,0]\n #pr[51]=[1,1,2,2,1,1,0,0]\n #pr[52]=[1,1,1,2,2,1,0,0]\n tmp1:=ApplyRootsReflections(rep,[4,51,52]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[5,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,1,2,6],[-1,-1,-1,-1]);\n\n #pr[26]=[0,1,0,1,1,1,0,0]\n #pr[27]=[0,0,1,1,1,1,0,0]\n tmp3:=ApplyRootsReflections(rep,[26,27]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[2,4],[-1,-1,-1,-1]);\n \n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[4,51,52]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[5,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,1,2,6],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ApplyRootsReflections(cent,[26,27]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,1],[5,-1],[11,1],[12,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[2,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n\n\n#\n# cls 54: D_4(a_1)A_1 Ross' rep\n#\nhandle54char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[54];\n info:=infos[54];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0]\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n tmp1:=ConjNegUa(tmp1,4,1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1]],Ordering(rep)); \n tmp1:=Conj(tmp1,uu); \n tmp1:=ConjugateByTori(tmp1,[2],[-1,-1,-1,-1]);\n\n #pr[65]=[1,1,2,2,1,1,1,1]\n #pr[67]=[1,1,1,2,2,1,1,1]\n tmp3:=ApplyRootsReflections(rep,[65,67,4]);\n uu:=Unipotent(chevalleyAdj(rep),[[12,-1],[11,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[1,2,4,6,8],[-1,-1,-1,-1,-1,-1]); \n \n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n tmp2:=ConjNegUa(tmp2,4,1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ApplyRootsReflections(cent,[65,67,4]);\n uu:=Unipotent(chevalleyAdj(cent),[[12,-1],[11,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[1,2,4,6,8],[-1,-1,-1,-1,-1]); \n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n#\n# cls 54: D_4(a_1)A_1 ([2,5,9,10,7] in E_7) [2,5,10,11,7] in E_8\n#\nhandle54char3old:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[54];\n info:=infos[54];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0]\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[12,1]],Ordering(rep)); \n tmp1:=Conj(tmp1,uu); \n tmp1:=ConjugateByTori(tmp1,[1,2],[-1,-1,-1,-1]);\n\n #pr[65]=[1,1,2,2,1,1,1,1]\n #pr[67]=[1,1,1,2,2,1,1,1]\n tmp3:=ApplyRootsReflections(rep,[65,67]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,-1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjNegUa(tmp3,4,1);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,-1],[5,-1],[12,1]],Ordering(rep));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[2,4],[-1,-1,-1,-1]); \n \n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,2],[-1,-1,-1,-1]);\n\n tmp4:=0;\n tmp4:=ApplyRootsReflections(cent,[65,67]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,-1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjNegUa(tmp4,4,1);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,-1],[5,-1],[12,1]],Ordering(cent));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjugateByTori(tmp4,[2,4],[-1,-1,-1,-1]); \n \n return [tmp1,tmp3,tmp2,tmp4];\nend;\n\n\n#\n# cls 53: A_3A_2 [3,4,2,6,7]\n#\nhandle53char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[53];\n info:=infos[53];\n \n rep:=Representative(o);\n\n #pr[26]=[0,1,0,1,1,1,0,0]\n #pr[27]=[0,0,1,1,1,1,0,0]\n #pr[55]=[0,1,1,2,2,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[26,27,55]);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[3,1],[6,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,6],[-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[26,27,55]);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[3,1],[6,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,6],[-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 52: A_4\n#\nhandle52char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[52];\n info:=infos[52];\n \n rep:=Representative(o);\n\n #pr[33]=[0,1,1,1,1,1,0,0]\n #pr[31]=[1,0,1,1,1,1,0,0]\n #pr[64]=[1,1,2,2,2,1,1,0]\n #pr[89]=[1,2,2,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[4,1],[11,-1],[17,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[4,1],[11,-1],[17,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[1]:=vals[2];\n#vals[3]:=-vals[1]+One(APR);\n#vals[4]:=vals[2]+One(APR);\n#vals[11]:=-(vals[2]^2-vals[2]-vals[10]+One(APR));\n#vals[17]:=-(vals[9]-vals[10]+vals[16]+One(APR));\n#\n# cls 52: A_4 [1,2,3,4]\n#\nhandle52char3old:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[52];\n info:=infos[52];\n \n rep:=Representative(o);\n\n #pr[33]=[0,1,1,1,1,1,0,0]\n #pr[31]=[1,0,1,1,1,1,0,0]\n #pr[64]=[1,1,2,2,2,1,1,0]\n #pr[89]=[1,2,2,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1],[4,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[33,31,64,89]);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1],[4,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 49: D_4(a_1)A_2\n#\nhandle49char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[49];\n info:=infos[49];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0] asta merge si cu rep=[2,3,10,12,7,8] urmat de ConjNegUa(tmp1,4,1)\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n tmp1:=ConjNegUa(tmp1,4,1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n tmp2:=ConjNegUa(tmp2,4,1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#\n# cls 49: D_4(a_1)A_2 [2,5,10,11,7,8] in E_8\n#\nhandle49char3old:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[49];\n info:=infos[49];\n \n rep:=Representative(o);\n\n #pr[23]=[1,1,1,1,0,0,0,0] asta merge si cu rep=[2,3,10,12,7,8] urmat de ConjNegUa(tmp1,4,1)\n #pr[24]=[1,0,1,1,1,0,0,0]\n tmp1:=ApplyRootsReflections(rep,[23,24]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[12,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,2],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[23,24]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,2],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 48: A_4A_1 \n#\nhandle48char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[48];\n info:=infos[48];\n\n rep:=Representative(o);\n\n #pr[41]=[0,1,1,1,1,1,1,0]\n #pr[39]=[1,0,1,1,1,1,1,0]\n #pr[57]=[1,1,2,2,2,1,0,0]\n #pr[89]=[1,2,2,4,3,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[41,39,57,89]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,-1],[11,-1],[17,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[41,39,57,89]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,-1],[11,-1],[17,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[2]:=vals[1];\n#vals[3]:=vals[1]-One(APR);\n#vals[4]:=-vals[2]-One(APR);\n#vals[11]:=vals[1]-vals[9]-One(APR);\n#vals[10]:=-vals[1]^2+vals[9];\n#vals[17]:=vals[1]^2-vals[16]-One(APR);\n\n#\n# cls 46: D_5(a_1)\n#\nhandle46char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[46];\n info:=infos[46];\n \n rep:=Representative(o);\n\n #pr[82]=[1,1,2,3,3,2,1,0]\n #pr[80]=[1,2,2,3,2,2,1,0]\n tmp1:=ApplyRootsReflections(rep,[82,80]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[12,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[82,80]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n\n#\n# cls 45: A_4A_1^2 \n#\nhandle45char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[45];\n info:=infos[45];\n\n rep:=Representative(o);\n\n #pr[71]=[1,1,2,2,2,2,1,0]\n #pr[72]=[1,1,2,2,2,1,1,1]\n #pr[112]=[1,3,3,5,4,3,2,1]\n #pr[111]=[2,2,3,5,4,3,2,1]\n tmp1:=ApplyRootsReflections(rep,[71,72,112,111]);\n uu:=Unipotent(chevalleyAdj(rep),[[1,1],[2,1],[3,-1],[9,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[5,8],[-1,aaa]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[71,72,112,111]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,1],[2,1],[3,-1],[9,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[5,8],[-1,aaa]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 40: D_4A_2 \n#\nhandle40char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[40];\n info:=infos[40];\n\n rep:=Representative(o);\n\n #pr[34]=[0,1,0,1,1,1,1,0]\n #pr[35]=[0,0,1,1,1,1,1,0]\n #pr[68]=[0,1,1,2,2,2,1,1]\n tmp1:=ApplyRootsReflections(rep,[34,35,68]);\n uu:=Unipotent(chevalleyAdj(rep),[[3,-1],[4,-1],[5,-1],[8,-1],[11,-1],[12,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,6,7,8],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[34,35,68]);\n uu:=Unipotent(chevalleyAdj(cent),[[3,-1],[4,-1],[5,-1],[8,-1],[11,-1],[12,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,6,7,8],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#vals[3]:=vals[2]-One(APR);\n#vals[4]:=-vals[2]-One(APR);\n#vals[5]:=vals[4];\n#vals[8]:=-vals[7]-One(APR);\n#vals[11]:=-vals[2]^2+vals[2]-vals[10]-One(APR);\n#vals[12]:=vals[2]-vals[10]+One(APR);\n\n\n#\n# cls 39: E_6(a_3) [1,4,6,17,18,19] this doesn't work in char2 \n#\nhandle39char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[39];\n info:=infos[39];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 34: D_6(a_2) \n#\nhandle34char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[34];\n info:=infos[34];\n\n rep:=Representative(o);\n\n #pr[42]=[0,1,0,1,1,1,1,0]\n #pr[43]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[42,43]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[10,1],[13,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[4,5,8],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[42,43]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[10,1],[13,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[4,5,8],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 33: E_6(a_3)A_1 [1,4,6,8,17,18,19] this doesn't work in char2 \n#\nhandle33char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[33];\n info:=infos[33];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 32: E_7(a_5)\n#\nhandle32char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[32];\n info:=infos[32];\n \n rep:=Representative(o);\n tmp1:=ConjNegUa(rep,1,1);\n tmp1:=ConjNegUa(tmp1,3,-1);\n tmp1:=ConjNegUa(tmp1,9,-1);\n tmp1:=ConjNegUa(tmp1,2,1);\n uu:=Unipotent(chevalleyAdj(rep),[[1,-1],[3,1],[5,-1],[6,-1],[9,1],[13,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n uu:=Unipotent(chevalleyAdj(rep),[[11,1],[14,1],[16,1],[20,1],[21,1],[25,1],[26,-1],[27,-1],[30,1],[33,-1],[35,-1],[37,-1],[38,-1],[39,1],[41,-1],[44,1],[45,1],[46,-1],[51,-1],[52,-1],[59,1],[64,-1],[66,1],[69,-1],[71,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTorus(tmp1,1,-1);\n\n tmp3:=ConjugateByTorus(rep,18,-1);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjNegUa(cent,1,1);\n tmp2:=ConjNegUa(tmp2,3,-1);\n tmp2:=ConjNegUa(tmp2,9,-1);\n tmp2:=ConjNegUa(tmp2,2,1);\n uu:=Unipotent(chevalleyAdj(cent),[[1,-1],[3,1],[5,-1],[6,-1],[9,1],[13,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n uu:=Unipotent(chevalleyAdj(cent),[[11,1],[14,1],[16,1],[20,1],[21,1],[25,1],[26,-1],[27,-1],[30,1],[33,-1],[35,-1],[37,-1],[38,-1],[39,1],[41,-1],[44,1],[45,1],[46,-1],[51,-1],[52,-1],[59,1],[64,-1],[66,1],[69,-1],[71,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTorus(tmp2,1,-1);\n\n tmp4:=0;\n tmp4:=ConjugateByTorus(cent,18,-1);\n\n return [tmp1,tmp3,tmp2,tmp4,uu];\nend;\n\n#\n# cls 30: E_8(a_7) (NOT FINISHED)\n#\nhandle30char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[30];\n info:=infos[30];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n #cent:=FromPositiveBorel(o,info[2]);\n #tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 28: D_6(a_1) \n#\nhandle28char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[28];\n info:=infos[28];\n\n rep:=Representative(o);\n\n #pr[42]=[0,1,0,1,1,1,1,0]\n #pr[43]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[42,43]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[3,4],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[42,43]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[3,4],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 26: E_7(a_4) [1,4,7,14,17,18,19,26] this doesn't work in char2 \n#\nhandle26char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[26];\n info:=infos[26];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 25: E_6(a_1)\n#\nhandle25char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[25];\n info:=infos[25];\n\n #pr[58]=[1,1,2,2,1,1,1,0]\n #pr[59]=[1,1,1,2,2,1,1,0]\n #pr[61]=[0,1,1,2,2,2,1,0]\n\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[58,59,61]);\n tmp1:=ConjNegUa(tmp1,4,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1],[5,-1],[10,-1],[11,-1],[12,1],[18,1],[19,1],[26,-1],[27,-1],[32,-1],[40,1],[48,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[5,7],[-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[58,59,61]);\n tmp2:=ConjNegUa(tmp2,4,-1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,1],[5,-1],[10,-1],[11,-1],[12,1],[18,1],[19,1],[26,-1],[27,-1],[32,-1],[40,1],[48,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[5,7],[-1,-1]);\n \n return [tmp1,tmp2,uu];\nend;\n\n#\n# cls 24: D_5A_2 \n#\nhandle24char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[24];\n info:=infos[24];\n\n rep:=Representative(o);\n\n #pr[87]=[1,1,2,3,3,2,1,1]\n #pr[86]=[1,2,2,3,2,2,1,1]\n #pr[119]=[2,3,4,6,5,4,3,1]\n tmp1:=ApplyRootsReflections(rep,[87,86,119]);\n uu:=Unipotent(chevalleyAdj(rep),[[8,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,4,7],[-1,-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[87,86,119]);\n uu:=Unipotent(chevalleyAdj(cent),[[8,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,4,7],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 21: D_7(a_2)\n#\nhandle21char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[21];\n info:=infos[21];\n\n rep:=Representative(o);\n\n #pr[113]=[2,3,3,5,4,3,2,1]\n #pr[114]=[2,2,4,5,4,3,2,1]\n tmp1:=ApplyRootsReflections(rep,[113,114]);\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[6,1],[11,-1],[13,-1],[20,-1],[27,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[5,6],[-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[113,114]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[6,1],[11,-1],[13,-1],[20,-1],[27,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[5,6],[-1,-1,-1,-1]);\n \n return [tmp1,tmp2];\nend;\n#\n# THIS IS FOR THE D_7(a_2) class in E_8 characteristic 3\n#\n#set:=Filtered(subs,i->i<=63);\n#Sort(set);\n#uu:=Unipotent(alg,List(set,i->[i,avars[i]]),Ordering(rep));\n#\n#vals:=ShallowCopy(avars);\n#vals[4]:=0;\n#vals[3]:=vals[2];\n#vals[5]:=vals[3]-vals[2];\n#vals[6]:=One(APR);\n#vals[7]:=0;\n#vals[8]:=vals[2];\n#vals[11]:=-vals[3]-vals[10]-One(APR);\n#vals[12]:=vals[3];\n#vals[13]:=-vals[2]+vals[10]-One(APR);\n#vals[14]:=vals[8];\n#vals[17]:=vals[2]^2+vals[2]-vals[15];\n#vals[18]:=-vals[2]-vals[17];\n#vals[19]:=vals[3]^2-vals[2]-vals[18];\n#vals[20]:=vals[13]+vals[10];\n#vals[21]:=vals[15];\n#vals[22]:=-vals[2]^2-vals[2]+vals[15]-vals[17];\n#vals[26]:=-vals[2]*vals[10]-vals[10]^2-vals[10]+vals[17];\n#vals[27]:=vals[2]+vals[10]+vals[17]-vals[26]+One(APR);\n#vals[28]:=vals[18]+vals[15];\n#vals[32]:=-(-vals[2]^3-vals[2]+vals[15]-vals[25]-vals[29]);\n#vals[33]:=-(vals[2]^2*vals[10]-vals[2]^2+vals[2]*vals[10]-vals[2]-vals[15]-vals[32]);\n#vals[34]:=vals[2]^2+vals[25]+vals[32];\n#vals[35]:=-vals[2]^3-vals[2]^2-vals[2]+vals[15]+vals[25]-vals[34];\n#vals[36]:=vals[2]*vals[15]+vals[10]*vals[15]+vals[15]+vals[29]+vals[34];\n#vals[41]:=-(vals[2]^4+vals[2]^3+vals[2]^2-vals[15]^2+vals[25]);\n#vals[43]:=vals[2]^3-vals[2]^2*vals[15]+vals[2]^2-vals[2]*vals[15]+vals[15]^2+vals[2]-vals[15]-vals[25]+vals[34]+vals[35]-vals[36]+vals[41]-vals[42];\n#vals[48]:=-vals[2]^4+vals[2]^3*vals[10]+vals[2]^3-vals[2]^2*vals[15]+vals[2]*vals[10]*vals[15]+vals[10]^2*vals[15]+vals[2]*vals[10]-vals[10]*vals[15]-vals[15]^2-vals[2]-vals[25]+vals[29]+vals[42];\n#vals[49]:=-(vals[2]^4+vals[2]^3+vals[2]^2*vals[15]+vals[2]*vals[10]*vals[15]+vals[10]^2*vals[15]-vals[2]*vals[15]+vals[10]*vals[15]+vals[15]^2+vals[41]-vals[42]);\n#vals[55]:=-(-vals[2]^4-vals[2]^2*vals[10]*vals[15]-vals[2]^3+vals[2]^2*vals[15]-vals[2]^2*vals[25]-vals[2]*vals[10]*vals[15]-vals[2]^2+vals[2]*vals[15]+vals[2]*vals[25]-vals[15]^2-vals[15]*vals[25]-vals[25]+vals[50]);\n#vals[61]:=-(vals[2]^4*vals[10]+vals[2]^3*vals[10]-vals[2]^2*vals[10]*vals[15]+vals[2]^3+vals[2]^2*vals[10]+vals[2]^2*vals[15]-vals[2]*vals[10]*vals[15]-vals[2]*vals[10]-vals[2]*vals[15]-vals[10]*vals[15]-vals[15]^2-vals[2]-vals[15]-vals[32]-vals[41]+vals[42]+vals[48]-vals[49]+vals[56]);\n#vals[62]:=-(-vals[2]^6+vals[2]^5+vals[2]^3*vals[10]*vals[15]-vals[2]^3*vals[15]+vals[2]^3*vals[25]-vals[2]^3*vals[29]+vals[2]^2*vals[10]*vals[15]-vals[2]*vals[10]*vals[15]^2-vals[10]^2*vals[15]^2+vals[2]^3+vals[2]^2*vals[15]+vals[2]^2*vals[25]-vals[2]*vals[10]*vals[15]+vals[2]*vals[15]^2+vals[2]*vals[15]*vals[25]+vals[10]*vals[15]*vals[25]-vals[15]^3-vals[2]^2+vals[2]*vals[15]+vals[2]*vals[25]-vals[2]*vals[29]+vals[15]*vals[29]+vals[25]^2-vals[25]*vals[29]+vals[29]^2+vals[25]-vals[50]);\n#\n#vv:=Value(uu,avars,vals);\n#vvv:=Value(vv,avars,List(avars,i->0));\n\n\n#\n# cls 18: E_6(a_1)A_1\n#\nhandle18char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[18];\n info:=infos[18];\n\n #pr[106]=[1,2,2,4,4,3,2,1]\n #pr[105]=[1,2,3,4,3,3,2,1]\n #pr[104]=[2,2,3,4,3,2,2,1]\n\n # this is for E_6(a_1)A_1\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[106,105,104]);\n tmp1:=ConjNegUa(tmp1,4,-1);\n uu:=Unipotent(chevalleyAdj(rep),[[2,1],[11,1],[12,-1],[5,1],[10,-1],[18,-1],[19,-1],[26,-1],[27,1],[32,1],[40,-1],[48,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[1,2,3,5,6],[-1,-1,-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[106,105,104]);\n tmp2:=ConjNegUa(tmp2,4,-1);\n uu:=Unipotent(chevalleyAdj(cent),[[2,1],[11,1],[12,-1],[5,1],[10,-1],[18,-1],[19,-1],[26,-1],[27,1],[32,1],[40,-1],[48,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[1,2,3,5,6],[-1,-1,-1,-1,-1]);\n \n return [tmp1,tmp2,uu];\nend;\n#\n# THIS IS FOR THE E_6(a_1)A_1 class in E_7 characteristic 3\n#\n#set:=List(Filtered(pr,i->i[7]=0 and i[8]=0),j->Position(pr,j));\n#uu:=Unipotent(alg,List(set,i->[i,avars[i]]),Ordering(rep));\n#vals:=ShallowCopy(avars);\n#vals[2]:=One(APR)-vals[1];\n#vals[3]:=0;\n#vals[4]:=0;\n#vals[5]:=vals[1]+One(APR);\n#vals[6]:=vals[5]-One(APR);\n#vals[11]:=One(APR)-vals[1];\n#vals[10]:=-One(APR);\n#vals[12]:=-vals[1]-vals[10]+One(APR);\n#vals[13]:=-vals[1]^2-vals[1]-vals[9];\n#vals[16]:=-(-vals[1]^2+vals[1]+vals[9]);\n#vals[17]:=-(-vals[1]^2+vals[1]-vals[16]);\n#vals[18]:=-vals[1]^2+vals[1]+vals[9]-One(APR);\n#vals[19]:=-(-vals[1]^2-vals[1]+vals[9]-vals[16]-One(APR));\n#vals[20]:=vals[1]^2-vals[18]-One(APR);\n#vals[24]:=-(vals[1]^3-vals[1]^2+vals[1]*vals[9]+vals[9]-vals[23]);\n#vals[25]:=-(vals[1]^3-vals[1]^2-vals[1]*vals[9]-vals[9]-vals[23]-vals[24]);\n#vals[26]:=-vals[1]^2-vals[23]-One(APR);\n#vals[27]:=-(vals[1]^3+vals[1]^2-vals[1]*vals[9]-vals[1]-vals[9]-vals[24]-One(APR));\n#vals[30]:=-(vals[1]^4+vals[1]^3+vals[1]^2*vals[9]+vals[1]^2-vals[1]*vals[9]+vals[9]^2-vals[23]);\n#vals[32]:=-(vals[1]^3+vals[1]^2-vals[9]-vals[23]+One(APR));\n#vals[33]:=-(vals[1]^4-vals[1]^3-vals[1]^2-vals[1]*vals[9]+vals[1]+vals[24]-vals[30]-vals[31]);\n#vals[37]:=-vals[1]^4+vals[1]^3+vals[1]^2*vals[9]-vals[1]*vals[9]-vals[9]^2+vals[9]-vals[23]+vals[31];\n#vals[40]:=-(vals[1]^4+vals[1]^3-vals[1]^2*vals[9]+vals[1]^2+vals[1]*vals[9]-vals[1]-vals[9]-vals[37]+One(APR));\n#vals[44]:=vals[1]^4-vals[1]^3*vals[9]+vals[1]^3+vals[1]^2*vals[9]+vals[1]*vals[9]^2+vals[1]^2-vals[9]^2-vals[23]+vals[38];\n#vals[48]:=-(-vals[1]^5-vals[1]^4-vals[1]^3*vals[9]-vals[1]^2*vals[9]-vals[1]^2+vals[1]*vals[9]-vals[9]^2-vals[1]+vals[9]-vals[23]+vals[37]+vals[38]-vals[45]+One(APR));\n#vals[51]:=-vals[1]^4-vals[1]^3*vals[23]+vals[1]^2*vals[9]^2-vals[1]^3+vals[1]*vals[9]^2-vals[1]^2-vals[1]*vals[23]-vals[9]^2+vals[23]^2+vals[23]+vals[38];\n#vals[52]:=vals[1]^6+vals[1]^5-vals[1]^4*vals[9]+vals[1]^4+vals[1]^3*vals[9]+vals[1]^2*vals[9]^2+vals[1]^3-vals[1]^2*vals[9]-vals[1]^2*vals[23]-vals[1]*vals[9]^2+vals[9]^3-vals[1]^2+vals[9]^2+vals[23]^2+vals[23]-vals[31]-vals[38]+vals[45];\n#vals[63]:=-(-vals[1]^6-vals[1]^5*vals[9]-vals[1]^4*vals[9]-vals[1]^3*vals[9]^2-vals[1]^3*vals[9]-vals[1]^3*vals[23]-vals[1]^3*vals[31]-vals[1]*vals[9]^3+vals[1]^3-vals[1]^2*vals[9]+vals[1]^2*vals[23]-vals[1]^2*vals[31]-vals[9]^3-vals[9]^2*vals[23]-vals[1]*vals[9]-vals[1]*vals[23]+vals[9]^2+vals[9]*vals[31]+vals[23]^2+vals[23]*vals[31]-vals[9]+vals[23]-vals[31]);\n#\n#vv:=Value(uu,avars,vals);\n#vvv:=Value(vv,avars,List(avars,i->0));\n\n\n#\n# cls 17: E_7(a_3) ([1,4,6,7,15,16,17] in E_7) [1,4,6,7,17,18,19] in E_8 this doesn't work in char2 \n#\nhandle17char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[17];\n info:=infos[17];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n\n# This is for Seitz' representative in first table\n#\n# cls 16: E_8(b_6)\n#\n#handle16char3:=function(orbs,infos)\n# local tmp1,tmp2,o,info,rep,cent;\n# o:=Classes(orbs)[16];\n# #info:=infos[16];\n# \n# rep:=Representative(o);\n# tmp1:=ConjugateByTori(rep,[3,4,7,8],[-1,-1,-1,-1]);# same as [11,15] should be Z(D_8)\n#\n# tmp2:=0;\n# #cent:=FromPositiveBorel(o,info[2]);\n# #tmp2:=ConjugateByTori(cent,[3,4,7,8],[-1,-1,-1,-1]);# same as [11,15] should be Z(D_8)\n# \n# return [tmp1,tmp2];\n#end;\n\n# This is for Seitz' representative used in proof\n#\n# cls 16: E_8(b_6) \n#\nhandle16char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[16];\n info:=infos[16];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[12,13,15],[-1,-1,-1,-1]);# should be Z(D_8)\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[12,13,15],[-1,-1,-1,-1]);# should be Z(D_8)\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 15: D_7(a_1)\n#\nhandle15char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent,uu;\n o:=Classes(orbs)[15];\n info:=infos[15];\n\n rep:=Representative(o);\n\n #pr[113]=[2,3,3,5,4,3,2,1]\n #pr[114]=[0,0,1,1,1,1,1,0]\n tmp1:=ApplyRootsReflections(rep,[113,114]);\n #uu:=Unipotent(chevalleyAdj(rep),[[4,1],[10,-1]],Ordering(rep)); si asta merge\n uu:=Unipotent(chevalleyAdj(rep),[[4,1],[11,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTori(tmp1,[2,3,4],[aaa,aaa,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[113,114]);\n uu:=Unipotent(chevalleyAdj(cent),[[4,1],[11,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[2,3,4],[aaa,aaa,-1]);\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 12: E_8(a_6)\n#\nhandle12char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu,vars;\n o:=Classes(orbs)[12];\n info:=infos[12];\n\n # L(Q)_2 has dimension 24 and should correspond to [ 4, 12, 14, 15, 21, 23, 25, 26, 31, 37, 46, 47, 53, 55, 57, 72, 73, 82, 90, 92, 97, 104, 106, 113 ]\n rep:=Representative(o);\n\n vars:=ShallowCopy(avars);#List([1..120],i->avars[i]);\n #vars[5]:=vars[1]*vars[2]*vars[3]-vars[1]*vars[3]*vars[13]-vars[2]*vars[3]*vars[5]+vars[2]*vars[9]-vars[2]*vars[13]-vars[9]*vars[13];\n vars[9]:=One(APR);\n vars[1]:=-vars[9]^2;#0;\n vars[2]:=vars[9]^3;\n #vars[9]:=One(APR);# sau -1\n vars[3]:=0;#-vars[9];\n vars[5]:=vars[1];\n #vars[23]:=-vars[9];\n #vars[2]:=vars[3]*vars[9]*vars[23]-vars[9]^2*vars[23];\n #vars[5]:=1;\n vars[26]:=-One(APR);\n vars[21]:=Zero(APR);\n vars[13]:=vars[1]*vars[3]-vars[3]*vars[5]+vars[9];\n vars[23]:=-vars[9]^3;\n vars[29]:=-(vars[9]^3*vars[21]+vars[2]-vars[9]);#0=-vars[21];\n \n tmp1:=ConjNegUa(rep,2,vars[2]);#1\n tmp1:=ConjNegUa(tmp1,5,vars[5]);#-1\n #tmp1:=ConjNegUa(tmp1,6,avars[6]);\n tmp1:=ConjNegUa(tmp1,13,vars[13]);#1\n #uu:=Unipotent(chevalleyAdj(rep),[[6,One(APR)]],Ordering(rep));\n #tmp1:=Conj(tmp1,uu);\n tmp1:=ConjNegUa(tmp1,1,vars[1]);#-1\n tmp1:=ConjNegUa(tmp1,3,vars[3]);#0\n tmp1:=ConjNegUa(tmp1,9,vars[9]);#1\n uu:=Unipotent(chevalleyAdj(rep),[[1,vars[21]],[3,vars[23]],[6,vars[26]],[9,vars[29]]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n uu:=Unipotent(chevalleyAdj(rep),[[4, -1 ], [ 8, -1 ], [ 10, 1 ], [ 11, -1 ], [ 14, 1 ], [ 15, 1 ], [ 16, 1 ], [ 19, -1 ], [ 21, -1 ], [ 22, -1 ], [ 23, -1 ], [ 25, 1 ], [ 26, 1 ], [ 27, -1 ], [ 28, 1 ], [ 30, -1 ], [ 31, 1 ], [ 32, 1 ], [ 33, -1 ], [ 34, 1 ], [ 36, -1 ], [ 37, -1 ], [ 40, -1 ], [ 41, 1 ], [ 42, 1 ], [ 44, 1 ], [ 47, -1 ], [ 50, 1 ], [ 52, -1 ], [ 54, 1 ], [ 55, -1 ], [ 57, -1 ], [ 61, -1 ], [ 62, 1 ], [ 65, 1 ], [ 69, 1 ], [ 76, -1 ], [ 77, -1 ], [ 78, 1 ], [ 81, -1 ], [ 82, -1 ], [ 83, 1 ], [ 85, -1 ], [ 86, -1 ], [ 91, 1 ], [ 93, -1 ], [ 94, 1 ], [ 97, 1 ], [ 98, -1 ], [ 102, -1 ], [ 103, -1 ], [ 106, 1 ], [ 107, -1 ], [ 108, 1 ], [ 109, -1 ], [ 111, -1 ], [ 114, -1 ], [ 115, -1 ], [ 117, 1 ], [ 118, -1 ] ],Ordering(rep));\n #uu:=Unipotent(chevalleyAdj(rep),[[1,avars[1]],[9,avars[9]]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n #tmp1:=ConjNegUa(tmp1,3,avars[3]);\n \n tmp3:=ConjugateByTori(rep,[4,6,7],[-1,-1,-1]);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjNegUa(cent,2,vars[2]);\n tmp2:=ConjNegUa(tmp2,5,vars[5]);\n tmp2:=ConjNegUa(tmp2,13,vars[13]);\n tmp2:=ConjNegUa(tmp2,1,vars[1]);\n tmp2:=ConjNegUa(tmp2,3,vars[3]);\n tmp2:=ConjNegUa(tmp2,9,vars[9]);\n uu:=Unipotent(chevalleyAdj(cent),[[1,vars[21]],[3,vars[23]],[6,vars[26]],[9,vars[29]]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n uu:=Unipotent(chevalleyAdj(cent),[[4, -1 ], [ 8, -1 ], [ 10, 1 ], [ 11, -1 ], [ 14, 1 ], [ 15, 1 ], [ 16, 1 ], [ 19, -1 ], [ 21, -1 ], [ 22, -1 ], [ 23, -1 ], [ 25, 1 ], [ 26, 1 ], [ 27, -1 ], [ 28, 1 ], [ 30, -1 ], [ 31, 1 ], [ 32, 1 ], [ 33, -1 ], [ 34, 1 ], [ 36, -1 ], [ 37, -1 ], [ 40, -1 ], [ 41, 1 ], [ 42, 1 ], [ 44, 1 ], [ 47, -1 ], [ 50, 1 ], [ 52, -1 ], [ 54, 1 ], [ 55, -1 ], [ 57, -1 ], [ 61, -1 ], [ 62, 1 ], [ 65, 1 ], [ 69, 1 ], [ 76, -1 ], [ 77, -1 ], [ 78, 1 ], [ 81, -1 ], [ 82, -1 ], [ 83, 1 ], [ 85, -1 ], [ 86, -1 ], [ 91, 1 ], [ 93, -1 ], [ 94, 1 ], [ 97, 1 ], [ 98, -1 ], [ 102, -1 ], [ 103, -1 ], [ 106, 1 ], [ 107, -1 ], [ 108, 1 ], [ 109, -1 ], [ 111, -1 ], [ 114, -1 ], [ 115, -1 ], [ 117, 1 ], [ 118, -1 ] ],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n \n tmp4:=0; \n tmp4:=ConjugateByTori(cent,[4,6,7],[-1,-1,-1]);\n\t \n return [tmp1,tmp3,tmp2,tmp4,uu];\nend;\n\n#\n# cls 10: E_8(b_5)\n#\nhandle10char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,o,info,rep,cent,uu;\n o:=Classes(orbs)[10];\n info:=infos[10];\n\n rep:=Representative(o);\n tmp1:=ConjNegUa(rep,1,1);\n tmp1:=ConjNegUa(tmp1,3,-1);\n tmp1:=ConjNegUa(tmp1,9,-1);\n tmp1:=ConjNegUa(tmp1,2,1);\n uu:=Unipotent(chevalleyAdj(rep),[[1,-1],[3,1],[5,-1],[6,-1],[9,1],[13,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n uu:=Unipotent(chevalleyAdj(rep),[[8,1],[10,-1],[11,1],[16,-1],[20,1],[21,1],[25,1],[27,-1],[30,-1],[31,1],[32,-1],[33,-1],[37,1],[38,-1],[40,1],[44,-1],[46,-1],[52,1],[55,-1],[59,1],[61,1],[63,1],[64,-1],[69,-1],[82,-1],[90,1],[93,1],[97,-1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n tmp1:=ConjugateByTorus(tmp1,1,-1);\n\n tmp3:=ConjugateByTorus(rep,18,-1);\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjNegUa(cent,1,1);\n tmp2:=ConjNegUa(tmp2,3,-1);\n tmp2:=ConjNegUa(tmp2,9,-1);\n tmp2:=ConjNegUa(tmp2,2,1);\n uu:=Unipotent(chevalleyAdj(cent),[[1,-1],[3,1],[5,-1],[6,-1],[9,1],[13,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n uu:=Unipotent(chevalleyAdj(cent),[[8,1],[10,-1],[11,1],[16,-1],[20,1],[21,1],[25,1],[27,-1],[30,-1],[31,1],[32,-1],[33,-1],[37,1],[38,-1],[40,1],[44,-1],[46,-1],[52,1],[55,-1],[59,1],[61,1],[63,1],[64,-1],[69,-1],[82,-1],[90,1],[93,1],[97,-1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTorus(tmp2,1,-1);\n\n tmp4:=0;\n tmp4:=ConjugateByTorus(cent,18,-1);\n \n return [tmp1,tmp3,tmp2,tmp4,uu];\nend;\n\n# For representative deduced from Seitz' E_8(b_6) given in first table\n#\n# cls 8: E_8(a_5)\n#\n#handle8char3:=function(orbs,infos)\n# local tmp1,tmp2,o,info,rep,cent;\n# o:=Classes(orbs)[8];\n# #info:=infos[8];\n# \n# rep:=Representative(o);\n# tmp1:=ConjugateByTori(rep,[3,4,7,8],[-1,-1,-1,-1]);# same as [11,15] should be Z(D_8)\n#\n# tmp2:=0;\n# #cent:=FromPositiveBorel(o,info[2]);\n# #tmp2:=ConjugateByTori(cent,[3,4,7,8],[-1,-1,-1,-1]);# same as [11,15] should be Z(D_8)\n# \n# return [tmp1,tmp2];\n#end;\n\n\n# For representative deduced from Seitz' E_8(a_6) used in proof\n#\n# cls 8: E_8(a_5)\n#\nhandle8char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[8];\n info:=infos[8];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[4,6,7],[-1,-1,-1,-1]);# should be Z(D_8)\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[4,6,7],[-1,-1,-1,-1]);# should be Z(D_8)\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 7: E_8(b_4) [1,4,7,8,14,17,19,26] this doesn't work in char2 \n#\nhandle7char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[7];\n info:=infos[7];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 5: E_8(a_4) [1,4,6,8,17,18,19,21] this doesn't work in char2 \n#\nhandle5char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[5];\n info:=infos[5];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTori(rep,[4,8],[-1,-1]);# h_4, h_8\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTori(cent,[4,8],[-1,-1]); # h_4, h_8\n \n return [tmp1,tmp2];\nend;\n\n#\n# cls 4: E_8(a_3) [1,4,6,7,8,17,18,19] this doesn't work in char2 \n#\nhandle4char3:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,cent;\n o:=Classes(orbs)[4];\n info:=infos[4];\n \n rep:=Representative(o);\n tmp1:=ConjugateByTorus(rep,4,-1);# h_1 --> h_4\n\n tmp2:=0;\n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ConjugateByTorus(cent,4,-1);# h_1 --> h_4\n \n return [tmp1,tmp2];\nend;\n\n", "meta": {"hexsha": "9cecad56504aba9d86a5c65f93c0f4d7bb8d6de9", "size": 37080, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/E8char3.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/E8char3.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/E8char3.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 32.7561837456, "max_line_length": 757, "alphanum_fraction": 0.5738403452, "num_tokens": 16610, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5621765008857981, "lm_q2_score": 0.40733340004593027, "lm_q1q2_score": 0.22899326553173605}} |
| {"text": "\n# Copyright 2018-2019, Carnegie Mellon University\n# See LICENSE for details\n\n#sin(a+b) = sin(a)cos(b) + cos(a)sin(b)\n#cos(a+b) = cos(a)cos(b) - sin(a)sin(b)\n\n# cos(a)x + sin(a)y \n# cos(a+b)x + sin(a+b)y\n# cos(a)cos(b)x - sin(a)sin(b)x + sin(a)cos(b)y + cos(a)sin(b)y\n# cos(a)cos(b)x + sin(a)cos(b)y + cos(a)sin(b)y - sin(a)sin(b)x\n# cos(b)[cos(a)x+sin(a)y] + sin(b)[cos(a)y-sin(a)x]\n\n\nNewRulesFor(HF, rec(\n HF_dummy := rec(\n applicable := (self, nt) >> true,\n forTransposition := false, \n apply := (t, c, nt) ->\n let( \n size := When(IsArrayT(t.params[1].t), t.params[1].t.size, Rows(t.params[1])),\n GathH(8, size, t.params[2]*size, 1)\n )\n )\n));\n\nNewRulesFor(TForAllInd, rec(\n TForAllInd_loop := rec( \n forTransposition := false,\n applicable := (self, nt) >> true,\n children := nt -> [ [ nt.params[2].withTags(nt.getTags()) ] ],\n apply := (t, c, nt) ->\n let(i := t.params[1], \n IterVStack(i, i.range,\n\t OLCompose(\n\t c[1],\n\t GathH(Cols(c[1]), Cols(c[1]), Cols(c[1])*i, 1)\n\t )\n\t )\n )\n )\n));\n\n\nNewRulesFor(TComputeDist, rec(\n TComputeDistBase := rec(\n apply := (t, c, nt) ->\n let(x := var.fresh_t(\"r\", TReal), y:= var.fresh_t(\"r\", TReal),\n OLCompose(\n Reduction(t.params[1], (a,b)->min(a,b), V(1000.0), False),\n\tBinOp(t.params[1], Lambda([x, y], add(x, y)))\n )\n ))\n));\n\n\nNewRulesFor(TForAnyInd, rec(\n TForAnyInd_loop := rec(\n forTransposition := false,\n applicable := (self, nt) >> true,\n children := nt -> [ [ nt.params[2].withTags(nt.getTags()) ] ],\n apply := (t, c, nt) -> \n\t let(iter := t.params[1], \n\t OLCompose(\n\t Reduction(iter.range, (a,b)->logic_or(a,b), V(false), \n\t a->eq(a, V(true))), IterVStack(iter, c[1]))),\n )\n));\n\n\nNewRulesFor(TInsidePoly, rec(\n TInsidePoly_EvalLinSys := rec(\n applicable := (self, nt) >> ObjId(nt.params[1]) = LinearSystem,\n forTransposition := false,\n children := nt -> [ [ TEvalLinSys(nt.params[1]).withTags(nt.getTags()) ] ],\n apply := (t, C, Nonterms) -> let(\n evalsys := C[1], \n i := Ind(Rows(evalsys)), x := var.fresh_t(\"r\", TDouble), \n cmp0 := PointWise(Rows(evalsys), Lambda([x,i], leq(x, V(0)))),\n forall_op := Reduction(Rows(evalsys), (a,b)->logic_and(a,b), V(true), a->eq(a, V(false))),\n OLCompose(forall_op, cmp0, evalsys))\n )\n));\n\nNewRulesFor(TEvalLinSys, rec(\n TEvalLinSys_TMatVecProd := rec(\n applicable := (self, nt) >> ObjId(nt.params[1]) = LinearSystem,\n children := nt -> [ [ TMatVecProd(nt.params[1].mat).withTags(nt.getTags()) ] ],\n forTransposition := false,\n apply := (t, C, Nonterms) -> let(linsys := t.params[1], A := linsys.mat, b := linsys.rhs, n :=linsys.dims()[1],\n x := var.fresh_t(\"r\", TDouble), i := Ind(n),\n OLCompose(PointWise(n, Lambda([x,i], sub(x, nth(b, i)))), C[1]))\n )\n));\n\nNewRulesFor(TMatVecProd, rec(\n TMatVecProd_Term := rec(\n applicable := (self, nt) >> true,\n forTransposition := false,\n apply := (t, C, Nonterms) -> let(mat := t.params[1], n := mat.dims()[1], m := mat.dims()[2], i := Ind(n), \n IterVStack(i, n, ScalarProd(m, nth(mat, i))))\n )\n));\n\nNewRulesFor(TInfinityNorm, rec(\n TInfinityNorm_Base := rec(\n applicable := True,\n forTransposition := false,\n apply := (t, C, Nonterms) -> let(n :=t.dims()[2], \n x := var.fresh_t(\"r\", TDouble), i := Ind(n),\n OLCompose(Reduction(n, (a,b)->max(a,b), V(0.0), False), PointWise(n, Lambda([x,i], abs(x)))))\n )\n));\n\nNewRulesFor(TDistance, rec(\n TDistance_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [[nt.params[1]]],\n apply := (t, C, Nonterms) -> let(n :=C[1].dims()[2], x := var.fresh_t(\"r\", TDouble), y := var.fresh_t(\"r\", TDouble),\n OLCompose(C[1], BinOp(n, Lambda([x,y], sub(x,y)))))\n )\n));\n\nNewRulesFor(TEvalPolynomial, rec(\n TEvalPolynomial_Base := rec(\n applicable := True,\n forTransposition := false,\n apply := (t, C, Nonterms) -> let(n := t.params[1]+1, x := var.fresh_t(\"r\", TDouble), y := var.fresh_t(\"r\", TDouble),\n OLCompose(ScalarProd(n, t.params[2]), Induction(n, Lambda([x,y], mul(x, y)), V(1.0))))\n )\n));\n\nNewRulesFor(TLess, rec(\n TLess_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [nt.params],\n apply := (t, c, Nonterms) -> let(\n\t\t\tn :=t.dims()[1], \n\t\t\tx := var.fresh_t(\"r\", TDouble), \n\t\t\ty := var.fresh_t(\"r\", TDouble),\n\t\t\tOLCompose(\n\t\t\t\tBinOp(n, Lambda([x,y], lt(x,y))), DirectSum(c[1], c[2]) )\n )\n)));\n\n\nNewRulesFor(TGreater, rec(\n TGreater_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [nt.params],\n apply := (t, c, Nonterms) -> let(\n n :=t.dims()[1], \n x := var.fresh_t(\"r\", TDouble), \n y := var.fresh_t(\"r\", TDouble),\n OLCompose(\n BinOp(n, Lambda([x,y], gt(x,y))), DirectSum(c[1], c[2]) )\n )\n)));\n\nNewRulesFor(TLessEqual, rec(\n TLessEqual_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [nt.params],\n apply := (t, c, Nonterms) -> let(\n n :=t.dims()[1], \n x := var.fresh_t(\"r\", TDouble), \n y := var.fresh_t(\"r\", TDouble),\n OLCompose(\n BinOp(n, Lambda([x,y], leq(x,y))), DirectSum(c[1], c[2]) )\n )\n)));\n\nNewRulesFor(TGreaterEqual, rec(\n TGreaterEqual_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [nt.params],\n apply := (t, c, Nonterms) -> let(\n n :=t.dims()[1], \n x := var.fresh_t(\"r\", TDouble), \n y := var.fresh_t(\"r\", TDouble),\n OLCompose(\n BinOp(n, Lambda([x,y], geq(x,y))), DirectSum(c[1], c[2]) )\n )\n)));\n\nNewRulesFor(TEqual, rec(\n TEqual_Base := rec(\n applicable := True,\n forTransposition := false,\n children := nt -> [nt.params],\n apply := (t, c, Nonterms) -> let(\n n :=t.dims()[1], \n x := var.fresh_t(\"r\", TDouble), \n y := var.fresh_t(\"r\", TDouble),\n OLCompose(\n BinOp(n, Lambda([x,y], eq(x,y))), DirectSum(c[1], c[2]) )\n )\n)));\n\n\nNewRulesFor(TCond, rec(\n\tCond_Base := rec(\n\t\tapplicable := True,\n\t\tforTransposition := false,\n\t\tchildren := nt -> [nt.params],\n\t\tapply := (t, c, Nonterms) -> let(\n\t\t\tCOND(c[1], c[2], c[3])\n\t\t)\n\t)\n));\n\n\nNewRulesFor(TConstant, rec(\n TConstant_Base := rec(\n applicable := True, \n forTransposition := false, \n children := nt -> [nt.params], \n apply := (t, C, Nonterms) -> let(x := var.fresh_t(\"r\", TDouble), i := Ind(1), PointWise(1, Lambda([x, i], x)))\n )\n));\n", "meta": {"hexsha": "5c1ef475565f246b2214d34225a1a885895bcb3b", "size": 6806, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "breakdown.gi", "max_stars_repo_name": "spiral-software/spiral-package-hcol", "max_stars_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "breakdown.gi", "max_issues_repo_name": "spiral-software/spiral-package-hcol", "max_issues_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "breakdown.gi", "max_forks_repo_name": "spiral-software/spiral-package-hcol", "max_forks_repo_head_hexsha": "b4a0118382e3bba91ecd82a6c667f2cdb6389ceb", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 1, "max_forks_repo_forks_event_min_datetime": "2019-11-26T05:21:02.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-26T05:21:02.000Z", "avg_line_length": 30.1150442478, "max_line_length": 124, "alphanum_fraction": 0.5248310314, "num_tokens": 2176, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5736784074525096, "lm_q2_score": 0.3923368301671084, "lm_q1q2_score": 0.2250751679152325}} |
| {"text": "\n# Copyright (c) 2018-2021, Carnegie Mellon University\n# See LICENSE for details\n\n\nImportAll(paradigms.smp); # for AParSMP\nImportAll(paradigms.vector); # for VRCLR\nImport(approx); # for CeilingRat.\n\nLoad(spiral.paradigms.dram.hacks); # for TTensor3 etc.\nImport(hacks);\n\n#_swrap := (nt) -> let(t:=nt.firstTag(), ScratchWrap(t.size,t.nsgmts,t.linesize));\n\n#_nodeFitsTensorDoesnt := (nt) -> let (\n# k := nt.getTag(1).size,\n# m := nt.params[1].dims()[2],\n# n := nt.params[2],\n#\n# 2*m <= k and m*n >= k\n#);\n\t\n#_isALStoreTag := (nt) -> nt.isTag(1,ALStore) or nt.isTag(1,ALStoreCx);\n\n_isADramTag := (nt) -> nt.isTag(1,ADram);\n_isATileTag := (nt) -> nt.isTag(1,ATile);\n_isATileRdTag := (nt) -> nt.isTag(1,ATileRd);\n_isATileWrTag := (nt) -> nt.isTag(1,ATileWr);\n_isACubeTag := (nt) -> nt.isTag(1,ACube);\n_isACubeRdTag := (nt) -> nt.isTag(1,ACubeRd);\n_isACubeWrTag := (nt) -> nt.isTag(1,ACubeWr);\n_isTL_I := (nt) -> nt.params[1]=1 and nt.params[2]=1 and nt.params[3]>1 and nt.params[4]=1;\n_isTL_L := (nt) -> nt.params[1]>1 and nt.params[2]>1 and nt.params[3]=1 and nt.params[4]=1;\n_isTL_I_L := (nt) -> nt.params[1]>1 and nt.params[2]>1 and nt.params[3]>1 and nt.params[4]=1;\n_isReduced1D := (nt) -> let(p := Length(nt.params[1].params), When(p=3, (Length(nt.params[1].params[1]) = 1), true));\n\n_DetermineTag := function(t)\n\tlocal ll,tag,k;\n\tll := When(Length(t.params)=3,Length(t.params[1]),1); #if MDDFT,x,1\n\t\n\tif(ll = 2 or ll = 1) then\n\t\tk := Int(Log2Int(t.getTag(1).rb)/2);\n\t\tk := 2^k;\n\t\tif(not (k^2 = t.getTag(1).rb)) then\n\t\t\tPrintLine(\"WARNING: Tile <-> Row-Buffer cannot be mathced perfectly!\");\n\t\tfi;\n\t\ttag := ATile(k,t.getTag(1).m);\n\telse if(ll = 3) then\n\t\tk := Int(Log2Int(t.getTag(1).rb)/3);\n\t\tk := 2^k;\n\t\tif(not (k^3 = t.getTag(1).rb)) then\n\t\t\tPrintLine(\"WARNING: Cube <-> Row-Buffer cannot be mathced perfectly!\");\n\t\tfi;\n\t\ttag := ACube(k,t.getTag(1).m);\n\telse\n\t\tPrintLine(\"I cannot handle an algorithm with \",ll,\" stages for now, sorry..\");\n\t\tError(\"\");\n\tfi; fi;\n\n\treturn tag;\nend;\n# NewRulesFor(TCompose, rec(\n# # (AB) -> (A) fence (B)\n# \tAB_tile := rec(\n# \t)\n# ));\n\nNewRulesFor(MDDFT, rec(\n MDDFT_tSPL_RowCol_break_2D := rec(\n info := \"tSPL MDDFT_n -> MDDFT_n/d, MDDFT_d\",\n\n applicable := (self, t) >> Length(t.params[1]) > 1 and not _isADramTag(t) and _isATileTag(t),\n freedoms := t -> [ [1..Length(t.params[1])-1] ],\n\n child := (t, fr) -> let(\n newdims := SplitAt(t.params[1], fr[1]),\n rot := t.params[2],\n [ TTensor(\n MDDFT(newdims[1], rot),\n MDDFT(newdims[2], rot)\n ).withTags(t.getTags())]\n ),\n\n apply := (t, C, Nonterms) -> C[1],\n switch := false\n ),\n\t\n\tMDDFT_tSPL_RowCol_break_3D := rec(\n info := \"tSPL MDDFT_n -> MDDFT_n/d, MDDFT_d\",\n\n applicable := (self, t) >> Length(t.params[1]) > 1 and not _isADramTag(t) and _isACubeTag(t),\n freedoms := t -> [ [1..Length(t.params[1])-1] ],\n\n children := (t) -> let(\n newdims := t.params[1],\n \n [[ TTensor3(\n MDDFT([newdims[1]]),\n MDDFT([newdims[2]]),\n MDDFT([newdims[3]])\n ).withTags(t.getTags())]]\n ),\n\n apply := (t, C, Nonterms) -> C[1],\n switch := false\n ),\n\t\n\tMDDFT_tSPL_RowCol_push := rec(\n info := \"tSPL MDDFT_n -> MDDFT_n/d, MDDFT_d\",\n\n applicable := (self, t) >> Length(t.params[1]) > 1 and _isADramTag(t),\n freedoms := t -> [ [1..Length(t.params[1])-1] ],\n\n child := (t, fr) -> let(\n\t\t\ttag := _DetermineTag(t),\n\t\t\tnewTag := Concat([tag], Drop(t.getTags(), 1)),\n [ t.withoutFirstTag().withTags(newTag) ]\n ),\n\n apply := (t, C, Nonterms) -> C[1],\n switch := false\n )\n\t\n));\n\n\nNewRulesFor(TTwiddle, rec(\n TTwiddle_dram := rec(\n minSize := false,\n maxSize := false,\n applicable := (self, nt) >> ((IsBool(self.minSize) and not self.minSize) or nt.params[1] >= self.minSize) and \n ((IsBool(self.maxSize) and not self.maxSize) or nt.params[1] <= self.maxSize),\n forTransposition := false,\n apply := (t, C, Nonterms) -> TwiddleROM(t.params[1], t.params[2], t.params[3])\n )\n));\n\n\n#######################################################################################\n# tSPL DFT rules\nNewRulesFor(DFT, rec(\n #F DFT_CT: 1965\n #F General Cooley-Tukey Rule\n #F DFT_n = (DFT_n/d tensor I_d) * diag * (I_n/d tensor F_d) * perm\n #F\n #F Cooley/Tukey:\n #F An Algorithm for the Machine Calculation of Complex Fourier Series.\n #F Mathematics of Computation, Vol. 19, 1965, pp. 297--301.\n #F\n DFT_tSPL_CT_tiled := rec(\n info := \"tSPL DFT(mn,k) -> DFT(m, k%m), DFT(n, k%n)\",\n\n maxSize := false,\n\n applicable := (self, nt) >> nt.params[1] > 2\n and (self.maxSize = false or nt.params[1] <= self.maxSize)\n\t\tand _isATileTag(nt)\n and not IsPrime(nt.params[1])\n\t\tand IsPosInt(Sqrt(nt.params[1]))\n and nt.hasTags(),\n\n children := nt -> let(n := Sqrt(nt.params[1]), m := n,\n\t\n\t[[\n TCompose([\n TGrp(TCompose([\n TTensorI(DFT(m, nt.params[2] mod m), n, AVec, AVec),\n TTwiddle(m*n, n, nt.params[2])\n ])),\n TGrp(TTensorI(DFT(n, nt.params[2] mod n), m, APar, AVec))\n ]).withTags(nt.getTags())\n ]]),\n\n apply := (nt, c, cnt) -> c[1],\n\n switch := false\n ),\n\t\n\tDFT_tSPL_push_tiled := rec(\n info := \"tSPL DFT(mn,k) -> DFT(m, k%m), DFT(n, k%n)\",\n\t\t\n\t\tmaxSize := false,\n \n\t\tapplicable := (self, t) >> t.params[1] > 2 and _isADramTag(t),\n\n children := (t) -> let(\n\t\t\ttag := _DetermineTag(t),\n\t\t\tnewTag := Concat([tag], Drop(t.getTags(), 1)),\n [[ t.withoutFirstTag().withTags(newTag) ]]\n ),\n\n apply := (t, C, Nonterms) -> C[1],\n switch := false\n )\n));\n\n\n############################## 3D Rules ##############################\n\n# (A x B) rules\nNewRulesFor(TTensor3, rec(\n# (A x B x C) -> (A x B x I)(I x I x C)\n AxBxI_IxIxC := rec(\n info := \"(A x B x C) -> (A x B x I)(I x I x C)\",\n forTransposition := false,\n applicable := nt -> true,\n #inplace := false,\n children := (self, nt) >> let(#inp := When(self.inplace, Inplace, x->x),\n [[ TCompose([\n TTensorI3(nt.params[1], nt.params[2], I(nt.params[3].dims()[2])),\n TTensorI3(I(nt.params[1].dims()[2]), I(nt.params[2].dims()[2]), nt.params[3])\n ]).withTags(nt.getTags()) ]]),\n apply := (nt, c, cnt) -> c[1],\n#D isApplicable := P -> true,\n#D allChildren := P -> [[TCompose([TTensorI(P[1], P[2].dims()[1], AVec, AVec), TTensorI(P[2], P[1].dims()[2], APar, APar)], P[3])]],\n#D rule := (P, C) -> C[1]\n ),\n\t# (A x B x C) -> (A x I x I)(I x B x C)\n AxIxI_IxBxC := rec(\n info := \"(A x B x C) -> (A x I x I)(I x B x C)\",\n forTransposition := false,\n applicable := nt -> true,\n #inplace := false,\n children := (self, nt) >> let(#inp := When(self.inplace, Inplace, x->x),\n [[ TCompose([\n\t\t\t\tTTensorI3(nt.params[1], I(nt.params[2].dims()[2]), I(nt.params[3].dims()[2])),\n\t\t\t\tTTensorI3(I(nt.params[1].dims()[2]), nt.params[2], nt.params[3])\n ]).withTags(nt.getTags()) ]]),\n apply := (nt, c, cnt) -> c[1],\n\t),\n\t\n\t# (A x B x C) -> (A x I x I)(I x B x I)(I x I x C)\n\tAxIxI_IxBxI_IxIxC := rec(\n info := \"(A x B x C) -> (A x I x I)(I x B x I)(I x I x C)\",\n forTransposition := false,\n applicable := nt -> true,\n #inplace := false,\n children := (self, nt) >> let(#inp := When(self.inplace, Inplace, x->x),\n [[ TCompose([\n\t\t\t\tTTensorI3(nt.params[1], I(nt.params[2].dims()[2]), I(nt.params[3].dims()[2])),\n\t\t\t\tTTensorI3(I(nt.params[1].dims()[2]), nt.params[2], I(nt.params[3].dims()[2])),\n\t\t\t\tTTensorI3(I(nt.params[1].dims()[2]), I(nt.params[2].dims()[2]), nt.params[3])\n ]).withTags(nt.getTags()) ]]),\n apply := (nt, c, cnt) -> c[1],\n\t)\n));\n\nNewRulesFor(TTensorI3, rec(\n\t# (In x In x An) -> In3 (In2/k2 x (Ik x Ik x DFTn)) In3\n\tIxIxA_cube := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeTag(nt)\n\t\t\t\t\t\t\tand IsIIA(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[3].dims()[2] / nt.getTag(1).k / nt.getTag(1).k)\n\t\t\t\t\t\t\tand (Length(nt.params[3].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.dims()[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[3].dims()[2],\n\t\t\tRdTag := Concat([ACubeRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ACubeWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(1,1,n*n*n,1).withTags(WrTag),\n\t\t\t\tTTensorI3(I(k),I(k),nt.params[3]).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(1,1,n*n*n,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[3].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n*n/k/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\n\t),\n\t\n\t# (An x In x In) -> Ln3_n (In2/k2 x (Ik x Ik x DFTn)) Ln3_n2\n\tAxIxI_cube := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeTag(nt)\n\t\t\t\t\t\t\tand IsAII(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[1].dims()[2] / nt.getTag(1).k / nt.getTag(1).k)\n\t\t\t\t\t\t\tand (Length(nt.params[1].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.dims()[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\tRdTag := Concat([ACubeRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ACubeWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(n*n*n,n,1,1).withTags(WrTag) ,\n\t\t\t\tTTensorI3(I(k),I(k),nt.params[1]).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(n*n*n,n*n,1,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n*n/k/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\t\n\t),\n\n\t# (In x An x In) -> In x Ln2_n (In2/k2 x (Ik x Ik x DFTn)) In x Ln2_n\n\tIxAxI_cube := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeTag(nt)\n\t\t\t\t\t\t\tand IsIAI(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[2].dims()[2] / nt.getTag(1).k / nt.getTag(1).k)\n\t\t\t\t\t\t\tand (Length(nt.params[2].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.dims()[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[2].dims()[2],\n\t\t\tRdTag := Concat([ACubeRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ACubeWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(n*n,n,n,1).withTags(WrTag) ,\n\t\t\t\tTTensorI3(I(k),I(k),nt.params[2]).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(n*n,n,n,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[2].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n*n/k/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\t\n\t),\n\t\n\tIxIxA_cube_base := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeTag(nt)\n\t\t\t\t\t\t\tand IsIIA(nt.params)\n\t\t\t\t\t\t\tand (Length(nt.params[3].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.dims()[2] <= nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> [[ ]],\n\t\t\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tn := nt.params[3].dims()[2],\n\t\t\tk2 := nt.params[2].dims()[2],\n\t\t\tk1 := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tCompKern(I(k1),I(k2),DFT(n)) \t\t\t\n\t\t)\n\t\t\n\t)\n\t\n\n));\n\n\nNewRulesFor(TL, rec(\n# In^2_{read} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n\tI_cubeRd := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeRdTag(nt)\n\t\t\t\t\t\t\tand _isTL_I(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[3],3)) #n3 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[3],3) / nt.getTag(1).k),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[3],3),\n\t\t\t#mem := MemRdPrm(fTensor(fId(n/k),L(n*n,n*n/k/k),fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n))),\n\t\t\tmem := MemRdPrm(fTensor(fId(n/k),L(n*n,n*n/k/k),fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n/k),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(fTensor(L(n*k,k*k), fId(k)))),\n\t\t\t\n\t\t\tloc*mem\n\t\t\t\n\t\t\t\n\t\t)\n\t),\n# In^2_{write} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n\tI_cubeWr := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeWrTag(nt)\n\t\t\t\t\t\t\tand _isTL_I(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[3],3)) #n3 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[3],3) / nt.getTag(1).k),\n\t\t\n\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[3],3),\n\t\t\t#mem := MemRdPrm(fTensor(fId(n/k),L(n*n,n*n/k/k),fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n))),\n\t\t\tmem := MemRdPrm(fTensor(fId(n/k),L(n*n,n*n/k/k),fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n/k),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(fTensor(L(n*k,k*k), fId(k)))),\n\t\t\t\n\t\t\tTransposedSPL(loc*mem)\n\t\t)\n\t),\n# Ln^2_n_{read} -> (In/k x L^nk_k)(L^n^2/k_n/k x Ik)\n\tLn3n2_cubeRd := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeRdTag(nt)\n\t\t\t\t\t\t\tand _isTL_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],3)) #n3 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],3) / nt.getTag(1).k),\n\t\t\t\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[1],3),\n\t\t\t#mem := \tMemRdPrm(fTensor(L(n*n*n/k,n*n/k/k), fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n))),\n\t\t\tmem := \tMemRdPrm(fTensor(L(n*n*n/k,n*n/k/k), fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n/k),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(fTensor(L(n*k*k,k*k)))),\n\t\t\t\n\t\t\tloc*mem\n\t\t)\n\t),\n# Ln^2_n_{write} -> (L^n^2/k_n x Ik)(In/k x L^nk_n)\n\tLn3n_cubeWr := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeWrTag(nt)\n\t\t\t\t\t\t\tand _isTL_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],3)) #n3 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],3) / nt.getTag(1).k),\n\t\t\n\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[1],3),\n\t\t\t#mem := \tMemRdPrm(fTensor(L(n*n*n/k,n*n/k/k), fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n))),\n\t\t\tmem := \tMemRdPrm(fTensor(L(n*n*n/k,n*n/k/k), fId(k))) * MemRdPrm(fTensor(fId(n),L(n,k),fId(n/k),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(fTensor(L(n*k*k,k*k)))),\n\t\t\t\n\t\t\tTransposedSPL(loc*mem)\n\t\t)\n\t\t\t\n\t),\n# Ln^2_n_{read} -> (In/k x L^nk_k)(L^n^2/k_n/k x Ik)\n\tInLn2n_cubeRd := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeRdTag(nt)\n\t\t\t\t\t\t\tand _isTL_I_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],2)) #n2 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],2) / nt.getTag(1).k),\n\t\t\t\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[1],2),\n\t\t\t#mem := MemRdPrm(fTensor(fId(n/k), L(n*n,n/k), fId(k))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(n*k))),\n\t\t\tmem := MemRdPrm(fTensor(fId(n/k), L(n*n,n/k), fId(k))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(n),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(L(n*k*k,k*k))) * DTensor(I(n*n/k/k), LocalRdPrm(fTensor(fId(n/k),L(k*k,k),fId(k)))),\n\t\t\t\n\t\t\tloc*mem\n\t\t)\n\t),\n\n\tInLn2n_cubeWr := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isACubeWrTag(nt)\n\t\t\t\t\t\t\tand _isTL_I_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],2)) #n2 -> n\n\t\t\t\t\t\t\tand IsPosInt(RootInt(nt.params[1],2) / nt.getTag(1).k),\n\t\t\t\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := RootInt(nt.params[1],2),\n\t\t\t#mem := MemRdPrm(fTensor(fId(n/k), L(n*n,n/k), fId(k))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(n*k))),\n\t\t\tmem := MemRdPrm(fTensor(fId(n/k), L(n*n,n/k), fId(k))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(n),fId(k))),\n\t\t\tloc := DTensor(I(n*n/k/k), LocalRdPrm(L(n*k*k,k*k))) * DTensor(I(n*n/k/k), LocalRdPrm(fTensor(fId(n/k),L(k*k,k),fId(k)))),\n\t\t\t\n\t\t\tTransposedSPL(loc*mem)\n\t\t)\t\t\n\t)\n\n));\n\n############################## 2D Rules ##############################\n\nNewRulesFor(TTensorI, rec(\n \n# ================================================================\n# nt.params; => [DFT_matix, Size_of_I, <APar,Avec>, <APar,Avec>]\n# So,\n# nt.params[1].dims()[2] -> Size of DFT matrix\n# nt.params[2] -> Size of I matrix\n# IsParPar actually checks nt.params[3]=APar and nt.params[4]=APar\n#\n# nt.getTag(1) -> Tag object. So access its methods via \".\"\n#\n# ================================================================\n# tSPL I x L x I\n# TL(m, n, k, j)\n# I(k), L(m, n), I(j)\n# ================================================================\n\n\n# (In x An) -> In^2 (In/k x Ik x An) In^2\n# (In x An)_{Tile(k,m)} -> In^2_{TileWr(k,m)} (In/k x Ik x An) In^2_{TileRd(k,m)} for k|n and m>kn\n\tIxA_tile := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsParPar(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[1].dims()[2] / nt.getTag(1).k)\n\t\t\t\t\t\t\tand _isReduced1D(nt) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\t#and (Length(nt.params[1].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2]*nt.params[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\tRdTag := Concat([ATileRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ATileWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(1,1,n*n,1).withTags(WrTag) ,\n\t\t\t\tTTensorI(nt.params[1],k,APar,APar).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(1,1,n*n,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\n\t),\n\n# (An x In) -> L^{n^2}_n (In/k x Ik x An) L^{n^2}_n\n\tAxI_tile := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsVecVec(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[1].dims()[2] / nt.getTag(1).k)\n\t\t\t\t\t\t\tand _isReduced1D(nt) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\t#and (Length(nt.params[1].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2]*nt.params[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\tRdTag := Concat([ATileRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ATileWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(n*n,n,1,1).withTags(WrTag) ,\n\t\t\t\tTTensorI(nt.params[1],k,APar,APar).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(n*n,n,1,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\n\t),\n# L^{n^2}_n (In x An) -> L^{n^2}_n (In/k x Ik x An) In^2\n\tL_IxA_tile := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsVecPar(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[1].dims()[2] / nt.getTag(1).k)\n\t\t\t\t\t\t\tand _isReduced1D(nt) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\t#and (Length(nt.params[1].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2]*nt.params[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\tRdTag := Concat([ATileRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ATileWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(n*n,n,1,1).withTags(WrTag) ,\n\t\t\t\tTTensorI(nt.params[1],k,APar,APar).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(1,1,n*n,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\n\t),\n# (In x An) L^{n^2}_n -> In^2 (In/k x Ik x An) L^{n^2}_n\n\tIxA_L_tile := rec(\n\t\tforTransposition := false,\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsParVec(nt.params)\n\t\t\t\t\t\t\tand IsPosInt(nt.params[1].dims()[2] / nt.getTag(1).k)\n\t\t\t\t\t\t\tand _isReduced1D(nt) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\t#and (Length(nt.params[1].params[1]) = 1) # reduced to 1D-DFT kernel\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2]*nt.params[2] > nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\tRdTag := Concat([ATileRd(k,m)], Drop(nt.getTags(), 1)),\n\t\t\tWrTag := Concat([ATileWr(k,m)], Drop(nt.getTags(), 1)),\n\t\t\t\n\t\t\t[[ \n\t\t\t\tTL(1,1,n*n,1).withTags(WrTag) ,\n\t\t\t\tTTensorI(nt.params[1],k,APar,APar).withTags(nt.getTags()), #.withTags(Drop(nt.getTags(), 1)) ,\n\t\t\t\tTL(n*n,n,1,1).withTags(RdTag) \n\t\t\t]]\n\t\t),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tMemFence(\n\t\t\t\tc[1] *\n\t\t\t\tDTensor(\n\t\t\t\t\tI(n/k),\n\t\t\t\t\t(c[2])\n\t\t\t\t) *\n\t\t\t\tc[3]\n\t\t\t)\n\t\t)\n\t)\n));\n\n# Termination Rules, i.e. computation fits in local memory\nNewRulesFor(TTensorI, rec(\n\tIxA_tile_base := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsParPar(nt.params)\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2] * nt.params[2] <= nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> [[ ]],\n\t\t\n\t\tapply := (nt, c ,cnt) -> let(\n\t\t\tk := nt.params[2],\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\tCompKern(I(k), DFT(n))\n\t\t)\n\t),\n\t\n\t\n\tAxI_tile_base := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsVecVec(nt.params)\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2] * nt.params[2] <= nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> [[ ]],\n\t\t\n\t\tapply := (nt, c ,cnt) -> let(\n\t\t\tk := nt.params[2],\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\t# NOTE: Check the L index!\n\t\t\tLocalWrPrm(fTensor(L(k*n,n))) * CompKern(I(k), DFT(n)) * LocalRdPrm(fTensor(L(n*k,k)))\n\t\t\t# TPrm and TL for splhdl\n\t\t\t#LocalWrPrm(Tensor(L(k*n,n))) * CompKern(I(k), DFT(n)) * LocalRdPrm(Tensor(L(n*k,k)))\n\t\t)\n\t),\n\t\n\t\n\tL_IxA_tile_base := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsVecPar(nt.params)\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2] * nt.params[2] <= nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> [[ ]],\n\t\t\n\t\tapply := (nt, c ,cnt) -> let(\n\t\t\tk := nt.params[2],\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\t# NOTE: Check the L index!\n\t\t\t# TTensorI(DFTn,k,AVec,APar) -> L(n*k,???) * (Ik x DFTn)\n\t\t\t# \n\t\t\t# \n\t\t\t# \n\t\t\tLocalWrPrm(fTensor(L(n*k,k))) * CompKern(I(k),DFT(n))\n\t\t\t# TPrm and TL for splhdl\n\t\t\t#LocalWrPrm(Tensor(L(n*k,k))) * CompKern(I(k),DFT(n))\n\t\t)\n\t),\n\t\n\t\n\tIxA_L_tile_base := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileTag(nt)\n\t\t\t\t\t\t\tand IsParVec(nt.params)\n\t\t\t\t\t\t\tand (nt.params[1].dims()[2] * nt.params[2] <= nt.getTag(1).m),\n\t\t\t\t\t\t\t\n\t\tchildren := nt -> [[ ]],\n\t\t\n\t\tapply := (nt, c ,cnt) -> let(\n\t\t\tk := nt.params[2],\n\t\t\tn := nt.params[1].dims()[2],\n\t\t\t\n\t\t\t# NOTE: Check the L index!\n\t\t\tCompKern(I(k),DFT(n)) * LocalRdPrm(fTensor(L(k*n,n)))\n\t\t\t# TPrm and TL for splhdl\n\t\t\t#CompKern(I(k),DFT(n)) * LocalRdPrm(Tensor(L(k*n,n)))\n\t\t)\n\t)\n));\n\n\nNewRulesFor(TL, rec(\n# In^2_{read} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n\tI_tileRd := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileRdTag(nt)\n\t\t\t\t\t\t\tand _isTL_I(nt)\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]))\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]) / nt.getTag(1).k),\n\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := Sqrt(nt.params[3]),\n\t\t\t\n\t\t\t\t\n\t\t\tDTensor(I(n/k), LocalRdPrm(fTensor(L(n,k),fId(k)))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(k))) \n\t\t\t# TPrm and TL for splhdl\t\t\n\t\t\t#DTensor(I(n/k), LocalRdPrm(Tensor(L(n,k),I(k)))) * MemRdPrm(fTensor(fId(n/k), L(n,n/k), fId(k))) \n\t\t\t\n\t\t)\n\t),\n# In^2_{write} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n\tI_tileWr := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileWrTag(nt)\n\t\t\t\t\t\t\tand _isTL_I(nt)\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]))\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]) / nt.getTag(1).k),\n\t\t\n\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := Sqrt(nt.params[3]),\n\t\t\t\n\t\t\t\n\t\t\tMemWrPrm(fTensor(fId(n/k), L(n,k), fId(k))) * DTensor(I(n/k), LocalWrPrm(fTensor(L(n,n/k),fId(k))))\n\t\t\t# TPrm and TL for splhdl\n\t\t\t#MemWrPrm(fTensor(fId(n/k), L(n,k), fId(k))) * DTensor(I(n/k), LocalWrPrm(Tensor(L(n,n/k),I(k))))\n\t\t)\n\t),\n# Ln^2_n_{read} -> (In/k x L^nk_k)(L^n^2/k_n/k x Ik)\n\tL_tileRd := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileRdTag(nt)\n\t\t\t\t\t\t\tand _isTL_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]))\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]) / nt.getTag(1).k),\n\t\t\t\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := Sqrt(nt.params[1]),\n\t\t\t\t\n\t\t\tDTensor(I(n/k), LocalRdPrm(fTensor(L(n*k,k)))) * MemRdPrm(fTensor(L(n*n/k,n/k), fId(k))) \n\t\t\t# TPrm and TL for splhdl\n\t\t\t#DTensor(I(n/k), LocalRdPrm(Tensor(L(n*k,k)))) * MemRdPrm(fTensor(L(n*n/k,n/k), fId(k))) \n\t\t\t\n\t\t)\n\t),\n# Ln^2_n_{write} -> (L^n^2/k_n x Ik)(In/k x L^nk_n)\n\tL_tileWr := rec(\n\t\tapplicable := nt -> nt.hasTags()\n\t\t\t\t\t\t\tand _isATileWrTag(nt)\n\t\t\t\t\t\t\tand _isTL_L(nt)\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]))\n\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]) / nt.getTag(1).k),\n\t\t\n\t\t\t\t\n\t\tapply := (nt, c, cnt) -> let(\n\t\t\tk := nt.getTag(1).k,\n\t\t\tm := nt.getTag(1).m,\n\t\t\tn := Sqrt(nt.params[1]),\n\t\t\t\n\t\t\tMemWrPrm(fTensor(L(n*n/k,n), fId(k))) * DTensor(I(n/k), LocalWrPrm(fTensor(L(n*k,n))))\n\t\t\t# TPrm and TL for splhdl\n\t\t\t#MemWrPrm(fTensor(L(n*n/k,n), fId(k))) * DTensor(I(n/k), LocalWrPrm(Tensor(L(n*k,n))))\n\t\t)\n\t\t\t\n\t)\n));\n\n#==============================================================\n# First version of TL rules\n# Generates children for permutations that is to be further optimized\n#==============================================================\n#\tNewRulesFor(TL, rec(\n#\t# In^2_{read} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n#\t\tI_tileRd := rec(\n#\t\t\tapplicable := nt -> nt.hasTags()\n#\t\t\t\t\t\t\t\tand _isATileRdTag(nt)\n#\t\t\t\t\t\t\t\tand _isTL_I(nt)\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]))\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]) / nt.getTag(1).k),\n#\t\t\t\n#\t\t\tchildren := nt -> let(\n#\t\t\t\tk := nt.getTag(1).k,\n#\t\t\t\tm := nt.getTag(1).m,\n#\t\t\t\tn := Sqrt(nt.params[3]),\n#\t\t\t\t\n#\t\t\t\t[[\n#\t\t\t\t\tTL(n, k, n/k, k).withTags(Drop(nt.getTags(), 1)) , \n#\t\t\t\t\tTL(n, n/k, n/k, k).withTags(Drop(nt.getTags(), 1))\n#\t\t\t\t]]\n#\t\t\t),\n#\t\t\t\n#\t\t\tapply := (nt, c, cnt) -> c[1] * c[2]\n#\t\t),\n#\t# In^2_{write} -> (In/k x L^n_k x Ik)(In/k x L^n_n/k x Ik)\t\n#\t\tI_tileWr := rec(\n#\t\t\tapplicable := nt -> nt.hasTags()\n#\t\t\t\t\t\t\t\tand _isATileWrTag(nt)\n#\t\t\t\t\t\t\t\tand _isTL_I(nt)\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]))\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[3]) / nt.getTag(1).k),\n#\t\t\t\n#\t\t\tchildren := nt -> let(\n#\t\t\t\tk := nt.getTag(1).k,\n#\t\t\t\tm := nt.getTag(1).m,\n#\t\t\t\tn := Sqrt(nt.params[3]),\n#\t\t\t\t\n#\t\t\t\t[[\n#\t\t\t\t\tTL(n, k, n/k, k).withTags(Drop(nt.getTags(), 1)) , \n#\t\t\t\t\tTL(n, n/k, n/k, k).withTags(Drop(nt.getTags(), 1))\n#\t\t\t\t]]\n#\t\t\t),\n#\t\t\t\n#\t\t\tapply := (nt, c, cnt) -> c[1] * c[2]\n#\t\t),\n#\t# Ln^2_n_{read} -> (In/k x L^nk_k)(L^n^2/k_n/k x Ik)\n#\t\tL_tileRd := rec(\n#\t\t\tapplicable := nt -> nt.hasTags()\n#\t\t\t\t\t\t\t\tand _isATileRdTag(nt)\n#\t\t\t\t\t\t\t\tand _isTL_L(nt)\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]))\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]) / nt.getTag(1).k),\n#\t\t\t\t\t\t\t\t\n#\t\t\tchildren := nt -> let(\n#\t\t\t\tk := nt.getTag(1).k,\n#\t\t\t\tm := nt.getTag(1).m,\n#\t\t\t\tn := Sqrt(nt.params[1]),\n#\t\t\t\t\n#\t\t\t\t[[\n#\t\t\t\t\tTL(n*k, k, n/k, 1).withTags(Drop(nt.getTags(), 1)) ,\n#\t\t\t\t\tTL(n*n/k, n/k, 1, k).withTags(Drop(nt.getTags(), 1))\n#\t\t\t\t]]\n#\t\t\t),\n#\t\t\t\n#\t\t\tapply := (nt, c, cnt) -> c[1] * c[2]\n#\t\t),\n#\t# Ln^2_n_{write} -> (L^n^2/k_n x Ik)(In/k x L^nk_n)\n#\t\tL_tileWr := rec(\n#\t\t\tapplicable := nt -> nt.hasTags()\n#\t\t\t\t\t\t\t\tand _isATileWrTag(nt)\n#\t\t\t\t\t\t\t\tand _isTL_L(nt)\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]))\n#\t\t\t\t\t\t\t\tand IsPosInt(Sqrt(nt.params[1]) / nt.getTag(1).k),\n#\t\t\t\n#\t\t\tchildren := nt -> let(\n#\t\t\t\tk := nt.getTag(1).k,\n#\t\t\t\tm := nt.getTag(1).m,\n#\t\t\t\tn := Sqrt(nt.params[1]),\n#\t\t\t\t\n#\t\t\t\t[[\n#\t\t\t\t\tTL(n*n/k, n, 1, k).withTags(Drop(nt.getTags(), 1)), \n#\t\t\t\t\tTL(n*k, n, n/k, 1).withTags(Drop(nt.getTags(), 1))\n#\t\t\t\t]]\n#\t\t\t),\n#\t\t\t\n#\t\t\tapply := (nt, c, cnt) -> c[1] * c[2]\n#\t\t\t\t\n#\t\t)\n#\t));\n#\t\n\n\n\n\n\n", "meta": {"hexsha": "561b7eeb24d56e87adda024e2f1df01839f20848", "size": 28401, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "namespaces/spiral/paradigms/dram/breakdown.gi", "max_stars_repo_name": "sr7cb/spiral-software", "max_stars_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_stars_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_stars_count": 42, "max_stars_repo_stars_event_min_datetime": "2019-09-01T19:29:39.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-17T12:26:12.000Z", "max_issues_repo_path": "namespaces/spiral/paradigms/dram/breakdown.gi", "max_issues_repo_name": "sr7cb/spiral-software", "max_issues_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_issues_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_issues_count": 12, "max_issues_repo_issues_event_min_datetime": "2020-11-20T16:15:52.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-07T21:17:28.000Z", "max_forks_repo_path": "namespaces/spiral/paradigms/dram/breakdown.gi", "max_forks_repo_name": "sr7cb/spiral-software", "max_forks_repo_head_hexsha": "349d9e0abe75bf4b9a4690f2dbee631700f8361a", "max_forks_repo_licenses": ["BSD-2-Clause-FreeBSD"], "max_forks_count": 21, "max_forks_repo_forks_event_min_datetime": "2019-08-20T19:27:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-01T22:11:18.000Z", "avg_line_length": 29.4616182573, "max_line_length": 139, "alphanum_fraction": 0.5159677476, "num_tokens": 10656, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.538983220687684, "lm_q2_score": 0.4148988457967688, "lm_q1q2_score": 0.2236235161671452}} |
| {"text": "#\n# A6<E8 (char2) is below\n#\n\n#\n# cls 31: E8(a7) MIZUNO\n#\nhandle31char2:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44,o,info,rep,cent,uu;\n o:=Classes(orbs)[31];\n info:=infos[31];\n rep:=Representative(o);\n\n uu:=Unipotent(alg,[[3,1],[16,1],[23,1],[8,1],[51,1],[58,1]],Ordering(rep));\n tmp1:=Conj(rep,uu);\n\n uu:=Unipotent(alg,[[3,1],[16,1],[8,1],[7,1],[10,1]],Ordering(rep));\n tmp2:=Conj(rep,uu);\n tmp2:=ApplyRootsReflections(tmp2,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,1],[8,1],[26,1],[41,1],[53,1],[80,1]],Ordering(tmp2));\n tmp2:=Conj(tmp2,uu);\n\n uu:=Unipotent(alg,[[16,1],[6,1],[1,1]],Ordering(rep));\n tmp3:=Conj(rep,uu);\n tmp3:=ConjNegUa(tmp3,7,1);\n tmp3:=ConjNegUa(tmp3,10,1);\n uu:=Unipotent(alg,[[45,1],[51,1]],Ordering(tmp3));\n tmp3:=Conj(tmp3,uu);\n\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(rep));\n tmp4:=Conj(rep,uu);\n tmp4:=ConjNegUa(tmp4,6,1);\n tmp4:=ConjNegUa(tmp4,1,1);\n uu:=Unipotent(alg,[[37,1]],Ordering(tmp4));\n tmp4:=Conj(tmp4,uu);\n\n#---\n cent:=FromPositiveBorel(o,info[2]);\n\n tmp11:=0;\n uu:=Unipotent(alg,[[3,1],[16,1],[23,1],[8,1],[51,1],[58,1]],Ordering(cent));\n tmp11:=Conj(cent,uu);\n\n tmp22:=0;\n uu:=Unipotent(alg,[[3,1],[16,1],[8,1],[7,1],[10,1]],Ordering(cent));\n tmp22:=Conj(cent,uu);\n tmp22:=ApplyRootsReflections(tmp22,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,1],[8,1],[26,1],[41,1],[53,1],[80,1]],Ordering(tmp22));\n tmp22:=Conj(tmp22,uu);\n\n tmp33:=0;\n uu:=Unipotent(alg,[[16,1],[6,1],[1,1]],Ordering(cent));\n tmp33:=Conj(cent,uu);\n tmp33:=ConjNegUa(tmp33,7,1);\n tmp33:=ConjNegUa(tmp33,10,1);\n uu:=Unipotent(alg,[[45,1],[51,1]],Ordering(tmp33));\n tmp33:=Conj(tmp33,uu);\n\n tmp44:=0;\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(cent));\n tmp44:=Conj(cent,uu);\n tmp44:=ConjNegUa(tmp44,6,1);\n tmp44:=ConjNegUa(tmp44,1,1);\n uu:=Unipotent(alg,[[37,1]],Ordering(tmp44));\n tmp44:=Conj(tmp44,uu);\n\n\n return [tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44];\nend;\n\n#\n# cls 30: E8(a7) MIZUNO\n#\nhandle30char3:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44,o,info,rep,\n cent,uu;\n o:=Classes(orbs)[30];\n info:=infos[30];\n rep:=Representative(o);\n\n tmp1:=ConjugateByTori(rep,[1,2,29],[-1,-1,-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[23,-1],[8,1],[51,-1],[58,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n\n tmp2:=ConjugateByTori(rep,[50],[-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[8,1],[7,-1],[10,-1]],Ordering(tmp2));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ApplyRootsReflections(tmp2,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,-1],[8,1],[15,-1],[17,1],[26,1],[41,-1],[53,1],[80,-1]],Ordering(tmp2));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[50,53],[-1,-1]);\n\n# tmp3:=ConjugateByTori(rep,[31],[1]);\n uu:=Unipotent(alg,[[16,-1],[6,-1],[1,-1]],Ordering(rep));\n tmp3:=Conj(rep,uu);\n tmp3:=ConjNegUa(tmp3,7,1);\n tmp3:=ConjNegUa(tmp3,10,1);\n uu:=Unipotent(alg,[[16,-1],[45,-1],[51,1]],Ordering(tmp3));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[31],[-1]);\n\n tmp4:=ConjugateByTori(rep,[2,3,5],[-1,-1,-1]);\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(rep));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjNegUa(tmp4,6,1);\n tmp4:=ConjNegUa(tmp4,1,1);\n tmp4:=Conj(tmp4,uu);\n uu:=Unipotent(alg,[[37,1]],Ordering(tmp4));\n tmp4:=Conj(tmp4,uu);\n\n#---\n cent:=FromPositiveBorel(o,info[2]);\n\n tmp11:=0;\n tmp11:=ConjugateByTori(cent,[1,2,29],[-1,-1,-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[23,-1],[8,1],[51,-1],[58,1]],Ordering(cent));\n tmp11:=Conj(tmp11,uu);\n\n tmp22:=0;\n tmp22:=ConjugateByTori(cent,[50],[-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[8,1],[7,-1],[10,-1]],Ordering(tmp22));\n tmp22:=Conj(tmp22,uu);\n tmp22:=ApplyRootsReflections(tmp22,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,-1],[8,1],[15,-1],[17,1],[26,1],[41,-1],[53,1],[80,-1]],Ordering(tmp22));\n tmp22:=Conj(tmp22,uu);\n tmp22:=ConjugateByTori(tmp22,[50,53],[-1,-1]);\n\n tmp33:=0;\n# tmp33:=ConjugateByTori(rep,[31],[1]);\n uu:=Unipotent(alg,[[16,-1],[6,-1],[1,-1]],Ordering(cent));\n tmp33:=Conj(cent,uu);\n tmp33:=ConjNegUa(tmp33,7,1);\n tmp33:=ConjNegUa(tmp33,10,1);\n uu:=Unipotent(alg,[[16,-1],[45,-1],[51,1]],Ordering(tmp33));\n tmp33:=Conj(tmp33,uu);\n tmp33:=ConjugateByTori(tmp33,[31],[-1]);\n\n tmp44:=0;\n tmp44:=ConjugateByTori(cent,[2,3,5],[-1,-1,-1]);\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(cent));\n tmp44:=Conj(tmp44,uu);\n tmp44:=ConjNegUa(tmp44,6,1);\n tmp44:=ConjNegUa(tmp44,1,1);\n tmp44:=Conj(tmp44,uu);\n uu:=Unipotent(alg,[[37,1]],Ordering(tmp44));\n tmp44:=Conj(tmp44,uu);\n\n return [tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44];\nend;\n\n#\n# cls 29: E8(a7) MIZUNO\n#\nhandle29char5:=function(orbs,infos)\n local tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44,o,info,rep,\n cent,uu;\n o:=Classes(orbs)[29];\n info:=infos[29];\n rep:=Representative(o);\n\n tmp1:=ConjugateByTori(rep,[1,2,29],[-1,-1,-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[23,-1],[8,1],[51,-1],[58,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n\n tmp2:=ConjugateByTori(rep,[50],[-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[8,1],[7,-1],[10,-1]],Ordering(tmp2));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ApplyRootsReflections(tmp2,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,-1],[8,1],[15,2],[17,3],[26,1],[41,-1],[53,1],[80,-1]],Ordering(tmp2));\n tmp2:=Conj(tmp2,uu);\n tmp2:=ConjugateByTori(tmp2,[50,53],[-1,-1]);\n\n# tmp3:=ConjugateByTori(rep,[31],[1]);\n uu:=Unipotent(alg,[[16,-1],[6,-1],[1,-1]],Ordering(rep));\n tmp3:=Conj(rep,uu);\n tmp3:=ConjNegUa(tmp3,7,1);\n tmp3:=ConjNegUa(tmp3,10,1);\n uu:=Unipotent(alg,[[16,2],[45,-1],[51,1]],Ordering(tmp3));\n tmp3:=Conj(tmp3,uu);\n tmp3:=ConjugateByTori(tmp3,[31],[-1]);\n\n tmp4:=ConjugateByTori(rep,[2,3,5],[-1,-1,-1]);\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(rep));\n tmp4:=Conj(tmp4,uu);\n tmp4:=ConjNegUa(tmp4,6,1);\n tmp4:=ConjNegUa(tmp4,1,1);\n# tmp4:=Conj(tmp4,uu);\n uu:=Unipotent(alg,[[10,3],[4,3],[37,1]],Ordering(tmp4));\n tmp4:=Conj(tmp4,uu);\n\n#---\n cent:=FromPositiveBorel(o,info[2]);\n\n tmp11:=0;\n tmp11:=ConjugateByTori(cent,[1,2,29],[-1,-1,-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[23,-1],[8,1],[51,-1],[58,1]],Ordering(cent));\n tmp11:=Conj(tmp11,uu);\n\n tmp22:=0;\n tmp22:=ConjugateByTori(cent,[50],[-1]);\n uu:=Unipotent(alg,[[3,1],[16,-1],[8,1],[7,-1],[10,-1]],Ordering(tmp22));\n tmp22:=Conj(tmp22,uu);\n tmp22:=ApplyRootsReflections(tmp22,[16,3,8]);\n uu:=Unipotent(alg,[[7,1],[10,1],[3,1],[16,-1],[8,1],[15,2],[17,3],[26,1],[41,-1],[53,1],[80,-1]],Ordering(tmp22));\n tmp22:=Conj(tmp22,uu);\n tmp22:=ConjugateByTori(tmp22,[50,53],[-1,-1]);\n\n tmp33:=0;\n# tmp33:=ConjugateByTori(rep,[31],[1]);\n uu:=Unipotent(alg,[[16,-1],[6,-1],[1,-1]],Ordering(cent));\n tmp33:=Conj(cent,uu);\n tmp33:=ConjNegUa(tmp33,7,1);\n tmp33:=ConjNegUa(tmp33,10,1);\n uu:=Unipotent(alg,[[16,2],[45,-1],[51,1]],Ordering(tmp33));\n tmp33:=Conj(tmp33,uu);\n tmp33:=ConjugateByTori(tmp33,[31],[-1]);\n\n tmp44:=0;\n tmp44:=ConjugateByTori(cent,[2,3,5],[-1,-1,-1]);\n uu:=Unipotent(alg,[[10,1],[4,1]],Ordering(cent));\n tmp44:=Conj(tmp44,uu);\n tmp44:=ConjNegUa(tmp44,6,1);\n tmp44:=ConjNegUa(tmp44,1,1);\n# tmp44:=Conj(tmp44,uu);\n uu:=Unipotent(alg,[[10,3],[4,3],[37,1]],Ordering(tmp44));\n tmp44:=Conj(tmp44,uu);\n\n return [tmp1,tmp2,tmp3,tmp4,tmp11,tmp22,tmp33,tmp44];\nend;\n\n#\n# cls 30: A_6 (THE RIGHT WAY)\n#\nhandle30char2bun:=function(orbs,infos)\n local tmp1,tmp2,o,info,rep,\n cent,uu;\n o:=Classes(orbs)[30];\n info:=infos[30];\n\n rep:=Representative(o);\n tmp1:=ApplyRootsReflections(rep,[7,61,97,4,25,4,2,3,5,12,27,39]);# [7,61,97,4,25,4,2,3,5] longest element in E7, [12,27,39] longest element in A6\n uu:=Unipotent(chevalleyAdj(rep),[[3,1],[5,1],[7,1],[11,1],[12,1],[27,1],[28,1]],Ordering(rep));\n tmp1:=Conj(tmp1,uu);\n \n cent:=FromPositiveBorel(o,info[2]);\n tmp2:=ApplyRootsReflections(cent,[7,61,97,4,25,4,2,3,5,12,27,39]);# [7,61,97,4,25,4,2,3,5] longest element in E7, [12,27,39] longest element in A6\n uu:=Unipotent(chevalleyAdj(cent),[[3,1],[5,1],[7,1],[11,1],[12,1],[27,1],[28,1]],Ordering(cent));\n tmp2:=Conj(tmp2,uu);\n \n return [tmp1,tmp2];\nend;\n", "meta": {"hexsha": "e666bd644bad2457293f0dd1ae3f78677b1c8c08", "size": 8422, "ext": "gi", "lang": "GAP", "max_stars_repo_path": "lib/components/E8a7comp.gi", "max_stars_repo_name": "iuliansimion/Chevalley.gap", "max_stars_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/components/E8a7comp.gi", "max_issues_repo_name": "iuliansimion/Chevalley.gap", "max_issues_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_issues_repo_licenses": ["MIT"], "max_issues_count": null, "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/components/E8a7comp.gi", "max_forks_repo_name": "iuliansimion/Chevalley.gap", "max_forks_repo_head_hexsha": "dd237f36d69a42bcd6cb6a24c5e4bf7dfb3da186", "max_forks_repo_licenses": ["MIT"], "max_forks_count": null, "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null, "avg_line_length": 33.4206349206, "max_line_length": 150, "alphanum_fraction": 0.5764663975, "num_tokens": 3630, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. NO", "lm_q1_score": 0.5813030906443133, "lm_q2_score": 0.352201788847459, "lm_q1q2_score": 0.20473598838748375}} |
|
|