File: stbc.gd

package info (click to toggle)
gap 4r4p9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,120 kB
  • ctags: 6,735
  • sloc: ansic: 96,692; sh: 3,254; makefile: 319; perl: 11; awk: 6
file content (542 lines) | stat: -rw-r--r-- 20,259 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
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
#############################################################################
##
#W  stbc.gd                     GAP library                    Heiko Thei"sen
#W                                                               'Akos Seress
##
#H  @(#)$Id: stbc.gd,v 4.45 2002/04/15 10:05:23 sal Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen, Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
Revision.stbc_gd :=
    "@(#)$Id: stbc.gd,v 4.45 2002/04/15 10:05:23 sal Exp $";


#############################################################################
##
#F  StabChain( <G>[, <options>] )
#F  StabChain( <G>, <base> )
#O  StabChainOp( <G>, <options> )
#A  StabChainMutable( <G> )
#A  StabChainMutable( <permhomom> )
#A  StabChainImmutable( <G> )
##
##  These commands compute a stabilizer chain for the permutation group <G>;
##  additionally, `StabChainMutable' is also an attribute for the group
##  homomorphism <permhomom> whose source is a permutation group.
##  
##  `StabChainOp' is an operation with two arguments <G> and <options>,
##  the latter being a record which controls some aspects of the computation
##  of a stabilizer chain (see below);
##  `StabChainOp' returns a *mutable* stabilizer chain.
##  `StabChainMutable' is a *mutable* attribute for groups or homomorphisms,
##  its default method for groups is to call `StabChainOp' with empty
##  options record.
##  `StabChainImmutable' is an attribute with *immutable* values;
##  its default method dispatches to `StabChainMutable'.
##
##  `StabChain' is a function with first argument a permutation group <G>,
##  and optionally a record <options> as second argument.
##  If the value of `StabChainImmutable' for <G> is already known and if this
##  stabilizer chain matches the requirements of <options>,
##  `StabChain' simply returns this stored stabilizer chain.
##  Otherwise `StabChain' calls `StabChainOp' and returns an immutable copy
##  of the result; additionally, this chain is stored as `StabChainImmutable'
##  value for <G>.
##  If no <options> argument is given,
##  its components default to the global variable `DefaultStabChainOptions'
##  (see~"DefaultStabChainOptions").
##  If <base> is a list of positive integers,
##  the version `StabChain( <G>, <base> )' defaults to
##  `StabChain( <G>, rec( base:= <base> ) )'.
##
##  If given, <options> is a record whose components specify properties of
##  the desired stabilizer chain or which may help the algorithm.
##  Default values for all of them can be given in the global variable
##  `DefaultStabChainOptions' (see~"DefaultStabChainOptions").
##  The following options are supported.
##  \beginitems
##  `base' (default an empty list) &
##      A list of points, through which the resulting stabilizer chain
##      shall run.
##      For the base $B$ of the resulting stabilizer chain <S> this means
##      the following.
##      If the `reduced' component of <options> is `true' then those points
##      of `base' with nontrivial basic orbits form the initial segment
##      of $B$, if the `reduced' component is `false' then `base' itself
##      is the initial segment of $B$.
##      Repeated occurrences of points in `base' are ignored.
##      If a stabilizer chain for <G> is already known then the stabilizer
##      chain is computed via a base change.
##
##  `knownBase' (no default value) &
##      A list of points which is known to be a base for the group.
##      Such a known base makes it easier to test whether a permutation
##      given as a word in terms of a set of generators is the identity,
##      since it suffices to map the known base with each factor
##      consecutively, rather than multiplying the whole permutations
##      (which would mean to map every point).
##      This speeds up the Schreier-Sims algorithm which is used when a new
##      stabilizer chain is constructed;
##      it will not affect a base change, however.
##      The component `knownBase' bears no relation to the `base'
##      component, you may specify a known base `knownBase' and a desired
##      base `base' independently.
##
##  `reduced' (default `true') &
##      If this is `true' the resulting stabilizer chain <S> is reduced,
##      i.e., the case  $G^{(i)} = G^{(i+1)}$ does not occur.
##      Setting `reduced' to `false' makes sense only if the component
##      `base' (see above) is also set;
##      in this case all points of `base' will occur in the base $B$ of <S>,
##      even if they have trivial basic orbits.
##      Note that if `base' is just an initial segment of $B$,
##      the basic orbits of the points in $B \setminus `base'$ are always
##      nontrivial.
##
##  `tryPcgs' (default `true') &
##      If this is `true' and either the degree is at most 100 or the group
##      is known to be solvable, {\GAP} will first try to construct a pcgs
##      (see Chapter~"Polycyclic Groups") for <G> which will succeed and
##      implicitly construct a stabilizer chain if <G> is solvable.
##      If <G> turns out non-solvable, one of the other methods will be used.
##      This solvability check is comparatively fast, even if it fails,
##      and it can save a lot of time if <G> is solvable.
##
##  `random' (default `1000') &
##      If the value is less than~$1000$,
##      the resulting chain is correct with probability
##      at least~$`random'/1000$.
##      The `random' option is explained in more detail
##      in~"Randomized Methods for Permutation Groups".
##
##  `size' (default `Size( <G> )' if this is known,
##          i.e., if `HasSize( <G> )' is `true') &
##      If this component is present, its value is assumed to be the order
##      of the group <G>.
##      This information can be used to prove that a non-deterministically
##      constructed stabilizer chain is correct.
##      In this case, {\GAP} does a non-deterministic construction until the
##      size is correct.
##
##  `limit' (default `Size( Parent( <G> ) )' or
##           `StabChainOptions( Parent( <G> ) ).limit' if this is present) &
##      If this component is present, it must be greater than or equal to
##      the order of <G>.
##      The stabilizer chain construction stops if size `limit' is reached.
##  \enditems
##
DeclareGlobalFunction( "StabChain" );
DeclareOperation( "StabChainOp", [ IsGroup, IsRecord ] );
DeclareAttribute( "StabChainMutable", IsObject, "mutable" );
DeclareAttribute( "StabChainImmutable", IsObject );


