1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#####################################################################
InstallGlobalFunction(HomologyPrimePart,
function(C,n,p)
local
M2, Smith, Divs, Dimension, Boundary,
i;
if n <0 then return false; fi;
Dimension:=C!.dimension;
Boundary:=C!.boundary;
#######################
M2:=[];
for i in [1..Dimension(n+1)] do
M2[i]:=Boundary(n+1,i);
od;
ConvertToMatrixRep(M2);
Divs:=ElementaryDivisorsPPartRk(M2,p);
M2:=0;
Smith:=[];
for i in [1..Length(Divs)-1] do
Append(Smith,ListWithIdenticalEntries(Divs[i]-Divs[i+1] ,p^i));
od;
#######################
return Smith ;
end);
#####################################################################
#####################################################################
#####################################################################
InstallGlobalFunction(CohomologyPrimePart,
function(C,N,p)
local
M2, Divs, Smith, Dimension, Boundary, i,row,n;
n:=N-1;
if N <0 then return [ ]; fi;
Dimension:=C!.dimension;
Boundary:=C!.boundary;
M2:=[];
if n=-1 then M2:=[List([1..Dimension(0)],i->0)];
else
for i in [1..Dimension(n)] do
M2[i]:=Boundary(n,i);
od;
fi;
Divs:=ElementaryDivisorsPPartRk(M2,p);
Smith:=[];
for i in [1..Length(Divs)-1] do
Append(Smith,ListWithIdenticalEntries(Divs[i]-Divs[i+1] ,p^i));
od;
return Smith;
end);
#####################################################################
#####################################################################
|