File: idgrp3.g

package info (click to toggle)
gap4-gdat 4.2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 78,948 kB
  • ctags: 10,624
  • sloc: ansic: 25,214; fortran: 12,279; ada: 6,377; asm: 4,623; cpp: 2,332; lisp: 910; cs: 503; ruby: 466; yacc: 284; tcl: 167; makefile: 51
file content (298 lines) | stat: -rw-r--r-- 11,704 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#############################################################################
##
#W  idgrp3.g                 GAP group library             Hans Ulrich Besche
##                                               Bettina Eick, Eamonn O'Brien
##
##  This file contains the identification routines for groups of order
##  2^n * p with 3 <= n <= 8 and p an odd prime
##
Revision.idgrp3_g :=
    "@(#)$Id: idgrp3.g,v 1.9 2000/01/23 13:58:54 gap Exp $";

#############################################################################
##
## tell GAP about the component
##
DeclareComponent("id3","2.1");

#############################################################################
##
#F ID_AVAILABLE_FUNCS[ 3 ]
##
ID_AVAILABLE_FUNCS[ 3 ] := function( size )
    local p;

    p := FactorsInt( size );
    if Length( p ) > 9 or p[ Length( p ) - 1 ] <> 2 or size = 512 then
        return fail;
    fi;

    return rec( func := 13,
                lib  := 3,
                n    := Length( p ) - 1,
                p    := p[ Length( p ) ] );
end;

