File: initperm.gi

package info (click to toggle)
gap-autpgrp 1.5-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 560 kB
  • ctags: 19
  • sloc: makefile: 107; sh: 9
file content (184 lines) | stat: -rw-r--r-- 5,371 bytes parent folder | download | duplicates (2)
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
#############################################################################
##
#W  initperm.gi              AutPGrp package                     Bettina Eick
##
#H  @(#)$Id: initperm.gi,v 1.7 2009/08/31 07:40:15 gap Exp $
##
Revision.("autpgrp/gap/initperm_gi") :=
    "@(#)$Id: initperm.gi,v 1.7 2009/08/31 07:40:15 gap Exp $";

#############################################################################
##
#F Fingerprint( G, U )
##
FingerprintSmall := function( G, U )
    return Flat( [IdGroup( U ), Size(CommutatorSubgroup( G, U )) ]);
end;

FingerprintMedium := function( G, U )
    local ranks, invs, comm, all, cls, fus, new;

    # some general stuff
    ranks := LGFirst( SpecialPcgs( U ) );
    invs  := AbelianInvariants( Centre(U) );
    comm  := Size( CommutatorSubgroup( G, U ) );

    # use conjugacy classes
    all := Orbits( G, AsList(U) );
    all := List( all, x -> Set(x));
    cls := List( all, x -> Order(x[1]) );
    Sort( cls );

    return Concatenation( ranks, invs, [comm], cls );
end;

FingerprintLarge := function( G, U )
    return LGFirst( SpecialPcgs(U) );
end;

FingerprintHuge := function( G, U )
    return List( DerivedSeries(U), Size );
end;

PGFingerprint := function ( G, U )
    if Size( U ) <= 255 and IsRecord( ID_AVAILABLE( Size(U) ) ) then
        return FingerprintSmall( G, U );
    elif Size( U ) <= 1000 then
        return FingerprintMedium( G, U );
    elif Size( U ) <= 2^21 then
        return FingerprintLarge( G, U );
    else
        return FingerprintHuge( G, U );
    fi;
end;

DualBasis := function( base )
  local M;
  M := NullspaceMat( TransposedMat( base ));
  M := List( M, ShallowCopy );
  TriangulizeMat( M );
  return M;
end;

#############################################################################
##
#F PartitionMinimalOvergrps ( G, pcgs, norm )
##
PartitionMinimalOvergrps := function( G, pcgs, norm )
    local min, done, part, i, tup, pos;

    Info( InfoAutGrp, 3, "  computing partition ");
    done := [];
    part := [];
    for i in [1..Length(norm)] do
        Info( InfoAutGrp, 4, "    start ",i);
        #min := DualBasis( [norm[i]] );
        min := InducedPcgsByBasis( pcgs, [norm[i]] );
        tup := PGFingerprint( G, SubgroupByPcgs( G, min ) );
        pos := Position( done, tup );
        if IsBool( pos ) then
            Add( part, [i] );
            Add( done, tup );
        else
            Add( part[pos], i );
        fi;
    od;
    Sort( part, function( x, y ) return Length(x) < Length(y); end );
    return part;
end;

#############################################################################
##
#F PartitionStabilizer ( A, part, norm )
##
PartitionStabilizer := function( A, part, norm )
    local iso, P, sub, gens, n, q;

    Info( InfoAutGrp, 3, "  computing stabilizer of ", part);
    iso := ActionHomomorphism( A, norm, OnLines, "surjective" );
    P := Image( iso );

    # transfer size info
    n := DimensionOfMatrixGroup(A);
    q := Size(FieldOfMatrixGroup(A));
    if HasIsNaturalGL(A) and IsNaturalGL(A) then
        SetSize(P,Size(A)/(q-1));
    elif HasIsNaturalSL(A) and IsNaturalSL(A) then
        SetSize(P,Size(A)/Gcd(n,q-1));
    fi;

    # loop
    for sub in part{[1..Length(part)-1]} do 
        if Length( sub ) = 1 then
            P := Stabilizer( P, sub[1], OnPoints );
            Info( InfoAutGrp, 3, "  found stabilizer of size ", Size(P));
        else
            P := Stabilizer( P, sub, OnSets );
            Info( InfoAutGrp, 3, "  found stabilizer of size ", Size(P));
        fi;
    od;
    gens := SmallGeneratingSet( P ); 
   
    # return
    return rec( perm := gens,
                mats := List( gens, x -> PreImagesRepresentative(iso,x) ),
                size := Size(P) ); 
end;

#############################################################################
##
#F AutoOfMat( mat, H )
##
AutoOfMat := function( mat, H )
    local img, aut, pcgs;
    pcgs := Pcgs(H);
    img := List( mat, x -> PcElementByExponentsNC(pcgs, x) );
    aut := PGAutomorphism( H, pcgs, img );
    return aut;
end;

#############################################################################
##
#F InitAutomorphismGroupOver( G )
##
InstallGlobalFunction( InitAutomorphismGroupOver,
  function( G )
    local r, p, pcgsG, pcgsN, pcgs, base, V, norm, part, stab, H, kern, A;

    Info( InfoAutGrp, 2, "  initialize automorphism group: Over ");

    # set up
    r := RankPGroup( G );
    p := PrimePGroup( G );

    # pgcs'se
    pcgsG := SpecialPcgs(G);
    pcgsN := InducedPcgsByPcSequenceNC( pcgsG, pcgsG{[r+1..Length(pcgsG)]} );
    pcgs  := pcgsG mod pcgsN;

    # get partition stabilizer
    base := IdentityMat( r, GF(p) );
    V    := GF(p)^r;
    norm := NormedVectors( V );
    part := PartitionMinimalOvergrps( G, pcgs, norm );
    stab := PartitionStabilizer( GL( r, p ), part, norm );

    # get quotient
    H := FrattiniQuotientPGroup( G );
    kern := InitAgAutos( H, p );

    # create aut grp
    A := rec();
    A.glAutos := List( stab.mats, x -> AutoOfMat( x, H ) );
    A.glOrder := stab.size;
    A.glOper  := ShallowCopy( stab.perm );
    A.agAutos := kern.auts;
    A.agOrder := kern.rels;
    A.one     := IdentityPGAutomorphism(H);
    A.group   := H;
    A.size    := A.glOrder * Product( A.agOrder );

    # try to construct solvable normal subgroup
    NiceInitGroup( A, true );
    return A;
  end);