  
  [1X6 [33X[0;0YOrbital Structures[133X[101X
  
  [33X[0;0YThe functions for orbital structures are based on recent work in permutation
  group algorithms. An orbital structure contains information about orbits and
  stabilisers  of  a  group  acting  on  a  set  for  the  purposes of quickly
  determining  representatives,  canonising elements, and transversal elements
  (directed) orbitals (orbits of ordered pairs of elements of the domain), and
  undirected orbitals, i.e. orbits of sets of size two.[133X
  
  
  [1X6.1 [33X[0;0YExamples[133X[101X
  
  [33X[0;0YTo create an orbital structure we need generators for a group, a set, and an
  action[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xos := OrbitalStructure([[127X[104X
    [4X[25X>[125X [27X(1,13,4,14,5)(2,10,12,9,8)(3,7,15,6,11)(16,17,18,20,19),[127X[104X
    [4X[25X>[125X [27X(1,2,3)(4,6,5)(7,10,13)(8,12,14)(9,11,15)(16,18,21)(17,19,20) ],[127X[104X
    [4X[25X>[125X [27X[1..21],[127X[104X
    [4X[25X>[125X [27XOnPoints);;[127X[104X
    [4X[25Xgap>[125X [27XOrbitalRepresentative(os, [16,15]);[127X[104X
    [4X[28X[ 16, 1 ][128X[104X
    [4X[25Xgap>[125X [27Xc := OrbitalCanonizingElement(os, [16, 15]);[127X[104X
    [4X[28X(1,10,9,5,15)(2,7,6,8,4)(3,13,14,11,12)(17,20,18,19,21)[128X[104X
    [4X[25Xgap>[125X [27XOnTuples(c, [16,15]);[127X[104X
    [4X[28X[ 16, 1 ][128X[104X
    [4X[25Xgap>[125X [27XUnorderedOrbitalRepresentative(os, [16,2]);[127X[104X
    [4X[28X[ 1, 16 ][128X[104X
    [4X[25Xgap>[125X [27Xc := UnorderedOrbitalCanonizingElement(os, [16,15]);[127X[104X
    [4X[28X(1,15)(2,4)(3,12)(5,10)(7,8)(11,13)(17,21)(19,20)[128X[104X
    [4X[25Xgap>[125X [27XOnSets(c, Set([16,15]));[127X[104X
    [4X[28X[ 1, 16 ][128X[104X
    [4X[25Xgap>[125X [27XAllOrbitalRepresentatives(os)[127X[104X
    [4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 1, 6 ], [ 1, 16 ],[128X[104X
    [4X[28X  [ 1, 18 ], [ 1, 20 ], [ 16, 1 ], [ 16, 2 ], [ 16, 3 ], [ 16, 16 ], [ 16, 17 ] ][128X[104X
    [4X[25Xgap>[125X [27XAllUnorderedOrbitalRepresentatives(os)[127X[104X
    [4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 1, 4 ], [ 1, 5 ], [ 1, 6 ], [ 1, 16 ], [ 1, 18 ],[128X[104X
    [4X[28X  [ 1, 20 ], [ 16, 16 ], [ 16, 17 ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-1 IsOrbitalStructure[101X
  
  [33X[1;0Y[29X[2XIsOrbitalStructure[102X( [3Xarg[103X ) [32X filter[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [1X6.1-2 OrbitalStructure[101X
  
  [33X[1;0Y[29X[2XOrbitalStructure[102X( [3Xgens[103X, [3Xdomain[103X, [3Xact[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YAn orbital structure[133X
  
  [33X[0;0YGiven generators, a set, and an action function create an orbital structure.
  An  orbital  structure  contains  a list of orbits of the group generated by
  [3Xgens[103X  on  [3Xdomain[103X,  a hashmap that maps any element of [3Xdomain[103X to the index of
  its  orbit  in  the  list  of orbits. We choose the smallest element of each
  orbit as representative. For each orbit, the orbital structure also contains
  the  stabilizer of the chosen orbit representative, together with all orbits
  of that stabilizer on [3Xdomain[103X with chosen representatives.[133X
  
  [1X6.1-3 OS_OrbitRepresentative[101X
  
  [33X[1;0Y[29X[2XOS_OrbitRepresentative[102X( [3Xarg[103X ) [32X function[133X
  
  [1X6.1-4 OS_CanonisingElement[101X
  
  [33X[1;0Y[29X[2XOS_CanonisingElement[102X( [3Xarg[103X ) [32X function[133X
  
  [1X6.1-5 OS_CanonisingElementAndRepresentative[101X
  
  [33X[1;0Y[29X[2XOS_CanonisingElementAndRepresentative[102X( [3Xarg[103X ) [32X function[133X
  
  [1X6.1-6 OS_StabilizerOf[101X
  
  [33X[1;0Y[29X[2XOS_StabilizerOf[102X( [3Xarg[103X ) [32X function[133X
  
  [1X6.1-7 OrbitalRepresentative[101X
  
  [33X[1;0Y[29X[2XOrbitalRepresentative[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ypair[133X
  
  [33X[0;0YGiven an orbital structure [3Xos[103X and a pair [3Xpair[103X of elements of the domain that
  [3Xos[103X is defined on, returns a canonical representative of [3Xpair[103X in its orbit of
  ordered pairs.[133X
  
  [1X6.1-8 AllOrbitalRepresentatives[101X
  
  [33X[1;0Y[29X[2XAllOrbitalRepresentatives[102X( [3Xos[103X ) [32X function[133X
  
  [33X[0;0YReturn  the  set  of  canonical representatives of orbits of pairs under the
  action of the orbital structure.[133X
  
  [1X6.1-9 OrbitalCanonizingElement[101X
  
  [33X[1;0Y[29X[2XOrbitalCanonizingElement[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya group element[133X
  
  [33X[0;0YGiven  an orbital structure [3Xos[103X and the pair [3Xpair[103X returns an element [22Xg[122X of the
  group that maps [3Xpair[103X to [10XOrbitalRepresentative(os, pair)[110X.[133X
  
  [1X6.1-10 OrbitalCanonizingElementInverse[101X
  
  [33X[1;0Y[29X[2XOrbitalCanonizingElementInverse[102X( [3Xarg[103X ) [32X function[133X
  
  [1X6.1-11 OrbitalTransversalIterator[101X
  
  [33X[1;0Y[29X[2XOrbitalTransversalIterator[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Yan iterator[133X
  
  [33X[0;0YGiven  an  orbital  structure  [3Xos[103X  and a pair [3Xpair[103X, returns an iterator that
  produces  an  element  [10Xg[110X  for  every  element  [10Xe[110X  in  the  orbit  such  that
  [10XOnTuples(OrbitalRepresentative(os, pair), g) = e[110X.[133X
  
  [1X6.1-12 UnorderedOrbitalRepresentative[101X
  
  [33X[1;0Y[29X[2XUnorderedOrbitalRepresentative[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ypair[133X
  
  [33X[0;0YGiven an orbital structure [3Xos[103X and a pair [3Xpair[103X of elements of the domain that
  [3Xos[103X is defined on, returns a canonical representative of [3Xpair[103X in its orbit of
  sets.[133X
  
  [1X6.1-13 AllUnorderedOrbitalRepresentatives[101X
  
  [33X[1;0Y[29X[2XAllUnorderedOrbitalRepresentatives[102X( [3Xos[103X ) [32X function[133X
  
  [33X[0;0YReturn  the  set  of canonical representatives of orbits of sets of size two
  under the action of the orbital structure.[133X
  
  [1X6.1-14 UnorderedOrbitalTransversalIterator[101X
  
  [33X[1;0Y[29X[2XUnorderedOrbitalTransversalIterator[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Yan iterator[133X
  
  [33X[0;0YGiven  an  orbital  structure  [3Xos[103X  and a pair [3Xpair[103X, returns an iterator that
  produces  an  element  [10Xg[110X  for  every  element  [10Xe[110X  in  the  orbit  such  that
  [10XOnSets(UnorderedOrbitalRepresentative(os, pair), g) = e[110X.[133X
  
  [1X6.1-15 UnorderedOrbitalCanonizingElement[101X
  
  [33X[1;0Y[29X[2XUnorderedOrbitalCanonizingElement[102X( [3Xos[103X, [3Xpair[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya group element[133X
  
  [33X[0;0YGiven  an orbital structure [3Xos[103X and the pair [3Xpair[103X returns an element [22Xg[122X of the
  group that maps [3Xpair[103X to [10XUnorderedOrbitalRepresentative(os, pair)[110X.[133X
  
  [1X6.1-16 UnorderedOrbitalCanonizingElementInverse[101X
  
  [33X[1;0Y[29X[2XUnorderedOrbitalCanonizingElementInverse[102X( [3Xarg[103X ) [32X function[133X
  