#############################################################################
##
#F ID_GROUP_FUNCS[ 13 ]( G, inforec )
##
## standard lookup in the case 2^n * p
##
ID_GROUP_FUNCS[ 13 ] := function( G, inforec )
    local size, sid, num, pos, cid, n, typ, c, sp, i, j, k, tmp, listInt,
          rank, id, g, gens, fgens, sgens, inv, coeff, p, root1, root2,
          pcgs, pelm, rels, C;

    listInt := function( int )                                               
        local r, i; 

        i := 1;
        r := [ ];                                                
        while int > 0 do                                      
            if int mod 2 = 1 then                         
                Add( r, i );                                                 
            fi;                                     
            i := i + 1;                                                  
            int := QuoInt( int, 2 );                             
        od;
        return r;
    end;

    if IsNilpotent( G ) then 
        return IdGroup( SylowSubgroup( G, 2 ) )[ 2 ];
    fi;

    size := Size( G );

    if ( not IsNormal( G, SylowSubgroup( G, 2 ) ) ) and
       ( not IsNormal( G, SylowSubgroup( G, inforec.p ) ) ) then
        if size = 768 and not IsBound( ID_GROUP_TREE.next[ 768 ] ) then
            ID_GROUP_TREE.next[ 768 ] := rec( fp:= [ 1, 2 ], next:= [ ] );
        fi;
        return ID_GROUP_FUNCS[ 8 ]( G, inforec, [ size, 2 ] );
    fi;

    sid := IdGroup( SylowSubgroup( G, 2 ) )[ 2 ];
    num := NUMBER_SMALL_GROUPS_FUNCS[ 11 ]( size, SMALL_AVAILABLE( size ) );

    if IsNormal( G, SylowSubgroup( G, 2 ) ) then
        num := num.pos[ Position( num.types, "p-autos" ) ];
        if not IsBound( SMALL_GROUP_LIB[ size ] ) then
            SMALL_GROUP_LIB[ size ] := rec();
        fi;
        if not IsBound( SMALL_GROUP_LIB[ size ].pnil ) then
            ReadSmallLib( "sml", 3, size, [ ] );
        fi;
        pos := Position( SMALL_GROUP_LIB[ size ].pnil.2syl, sid );
        if ( not IsBound( SMALL_GROUP_LIB[ size ].pnil.2syl[ pos+1 ] ) )
           or ( SMALL_GROUP_LIB[ size ].pnil.2syl[ pos + 1 ] <> sid ) then
            return num + pos;
        fi;
        if size = 768 and not IsBound( ID_GROUP_TREE.next[ 768 ] ) then
            ID_GROUP_TREE.next[ 768 ] := rec( fp:= [ 1, 2 ], next:= [ ] );
        fi;
        return ID_GROUP_FUNCS[ 8 ]( G, inforec, [ size, 1, sid ] );
    fi;

    # p-sylow-subgroup is normal
    cid := IdGroup( Centralizer( SylowSubgroup( G, 2 ),
                                 SylowSubgroup( G, inforec.p ) ) );
    n   := inforec.n;
    typ := Log( 2 ^ n / cid[ 1 ], 2 );
    cid := cid[ 2 ];
    num := num.pos[ Position( num.types, typ ) ];

    if typ = 1 and n in [ 7, 8 ] then
        if n = 7 then
            c := [ 0, 4514, 13729 ];
        else
            c := [     0,   3465,   8461,  14319,  20208,  25076 , 30536,
                   36802,  48659,  61838,  75468,  84609,  94875, 106350,
                  115482, 124305, 135946, 146216, 158916, 171446, 185870,
                  199622, 211598, 223026, 236294, 250682, 263271, 271778,
                  286530, 307239, 328434, 351278, 379078, 402238, 431410,
                  461222, 485658, 515470, 544547, 568726, 596286, 625438,
                  656042, 686670, 716722, 746080, 771660, 799616, 830416,
                  861172, 891634, 922178, 951604, 976054, 988277, 1006917, 
                  1026007 ];
        fi;
        sp := QuoInt( sid - 1, 1000 ) * 1000 + 1;
        num := num + c[ QuoInt( sid + 999, 1000 ) ];
    else
        sp := 1;
    fi;

    if n < 8 then
        if not IsBound( SMALL_GROUP_LIB[ n ] ) then
            ReadSmallLib( "nor", 3, 2, [ n ] );
        fi;
    else  
        if not IsBound( SMALL_GROUP_LIB[ 8 ] ) then
            SMALL_GROUP_LIB[ 8 ] := [ ];
        fi;
        if not IsBound( SMALL_GROUP_LIB[ 8 ][ typ ] ) then
            c := [ 1, 2, 3, 3, 3, 3, 3, 3 ];
            ReadSmallLib( "nor", 3, 2, [ 8, c[ typ ] ] );
        fi;
    fi;

    if IsRecord( SMALL_GROUP_LIB[ n ][ typ ] ) then
        tmp := [ ];
        i := 0;
        for j in [ 1 .. Length( SMALL_GROUP_LIB[ n ][ typ ].pos ) ] do
            if SMALL_GROUP_LIB[ n ][ typ ].pos[ j ] > 0 then
                i := i + 1;
                tmp[ SMALL_GROUP_LIB[ n ][ typ ].pos[ j ] ] :=
                    SMALL_GROUP_LIB[ n ][ typ ].val[ i ];
            else
                for k in [ SMALL_GROUP_LIB[ n ][ typ ].pos[ j - 1] + 1 ..
                          -SMALL_GROUP_LIB[ n ][ typ ].pos[ j ] ] do
                    i := i + 1;
                    tmp[ k ] := SMALL_GROUP_LIB[ n ][ typ ].val[ i ];
                od;
            fi;
        od;
        SMALL_GROUP_LIB[ n ][ typ ] := tmp;
    fi;

    for i in [ sp .. sid ] do
        if typ = 1 and ( not IsBound( SMALL_GROUP_LIB[n][typ][ i ] ) ) then
            SMALL_GROUP_LIB[n][typ][ i ] := SMALL_GROUP_LIB[n][typ][ i-1 ];
        fi;
        if IsBound( SMALL_GROUP_LIB[ n ][ typ ][ i ] ) then
            if IsInt( SMALL_GROUP_LIB[ n ][ typ ][ i ] ) then
                if SMALL_GROUP_LIB[ n ][ typ ][ i ] < 0 then
                    if IsInt( SMALL_GROUP_LIB[ n ][ typ ][
                                   -SMALL_GROUP_LIB[ n ][ typ ][ i ] ] ) then
                        SMALL_GROUP_LIB[ n ][ typ ][
                                     -SMALL_GROUP_LIB[ n ][ typ ][ i ] ] :=
                            listInt( SMALL_GROUP_LIB[ n ][ typ ][
                                     -SMALL_GROUP_LIB[ n ][ typ ][ i ] ]);
                    fi;
                    SMALL_GROUP_LIB[ n ][ typ ][ i ] := SMALL_GROUP_LIB[ n ]
                                [ typ ][ -SMALL_GROUP_LIB[ n ][ typ ][ i ] ];
                else
                    SMALL_GROUP_LIB[ n ][ typ ][ i ] := listInt(
                                          SMALL_GROUP_LIB[ n ][ typ ][ i ] );
                fi;
            fi;
            num := num + Length( SMALL_GROUP_LIB[ n ][ typ ][ i ] );
        fi;
    od;

    # num is the last group of the correct n, typ, sid
    if Length( SMALL_GROUP_LIB[ n ][ typ ][ sid ] ) = 1 then
        return num;
    fi;

    # look if there will be a conflict
    c := [ ,, [],
           [ 1 ],
           [ 1, 1 ],
           [ 1, 1, 1 ],
           [ 6, 1, 1, 1 ],
           [ 300, 20, 1, 1, 1 ] ];
    if IsBound( c[ n ][ typ ] ) then
        c := c[ n ][ typ ];
        if c > 1 then
            i := ID_GROUP_FUNCS[ 8 ]( G, inforec,
                                     [ n, typ, sid mod c, sid, cid ], true );
        else
            i := ID_GROUP_FUNCS[ 8 ]( G, inforec,
                                     [ n, typ, sid, cid ], true );
        fi;
        p := [ 3, 5, 17, 17, 97 ];
        p := p[ typ ];
        if i <> fail then
            if p <> inforec.p then
                # construct the group of size 2^n * p (<>inforec.p) with the
                # analogue operation of the 2-sylowsubgroup on the p-sylowsub
                g := FreeGroup( n + 1 );
                gens := GeneratorsOfGroup( g );
                pcgs := Pcgs( SylowSubgroup( G, 2 ) );
                pelm := First( GeneratorsOfGroup( SylowSubgroup( G,
                                 inforec.p )), x -> Order( x ) = inforec.p );
                rels := RelatorsCode( CodePcgs( pcgs ), 2^n, gens{[1 ..n ]});
                Add( rels, gens[ n + 1 ] ^ p );
                root1 := PrimitiveRootMod( p ) ^ ((p-1)/2^typ) mod p;
                root2 := PrimitiveRootMod( inforec.p ) ^
                                         ((inforec.p-1)/2^typ) mod inforec.p;
                root2 := List( [ 0 .. 2 ^ typ - 1 ], x-> pelm ^ (root2^x) );
                for j in [ 1 .. n ] do
                    Add( rels, gens[ n+1 ] ^ gens[ j ] / gens[ n+1 ] ^
                         ( root1 ^ ( ( Position( root2, pelm^pcgs[j] ) - 1 )
                           mod p ) ) );
                od;
                G := PcGroupFpGroup( g / rels );
                if Size( G ) < 1000 and n <> 8 then
                    return i.next[ Position( i.fp, IdGroup( G )[ 2 ] ) ];
                fi;
            fi;
            if c > 1 then
                return ID_GROUP_FUNCS[ 8 ]( G, inforec,
                                           [ n, typ, sid mod c, sid, cid ] );
            else
                return ID_GROUP_FUNCS[ 8 ]( G, inforec, [ n, typ, sid,cid] );
            fi;
        fi;
    fi;

    # there is no conflict. Analyse the ids of the centralizer of the 
    # p-sylowsubgroup in the 2-sylowsubgroup
    c := [ ,, [ 1, 4 ],
           [ 1, 9, 13 ],
           [ 1, 20, 44, 50 ],
           [ 1, 54, 191, 259, 266 ],
           [ 1, 163, 996, 2149, 2318, 2327 ],
           [ 1, 541, 6731, 26972, 55625, 56081, 56091 ] ];
    c := c[ n ];
    rank := 1;
    repeat
        rank := rank + 1;
    until c[ rank ] >= sid;

    g := SmallGroup( 2^n, sid );
    gens := GeneratorsOfGroup( g );

    if typ = 1 then
        fgens := Reversed( gens{[ rank + 1 .. n ]} );
        for j in [ 1 .. Length( SMALL_GROUP_LIB[ n ][ typ ][ sid ] ) ] do
            coeff := CoefficientsMultiadic( 2 + 0 * [ 1 .. rank ],
                                   SMALL_GROUP_LIB[ n ][ typ ][ sid ][ j ] );
            sgens := ShallowCopy( fgens );
            Unbind( inv );
            for i in Reversed( [ 1 .. rank ] ) do
                if coeff[ i ] = 0 then
                    Add( sgens, gens[ i ] );
                else
                    if IsBound( inv ) then
                        Add( sgens, gens[ i ] * inv );
                    else
                        inv := gens[ i ];
                    fi;
                fi;
            od;
            if cid = IdGroup( GroupByGenerators( Reversed( sgens ) ) )[2] then
                return num - Length( SMALL_GROUP_LIB[n][typ][ sid ] ) + j;
            fi;
        od;
        Error( "fatal Error in function ID_GROUP_FUNCS[ 13 ]" );
    fi;

    # typ in [ 2 .. 
    C := CyclicGroup( 2 ^ typ );
    c := GeneratorsOfGroup( C )[ 1 ];
    gens := gens{[ 1 .. rank ]};
    for j in [ 1 .. Length( SMALL_GROUP_LIB[ n ][ typ ][ sid ] ) ] do
        if SMALL_GROUP_LIB[ n ][ typ ][ sid ][ j ] > 0 then
            coeff := CoefficientsMultiadic( 2 ^ typ + 0 * [ 1 .. rank ],
                                   SMALL_GROUP_LIB[ n ][ typ ][ sid ][ j ] );
            if IdGroup( Kernel( GroupHomomorphismByImages( g, C, gens,
               List( coeff, x-> c ^ x ) ) ) ) = [ 2 ^ ( n - typ ), cid ] then
                return num - Length( SMALL_GROUP_LIB[n][typ][ sid ] ) + j;
            fi;
        fi;
    od;
    Error( "fatal Error in function ID_GROUP_FUNCS[ 13 ]" );
end;