#############################################################################
##
#A  StabChainOptions( <G> )
##
##  is a record that stores the options with which the stabilizer chain
##  stored in `StabChainImmutable' has been computed
##  (see~"StabChain" for the options that are supported).
##
DeclareAttribute( "StabChainOptions", IsPermGroup, "mutable" );


#############################################################################
##
#V  DefaultStabChainOptions
##
##  are the options for `StabChain' which are set as default.
##
DeclareGlobalVariable( "DefaultStabChainOptions",
    "default options for stabilizer chain calculations" );


#############################################################################
##
#F  StabChainBaseStrongGenerators( <base>, <sgs>, <one> )
##
##  If a base <base> for a permutation group $G$ and a strong generating set
##  <sgs> for $G$ with respect to <base> are given. <one> must be the
##  appropriate `One' (in most cases this will be `()').
##  This function constructs a stabilizer chain  without the need to find
##  Schreier generators;
##  so this is much faster than the other algorithms.
##
DeclareGlobalFunction( "StabChainBaseStrongGenerators" );


#############################################################################
##
#F  CopyStabChain( <S> )
##
##  This function returns a copy of the stabilizer chain <S>
##  that has no mutable object (list or record) in common with <S>.
##  The `labels'  components of the result are possibly shared by several
##  levels, but superfluous labels are removed.
##  (An entry in `labels' is superfluous if it does not occur among the
##  `genlabels' or `translabels' on any of the levels which share that
##  `labels' component.)
##
##  This is useful for  stabiliser sub-chains that  have been obtained as
##  the (iterated) `stabilizer' component of a bigger chain.
##
DeclareGlobalFunction( "CopyStabChain" );


