<h4>7.1 <span class="Heading">Some iterators for groups and their isomorphisms</span></h4>
<p>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.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AllIsomorphismsIterator</code>( <var class="Arg">G</var>, <var class="Arg">H</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AllIsomorphismsNumber</code>( <var class="Arg">G</var>, <var class="Arg">H</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AllIsomorphisms</code>( <var class="Arg">G</var>, <var class="Arg">H</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The main <strong class="pkg">GAP</strong> library contains functions producing complete lists of group homomorphisms such as <code class="code">AllHomomorphisms</code>; <code class="code">AllEndomorphisms</code> and <code class="code">AllAutomorphisms</code>. Here we add the missing <code class="code">AllIsomorphisms(G,H)</code> for a list of isomorphisms from <span class="SimpleMath">\(G\)</span> to <span class="SimpleMath">\(H\)</span>. The method is simple -- find one isomorphism <span class="SimpleMath">\(G \to H\)</span> and compose this with all the automorphisms of <span class="SimpleMath">\(G\)</span>. 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 <code class="code">AllIsomorphismsNumber</code> returns the number of isomorphisms iterated over (this is, of course, just the order of the automorphisms group). The operation <code class="code">AllIsomorphisms</code> produces the list or isomorphisms.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AllSubgroupsIterator</code>( <var class="Arg">G</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The manual entry for the operation <code class="code">AllSubgroups</code> states that it is only intended to be used on small examples in a classroom situation. Access to all subgroups was required by the <strong class="pkg">XMod</strong> package, so this iterator was introduced here. It used the operations <code class="code">LatticeSubgroups(G)</code> and <code class="code">ConjugacyClassesSubgroups(lat)</code>, and then iterates over the entries in these classes.</p>
<h4>7.2 <span class="Heading">Operations on iterators</span></h4>
<p>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.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CartesianIterator</code>( <var class="Arg">iter1</var>, <var class="Arg">iter2</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This iterator returns all pairs <span class="SimpleMath">\([x,y]\)</span> where <span class="SimpleMath">\(x\)</span> is the output of a first iterator and <span class="SimpleMath">\(y\)</span> is the output of a second iterator.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UnorderedPairsIterator</code>( <var class="Arg">iter</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This operation returns pairs <span class="SimpleMath">\([x,y]\)</span> where <span class="SimpleMath">\(x,y\)</span> are output from a given iterator <code class="code">iter</code>. Unlike the output from <code class="code">CartesianIterator(iter,iter)</code>, unordered pairs are returned. In the case <span class="SimpleMath">\(L = [1,2,3,\ldots]\)</span> the pairs are ordered as <span class="SimpleMath">\([1,1],[1,2],[2,2],[1,3],[2,3],[3,3],\ldots\)</span>.</p>