File: volume.gi

package info (click to toggle)
gap-hap 1.74%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 58,664 kB
  • sloc: xml: 16,678; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (69 lines) | stat: -rw-r--r-- 1,789 bytes parent folder | download
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
##################################
InstallGlobalFunction(QuadraticCharacter,
function(Q,m)
return Jacobi(Discriminant(Q),m);
end);
##################################

##################################
InstallGlobalFunction(Lfunction,
function(arg)
local Q,s,t,L,n;
Q:=arg[1];
s:=arg[2];
if Length(arg)=3 then t:=arg[3]; else t:=1000; fi;
L:=0;
for n in [1..t] do
L:=L+ QuadraticCharacter(Q,n)*n^(-s);
od;
return Int(10^8*L)/10^8;
end);
##################################

##################################
InstallOtherMethod(IsomorphismFpGroup,
"for HAP SL2Z subgroups",
[IsHapSL2ZSubgroup],
1000000,#Again, there must be a better way
function(H)
local QH, epi, ElementToWord, iso;
QH:=HAP_RightTransversalSL2ZSubgroups(H,false);
iso:=IsomorphismFpGroup(QH);
epi:=QH!.epimorphism;
ElementToWord:=QH!.ElementToWord;
return GroupHomomorphismByFunction(H, Image(iso), x->
                Image(iso,Image(epi,ElementToWord(x)) ) );


end);
##################################

#################################
InstallOtherMethod(AbelianInvariants,
"for HAP SL2Z subgroups",
[IsHapSL2ZSubgroup],
1000000,#Again, there must be a better way
function(H)
return AbelianInvariants(HAP_RightTransversalSL2ZSubgroups(H,false));
end);
##################################

#################################
InstallOtherMethod(IsPrime,
"for deals in s ting of quadratic integers",
[IsIdealOfQuadraticIntegers],
1000000,#Again, there must be a better way
function(I)
local N, p;
N:=Norm(I);
if IsPrimeInt(N) then return true;fi;
if N=1 then return false; fi;
N:=Factors(N);
if Length(N)>2 then return false; fi;
if Length(N)=1 then return true; fi;
p:=N[1]; #So Norm(I)=p^2.
if QuadraticCharacter(AssociatedRing(I),p)=-1 then return true;
else return false; fi;
end);
##################################