#############################################################################
##
#F  CopyOptionsDefaults( <G>, <options> ) . . . . . . . copy options defaults
##
##  sets components in a stabilizer chain options record <options> according
##  to what is known about the group <G>. This can be used to obtain a new
##  stabilizer chain for <G> quickly.
##
DeclareGlobalFunction( "CopyOptionsDefaults" );


#############################################################################
##
#F  BaseStabChain( <S> )
##
##  returns the base belonging to the stabilizer chain <S>.
##
DeclareGlobalFunction( "BaseStabChain" );


#############################################################################
##
#A  BaseOfGroup( <G> )
##
##  returns a base of the permutation group <G>.
##  There is *no* guarantee that a stabilizer chain stored in <G>
##  corresponds to this base!
##
DeclareAttribute( "BaseOfGroup", IsPermGroup );


#############################################################################
##
#F  SizeStabChain( <S> )
##
##  returns the product of the orbit lengths in the stabilizer chain <S>,
##  that is, the order of the group described by <S>.
##
DeclareGlobalFunction( "SizeStabChain" );


#############################################################################
##
#F  StrongGeneratorsStabChain( <S> )
##
##  returns a strong generating set corresponding to the stabilizer chain <S>.
##
DeclareGlobalFunction( "StrongGeneratorsStabChain" );


#############################################################################
##
#F  GroupStabChain([<G>,] <S> )
##
##  constructs a permutation group with stabilizer chain <S>, i.e., a group
##  with  generators `Generators( <S>  )'   to  which <S> is assigned as
##  component  `stabChain'. If the  optional argument <G> is  given, the
##  result  will have the parent <G>.
##
DeclareGlobalFunction( "GroupStabChain" );


#############################################################################
##
#F  IndicesStabChain( <S> )
##
##   returns a list of the indices of the stabilizers in the stabilizer
##   chain <S>.
##
DeclareGlobalFunction( "IndicesStabChain" );


#############################################################################
##
#F  ListStabChain( <S> )
##
##  returns a list that contains at position $i$ the stabilizer of the first
##  $i-1$ base points in the stabilizer chain <S>.
##
DeclareGlobalFunction( "ListStabChain" );


#############################################################################
##
#F  OrbitStabChain( <S>, <pnt> )
##
##  returns the orbit of <pnt> under the group described by the stabilizer
##  chain <S>.
##
DeclareGlobalFunction( "OrbitStabChain" );


#############################################################################
##
#F  ElementsStabChain( <S> )
##
##  returns a list of all elements of the group described by the stabilizer
##  chain <S>.
##
DeclareGlobalFunction( "ElementsStabChain" );


#############################################################################
##
#A  MinimalStabChain(<G>)
##
##  returns the reduced stabilizer chain corresponding to the base
##  $[1,2,3,4,\ldots]$.
##
DeclareAttribute( "MinimalStabChain", IsPermGroup );


#############################################################################
##
#F  ChangeStabChain( <S>, <base>[, <reduced>] )
##
##  changes or reduces a stabilizer chain <S> to be adapted to the base
##  <base>.
##  The optional argument <reduced> is interpreted as follows.
##  \beginitems
##  `reduced = false' : &
##      change the stabilizer chain, do not reduce it,
##
##  `reduced = true' : &
##      change the stabilizer chain, reduce it.
##  \enditems
##
DeclareGlobalFunction( "ChangeStabChain" );


#############################################################################
##
#F  ExtendStabChain( <S>, <base> )
##
##  extends the stabilizer chain <S> so that it corresponds to base <base>.
##  The original base of <S> must be a subset of <base>.
##
DeclareGlobalFunction( "ExtendStabChain" );


#############################################################################
##
#F  ReduceStabChain( <S> )
##
##  changes the stabilizer chain <S> to a reduced stabilizer chain by
##  eliminating trivial steps.
##
DeclareGlobalFunction( "ReduceStabChain" );


