File: edim.gi

package info (click to toggle)
gap-hap 1.66%2Bds-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 55,348 kB
  • sloc: xml: 15,368; sh: 216; javascript: 155; makefile: 126; ansic: 57; perl: 36
file content (70 lines) | stat: -rw-r--r-- 1,456 bytes parent folder | download | duplicates (3)
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);
#####################################################################
#####################################################################