ProjSummands:=function(P,N) //removes indecomposable //projective direct summands from //the P-module N; //P needs to be a group of prime //power order q:=N; h:=true; ord:=Order(P); while h eq true do if Dimension(q) gt 0 then i:=0; bool:=false; while bool eq false do vec:=Random(q); test:=sub; if Dimension(test) eq ord then q:=quo; Dimension(q); bool:=true; elif i lt 10 then i:= i+1; else h:=false; bool:=true; end if; end while; else h:=false; end if; end while; return q; end function; CyclicVertexSummands:=function(P,N,b); //removes indecomposable //direct summands with cyclic vertices from //the P-module N; //P needs to be a group of prime //power order; //b is an upper bound for the number //of random trials carried out for each //cyclic subgroup of P; M:=ProjSummands(P,N); print "proj"; K:=CoefficientRing(M); p:=Characteristic(K); cyc:=CyclicSubgroups(P); cyc:=[x`subgroup: x in cyc|x`order gt 1]; for j in [1..#cyc] do cgens:=Generators(cyc[j]); for g in cgens do if Order(g) eq Order(cyc[j]) then cyc[j]:=sub; end if; end for; end for; j:=1; while j le #cyc do C:=cyc[j]; q:=Order(C); c:=Order(P)/q; for s in [1..q] do i:=0; while i lt b do if Dimension(M) ge s*c then if i eq 0 then res:=Restriction(M,C); acts:=ActionGenerators(res); a:=acts[1]-IdentityMatrix(K,Dimension(M)); Ms:=Nullspace(a^s); end if; x:=Random(Ms); sub:=sub; if Dimension(sub) eq s*c then Q:=quo; ressub:=Restriction(sub,C); resquo:=Restriction(Q,C); sum:=DirectSum(resquo,ressub); actssum:=ActionGenerators(sum); if IsSimilar(acts[1],actssum[1]) eq true then M:=Q; Dimension(M); i:=0; else i:=i+1; end if; else i:=i+1; end if; else i:=b; end if; end while; end for; j:=j+1; end while; return M; end function;