#############################################################################
##
#F  EmptyStabChain( <labels>, <id>[, <pnt>] )
##
##  constructs  a   stabilizer  chain  for   the trivial   group with
##  `identity=<id>' and `labels=$\{id\}\cup  labels$'  (but of course with
##  `genlabels=[ ]' and `generators=[ ]'). If the optional third argument
##  <pnt>  is present, the only stabilizer   of the chain is initialized
##  with the  one-point basic orbit  `[ <pnt> ]' and with `translabels' and
##  `transversal' components.
##
DeclareGlobalFunction( "EmptyStabChain" );


#############################################################################
##
#F  ConjugateStabChain( <S>, <T>, <hom>, <map>[, <cond>] )
##
##  conjugates the stabilizer chain <S>.
##  If given, <cond> is a function that determines for a stabilizer record
##  whether the recursion should continue for this record.
##
DeclareGlobalFunction( "ConjugateStabChain" );


#############################################################################
##
#F  RemoveStabChain( <S> )
##
##  <S> must be a stabilizer record in a stabilizer chain. This chain then
##  is cut off at <S> by changing the entries in <S>. This can be used to
##  remove trailing trivial steps.
##
DeclareGlobalFunction( "RemoveStabChain" );

DeclareOperation( "MembershipTestKnownBase", [ IsRecord, IsList, IsList ] );


#############################################################################
##
#F  SiftedPermutation( <S>, <g> )
##
##  sifts the permutation <g> through the stabilizer chain <S> and returns
##  the result after the last step.
##
##  The element <g> is sifted as follows: <g> is replaced by
##  `<g> \* InverseRepresentative( <S>, <S>.orbit[1]^<g> )',
##  then <S> is replaced by `<S>.stabilizer' and this process is repeated
##  until <S> is trivial or `<S>.orbit[1]^<g>' is not in the basic orbit
##  `<S>.orbit'.
##  The remainder <g> is returned, it is the identity permutation if and
##  only if the original <g> is in the group $G$ described by
##  the original~<S>.
##
DeclareGlobalFunction( "SiftedPermutation" );


#############################################################################
##
#F  MinimalElementCosetStabChain( <S>, <g> )
##
##  Let $G$ be the group described by the stabilizer chain <S>.
##  This function returns a permutation $h$ such that $G <g> = G h$
##  (that is, $<g> / h \in G$) and with the additional property that
##  the list of images under $h$ of the base belonging to <S> is minimal
##  w.r.t.~lexicographical ordering.
##
DeclareGlobalFunction( "MinimalElementCosetStabChain" );


#############################################################################
##
#F  SCMinSmaGens(<G>,<S>,<emptyset>,<identity element>,<flag>)
##
##  This function computes a stabilizer chain for a minimal base image and 
##  a smallest generating set wrt. this base for a permutation
##  group.
##
##  <G> must be a permutation group and <S> a mutable stabilizer chain for
##  <G> that defines a base <bas>. Let <mbas> the smallest image (OnTuples)
##  of <G>. Then this operation changes <S> to a stabilizer chain wrt.
##  <mbas>.
##  The arguments <emptyset> and <identity element> are needed
##  only for the recursion.
##
##  The function returns a record whose component `gens' is a list whose
##  first element is the smallest element wrt. <bas>. (i.e. an element which
##  maps <bas> to <mbas>. If <flag> is `true', `gens' is  the smallest
##  generating set wrt. <bas>. (If <flag> is `false' this will not be
##  computed.)
##
DeclareGlobalFunction("SCMinSmaGens");


#############################################################################
##
#F  LargestElementStabChain( <S>, <id> )
##
##  Let $G$ be the group described by the stabilizer chain <S>.
##  This function returns the element $h \in G$ with the property that
##  the list of images under $h$ of the base belonging to <S> is maximal
##  w.r.t.~lexicographical ordering.
##  The second argument must be an identity element (used to start the
##  recursion)
##
DeclareGlobalFunction( "LargestElementStabChain" );


