File: arithmeticOps.gi

package info (click to toggle)
gap-hap 1.73%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky
  • size: 58,508 kB
  • sloc: xml: 16,467; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (71 lines) | stat: -rw-r--r-- 1,785 bytes parent folder | download | duplicates (4)
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
71

##########################################################################
#0
#F  RightTransversal
##
##  Define a new method for computing the set of right cosets
##  of a congruence subgroup in its main group SL2Z[1/m]
##
##  Input: A pair of groups (G,H) where G is SL2Z(1/m)  
##         and H is its congruence subgroup
##  Output: A set of right cosets of H in G 
##             
##
InstallOtherMethod(RightTransversal,
"Right Transversal for SL2Z(1/m) and its congruence subgroup",
[IsHAPRationalSpecialLinearGroup,IsMatrixGroup],
function(G,H)
local 
    T,trans,NameG,i,j,m,n,p,S,d,enum;
    
    NameG:=Name(G);
    i:=Position(NameG,'/');
    j:=Position(NameG,']');
    m:=Int(NameG{[i+1..j-1]});
    n:=H!.levels[1];
    p:=H!.levels[2];
    if not n=m then 
        return "two groups are not in the same level";
    fi;
    T:=[[1,0],[1,1]];
    S:=[[0,-1],[1,0]];

    enum:=EnumeratorByFunctions(CollectionsFamily( FamilyObj( G ) ),rec(
        ElementNumber:=function(enum,n)
        if n<p+1 then 
            return CanonicalRightCountableCosetElement(H,T^n);
        else 
            return CanonicalRightCountableCosetElement(H,S);
        fi;
    end,
    
    NumberElement:=function(enum,elm)
        local i;
        if elm*S^-1 in H then 
            return p+1;fi;
        for i in [1..p] do
            if elm*T^-i in H then
                return i;
            fi;
        od;
    return fail;
    end,
    
    Length:=function(enum)
        return p+1;
    end,
    
    PrintObj:=function(enum)
        Print("RightTransversal of ",Name(H)," in ",Name(G));
    end,

    group:=G,
    subgroup:=H,
    ));
    
    SetIsSSortedList( enum, true );
    return enum;
end);
##
################### end of RightTransversal ##############################