@@ -1925,7 +1925,9 @@ def _matrix_coefficient_data(self, rep_type, as_str=False):
19251925 rep_type = "GLFp"
19261926 return R , N , k , d , rep_type
19271927
1928- def decode_as_matrix (self , code , rep_type , as_str = False , LieType = False , ListForm = False ):
1928+ def decode_as_matrix (self , code , rep_type , as_str = False , LieType = False , ListForm = False , GLFq_logs = None ):
1929+ if GLFq_logs is None :
1930+ GLFq_logs = as_str or ListForm
19291931 # ListForm is for code snippet
19301932 if rep_type == "GLZ" and not isinstance (code , int ): # decimal here represents an integer encoding b
19311933 a , b = str (code ).split ("." )
@@ -1948,13 +1950,14 @@ def pad(X, m):
19481950 L = pad (L , k * d ** 2 )
19491951 if rep_type == "GLFq" :
19501952 L = [R (L [i :i + k ]) for i in range (0 , k * d ** 2 , k )]
1951- L = [l .log (a ) if l != 0 else - 1 for l in L ] #-1 represents 0, to distinguish from a^0
1953+ if GLFq_logs :
1954+ L = [l .log (a ) if l != 0 else - 1 for l in L ] #-1 represents 0, to distinguish from a^0
19521955 elif rep_type == "GLZ" :
19531956 shift = (N - 1 ) // 2
19541957 L = [c - shift for c in L ]
19551958 if ListForm :
19561959 return L #as ints representing powers of primitive element if GLFq
1957- if rep_type == "GLFq" :
1960+ if rep_type == "GLFq" and GLFq_logs :
19581961 x = matrix (ZZ , d , d , L ) #giving powers of alpha (primitive element)
19591962 else :
19601963 x = matrix (R , d , d , L )
@@ -1963,21 +1966,22 @@ def pad(X, m):
19631966 if LieType and self .representations ["Lie" ][0 ]["family" ][0 ] == "P" :
19641967 return r"\left[" + latex (x ) + r"\right]"
19651968 if rep_type == "GLFq" : #need to customize latex command for GLFq
1966- rs = 'r' * d
1967- st_latex = r'\left(\begin{array}{' + rs + '}'
1968- for i in range (d ):
1969- for j in range (d ):
1970- if j < d - 1 :
1971- endstr = ' & '
1972- else :
1973- endstr = r' \\ '
1974- if L [d * i + j ] > 0 :
1975- st_latex = st_latex + r'\alpha^{' + str (L [d * i + j ]) + '}' + endstr
1976- elif L [d * i + j ] == 0 :
1977- st_latex = st_latex + str (1 ) + endstr
1978- else :
1979- st_latex = st_latex + str (0 ) + endstr
1980- st_latex = st_latex + r'\end{array}\right)'
1969+ ls = 'l' * d
1970+ st_latex = r'\left(\begin{array}{' + ls + '}'
1971+ for i , entrylog in enumerate (L ):
1972+ if entrylog > 1 :
1973+ st_latex += rf'\alpha^{{{ entrylog } }}'
1974+ elif entrylog == 1 :
1975+ st_latex += r'\alpha'
1976+ elif entrylog == 0 :
1977+ st_latex += "1"
1978+ else :
1979+ st_latex += "0"
1980+ if (i + 1 )% d == 0 :
1981+ st_latex += r' \\ '
1982+ else :
1983+ st_latex += ' & '
1984+ st_latex += r'\end{array}\right)'
19811985 return st_latex
19821986 return latex (x )
19831987 return x
@@ -2236,7 +2240,12 @@ def representation_line(self, rep_type, skip_head=False):
22362240 # Matrix group
22372241 R , N , k , d , _ = self ._matrix_coefficient_data (rep_type , as_str = True )
22382242 gens = ", " .join (self .decode_as_matrix (g , rep_type , as_str = True ) for g in rdata ["gens" ])
2239- gens = fr"$\left\langle { gens } \right\rangle \subseteq \GL_{{{ d } }}({ R } )$"
2243+ ambient = fr"\GL_{{{ d } }}({ R } )"
2244+ if rep_type == "GLFq" :
2245+ Fq = GF (N ** k , "alpha" )
2246+ poly = latex (Fq .polynomial ())
2247+ ambient += fr" = \GL_{{{ d } }}(\F_{{{ N } }}[\alpha]/({ poly } ))"
2248+ gens = fr"$\left\langle { gens } \right\rangle \subseteq { ambient } $"
22402249 code_cmd = self .create_snippet (rep_type )
22412250 if skip_head :
22422251 return f'<tr><td></td><td colspan="5">{ gens } </td></tr>{ code_cmd } '
@@ -2735,7 +2744,7 @@ def code_snippets(self):
27352744 nZN = self .representations ["GLZN" ]["d" ]
27362745 N = self .representations ["GLZN" ]["p" ]
27372746 LZN = [self .decode_as_matrix (g , "GLZN" , ListForm = True ) for g in self .representations ["GLZN" ]["gens" ]]
2738- LZNsplit = "[" + "," .join ([ split_matrix_list_ZN (self . decode_as_matrix ( g , "GLZN" , ListForm = True ) , nZN , N ) for g in self . representations [ "GLZN" ][ "gens" ]] ) + "]"
2747+ LZNsplit = "[" + "," .join (split_matrix_list_ZN (mat , nZN , N ) for mat in LZN ) + "]"
27392748 else :
27402749 nZN , N , LZN , LZNsplit = None , None , None , None
27412750 if "GLZq" in self .representations :
@@ -2749,8 +2758,9 @@ def code_snippets(self):
27492758 if "GLFq" in self .representations :
27502759 nFq = self .representations ["GLFq" ]["d" ]
27512760 Fq = self .representations ["GLFq" ]["q" ]
2752- LFq = "," .join ([split_matrix_Fq_add_al (self .decode_as_matrix (g , "GLFq" , ListForm = True ), nFq ) for g in self .representations ["GLFq" ]["gens" ]])
2753- LFqsplit = "[" + "," .join ([split_matrix_list_Fq (self .decode_as_matrix (g , "GLFq" , ListForm = True ), nFq , Fq ) for g in self .representations ["GLFq" ]["gens" ]]) + "]"
2761+ mats = [self .decode_as_matrix (g , "GLFq" , ListForm = True ) for g in self .representations ["GLFq" ]["gens" ]]
2762+ LFq = "," .join (split_matrix_Fq_add_al (mat , nFq ) for mat in mats )
2763+ LFqsplit = "[" + "," .join (split_matrix_list_Fq (mat , nFq , Fq ) for mat in mats ) + "]"
27542764 else :
27552765 nFq , Fq , LFq , LFqsplit = None , None , None , None
27562766
0 commit comments