DeclareCategory( "IsPermOnEnumerator",
    IsMultiplicativeElementWithInverse and IsPerm );

DeclareOperation( "PermOnEnumerator", [ IsList, IsObject ] );

DeclareGlobalFunction( "DepthSchreierTrees" );


#############################################################################
##
#F  AddGeneratorsExtendSchreierTree( <S>, <new> )
##
##  adds the elements  in <new> to the list  of generators of <S> and at the
##  same time extends the  orbit and transversal. This is the only legal way
##  to extend  a  Schreier tree (because this involves careful handling of
##  the tree components).
##
DeclareGlobalFunction( "AddGeneratorsExtendSchreierTree" );

DeclareGlobalFunction( "ChooseNextBasePoint" );
DeclareGlobalFunction( "StabChainStrong" );
DeclareGlobalFunction( "StabChainForcePoint" );
DeclareGlobalFunction( "StabChainSwap" );
DeclareGlobalFunction( "InsertElmList" );
DeclareGlobalFunction( "RemoveElmList" );
DeclareGlobalFunction( "LabsLims" );


#############################################################################
##
#F  InsertTrivialStabilizer( <S>, <pnt> )
##
##  `InsertTrivialStabilizer' initializes the current stabilizer with <pnt>
##  as `EmptyStabChain' did,  but  assigns the original <S> to the  new
##  `<S>.stabilizer' component,  such that  a new level with trivial basic
##  orbit (but identical  `labels' and `ShallowCopy'ed `genlabels' and
##  `generators') is  inserted.
##  This function should be used only if <pnt> really is fixed by the generators
##  of <S>, because then new generators can be added and the orbit and
##  transversal at the same time extended with
##  `AddGeneratorsExtendSchreierTree'.
##
DeclareGlobalFunction( "InsertTrivialStabilizer" );

DeclareGlobalFunction( "InitializeSchreierTree" );

DeclareGlobalFunction( "BasePoint" );
DeclareGlobalFunction( "IsInBasicOrbit" );


#############################################################################
##
#F  IsFixedStabilizer( <S>, <pnt> )
##
## returns `true'  if <pnt> is fixed by   all generators of  <S> and `false'
## otherwise.
##
DeclareGlobalFunction( "IsFixedStabilizer" );


#############################################################################
##
#F  InverseRepresentative( <S>, <pnt> )
##
##  calculates the transversal element which  maps <pnt> back to  the base
##  point of  <S>. It just  runs back through the  Schreier tree from <pnt>
##  to the root and multiplies the labels along the way.
##
DeclareGlobalFunction( "InverseRepresentative" );

DeclareGlobalFunction( "QuickInverseRepresentative" );
DeclareGlobalFunction( "InverseRepresentativeWord" );

DeclareGlobalFunction( "StabChainRandomPermGroup" );
DeclareGlobalFunction( "SCRMakeStabStrong" );
DeclareGlobalFunction( "SCRStrongGenTest" );
DeclareGlobalFunction( "SCRSift" );
DeclareGlobalFunction( "SCRStrongGenTest2" );
DeclareGlobalFunction( "SCRNotice" );
DeclareGlobalFunction( "SCRExtend" );
DeclareGlobalFunction( "SCRSchTree" );
DeclareGlobalFunction( "SCRRandomPerm" );
DeclareGlobalFunction( "SCRRandomString" );
DeclareGlobalFunction( "SCRRandomSubproduct" );
DeclareGlobalFunction( "SCRExtendRecord" );
DeclareGlobalFunction( "SCRRestoredRecord" );
DeclareGlobalFunction( "VerifyStabilizer" );
DeclareGlobalFunction( "VerifySGS" );
DeclareGlobalFunction( "ExtensionOnBlocks" );
DeclareGlobalFunction( "ClosureRandomPermGroup" );


#############################################################################
##
#E