Difference between revisions of "Guide to contributing: Code"

From Block library
Jump to: navigation, search
(Removed GAP code heading)
 
(8 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
== Magma code ==
 
== Magma code ==
  
The following code, written by Claudio Marchi and [[User:CesareGArdito|Cesare G. Ardito]], can usually be run on the free Magma online calculator[http://magma.maths.usyd.edu.au/calc/], as long as the involved group is small.
+
The following code, written by Claudio Marchi and [[User:CesareGArdito|Cesare G. Ardito]], can usually be run on the free Magma online calculator [http://magma.maths.usyd.edu.au/calc/], as long as the involved group is small.
  
 +
<div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto;">
 +
<div style="font-weight:bold;line-height:1.6;">Magma code</div>
 +
<div class="mw-collapsible-content">
 
<pre>
 
<pre>
 +
 +
/* Input data: a group, a prime and an exponent such that GF(p^n) contains all the necessary roots of unity */
 +
G:=SmallGroup(2,1);
 +
p:=2;
 +
splittingexponent:=1;
 +
/* End of input data*/
 +
 
LoewyStructure:= function(W,p,k,S,irrs)
 
LoewyStructure:= function(W,p,k,S,irrs)
 
   Z:=W;
 
   Z:=W;
Line 85: Line 95:
 
return " ";
 
return " ";
 
end function;
 
end function;
 
/* Input data: a group, a prime and an exponent such that GF(p^n) contains all the necessary roots of unity */
 
G:=SmallGroup(2,1);
 
p:=2;
 
splittingexponent:=1;
 
/* End input data*/
 
  
 
PrintLatex(AbsoluteCartanMatrix(G,GF(p^splittingexponent)));
 
PrintLatex(AbsoluteCartanMatrix(G,GF(p^splittingexponent)));
Line 101: Line 105:
 
end for;
 
end for;
 
</pre>
 
</pre>
 
+
</div></div>
 
Note that, if <math>G</math> has more than one block, some manual work on the output is needed to isolate the relevant submatrices and indecomposable projective modules that belong to the block that is being investigated.
 
Note that, if <math>G</math> has more than one block, some manual work on the output is needed to isolate the relevant submatrices and indecomposable projective modules that belong to the block that is being investigated.

Latest revision as of 19:08, 10 January 2024

The code in this section computes the Cartan matrix, the decomposition matrix and the Loewy structure of the projective indecomposable modules. The output is formatted in LaTeX, so it can be copied and pasted easily on the relevant block page.

Magma code

The following code, written by Claudio Marchi and Cesare G. Ardito, can usually be run on the free Magma online calculator [1], as long as the involved group is small.

Magma code

/* Input data: a group, a prime and an exponent such that GF(p^n) contains all the necessary roots of unity */
G:=SmallGroup(2,1); 
p:=2;
splittingexponent:=1;
/* End of input data*/

LoewyStructure:= function(W,p,k,S,irrs)
  Z:=W;
  t:=0;
  maxlength:=100;
  M:=ZeroMatrix(Integers(),maxlength,maxlength);
  repeat                
    t:=t+1;
    J:=JacobsonRadical(W);
    V:=W/J;
    V:=ChangeRing(V,GF(p^k));
    if IsDecomposable(V) then
      indsum:=IndecomposableSummands(V);
      for i in [1..#indsum] do
        for j in S do
          V7:=indsum[i];
          U:=irrs[j];
          U:=ChangeRing(U,GF(p^k));
          V:=ChangeRing(V7,GF(p^k));
          if IsIsomorphic(V,U) then
            M[t][i]:=j;                                    
            continue i;
          end if;
        end for;
      end for;    
    else
      for j in S do
        U:=irrs[j];
        U:=ChangeRing(U,GF(p^k));
        V:=ChangeRing(V,GF(p^k));
        if IsIsomorphic(V,U) then
          M[t][1]:=j;
          break j;
        end if;
      end for;
    end if;    
    W:=J;
    if IsIrreducible(W) then
      t:=t+1;
      for j in S do
        U:=irrs[j];
        U:=ChangeRing(U,GF(p^k));
        V:=ChangeRing(W,GF(p^k));
        if IsIsomorphic(V,U) then
          M[t][1]:=j;
          break j;
        end if;
      end for;    
    end if;
  until IsIrreducible(W);
  printf("\n");
  for i in [1..maxlength] do
    flag:=0;
    for j in [1..maxlength] do
      if(not (M[i][j] eq 0)) then 
        flag:=1;
        printf "S_\{%o\} ", M[i][j]; 
      end if;
    end for;
    if(flag eq 1) then
      printf("\\\\ \n");
    end if;
  end for;
  print "The structure above is the Loewy structure of";
  return Z;
  end function;

PrintLatex:= function(M)
  for i in [1..NumberOfRows(M)-1] do
    for j in [1..NumberOfColumns(M)-1] do
      printf "%o & ", M[i,j];
    end for;
    printf "%o \\\\ \n", M[i,NumberOfColumns(M)];
  end for;
  for j in [1..NumberOfColumns(M)-1] do
    printf "%o & ", M[NumberOfRows(M),j];
  end for;
printf "%o \n", M[NumberOfRows(M),NumberOfColumns(M)];
return " ";
end function;

PrintLatex(AbsoluteCartanMatrix(G,GF(p^splittingexponent)));
printf("\n");
PrintLatex(DecompositionMatrix(G,GF(p^splittingexponent)));
irrs:=AbsolutelyIrreducibleModules(G, GF(p^splittingexponent));
P:=ProjectiveIndecomposableModules(G, GF(p^splittingexponent));
for i in [1..#P] do
  LoewyStructure(P[i],p,splittingexponent,[1..#irrs],irrs);
end for;

Note that, if [math]G[/math] has more than one block, some manual work on the output is needed to isolate the relevant submatrices and indecomposable projective modules that belong to the block that is being investigated.