File: chap7.txt

package info (click to toggle)
gap-utils 0.93-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,504 kB
  • sloc: xml: 2,167; javascript: 155; makefile: 105
file content (140 lines) | stat: -rw-r--r-- 7,123 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
  
  7 Iterators
  
  
  7.1 Some iterators for groups and their isomorphisms
  
  The  motivation  for  adding  these  operations  is  partly to give a simple
  example  of  an iterator for a list that does not yet exist, and need not be
  created.
  
  7.1-1 AllIsomorphismsIterator
  
  AllIsomorphismsIterator( G, H )  operation
  AllIsomorphismsNumber( G, H )  operation
  AllIsomorphisms( G, H )  operation
  
  The  main  GAP  library contains functions producing complete lists of group
  homomorphisms     such    as    AllHomomorphisms;    AllEndomorphisms    and
  AllAutomorphisms. Here we add the missing AllIsomorphisms(G,H) for a list of
  isomorphisms  from G to H. The method is simple -- find one isomorphism G ->
  H  and  compose  this with all the automorphisms of G. In all these cases it
  may  not  be  desirable  to  construct  a  list  of  homomorphisms, but just
  implement  an  iterator,  and  that  is  what  is  done  here. The operation
  AllIsomorphismsNumber returns the number of isomorphisms iterated over (this
  is,  of  course,  just  the order of the automorphisms group). The operation
  AllIsomorphisms produces the list or isomorphisms.
  
    Example  
    
    gap> G := SmallGroup( 6,1);; 
    gap> iter := AllIsomorphismsIterator( G, s3 );;
    gap> NextIterator( iter );
    [ f1, f2 ] -> [ (6,7), (5,6,7) ]
    gap> n := AllIsomorphismsNumber( G, s3 );
    6
    gap> AllIsomorphisms( G, s3 );
    [ [ f1, f2 ] -> [ (6,7), (5,6,7) ], [ f1, f2 ] -> [ (5,7), (5,6,7) ], 
      [ f1, f2 ] -> [ (5,6), (5,7,6) ], [ f1, f2 ] -> [ (6,7), (5,7,6) ], 
      [ f1, f2 ] -> [ (5,7), (5,7,6) ], [ f1, f2 ] -> [ (5,6), (5,6,7) ] ]
    gap> iter := AllIsomorphismsIterator( G, s3 );;
    gap> for h in iter do Print( ImageElm( h, G.1 ) = (6,7), ", " ); od;
    true, false, false, true, false, false,
    
  
  
  7.1-2 AllSubgroupsIterator
  
  AllSubgroupsIterator( G )  operation
  
  The  manual  entry  for  the  operation  AllSubgroups states that it is only
  intended  to  be  used on small examples in a classroom situation. Access to
  all  subgroups  was  required  by  the  XMod  package,  so this iterator was
  introduced   here.   It   used   the   operations   LatticeSubgroups(G)  and
  ConjugacyClassesSubgroups(lat),  and then iterates over the entries in these
  classes.
  
    Example  
    
    gap> c3c3 := Group( (1,2,3), (4,5,6) );; 
    gap> iter := AllSubgroupsIterator( c3c3 );
    <iterator>
    gap> while not IsDoneIterator(iter) do Print(NextIterator(iter),"\n"); od;
    Group( () )
    Group( [ (4,5,6) ] )
    Group( [ (1,2,3) ] )
    Group( [ (1,2,3)(4,5,6) ] )
    Group( [ (1,3,2)(4,5,6) ] )
    Group( [ (4,5,6), (1,2,3) ] )
    
  
  
  
  7.2 Operations on iterators
  
  This  section  considers  ways  of  producing  an  iterator from one or more
  iterators.  It  may  be  that  operations  equivalent to these are available
  elsewhere  in  the  library  --  if  so, the ones here can be removed in due
  course.
  
  7.2-1 CartesianIterator
  
  CartesianIterator( iter1, iter2 )  operation
  
  This  iterator  returns  all  pairs  [x,y]  where x is the output of a first
  iterator and y is the output of a second iterator.
  
    Example  
    
    gap> it1 := Iterator( [ 1, 2, 3 ] );;
    gap> it2 := Iterator( [ 4, 5, 6 ] );;
    gap> iter := CartesianIterator( it1, it2 );;
    gap> while not IsDoneIterator(iter) do Print(NextIterator(iter),"\n"); od;
    [ 1, 4 ]
    [ 1, 5 ]
    [ 1, 6 ]
    [ 2, 4 ]
    [ 2, 5 ]
    [ 2, 6 ]
    [ 3, 4 ]
    [ 3, 5 ]
    [ 3, 6 ]
    
  
  
  7.2-2 UnorderedPairsIterator
  
  UnorderedPairsIterator( iter )  operation
  
  This  operation  returns  pairs  [x,y]  where  x,y  are  output from a given
  iterator   iter.   Unlike   the  output  from  CartesianIterator(iter,iter),
  unordered  pairs  are  returned.  In  the case L = [1,2,3,...] the pairs are
  ordered as [1,1],[1,2],[2,2],[1,3],[2,3],[3,3],....
  
    Example  
    
    gap> L := [6,7,8,9];;
    gap> iterL := IteratorList( L );; 
    gap> pairsL := UnorderedPairsIterator( iterL );;                              
    gap> while not IsDoneIterator(pairsL) do Print(NextIterator(pairsL),"\n"); od;
    [ 6, 6 ]
    [ 6, 7 ]
    [ 7, 7 ]
    [ 6, 8 ]
    [ 7, 8 ]
    [ 8, 8 ]
    [ 6, 9 ]
    [ 7, 9 ]
    [ 8, 9 ]
    [ 9, 9 ]
    gap> iter4 := IteratorList( [ 4 ] );
    <iterator>
    gap> pairs4 := UnorderedPairsIterator(iter4);
    <iterator>
    gap> NextIterator( pairs4 );
    [ 4, 4 ]
    gap> IsDoneIterator( pairs4 );
    true