  
  [1X2 [33X[0;0YTutorial for the [5XSingerAlg[105X[101X[1X package[133X[101X
  
  [33X[0;0YThis chapter shows small introductory computations with the functions of the
  package. More examples can be found in Section [14X4.3[114X.[133X
  
  [33X[0;0YIn  order  to  force  that the examples in this manual consist only of ASCII
  characters,  we  set the user preference [10XDisplayFunction[110X of the package (see
  Section [14X3.2-3[114X) to the value [10X"Print"[110X. This is necessary because the LaTeX and
  HTML versions of [5XGAPDoc[105X documents do not support non-ASCII characters.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xorigpref:= UserPreference( "SingerAlg", "DisplayFunction" );;[127X[104X
    [4X[25Xgap>[125X [27XSetUserPreference( "SingerAlg", "DisplayFunction", "Print" );[127X[104X
  [4X[32X[104X
  
  
  [1X2.1 [33X[0;0YHow to Study Singer Algebras[133X[101X
  
  [33X[0;0YThe  definition  of Singer algebras given in Section [14X1.2[114X suggests that [5XGAP[105X's
  tools  for  algebras defined by structure constants (see Section [14X'Reference:
  Constructing  Algebras  by Structure Constants'[114X) might be suitable for them,
  and Section [14X3.1[114X takes this approach.[133X
  
  [33X[0;0YHowever,  the  fact  that the canonical bases of Singer algebras have a very
  special structure –the product of two basis elements is either another basis
  element or zero– implies that many interesting subalgebras and subspaces can
  be described in terms of subsets of the canonical basis. Thus many questions
  can be answered using combinatorial computations, without the need to add or
  multiply or even create elements of the algebra. Section [14X3.3[114X lists functions
  where this approach is taken.[133X
  
  [33X[0;0YMost  of  the functions of the [5XSingerAlg[105X package do not involve objects that
  represent  algebraic  structures.  In  particular,  the  [5XJulia[105X code does not
  introduce such objects.[133X
  
  
  [1X2.2 [33X[0;0YNumber Theoretic Caveats[133X[101X
  
  [33X[0;0YWhen  one  deals  with  Singer algebras [22XA[q,z] = A(q,n,e)[122X, with [22Xq^n-1 = e z[122X,
  seemingly  trivial  computations can become expensive even if the dimensions
  (equal  to  [22Xz+1[122X)  and the parameters [22Xq[122X and [22Xn[122X are small, because the number [22Xe[122X
  can  still  be huge; see Section [14X2.2-1[114X for examples. The point is that there
  are  situations  where  one  can  (and then should) avoid dealing with large
  numbers, but there are also situations where this is not possible. Since [5XGAP[105X
  knows  just  one  type  of integers, there is no need to write different [5XGAP[105X
  code  for  computations  with  small or large integers. This is different in
  [5XJulia[105X,  where  one  can (and wants to) write special code for computing with
  small integers whenever one knows in advance that there will be no overflow.[133X
  
  [33X[0;0YOther   computational  problems  arise  from  factorization  questions.  One
  instance  is the computation of the multiplicative order of [22Xq[122X modulo [22Xz[122X or [22Xe[122X;
  an example where calling [10XOrderMod( [110X[22Xq[122X[10X, [110X[22Xe[122X[10X )[110X runs into problems is shown in the
  documentation  of  [2XOrderModExt[102X  ([14X3.6-2[114X).  Here  the point is that one should
  enter  a  known  multiple  of  the desired multiplicative order as the third
  argument of [2XOrderModExt[102X ([14X3.6-2[114X) whenever this is possible.[133X
  
  [33X[0;0YAlso  primality  tests  in  the  context  of  natural questions about Singer
  algebras may run into problems, see Section [14X2.2-2[114X.[133X
  
  
  [1X2.2-1 [33X[0;0YLarge values of [22Xe[122X[101X[1X[133X[101X
  
  [33X[0;0YComputational  examples  in the study of [22XA(q,n,e)[122X often avoid dealing with [22Xe[122X
  because  this  number  can  be  very large when the algebra itself has small
  dimension. Let us look at the database of [22XA[q,z][122X with [22Xz ≤ 10000[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xcand:= AllSingerAlgebraInfos( "e", e -> e > 2^64 );;   [127X[104X
    [4X[25Xgap>[125X [27XLength( cand );                                     [127X[104X
    [4X[28X543989[128X[104X
    [4X[25Xgap>[125X [27Xcand:= AllSingerAlgebraInfos( "e", e -> e > 10^10000 );;         [127X[104X
    [4X[25Xgap>[125X [27XLength( cand );[127X[104X
    [4X[28X12[128X[104X
    [4X[25Xgap>[125X [27XSortParallel( List( cand, r -> r.e ), cand );[127X[104X
    [4X[25Xgap>[125X [27Xcand[ Length( cand ) ];[127X[104X
    [4X[28Xrec( LL := 3, d := [ 1, 9438 ], dec := 0, diff := 0, [128X[104X
    [4X[28X  e := <integer 646...617 (12666 digits)>, isom := [ 9439, 2 ], [128X[104X
    [4X[28X  m := 99099, n := 9438, q := 22, vprime := [ 1, 9438, 1 ], z := 9439 [128X[104X
    [4X[28X )[128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe  see  that  for  the  majority of entries in the database, the value of [22Xe[122X
  cannot  be  represented by a 64-bit integer, and that the largest value of [22Xe[122X
  in the database is bigger than [22X10^12666[122X.[133X
  
  [33X[0;0YWhen  one deals with [22XA[q,z][122X, one of the basic tasks is to compute the [22Xq[122X-adic
  coefficients  of  some  multiple of [22Xe[122X, i. e., to write [22Xk e = ∑_{i = 0}^n a_i
  q^i[122X,  with  [22X0  ≤ a_i < q[122X. By [BHHK21, Remark 2.23 (iv)], one can compute the
  [22Xa_i[122X without dealing explicitly with numbers of the magnitude of [22Xe[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xq:= 22;;  n:= 9438;;  z:= 9439;;[127X[104X
    [4X[25Xgap>[125X [27Xe:= (q^n-1)/z;;[127X[104X
    [4X[25Xgap>[125X [27Xcoeffs1:= CoefficientsQadic( e, q );;[127X[104X
    [4X[25Xgap>[125X [27Xcoeffs2:= CoefficientsQadicReversed( 1, z, q, n );;[127X[104X
    [4X[25Xgap>[125X [27XLength( coeffs1 );[127X[104X
    [4X[28X9436[128X[104X
    [4X[25Xgap>[125X [27XLength( coeffs2 );[127X[104X
    [4X[28X9438[128X[104X
    [4X[25Xgap>[125X [27Xcoeffs1 = Reversed( coeffs2 ){[1..9436]};  [127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YNote  that  [2XCoefficientsQadicReversed[102X  ([14X3.1-12[114X) is several times faster than
  [2XCoefficientsQadic[102X  ([14XReference:  CoefficientsQadic[114X);  the  two  functions  in
  question    are    interpreted    [5XGAP[105X    functions.    The   [5XJulia[105X   variant
  [10XJulia.SingerAlg.CoefficientsQadicReversed[110X  is  faster  than the [5XGAP[105X function
  [2XCoefficientsQadicReversed[102X    ([14X3.1-12[114X),    whereas    the    [5XJulia[105X    variant
  [10XJulia.SingerAlg.CoefficientsQadic[110X    needs    about   the   same   time   as
  [2XCoefficientsQadic[102X  ([14XReference:  CoefficientsQadic[114X).  Note  that computations
  with small integers are much faster in [5XJulia[105X than in [5XGAP[105X, but that the [5XJulia[105X
  data type of big integers is not supported well.[133X
  
  
  [1X2.2-2 [33X[0;0YPrimality tests[133X[101X
  
  [33X[0;0YSuppose  we  want  to  check  whether [BHHK21, Thm. 4.3 (i)] yields that the
  Loewy  length of a given Singer algebra [22XA(q,n,e)[122X is equal to the upper bound
  [22X⌊ n (q-1) / m(q,e) ⌋ + 1[122X; for that, we have to decide whether [22Xe/2[122X is a prime
  power.[133X
  
  [33X[0;0YIn  the  case  of [22X(q, z) = (8390, 21)[122X, [5XGAP[105X prints a message and then nothing
  happens for a long time.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[28Xap> z:= 8390;[128X[104X
    [4X[28X8390[128X[104X
    [4X[25Xgap>[125X [27Xr:= OneSingerAlgebraInfo( "z", z, "q", 21 );;[127X[104X
    [4X[25Xgap>[125X [27XLogInt( r.e, 10 );[127X[104X
    [4X[28X550[128X[104X
    [4X[25Xgap>[125X [27XIsEvenInt( r.e );[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsPrimePowerInt( r.e/2 );[127X[104X
    [4X[28X#I  Straightforward Fermat-Lucas primality proof failed on 6096...[128X[104X
    [4X[28X[...][128X[104X
  [4X[32X[104X
  
  [33X[0;0Y(Fortunately,  we  need  not  check whether [22Xe/2[122X is a prime power; if we look
  into  the  proof  of  [BHHK21,  Thm.  4.3  (i)],  we find out that a cheaper
  criterion can be used.)[133X
  
  
  [1X2.3 [33X[0;0YSome Examples from the Papers[133X[101X
  
  [33X[0;0YWe  show  the  examples of Singer algebras [22XA(q,n,e)[122X that appear in [BHHK20].
  See  Section  [14X1.2[114X  for  the  meaning  of  the  term  [21Xmonomial[121X,  and  Section
  [2XDisplaySingerMonomials[102X ([14X3.2-1[114X) for the meaning of the output that is shown.[133X
  
  [33X[0;0Y[22X(q,n,e) = (3,4,5)[122X, [BHHK20, Example 3.2]:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 3, 4, 5 );[127X[104X
    [4X[28XA[3,4,16][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 |  0[128X[104X
    [4X[28X1 | 6 |  1  2  3  6  9 11[128X[104X
    [4X[28X2 | 7 |  4  5  7  8 12 13 15[128X[104X
    [4X[28X3 | 2 | 10 14[128X[104X
    [4X[28X4 | 1 | 16[128X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 3, 4, 5 : m );[127X[104X
    [4X[28XA[3,4,16][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 | (0,0,0,0)[128X[104X
    [4X[28X1 | 6 | (0,0,2,1) (0,1,0,1) (0,2,1,0) (1,0,0,2) (1,0,1,0) (2,1,0,0)[128X[104X
    [4X[28X2 | 7 | (0,1,2,2) (0,2,0,2) (1,1,1,1) (1,2,2,0) (2,0,1,2) (2,0,2,0)[128X[104X
    [4X[28X  |   | (2,2,0,1)[128X[104X
    [4X[28X3 | 2 | (1,2,1,2) (2,1,2,1)[128X[104X
    [4X[28X4 | 1 | (2,2,2,2)[128X[104X
  [4X[32X[104X
  
  [33X[0;0Y[22X(q,n,e) = (13,2,8)[122X, [BHHK20, Example 3.3]:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 13, 2, 8 );[127X[104X
    [4X[28XA[13,2,21][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 |  0[128X[104X
    [4X[28X1 | 4 |  1  2  5 13[128X[104X
    [4X[28X2 | 5 |  3  4  7 10 18[128X[104X
    [4X[28X3 | 4 |  6  9 12 15[128X[104X
    [4X[28X4 | 5 |  8 11 14 17 20[128X[104X
    [4X[28X5 | 2 | 16 19[128X[104X
    [4X[28X6 | 1 | 21[128X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 13, 2, 8 : m );[127X[104X
    [4X[28XA[13,2,21][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 | ( 0, 0)[128X[104X
    [4X[28X1 | 4 | ( 0, 8) ( 1, 3) ( 3, 1) ( 8, 0)[128X[104X
    [4X[28X2 | 5 | ( 1,11) ( 2, 6) ( 4, 4) ( 6, 2) (11, 1)[128X[104X
    [4X[28X3 | 4 | ( 3, 9) ( 5, 7) ( 7, 5) ( 9, 3)[128X[104X
    [4X[28X4 | 5 | ( 4,12) ( 6,10) ( 8, 8) (10, 6) (12, 4)[128X[104X
    [4X[28X5 | 2 | ( 9,11) (11, 9)[128X[104X
    [4X[28X6 | 1 | (12,12)[128X[104X
  [4X[32X[104X
  
  [33X[0;0Y[22X(q,n,e) = (5,4,78)[122X, [BHHK20, Example 5.1]:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 5, 4, 78 );[127X[104X
    [4X[28XA[5,4,8][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 | 0[128X[104X
    [4X[28X1 | 3 | 1 2 5[128X[104X
    [4X[28X2 | 3 | 3 4 7[128X[104X
    [4X[28X3 | 1 | 6[128X[104X
    [4X[28X4 | 1 | 8[128X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 5, 4, 78 : m );[127X[104X
    [4X[28XA[5,4,8][128X[104X
    [4X[28X[128X[104X
    [4X[28X0 | 1 | (0,0,0,0)[128X[104X
    [4X[28X1 | 3 | (0,3,0,3) (1,1,1,1) (3,0,3,0)[128X[104X
    [4X[28X2 | 3 | (1,4,1,4) (2,2,2,2) (4,1,4,1)[128X[104X
    [4X[28X3 | 1 | (3,3,3,3)[128X[104X
    [4X[28X4 | 1 | (4,4,4,4)[128X[104X
  [4X[32X[104X
  
  [33X[0;0Y[22X(q,n,e) = (11,2,4)[122X, [BHHK20, Example 5.2]:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 11, 2, 4 );[127X[104X
    [4X[28XA[11,2,30][128X[104X
    [4X[28X[128X[104X
    [4X[28X 0 | 1 |  0[128X[104X
    [4X[28X 1 | 3 |  1  3 11[128X[104X
    [4X[28X 2 | 5 |  2  4  6 14 22[128X[104X
    [4X[28X 3 | 5 |  5  7  9 17 25[128X[104X
    [4X[28X 4 | 5 |  8 10 12 20 28[128X[104X
    [4X[28X 5 | 3 | 13 15 23[128X[104X
    [4X[28X 6 | 3 | 16 18 26[128X[104X
    [4X[28X 7 | 3 | 19 21 29[128X[104X
    [4X[28X 8 | 1 | 24[128X[104X
    [4X[28X 9 | 1 | 27[128X[104X
    [4X[28X10 | 1 | 30[128X[104X
    [4X[25Xgap>[125X [27XDisplaySingerMonomials( 11, 2, 4 : m );[127X[104X
    [4X[28XA[11,2,30][128X[104X
    [4X[28X[128X[104X
    [4X[28X 0 | 1 | ( 0, 0)[128X[104X
    [4X[28X 1 | 3 | ( 0, 4) ( 1, 1) ( 4, 0)[128X[104X
    [4X[28X 2 | 5 | ( 0, 8) ( 1, 5) ( 2, 2) ( 5, 1) ( 8, 0)[128X[104X
    [4X[28X 3 | 5 | ( 1, 9) ( 2, 6) ( 3, 3) ( 6, 2) ( 9, 1)[128X[104X
    [4X[28X 4 | 5 | ( 2,10) ( 3, 7) ( 4, 4) ( 7, 3) (10, 2)[128X[104X
    [4X[28X 5 | 3 | ( 4, 8) ( 5, 5) ( 8, 4)[128X[104X
    [4X[28X 6 | 3 | ( 5, 9) ( 6, 6) ( 9, 5)[128X[104X
    [4X[28X 7 | 3 | ( 6,10) ( 7, 7) (10, 6)[128X[104X
    [4X[28X 8 | 1 | ( 8, 8)[128X[104X
    [4X[28X 9 | 1 | ( 9, 9)[128X[104X
    [4X[28X10 | 1 | (10,10)[128X[104X
  [4X[32X[104X
  
  
  [1X2.4 [33X[0;0YExample: The case [22Xn = 4[122X[101X[1X[133X[101X
  
  [33X[0;0YFor fixed (small) [22Xn[122X, we are interested in the question for which values of [22Xq[122X
  and  [22Xz[122X  the  upper  bound  [22X⌊  n  (q-1) / m(q,e) ⌋ + 1[122X on the Loewy length of
  [22XA[q,n,z][122X is not attained.[133X
  
  [33X[0;0YIf  [22Xn  ≤  3[122X holds then we know by [BHHK20, Cor. 7.1] that the upper bound is
  always  attained.  For [22Xn = 5[122X, the database of Singer algebras contains a few
  examples where the bound is not attained (cf. [BHHK21, Remark 7.13]).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xexpls:= AllSingerAlgebraInfos( "n", 5,                                 [127X[104X
    [4X[25X>[125X [27X               r -> r.LL = Int( r.n * ( r.q-1 ) / r.m ) + 1, false );;[127X[104X
    [4X[25Xgap>[125X [27XLength( expls );[127X[104X
    [4X[28X13[128X[104X
    [4X[25Xgap>[125X [27Xexpls[1];[127X[104X
    [4X[28Xrec( LL := 7, d := [ 43, 408 ], dec := 0, diff := 1, e := 407592814, [128X[104X
    [4X[28X  isom := [ 1353, 223 ], m := 148, n := 5, q := 223, [128X[104X
    [4X[28X  vprime := [ 1, 261, 375, 395, 260, 61, 1 ], z := 1353 )[128X[104X
  [4X[32X[104X
  
  [33X[0;0YFrom  now  on,  we  fix  [22Xn = 4[122X. The upper bound is attained for all relevant
  entries in the database.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XOneSingerAlgebraInfo( "n", 4,[127X[104X
    [4X[25X>[125X [27X       r -> r.LL = Int( r.n * ( r.q-1 ) / r.m ) + 1, false );[127X[104X
    [4X[28Xfail[128X[104X
  [4X[32X[104X
  
  [33X[0;0YWe comute the Loewy lengths of the algebras [22XA[q,4,z][122X, for [22X2 ≤ q ≤ 40[122X and for
  all divisors [22Xz[122X of [22Xq^4 - 1[122X, and compare them with the upper bound.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xn:= 4;;[127X[104X
    [4X[25Xgap>[125X [27Xfor q in [ 2 .. 40 ] do[127X[104X
    [4X[25X>[125X [27X     for z in DivisorsInt( q^n-1 ) do[127X[104X
    [4X[25X>[125X [27X       if z > SingerAlg.MaxZ then[127X[104X
    [4X[25X>[125X [27X         A:= SingerAlgebra( q, n, z );[127X[104X
    [4X[25X>[125X [27X         m:= MinimalDegreeOfSingerAlgebra( A );[127X[104X
    [4X[25X>[125X [27X         if LoewyLength( A ) <> Int( n * (q-1) / m ) + 1 then[127X[104X
    [4X[25X>[125X [27X           Print( "found an example\n" );[127X[104X
    [4X[25X>[125X [27X         fi;[127X[104X
    [4X[25X>[125X [27X       fi;[127X[104X
    [4X[25X>[125X [27X     od;[127X[104X
    [4X[25X>[125X [27X   od;[127X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  above  computations  should  need less than a minute, provided that the
  [5XJulia[105X  code  can  be used; much more time is needed if only [5XGAP[105X can be used.
  [BHHK21,  Section  1]  states that the bound is always attained for [22Xq ≤ 100[122X;
  the computations for that need several hours (using [5XJulia[105X).[133X
  
  [33X[0;0YIn  some  of the examples, such as for [22X(q, e) = (29, 48)[122X, the computation of
  [22Xm(q,e)[122X  without  calling  [2XLoewyStructureInfoJulia[102X ([14X3.1-11[114X) is more expensive
  than  calling  this  function directly and then reading off the Loewy length
  (and [22Xm(q,e)[122X).[133X
  
