GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1X8 [33X[0;0YThe Algorithms Implemented in RCWA[133X[101X23[33X[0;0YThis chapter lists brief descriptions of the algorithms and methods4implemented in this package. These descriptions are kept very informal and5terse, and some of them provide only rudimentary information. They are6listed in alphabetical order. The word [21Xtrivial[121X as a description means that7essentially nothing is done except of performing I/O operations, storing or8recalling one or several values or doing very basic computations, and9[21Xstraightforward[121X means that no sophisticated algorithm is used. Note that10[21Xtrivial[121X and [21Xstraightforward[121X are to be read as [13Xmathematically[113X trivial11respectively straightforward, and that the code of a function or method12attributed in this way can still be reasonably long and complicated. Longer13and better descriptions of [13Xsome[113X of the algorithms and methods can be found14in [Koh08].[133X1516[8X [10XActionOnRespectedPartition([3XG[103X[8X[10X)[110X[8X [108X17[33X[0;6Y[21XStraightforward[121X after having computed a respected partition by18[10XRespectedPartition[110X.[133X1920[8X [10XAllElementsOfCTZWithGivenModulus([3Xm[103X[8X[10X)[110X[8X [108X21[33X[0;6YThis function first determines a list of all unordered partitions22[22XmathcalP[122X of ℤ into [3Xm[103X residue classes. Then for any such partition23[22XmathcalP[122X it runs a loop over the elements of the symmetric group of24degree [3Xm[103X. For any [22Xσ ∈ S_m[122X and any partition [22XmathcalP[122X it constructs the25element of [22XCT(Z)[122X with modulus dividing [22Xm[122X which maps the ordered26partition [22X{0(m), 1(m), dots, m-1(m)}[122X to the ordered partition obtained27from [22XmathcalP[122X by permuting the residue classes with [22Xσ[122X. Finally it28discards the elements whose modulus is a proper divisor of [3Xm[103X, and29returns the [21Xrest[121X.[133X3031[8X [10XBall([3XG[103X[8X[10X,[3Xg[103X[8X[10X,[3Xr[103X[8X[10X)[110X[8X [108X32[33X[0;6Y[21XStraightforward[121X.[133X3334[8X [10XBall([3XG[103X[8X[10X,[3Xp[103X[8X[10X,[3Xr[103X[8X[10X,[3Xact[103X[8X[10X)[110X[8X [108X35[33X[0;6Y[21XStraightforward[121X.[133X3637[8X [10XClassPairs([3Xm[103X[8X[10X)[110X[8X [108X38[33X[0;6YRuns a loop over all 4-tuples of nonnegative integers less than [3Xm[103X, and39filters by congruence criteria and ordering of the entries.[133X4041[8X [10XClassReflection([3Xr[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X42[33X[0;6Y[21XTrivial[121X.[133X4344[8X [10XClassRotation([3Xr[103X[8X[10X,[3Xm[103X[8X[10X,[3Xu[103X[8X[10X)[110X[8X [108X45[33X[0;6Y[21XTrivial[121X.[133X4647[8X [10XClassShift([3Xr[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X48[33X[0;6Y[21XTrivial[121X.[133X4950[8X [10XClassTransposition([3Xr1[103X[8X[10X,[3Xm1[103X[8X[10X,[3Xr2[103X[8X[10X,[3Xm2[103X[8X[10X)[110X[8X [108X51[33X[0;6Y[21XTrivial[121X.[133X5253[8X [10XClassWiseOrderPreservingOn([3Xf[103X[8X[10X)[110X[8X, etc. [108X54[33X[0;6YForms the union of the residue classes modulo the modulus of [3Xf[103X in55whose corresponding coefficient triple the first entry is positive,56zero or negative, respectively.[133X5758[8X [10XCoefficients([3Xf[103X[8X[10X)[110X[8X [108X59[33X[0;6Y[21XTrivial[121X.[133X6061[8X [10XCommonRightInverse([3Xl[103X[8X[10X,[3Xr[103X[8X[10X)[110X[8X [108X62[33X[0;6YSee [10XRightInverse[110X.[133X6364[8X [10XCT([3XR[103X[8X[10X)[110X[8X [108X65[33X[0;6YAttributes and properties are set according to [Koh10].[133X6667[8X [10XCycleRepresentativesAndLengths([3Xg[103X[8X[10X,[3XS[103X[8X[10X)[110X[8X [108X68[33X[0;6Y[21XStraightforward[121X.[133X6970[8X [10XCyclesOnFiniteOrbit([3XG[103X[8X[10X,[3Xg[103X[8X[10X,[3Xn[103X[8X[10X)[110X[8X [108X71[33X[0;6Y[21XStraightforward[121X.[133X7273[8X [10XDecreasingOn([3Xf[103X[8X[10X)[110X[8X [108X74[33X[0;6YForms the union of the residue classes which are determined by the75coefficients as indicated.[133X7677[8X [10XDerivedSubgroup([3XG[103X[8X[10X)[110X[8X [108X78[33X[0;6YNo genuine method -- [5XGAP[105X Library methods already work for tame groups.[133X7980[8X [10XDeterminant([3Xg[103X[8X[10X)[110X[8X [108X81[33X[0;6YEvaluation of the given expression. For the mathematical meaning82(epimorphism!), see Theorem 2.11.9 in [Koh05].[133X8384[8X [10XDifferencesList([3Xl[103X[8X[10X)[110X[8X [108X85[33X[0;6Y[21XTrivial[121X.[133X8687[8X [10XDirectProduct([3XG1[103X[8X[10X,[3XG2[103X[8X[10X, ... )[110X[8X [108X88[33X[0;6YRestricts the groups [3XG1[103X, [3XG2[103X, ... to disjoint residue classes. See89[10XRestriction[110X and Corollary 2.3.3 in [Koh05].[133X9091[8X [10XDisplay([3Xf[103X[8X[10X)[110X[8X [108X92[33X[0;6Y[21XTrivial[121X.[133X9394[8X [10XDistanceToNextSmallerPointInOrbit([3XG[103X[8X[10X,[3Xn[103X[8X[10X)[110X[8X [108X95[33X[0;6Y[21XStraightforward[121X -- computes balls of radius [22Xr[122X about [3Xn[103X for [22Xr = 1, 2,96dots[122X until a point smaller than [22Xn[122X is found.[133X9798[8X [10XDivisor([3Xf[103X[8X[10X)[110X[8X [108X99[33X[0;6YLcm of coefficients, as indicated.[133X100101[8X [10XDrawGrid([3XU[103X[8X[10X,[3Xrange_y[103X[8X[10X,[3Xrange_x[103X[8X[10X,[3Xfilename[103X[8X[10X)[110X[8X [108X102[33X[0;6Y[21XStraightforward[121X.[133X103104[8X [10XDrawOrbitPicture[110X[8X [108X105[33X[0;6YCompute spheres of radius [22X1, dots, r[122X around the given point(s). Choose106the origin either in the lower left corner of the picture (if all107points lie in the first quadrant) or in the middle of the picture (if108they don't). Mark points of the ball with black pixels in case of a109monochrome picture. Choose colors from the given palette depending on110the distance from the starting points in case of a colored picture.[133X111112[8X [10XEpimorphismFromFpGroup([3XG[103X[8X[10X,[3Xr[103X[8X[10X)[110X[8X [108X113[33X[0;6YComputes orders of elements in the ball of radius [3Xr[103X about 1 in [3XG[103X, and114uses the corresponding relations if they affect the abelian invariants115of [3XG[103X, [3XG'[103X, [3XG''[103X, etc..[133X116117[8X [10XExponent([3XG[103X[8X[10X)[110X[8X [108X118[33X[0;6YCheck whether [3XG[103X is finite. If it is, then use the [5XGAP[105X Library method,119applied to [10XImage(IsomorphismPermGroup([3XG[103X[10X))[110X. Check whether [3XG[103X is tame. If120yes, return [10Xinfinity[110X. If not, run a loop over [3XG[103X until finding an121element of infinite order. Once one is found, return [10Xinfinity[110X.[133X122123[33X[0;6YThe final loop to find a non-torsion element can be left away under124the assumption that any finitely generated wild rcwa group has a wild125element. It looks likely that this holds, but currently the author126does not know a proof.[133X127128[8X [10XExtRepOfObj([3Xf[103X[8X[10X)[110X[8X [108X129[33X[0;6Y[21XTrivial[121X.[133X130131[8X [10XFactorizationIntoCSCRCT([3Xg[103X[8X[10X)[110X[8X, [10XFactorization([3Xg[103X[8X[10X)[110X[8X [108X132[33X[0;6YThe method used here is rather sophisticated, and will likely some133time be published elsewhere. At the moment termination is not134guaranteed, but in case of termination the result is certain. The135strategy is roughly first to make the mapping class-wise136order-preserving and balanced, and then to remove all prime factors137from multiplier and divisor one after the other in decreasing order by138dividing by appropriate class transpositions. The remaining integral139mapping can be factored in a similar way as a permutation of a finite140set can be factored into transpositions.[133X141142[8X [10XFactorizationOnConnectedComponents([3Xf[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X143[33X[0;6YCalls [5XGRAPE[105X to get the connected components of the transition graph,144and then computes a partition of the suitably [21Xblown up[121X coefficient145list corresponding to the connected components.[133X146147[8X [10XFixedPointsOfAffinePartialMappings([3Xf[103X[8X[10X)[110X[8X [108X148[33X[0;6Y[21XStraightforward[121X.[133X149150[8X [10XFixedResidueClasses([3Xg[103X[8X[10X,[3Xmaxmod[103X[8X[10X)[110X[8X, [10XFixedResidueClasses([3XG[103X[8X[10X,[3Xmaxmod[103X[8X[10X)[110X[8X [108X151[33X[0;6YRuns a loop over all moduli [22Xm ≤[122X [3Xmaxmod[103X and all residues [22Xr[122X modulo these152moduli, and selects those residue classes [22Xr(m)[122X which are mapped to153itself by [3Xg[103X, respectively, by all generators of [3XG[103X.[133X154155[8X [10XFloatQuotientsList([3Xl[103X[8X[10X)[110X[8X [108X156[33X[0;6Y[21XTrivial[121X.[133X157158[8X [10XGluckTaylorInvariant([3Xa[103X[8X[10X)[110X[8X [108X159[33X[0;6YEvaluation of the given expression.[133X160161[8X [10XGroupByResidueClasses([3Xclasses[103X[8X[10X)[110X[8X [108X162[33X[0;6YFinds all pairs of residue classes in the list [3Xclasses[103X which are163disjoint, forms the corresponding class transpositions and returns the164group generated by them.[133X165166[8X [10XGuessedDivergence([3Xf[103X[8X[10X)[110X[8X [108X167[33X[0;6YNumerical computation of the limit of some series, which seems to168converge [21Xoften[121X. Caution!!![133X169170[8X [10XImage([3Xf[103X[8X[10X)[110X[8X, [10XImage([3Xf[103X[8X[10X,[3XS[103X[8X[10X)[110X[8X [108X171[33X[0;6Y[21XStraightforward[121X if one can compute images of residue classes under172affine mappings and unite and intersect residue classes (Chinese173Remainder Theorem). See Lemma 1.2.1 in [Koh05].[133X174175[8X [10XImageDensity([3Xf[103X[8X[10X)[110X[8X [108X176[33X[0;6YEvaluation of the given expression.[133X177178[8X [10X[3Xg[103X[8X[10X in [3XG[103X[8X[10X[110X[8X (membership test for rcwa groups) [108X179[33X[0;6YTest whether the mapping [3Xg[103X or its inverse is in the list of generators180of [3XG[103X. If it is, return [10Xtrue[110X. Test whether its prime set is a subset of181the prime set of [3XG[103X. If not, return [10Xfalse[110X. Test whether the multiplier182or the divisor of [3Xg[103X has a prime factor which does not divide the183multiplier of [3XG[103X. If yes, return [10Xfalse[110X. Test if [3XG[103X is class-wise184order-preserving, and [3Xg[103X is not. If so, return [10Xfalse[110X. Test if the sign185of [3Xg[103X is -1 and all generators of [3XG[103X have sign 1. If yes, return [10Xfalse[110X.186Test if [3XG[103X is class-wise order-preserving, all generators of [3XG[103X have187determinant 0 and [3Xg[103X has determinant [22X≠ 0[122X. If yes, return [10Xfalse[110X. Test188whether the support of [3Xg[103X is a subset of the support of [3XG[103X. If not,189return [10Xfalse[110X. Test whether [3XG[103X fixes the nonnegative integers setwise,190but [3Xg[103X does not. If yes, return [10Xfalse[110X.[133X191192[33X[0;6YIf [3XG[103X is tame, proceed as follows: Test whether the modulus of [3Xg[103X193divides the modulus of [3XG[103X. If not, return [10Xfalse[110X. Test whether [3XG[103X is194finite and [3Xg[103X has infinite order. If so, return [10Xfalse[110X. Test whether [3Xg[103X195is tame. If not, return [10Xfalse[110X. Compute a respected partition [10XP[110X of [3XG[103X196and the finite permutation group [10XH[110X induced by [3XG[103X on it (see197[10XRespectedPartition[110X). Check whether [3Xg[103X permutes [10XP[110X. If not, return [10Xfalse[110X.198Let [10Xh[110X be the permutation induced by [3Xg[103X on [10XP[110X. Check whether [10Xh[110X lies in [10XH[110X.199If not, return [10Xfalse[110X. Compute an element [10Xg1[110X of [3XG[103X which acts on [10XP[110X200like [3Xg[103X. For this purpose, factor [3Xh[103X into generators of [10XH[110X using201[10XPreImagesRepresentative[110X, and compute the corresponding product of202generators of [3XG[103X. Let [10Xk := g/g1[110X. The mapping [10Xk[110X is always integral.203Compute the kernel [10XK[110X of the action of [3XG[103X on [10XP[110X using204[10XKernelOfActionOnRespectedPartition[110X. Check whether [10Xk[110X lies in [10XK[110X. This is205done using the package [5XPolycyclic[105X [EHN13], and uses an isomorphism206from a supergroup of [10XK[110X which is isomorphic to the [10X|P|[110X-fold direct207product of the infinite dihedral group and which always contains [10Xk[110X to208a polycyclically presented group. If [10Xk[110X lies in [10XK[110X, return [10Xtrue[110X,209otherwise return [10Xfalse[110X.[133X210211[33X[0;6YIf [3XG[103X is not tame, proceed as follows: Look for finite orbits of [3XG[103X. If212some are found, test whether [3Xg[103X acts on them, and whether the induced213permutations lie in the permutation groups induced by [3XG[103X. If for one of214the examined orbits one of the latter two questions has a negative215answer, then return [10Xfalse[110X. Look for a positive integer [22Xm[122X such that [3Xg[103X216does not leave a partition of ℤ into unions of residue classes (mod [22Xm[122X)217invariant which is fixed by [3XG[103X. If successful, return [10Xfalse[110X. If not,218try to factor [3Xg[103X into generators of [3XG[103X using [10XPreImagesRepresentative[110X. If219successful, return [10Xtrue[110X. If [3Xg[103X is in [3XG[103X, this terminates after a finite220number of steps. Both run time and memory requirements are exponential221in the word length. If [3Xg[103X is not in [3XG[103X at this stage, the method runs222into an infinite loop.[133X223224[8X [10X[3Xf[103X[8X[10X in [3XM[103X[8X[10X[110X[8X (membership test for rcwa monoids) [108X225[33X[0;6YTest whether the mapping [3Xf[103X is in the list of generators of [3XG[103X. If it226is, return [10Xtrue[110X. Test whether the multiplier of [3Xf[103X is zero, but all227generators of [3XM[103X have nonzero multiplier. If yes, return [10Xfalse[110X. Test if228neither [3Xf[103X nor any generator of [3XM[103X has multiplier zero. If so, check229whether the prime set of [3Xf[103X is a subset of the prime set of [3XM[103X, and230whether the set of prime factors of the multiplier of [3Xf[103X is a subset of231the union of the sets of prime factors of the multipliers of the232generators of [3XM[103X. If one of these is not the case, return [10Xfalse[110X. Check233whether the set of prime factors of the divisor of [3Xf[103X is a subset of234the union of the sets of prime factors of the divisors of the235generators of [3XM[103X. If not, return [10Xfalse[110X. If the underlying ring is ℤ or236a semilocalization thereof, then check whether [3Xf[103X is not class-wise237order-preserving, but [3XM[103X is. If so, return [10Xfalse[110X.[133X238239[33X[0;6YIf [3Xf[103X is not injective, but all generators of [3XM[103X are, then return [10Xfalse[110X.240If [3Xf[103X is not surjective, but all generators of [3XM[103X are, then return241[10Xfalse[110X. If the support of [3Xf[103X is not a subset of the support of [3XM[103X, then242return [10Xfalse[110X. If [3Xf[103X is not sign-preserving, but [3XM[103X is, then return243[10Xfalse[110X. Check whether [3XM[103X is tame. If so, then return [10Xfalse[110X provided that244one of the following three conditions hold: 1. The modulus of [3Xf[103X does245not divide the modulus of [3XM[103X. 2. [3Xf[103X is not tame. 3. [3XM[103X is finite, and [3Xf[103X246is bijective and has infinite order. If membership has still not been247decided, use [10XShortOrbits[110X to look for finite orbits of [3XM[103X, and check248whether [3Xf[103X fixes all of them setwise. If a finite orbit is found which249[3Xf[103X does not map to itself, then return [10Xfalse[110X.[133X250251[33X[0;6YFinally compute balls of increasing radius around 1 until [3Xf[103X is found252to lie in one of them. If that happens, return [10Xtrue[110X. If [3Xf[103X is an253element of [3XM[103X, this will eventually terminate, but if at this stage [3Xf[103X254is not an element of [3XM[103X, this will run into an infinite loop.[133X255256[8X [10X[3Xpoint[103X[8X[10X in [3Xorbit[103X[8X[10X[110X[8X (membership test for orbits) [108X257[33X[0;6YUses the equality test for orbits: The orbit equality test computes258balls of increasing radius around the orbit representatives until they259intersect non-trivially. Once they do so, it returns [10Xtrue[110X. If it finds260that one or both of the orbits are finite, it makes use of that261information, and returns [10Xfalse[110X if appropriate. In between, i.e. after262having computed balls to a certain extent depending on the properties263of the group, it chooses a suitable modulus [22Xm[122X and computes orbits264(modulo [22Xm[122X). If the representatives of the orbits to be compared belong265to different orbits (mod [22Xm[122X), it returns [10Xfalse[110X. If this is not the case266although the orbits are different, the equality test runs into an267infinite loop.[133X268269[8X [10XIncreasingOn([3Xf[103X[8X[10X)[110X[8X [108X270[33X[0;6YForms the union of the residue classes which are determined by the271coefficients as indicated.[133X272273[8X [10XIndex([3XG[103X[8X[10X,[3XH[103X[8X[10X)[110X[8X [108X274[33X[0;6YIn general, i.e. if the underlying ring is not ℤ, proceed as follows:275If both groups [3XG[103X and [3XH[103X are finite, return the quotient of their276orders. If [3XG[103X is infinite, but [3XH[103X is finite, return [10Xinfinity[110X. Otherwise277return the number of right cosets of [3XH[103X in [3XG[103X, computed by the [5XGAP[105X278Library function [10XRightCosets[110X.[133X279280[33X[0;6YIf the underlying ring is ℤ, do additionally the following before281attempting to compute the list of right cosets: If the group [3XG[103X is282class-wise order-preserving, check whether one of its generators has283nonzero determinant, and whether all generators of [3XH[103X have284determinant zero. If so, then return [10Xinfinity[110X. Check whether [3XH[103X is285tame, but [3XG[103X is not. If so, then return [10Xinfinity[110X. If [3XG[103X is tame, then286check whether the rank of the largest free abelian subgroup of the287kernel of the action of [3XG[103X on a respected partition is higher than the288corresponding rank for [3XH[103X. For this check, use289[10XRankOfKernelOfActionOnRespectedPartition[110X. If it is, then return290[10Xinfinity[110X.[133X291292[8X [10XInduction([3Xg[103X[8X[10X,[3Xf[103X[8X[10X)[110X[8X [108X293[33X[0;6YComputes [10Xf * g * RightInverse([3Xf[103X[10X)[110X.[133X294295[8X [10XInduction([3XG[103X[8X[10X,[3Xf[103X[8X[10X)[110X[8X [108X296[33X[0;6YGets a set of generators by applying [10XInduction([3Xg[103X[10X,[3Xf[103X[10X)[110X to the generators297[3Xg[103X of [3XG[103X.[133X298299[8X [10XInjectiveAsMappingFrom([3Xf[103X[8X[10X)[110X[8X [108X300[33X[0;6YThe function starts with the entire source of [3Xf[103X as [21Xpreimage[121X [10Xpre[110X and301the empty set as [21Ximage[121X [10Xim[110X. It loops over the residue classes302(mod [10XMod([3Xf[103X[10X)[110X). For any such residue class [10Xcl[110X the following is done:303Firstly, the image of [10Xcl[110X under [3Xf[103X is added to [10Xim[110X. Secondly, the304intersection of the preimage of the intersection of the image of [10Xcl[110X305under [3Xf[103X and [10Xim[110X under [3Xf[103X and [10Xcl[110X is subtracted from [10Xpre[110X.[133X306307[8X [10XIntegralConjugate([3Xf[103X[8X[10X)[110X[8X, [10XIntegralConjugate([3XG[103X[8X[10X)[110X[8X [108X308[33X[0;6YUses the algorithm described in the proof of Theorem 2.5.14309in [Koh05].[133X310311[8X [10XIntegralizingConjugator([3Xf[103X[8X[10X)[110X[8X, [10XIntegralizingConjugator([3XG[103X[8X[10X)[110X[8X [108X312[33X[0;6YUses the algorithm described in the proof of Theorem 2.5.14313in [Koh05].[133X314315[8X [10XInverse([3Xf[103X[8X[10X)[110X[8X [108X316[33X[0;6YEssentially inversion of affine mappings. See Lemma 1.3.1, Part (b)317in [Koh05].[133X318319[8X [10XIsBalanced([3Xf[103X[8X[10X)[110X[8X [108X320[33X[0;6YChecks whether the sets of prime factors of the multiplier and the321divisor of [3Xf[103X are the same.[133X322323[8X [10XIsBijective([3Xf[103X[8X[10X)[110X[8X [108X324[33X[0;6Y[21XTrivial[121X, respectively, see [10XIsInjective[110X and [10XIsSurjective[110X.[133X325326[8X [10XIsClassReflection([3Xg[103X[8X[10X)[110X[8X [108X327[33X[0;6YComputes the support of [3Xg[103X, and compares [3Xg[103X with the corresponding class328reflection.[133X329330[8X [10XIsClassRotation([3Xg[103X[8X[10X)[110X[8X [108X331[33X[0;6YComputes the support of [3Xg[103X, extracts the possible rotation factor from332the coefficients and compares [3Xg[103X with the corresponding class rotation.[133X333334[8X [10XIsClassShift([3Xg[103X[8X[10X)[110X[8X [108X335[33X[0;6YComputes the support of [3Xg[103X, and compares [3Xg[103X with the corresponding class336shift.[133X337338[8X [10XIsClassTransposition([3Xg[103X[8X[10X), IsGeneralizedClassTransposition([3Xg[103X[8X[10X)[110X[8X [108X339[33X[0;6YComputes the support of [3Xg[103X, writes it as a disjoint union of two340residue classes and compares [3Xg[103X with the class transposition which341interchanges them.[133X342343[8X [10XIsClassWiseOrderPreserving([3Xf[103X[8X[10X)[110X[8X, [10XIsClassWiseTranslating([3Xf[103X[8X[10X)[110X[8X [108X344[33X[0;6Y[21XTrivial[121X.[133X345346[8X [10XIsConjugate(RCWA(Integers),[3Xf[103X[8X[10X,[3Xg[103X[8X[10X)[110X[8X [108X347[33X[0;6YTest whether [3Xf[103X and [3Xg[103X have the same order, and whether either both or348none of them is tame. If not, return [10Xfalse[110X.[133X349350[33X[0;6YIf the mappings are wild, use [10XShortCycles[110X to search for finite cycles351not belonging to an infinite series, until their numbers for a352particular length differ. This may run into an infinite loop. If it353terminates, return [10Xfalse[110X.[133X354355[33X[0;6YIf the mappings are tame, use the method described in the proof of356Theorem 2.5.14 in [Koh05] to construct integral conjugates of [3Xf[103X and [3Xg[103X.357Then essentially use the algorithm described in the proof of358Theorem 2.6.7 in [Koh05] to compute [21Xstandard representatives[121X of the359conjugacy classes which the integral conjugates of [3Xf[103X and [3Xg[103X belong to.360Finally compare these standard representatives, and return [10Xtrue[110X if361they are equal and [10Xfalse[110X if not.[133X362363[8X [10XIsInjective([3Xf[103X[8X[10X)[110X[8X [108X364[33X[0;6YSee [10XImage[110X.[133X365366[8X [10XIsIntegral([3Xf[103X[8X[10X)[110X[8X [108X367[33X[0;6Y[21XTrivial[121X.[133X368369[8X [10XIsNaturalCT([3XG[103X[8X[10X)[110X[8X, [10XIsNaturalRCWA([3XG[103X[8X[10X)[110X[8X [108X370[33X[0;6YOnly checks a set flag.[133X371372[8X [10XIsomorphismMatrixGroup([3XG[103X[8X[10X)[110X[8X [108X373[33X[0;6YUses the algorithm described in the proof of Theorem 2.6.3 in [Koh05].[133X374375[8X [10XIsomorphismPermGroup([3XG[103X[8X[10X)[110X[8X [108X376[33X[0;6YIf the group [3XG[103X is finite and class-wise order-preserving, use377[10XActionOnRespectedPartition[110X. If [3XG[103X is finite, but not class-wise378order-preserving, compute the action on the respected partition which379is obtained by splitting any residue class [22Xr(m)[122X in380[10XRespectedPartition([3XG[103X[10X)[110X into three residue classes [22Xr(3m), r+m(3m),381r+2m(3m)[122X. If [3XG[103X is infinite, there is no isomorphism to a finite382permutation group, thus return [10Xfail[110X.[133X383384[8X [10XIsomorphismRcwaGroup([3XG[103X[8X[10X)[110X[8X [108X385[33X[0;6YThe method for finite groups uses [10XRcwaMapping[110X, Part (d).[133X386387[33X[0;6YThe method for free products of finite groups uses the Table-Tennis388Lemma (which is also known as [13XPing-Pong Lemma[113X, cf. e.g. Section II.B.389in [dlH00]). It uses regular permutation representations of the390factors [22XG_r[122X ([22Xr = 0, dots ,m-1[122X) of the free product on residue classes391modulo [22Xn_r := |G_r|[122X. The basic idea is that since point stabilizers in392regular permutation groups are trivial, all non-identity elements map393any of the permuted residue classes into their complements. To get394into a situation where the Table-Tennis Lemma is applicable, the395method computes conjugates of the images of the mentioned permutation396representations under rcwa permutations [22Xσ_r[122X which satisfy [22X0(n_r)^σ_r =397ℤ ∖ r(m)[122X.[133X398399[33X[0;6YThe method for free groups uses an adaptation of the construction400given on page 27 in [dlH00] from PSL(2,ℂ) to RCWA(ℤ). As an equivalent401for the closed discs used there, the method takes the residue classes402modulo two times the rank of the free group.[133X403404[8X [10XIsOne([3Xf[103X[8X[10X)[110X[8X [108X405[33X[0;6Y[21XTrivial[121X.[133X406407[8X [10XIsPerfect([3XG[103X[8X[10X)[110X[8X [108X408[33X[0;6YIf the group [3XG[103X is trivial, then return [10Xtrue[110X. Otherwise if it is409abelian, then return [10Xfalse[110X.[133X410411[33X[0;6YIf the underlying ring is ℤ, then do the following: If one of the412generators of [3XG[103X has sign -1, then return [10Xfalse[110X. If [3XG[103X is class-wise413order-preserving and one of the generators has nonzero determinant,414then return [10Xfalse[110X.[133X415416[33X[0;6YIf [3XG[103X is wild, and perfectness has not been decided so far, then give417up. If [3XG[103X is finite, then check the image of [10XIsomorphismPermGroup([3XG[103X[10X)[110X418for perfectness, and return [10Xtrue[110X or [10Xfalse[110X accordingly.[133X419420[33X[0;6YIf the group [3XG[103X is tame and if it acts transitively on its stored421respected partition, then return [10Xtrue[110X or [10Xfalse[110X depending on whether422the finite permutation group [10XActionOnRespectedPartition([3XG[103X[10X)[110X is perfect423or not. If [3XG[103X does not act transitively on its stored respected424partition, then give up.[133X425426[8X [10XIsPrimeSwitch([3Xg[103X[8X[10X)[110X[8X [108X427[33X[0;6YChecks whether the multiplier of [3Xg[103X is an odd prime, and compares [3Xg[103X428with the corresponding prime switch.[133X429430[8X [10XIsSignPreserving([3Xf[103X[8X[10X)[110X[8X [108X431[33X[0;6YIf [3Xf[103X is not class-wise order-preserving, then return [10Xfalse[110X. Otherwise432let [22Xc ≥ 1[122X be greater than or equal to the maximum of the absolute433values of the coefficients [22Xb_r(m)[122X of the affine partial mappings of [3Xf[103X,434and check whether the minimum of the image of [22X{0, dots, c}[122X under [3Xf[103X is435nonnegative and whether the maximum of the image of [22X{-c, dots, -1}[122X436under [3Xf[103X is negative. If both is the case, then return [10Xtrue[110X, otherwise437return [10Xfalse[110X.[133X438439[8X [10XIsSolvable([3XG[103X[8X[10X)[110X[8X [108X440[33X[0;6YIf [3XG[103X is abelian, then return [10Xtrue[110X. If [3XG[103X is tame, then return [10Xtrue[110X or441[10Xfalse[110X depending on whether [10XActionOnRespectedPartition([3XG[103X[10X)[110X is solvable442or not. If [3XG[103X is wild, then give up.[133X443444[8X [10XIsSubset([3XG[103X[8X[10X,[3XH[103X[8X[10X)[110X[8X (checking for a subgroup relation) [108X445[33X[0;6YCheck whether the set of stored generators of [3XH[103X is a subset of the set446of stored generators of [3XG[103X. If so, return [10Xtrue[110X. Check whether the prime447set of [3XH[103X is a subset of the prime set of [3XG[103X. If not, return [10Xfalse[110X.448Check whether the support of [3XH[103X is a subset of the support of [3XG[103X. If449not, return [10Xfalse[110X. Check whether [3XG[103X is tame, but [3XH[103X is wild. If so,450return [10Xfalse[110X.[133X451452[33X[0;6YIf [3XG[103X and [3XH[103X are both tame, then proceed as follows: If the multiplier453of [3XH[103X does not divide the multiplier of [3XG[103X, then return [10Xfalse[110X. If [3XH[103X does454not respect the stored respected partition of [3XG[103X, then return [10Xfalse[110X.455Check whether the finite permutation group induced by [3XH[103X on456[10XRespectedPartition([3XG[103X[10X)[110X is a subgroup of [10XActionOnRespectedPartition([3XG[103X[10X)[110X.457If yes, return [10Xtrue[110X. Check whether the order of [3XH[103X is greater than the458order of [3XG[103X. If so, return [10Xfalse[110X.[133X459460[33X[0;6YFinally use the membership test to check whether all generators of [3XH[103X461lie in [3XG[103X, and return [10Xtrue[110X or [10Xfalse[110X accordingly.[133X462463[8X [10XIsSurjective([3Xf[103X[8X[10X)[110X[8X [108X464[33X[0;6YSee [10XImage[110X.[133X465466[8X [10XIsTame([3XG[103X[8X[10X)[110X[8X [108X467[33X[0;6YChecks whether the modulus of the group is nonzero.[133X468469[8X [10XIsTame([3Xf[103X[8X[10X)[110X[8X [108X470[33X[0;6YApplication of the criteria given in Corollary 2.5.10 and 2.5.12 and471Theorem A.8 and A.11 in [Koh05], as well as of the criteria given472in [Koh07a]. The criterion [21Xsurjective, but not injective means wild[121X473(Theorem A.8 in [Koh05]) is the subject of [Koh07b]. The package [5XGRAPE[105X474is needed for the application of the criterion which says that an rcwa475permutation is wild if a transition graph has a weakly-connected476component which is not strongly-connected (cf. Theorem A.11477in [Koh05]).[133X478479[8X [10XIsTransitive([3XG[103X[8X[10X,Integers)[110X[8X [108X480[33X[0;6YLook for finite orbits, using [10XShortOrbits[110X on a couple of intervals. If481a finite orbit is found, return [10Xfalse[110X. Test if [3XG[103X is finite. If yes,482return [10Xfalse[110X.[133X483484[33X[0;6YSearch for an element [10Xg[110X and a residue class [22Xr(m)[122X such that the485restriction of [10Xg[110X to [22Xr(m)[122X is given by [22Xn ↦ n + m[122X. Then the cyclic group486generated by [10Xg[110X acts transitively on [22Xr(m)[122X. The element [10Xg[110X is searched487among the generators of [3XG[103X, its powers, its commutators, powers of its488commutators and products of few different generators. The search for489such an element may run into an infinite loop, as there is no490guarantee that the group has a suitable element.[133X491492[33X[0;6YIf suitable [10Xg[110X and [22Xr(m)[122X are found, proceed as follows:[133X493494[33X[0;6YPut [22XS := r(m)[122X. Put [22XS := S ∪ S^g[122X for all generators [22Xg[122X of [3XG[103X, and repeat495this until [22XS[122X remains constant. This may run into an infinite loop.[133X496497[33X[0;6YIf it terminates: If [22XS = ℤ[122X, return [10Xtrue[110X, otherwise return [10Xfalse[110X.[133X498499[8X [10XIsTransitiveOnNonnegativeIntegersInSupport([3XG[103X[8X[10X)[110X[8X [108X500[33X[0;6YComputes balls about 1 with successively increasing radii, and checks501whether the union of the sets where the elements of these balls are502decreasing or shifting down equals the support of [3XG[103X. If a positive503answer is found, transitivity on [21Xsmall[121X points (nonnegative integers504less than an explicit bound) is verified.[133X505506[8X [10XIsZero([3Xf[103X[8X[10X)[110X[8X [108X507[33X[0;6Y[21XTrivial[121X.[133X508509[8X [10XKernelOfActionOnRespectedPartition([3XG[103X[8X[10X)[110X[8X [108X510[33X[0;6YFirst determine the abelian invariants of the kernel [10XK[110X. For this,511compute sufficiently many quotients of orders of permutation groups512induced by [3XG[103X on refinements of the stored respected partition [10XP[110X by the513order of the permutation group induced by [3XG[103X on [10XP[110X itself. Then use a514random walk through the group [3XG[103X. Compute powers of elements515encountered along the way which fix [10XP[110X. Translate these kernel elements516into elements of a polycyclically presented group isomorphic to the517[10X|P|[110X-fold direct product of the infinite dihedral group ([10XK[110X certainly518embeds into this group). Use [5XPolycyclic[105X [EHN13] to collect independent519[21Xnice[121X generators of [10XK[110X. Proceed until the permutation groups induced520by [10XK[110X on the refined respected partitions all equal the initially521stored quotients.[133X522523[8X [10XLargestSourcesOfAffineMappings([3Xf[103X[8X[10X)[110X[8X [108X524[33X[0;6YForms unions of residue classes modulo the modulus of the mapping,525whose corresponding coefficient triples are equal.[133X526527[8X [10XLaTeXStringRcwaMapping([3Xf[103X[8X[10X)[110X[8X, [10XLaTeXAndXDVI([3Xf[103X[8X[10X)[110X[8X [108X528[33X[0;6YCollects residue classes those corresponding coefficient triples are529equal.[133X530531[8X [10XLikelyContractionCentre([3Xf[103X[8X[10X,[3Xmaxn[103X[8X[10X,[3Xbound[103X[8X[10X)[110X[8X [108X532[33X[0;6YComputes trajectories with starting values from a given interval,533until a cycle is reached. Aborts if the trajectory exceeds the534prescribed bound. Form the union of the detected cycles.[133X535536[8X [10XLoadDatabaseOf...()[110X[8X, [10XLoadRCWAExamples()[110X[8X [108X537[33X[0;6Y[21XTrivial[121X. -- These functions do nothing more than reading in certain538files.[133X539540[8X [10XLocalizedRcwaMapping([3Xf[103X[8X[10X,[3Xp[103X[8X[10X)[110X[8X [108X541[33X[0;6Y[21XTrivial[121X.[133X542543[8X [10XLog2HTML([3Xlogfilename[103X[8X[10X)[110X[8X [108X544[33X[0;6YStraightforward string operations.[133X545546[8X [10XLoops([3Xf[103X[8X[10X)[110X[8X [108X547[33X[0;6YRuns over the residue classes modulo the modulus of [3Xf[103X, and selects548those of them which [3Xf[103X does not map to themselves, but which intersect549non-trivially with their images under [3Xf[103X.[133X550551[8X [10XMaximalShift([3Xf[103X[8X[10X)[110X[8X [108X552[33X[0;6Y[21XTrivial[121X.[133X553554[8X [10XMergerExtension([3XG[103X[8X[10X,[3Xpoints[103X[8X[10X,[3Xpoint[103X[8X[10X)[110X[8X [108X555[33X[0;6YAs described in [2XMergerExtension[102X ([14X3.1-4[114X).[133X556557[8X [10XMirrored([3Xg[103X[8X[10X)[110X[8X, [10XMirrored([3XG[103X[8X[10X)[110X[8X [108X558[33X[0;6YConjugates with [22Xn ↦ -n - 1[122X, as indicated in the definition.[133X559560[8X [10XmKnot([3Xm[103X[8X[10X)[110X[8X [108X561[33X[0;6Y[21XStraightforward[121X, following the definition given in [Kel99].[133X562563[8X [10XModulus([3XG[103X[8X[10X)[110X[8X [108X564[33X[0;6YSearches for a wild element in the group. If unsuccessful, tries to565construct a respected partition (see [10XRespectedPartition[110X).[133X566567[8X [10XModulus([3Xf[103X[8X[10X)[110X[8X [108X568[33X[0;6Y[21XTrivial[121X.[133X569570[8X [10XMovedPoints([3XG[103X[8X[10X)[110X[8X [108X571[33X[0;6YNeeds only forming unions of residue classes and determining fixed572points of affine mappings.[133X573574[8X [10XMultiplier([3Xf[103X[8X[10X)[110X[8X [108X575[33X[0;6YLcm of coefficients, as indicated.[133X576577[8X [10XMultpk([3Xf[103X[8X[10X,[3Xp[103X[8X[10X,[3Xk[103X[8X[10X)[110X[8X [108X578[33X[0;6YForms the union of the residue classes modulo the modulus of the579mapping, which are determined by the given divisibility criteria for580the coefficients of the corresponding affine mapping.[133X581582[8X [10XNrClassPairs([3Xm[103X[8X[10X)[110X[8X [108X583[33X[0;6YRelatively straightforward. -- Practical for values of [3Xm[103X ranging up584into the hundreds and corresponding counts of $10^9$ and more.[133X585586[8X [10XNrConjugacyClassesOfCTZOfOrder([3Xord[103X[8X[10X)[110X[8X, [108X587[33X[0;6YEvaluation of the expression588[10XLength(Filtered(Combinations(DivisorsInt(ord)), l -> l <> [] and589Lcm(l) = ord))[110X.[133X590591[8X [10XNrConjugacyClassesOfRCWAZOfOrder([3Xord[103X[8X[10X)[110X[8X [108X592[33X[0;6YThe class numbers are taken from Corollary 2.7.1 in [Koh05].[133X593594[8X [10XObjByExtRep([3Xfam[103X[8X[10X,[3Xl[103X[8X[10X)[110X[8X [108X595[33X[0;6Y[21XTrivial[121X.[133X596597[8X [10XOne([3Xf[103X[8X[10X)[110X[8X, [10XOne([3XG[103X[8X[10X)[110X[8X, [108X598[33X[0;6Y[21XTrivial[121X.[133X599600[8X [10XOrbit([3XG[103X[8X[10X,[3Xpnt[103X[8X[10X,[3Xgens[103X[8X[10X,[3Xacts[103X[8X[10X,[3Xact[103X[8X[10X)[110X[8X [108X601[33X[0;6YCheck if the orbit has length less than a certain bound. If so, then602return it as a list. Otherwise test whether the group [3XG[103X is tame or603wild.[133X604605[33X[0;6YIf [3XG[103X is tame, then test whether [3XG[103X is finite. If yes, then compute the606orbit by the [5XGAP[105X Library method. Otherwise proceed as follows: Compute607a respected partition [22XmathcalP[122X of [3XG[103X. Use [22XmathcalP[122X to find a residue608class [22Xr(m)[122X which is a subset of the orbit to be computed. In general,609[22Xr(m)[122X will not be one of the residue classes in [22XmathcalP[122X, but a subset610of one of them. Put [22XΩ := r(m)[122X. Unite the set [22XΩ[122X with its images under611all the generators of [3XG[103X and their inverses. Repeat that until [22XΩ[122X does612not change any more. Return [22XΩ[122X.[133X613614[33X[0;6YIf [3XG[103X is wild, then return an orbit object which stores the group [3XG[103X,615the representative [3Xrep[103X and the action [3Xact[103X.[133X616617[8X [10XOrbitsModulo([3Xf[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X618[33X[0;6YUses [5XGRAPE[105X to compute the connected components of the transition619graph.[133X620621[8X [10XOrbitsModulo([3XG[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X622[33X[0;6Y[21XStraightforward[121X.[133X623624[8X [10XOrder([3Xf[103X[8X[10X)[110X[8X [108X625[33X[0;6YTest for [10XIsTame[110X. If the mapping is not tame, then return [10Xinfinity[110X.626Otherwise use Corollary 2.5.10 in [Koh05].[133X627628[8X [10XPermutationOpNC([3Xsigma[103X[8X[10X,[3XP[103X[8X[10X,[3Xact[103X[8X[10X)[110X[8X [108X629[33X[0;6YSeveral different methods for different types of arguments, which630either provide straightforward optimizations via computing with631coefficients directly, or just delegate to [10XPermutationOp[110X.[133X632633[8X [10XPreImage([3Xf[103X[8X[10X,[3XS[103X[8X[10X)[110X[8X [108X634[33X[0;6YSee [10XImage[110X.[133X635636[8X [10XPreImagesRepresentative([3Xphi[103X[8X[10X,[3Xg[103X[8X[10X)[110X[8X, [10XPreImagesRepresentatives([3Xphi[103X[8X[10X,[3Xg[103X[8X[10X)[110X[8X [108X637[33X[0;6YAs described in the documentation of these methods. The underlying638idea to successively compute two balls around 1 and [3Xg[103X until they639intersect non-trivially is standard in computational group theory. For640rcwa groups it would mean wasting both memory and run time to actually641compute group elements. Thus only images of tuples of points are642computed and stored.[133X643644[8X [10XPrimeSet([3Xf[103X[8X[10X)[110X[8X, [10XPrimeSet([3XG[103X[8X[10X)[110X[8X [108X645[33X[0;6Y[21XStraightforward[121X.[133X646647[8X [10XPrimeSwitch([3Xp[103X[8X[10X)[110X[8X [108X648[33X[0;6YMultiplication of rcwa mappings as indicated.[133X649650[8X [10XPrint([3Xf[103X[8X[10X)[110X[8X [108X651[33X[0;6Y[21XTrivial[121X.[133X652653[8X [10X[3Xf[103X[8X[10X*[3Xg[103X[8X[10X[110X[8X [108X654[33X[0;6YEssentially composition of affine mappings. See Lemma 1.3.1, Part (a)655in [Koh05].[133X656657[8X [10XProjectionsToCoordinates([3Xf[103X[8X[10X)[110X[8X [108X658[33X[0;6YStraightforward coefficient operations.[133X659660[8X [10XProjectionsToInvariantUnionsOfResidueClasses([3XG[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X661[33X[0;6YUse [10XOrbitsModulo[110X to determine the supports of the images of the662epimorphisms to be determined, and use [10XRestrictedPerm[110X to compute the663images of the generators of [3XG[103X under these epimorphisms.[133X664665[8X [10XQuotientsList([3Xl[103X[8X[10X)[110X[8X [108X666[33X[0;6Y[21XTrivial[121X.[133X667668[8X [10XRandom(RCWA(Integers))[110X[8X [108X669[33X[0;6YComputes a product of [21Xrandomly[121X chosen class shifts, class reflections670and class transpositions. This seems to be suitable for generating671reasonably good examples.[133X672673[8X [10XRankOfKernelOfActionOnRespectedPartition([3XG[103X[8X[10X)[110X[8X [108X674[33X[0;6YPerforms the first part of the computations done by675[10XKernelOfActionOnRespectedPartition[110X.[133X676677[8X [10XRcwa([3XR[103X[8X[10X)[110X[8X [108X678[33X[0;6Y[21XTrivial[121X. -- Attributes and properties set can be derived easily or679hold by definition.[133X680681[8X [10XRCWA([3XR[103X[8X[10X)[110X[8X [108X682[33X[0;6YAttributes and properties are set according to Theorem 2.1.1,683Theorem 2.1.2, Corollary 2.1.6 and Theorem 2.12.8 in [Koh05].[133X684685[8X [10XRCWABuildManual()[110X[8X [108X686[33X[0;6YConsists of a call to a function from the [5XGAPDoc[105X package.[133X687688[8X [10XRcwaGroupByPermGroup([3XG[103X[8X[10X)[110X[8X [108X689[33X[0;6YUses [10XRcwaMapping[110X, Part (d).[133X690691[8X [10XRCWAInfo([3Xn[103X[8X[10X)[110X[8X [108X692[33X[0;6Y[21XTrivial[121X.[133X693694[8X [10XRcwaMapping[110X[8X [108X695[33X[0;6Y(a)-(c): [21Xtrivial[121X, (d): [10Xn^perm - n[110X for determining the coefficients,696(e): [21Xaffine mappings by values at two given points[121X, (f) and (g):697[21Xtrivial[121X, (h) and (i): correspond to Lemma 2.1.4 in [Koh05], (j): uses698a simple parser for the permitted expressions.[133X699700[8X [10XRCWATestAll()[110X[8X, [10XRCWATestInstall()[110X[8X [108X701[33X[0;6YJust read in files running / containing the tests.[133X702703[8X [10XRCWATestExamples()[110X[8X [108X704[33X[0;6YRuns the example tester from the [5XGAPDoc[105X package.[133X705706[8X [10XRepresentativeAction([3XG[103X[8X[10X,[3Xsrc[103X[8X[10X,[3Xdest[103X[8X[10X,[3Xact[103X[8X[10X)[110X[8X, [10XRepresentativeActionPreImage[110X[8X [108X707[33X[0;6YAs described in the documentation of these methods. The underlying708idea to successively compute two balls around [3Xsrc[103X and [3Xdest[103X until they709intersect non-trivially is standard in computational group theory.710Words standing for products of generators of [3XG[103X are stored for every711image of [3Xsrc[103X or [3Xdest[103X.[133X712713[8X [10XRepresentativeAction(RCWA(Integers),[3XP1[103X[8X[10X,[3XP2[103X[8X[10X)[110X[8X [108X714[33X[0;6YArbitrary mapping: see Lemma 2.1.4 in [Koh05]. Tame mapping: see proof715of Theorem 2.8.9 in [Koh05]. The former is almost trivial, while the716latter is a bit complicated and takes usually also much more time.[133X717718[8X [10XRepresentativeAction(RCWA(Integers),[3Xf[103X[8X[10X,[3Xg[103X[8X[10X)[110X[8X [108X719[33X[0;6YThe algorithm used by [10XIsConjugate[110X constructs actually also an element720[10Xx[110X such that [10X[3Xf[103X[10X^x = [3Xg[103X[10X[110X.[133X721722[8X [10XRespectedPartition([3Xf[103X[8X[10X)[110X[8X, [10XRespectedPartition([3XG[103X[8X[10X)[110X[8X [108X723[33X[0;6YThere are presently two sophisticated algorithms implemented for724finding respected partitions. One of them has evolved from the725algorithm described in the proof of Theorem 2.5.8 in [Koh05]. The726other one starts with the coarsest partition of the base ring such727that every generator of [3XG[103X is affine on every part. This partition is728then refined successively until a respected partition is obtained. The729refinement step is basically as follows: Take the images of the730partition under all generators of [3XG[103X. This way one obtains as many731further partitions of the base ring as there are generators of [3XG[103X. Then732the [21Xnew[121X partition is the coarsest common refinement of all these733partitions.[133X734735[8X [10XRespectsPartition([3XG[103X[8X[10X,[3XP[103X[8X[10X)[110X[8X [108X736[33X[0;6Y[21XStraightforward[121X.[133X737738[8X [10XRestrictedBall([3XG[103X[8X[10X,[3Xg[103X[8X[10X,[3Xr[103X[8X[10X,[3Xmodulusbound[103X[8X[10X)[110X[8X [108X739[33X[0;6Y[21XStraightforward[121X.[133X740741[8X [10XRestrictedPerm([3Xg[103X[8X[10X,[3XS[103X[8X[10X)[110X[8X [108X742[33X[0;6Y[21XStraightforward[121X.[133X743744[8X [10XRestriction([3Xg[103X[8X[10X,[3Xf[103X[8X[10X)[110X[8X [108X745[33X[0;6YComputes the action of [10XRightInverse([3Xf[103X[10X) * g * f[110X on the image of [3Xf[103X.[133X746747[8X [10XRestriction([3XG[103X[8X[10X,[3Xf[103X[8X[10X)[110X[8X [108X748[33X[0;6YGets a set of generators by applying [10XRestriction([3Xg[103X[10X,[3Xf[103X[10X)[110X to the749generators [3Xg[103X of [3XG[103X.[133X750751[8X [10XRightInverse([3Xf[103X[8X[10X)[110X[8X [108X752[33X[0;6Y[21XStraightforward[121X if one knows how to compute images of residue classes753under affine mappings, and how to compute inverses of affine mappings.[133X754755[8X [10XRoot([3Xf[103X[8X[10X,[3Xk[103X[8X[10X)[110X[8X [108X756[33X[0;6YIf [3Xf[103X is bijective, class-wise order-preserving and has finite order:[133X757758[33X[0;6YFind a conjugate of [3Xf[103X which is a product of class transpositions.759Slice cycles [22X∏_i=2^l τ_r_1(m_1),r_i(m_i)[122X of [3Xf[103X a respected partition760[22XmathcalP[122X into cycles [22X∏_i=1^l ∏_j=0^k-1 τ_r_1(km_1),r_i+jm_i(km_i)[122X of761the [3Xk[103X-fold length on the refined partition which one gets from762[22XmathcalP[122X by decomposing any [22Xr_i(m_i) ∈ mathcalP[122X into residue classes763(mod [22Xkm_i[122X). Finally conjugate the resulting permutation back.[133X764765[33X[0;6YOther cases seem to be more difficult and are currently not covered.[133X766767[8X [10XRotationFactor([3Xg[103X[8X[10X)[110X[8X [108X768[33X[0;6Y[21XTrivial[121X.[133X769770[8X [10XRunDemonstration([3Xfilename[103X[8X[10X)[110X[8X [108X771[33X[0;6Y[21XTrivial[121X -- only I/O operations.[133X772773[8X [10XSemilocalizedRcwaMapping([3Xf[103X[8X[10X,[3Xpi[103X[8X[10X)[110X[8X [108X774[33X[0;6Y[21XTrivial[121X.[133X775776[8X [10XShiftsDownOn([3Xf[103X[8X[10X)[110X[8X, [10XShiftsUpOn([3Xf[103X[8X[10X)[110X[8X [108X777[33X[0;6YStraightforward coefficient- and residue class operations.[133X778779[8X [10XShortCycles([3Xg[103X[8X[10X,[3Xmaxlng[103X[8X[10X)[110X[8X [108X780[33X[0;6YLooks for fixed points of affine partial mappings of powers of [3Xg[103X.[133X781782[8X [10XShortCycles([3Xg[103X[8X[10X,[3XS[103X[8X[10X,[3Xmaxlng[103X[8X[10X)[110X[8X, [10XShortCycles([3Xg[103X[8X[10X,[3XS[103X[8X[10X,[3Xmaxlng[103X[8X[10X,[3Xmaxn[103X[8X[10X)[110X[8X [108X783[33X[0;6Y[21XStraightforward[121X.[133X784785[8X [10XShortOrbits([3XG[103X[8X[10X,[3XS[103X[8X[10X,[3Xmaxlng[103X[8X[10X)[110X[8X, [10XShortOrbits([3XG[103X[8X[10X,[3XS[103X[8X[10X,[3Xmaxlng[103X[8X[10X,[3Xmaxn[103X[8X[10X)[110X[8X [108X786[33X[0;6Y[21XStraightforward[121X.[133X787788[8X [10XShortResidueClassCycles([3Xg[103X[8X[10X,[3Xmodulusbound[103X[8X[10X,[3Xmaxlng[103X[8X[10X)[110X[8X [108X789[33X[0;6YDifferent methods -- see source code in [11Xpkg/rcwa/lib/rcwamap.gi[111X.[133X790791[8X [10XShortResidueClassOrbits([3Xg[103X[8X[10X,[3Xmodulusbound[103X[8X[10X,[3Xmaxlng[103X[8X[10X)[110X[8X [108X792[33X[0;6YDifferent methods -- see source code in [11Xpkg/rcwa/lib/rcwagrp.gi[111X.[133X793794[8X [10XSign([3Xg[103X[8X[10X)[110X[8X [108X795[33X[0;6YEvaluation of the given expression. For the mathematical meaning796(epimorphism!), see Theorem 2.12.8 in [Koh05].[133X797798[8X [10XSinks([3Xf[103X[8X[10X)[110X[8X [108X799[33X[0;6YComputes the strongly connected components of the transition graph by800the function [10XSTRONGLY_CONNECTED_COMPONENTS_DIGRAPH[110X, and selects those801which are proper subsets of their preimages and proper supersets of802their images under [3Xf[103X.[133X803804[8X [10XSize([3XG[103X[8X[10X)[110X[8X (order of an rcwa group) [108X805[33X[0;6YTest whether one of the generators of the group [3XG[103X has infinite order.806If so, return [10Xinfinity[110X. Test whether the group [3XG[103X is tame. If not,807return [10Xinfinity[110X. Test whether808[10XRankOfKernelOfActionOnRespectedPartition([3XG[103X[10X)[110X is nonzero. If so, return809[10Xinfinity[110X. Otherwise if [3XG[103X is class-wise order-preserving, return the810size of the permutation group induced on the stored respected811partition. If [3XG[103X is not class-wise order-preserving, return the size of812the permutation group induced on the refinement of the stored813respected partition which is obtained by splitting each residue class814into three residue classes with equal moduli.[133X815816[8X [10XSize([3XM[103X[8X[10X)[110X[8X (order of an rcwa monoid) [108X817[33X[0;6YCheck whether [3XM[103X is in fact an rcwa group. If so, use the method for818rcwa groups instead. Check whether one of the generators of [3XM[103X is819surjective, but not injective. If so, return [10Xinfinity[110X. Check whether820for all generators [22Xf[122X of [3XM[103X, the image of the union of the loops of [22Xf[122X821under [22Xf[122X is finite. If not, return [10Xinfinity[110X. Check whether one of the822generators of [3XM[103X is bijective and has infinite order. If so, return823[10Xinfinity[110X. Check whether one of the generators of [3XM[103X is wild. If so,824return [10Xinfinity[110X. Apply the above criteria to the elements of the ball825of radius 2 around 1, and return [10Xinfinity[110X if appropriate. Finally826attempt to compute the list of elements of [3XM[103X. If this is successful,827return the length of the resulting list.[133X828829[8X [10XSmallGeneratingSet([3XG[103X[8X[10X)[110X[8X [108X830[33X[0;6YEliminates generators [22Xg[122X which can be found to be redundant [13Xeasily[113X,831i.e. by checking whether the balls about 1 and [22Xg[122X of some small radius832[22Xr[122X in the group generated by all generators of [3XG[103X except for [22Xg[122X intersect833nontrivially.[133X834835[8X [10XSources([3Xf[103X[8X[10X)[110X[8X [108X836[33X[0;6YComputes the strongly connected components of the transition graph by837the function [10XSTRONGLY_CONNECTED_COMPONENTS_DIGRAPH[110X, and selects those838which are proper supersets of their preimages and proper subsets of839their images under [3Xf[103X.[133X840841[8X [10XSparseRep([3Xf[103X[8X[10X)[110X[8X, [10XStandardRep([3Xf[103X[8X[10X)[110X[8X [108X842[33X[0;6YStraightforward coefficient operations.[133X843844[8X [10XSplittedClassTransposition([3Xct[103X[8X[10X,[3Xk[103X[8X[10X)[110X[8X [108X845[33X[0;6Y[21XStraightforward[121X.[133X846847[8X [10XStructureDescription([3XG[103X[8X[10X)[110X[8X [108X848[33X[0;6YThis method uses a combination of techniques to obtain some basic849information on the structure of an rcwa group. The returned850description reflects the way the group has been built ([10XDirectProduct[110X,851[10XWreathProduct[110X, etc.).[133X852853[8X [10X[3Xf[103X[8X[10X+[3Xg[103X[8X[10X[110X[8X [108X854[33X[0;6YPointwise addition of affine mappings.[133X855856[8X [10XString([3Xobj[103X[8X[10X)[110X[8X [108X857[33X[0;6Y[21XTrivial[121X.[133X858859[8X [10XSupport([3XG[103X[8X[10X)[110X[8X [108X860[33X[0;6Y[21XStraightforward[121X.[133X861862[8X [10XTrajectory([3Xf[103X[8X[10X,[3Xn[103X[8X[10X,...)[110X[8X [108X863[33X[0;6YIterated application of an rcwa mapping. In the methods computing864[21Xaccumulated coefficients[121X, additionally composition of affine mappings.[133X865866[8X [10XTransitionGraph([3Xf[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X867[33X[0;6Y[21XStraightforward[121X -- just check a sufficiently long interval.[133X868869[8X [10XTransitionMatrix([3Xf[103X[8X[10X,[3Xm[103X[8X[10X)[110X[8X [108X870[33X[0;6YEvaluation of the given expression.[133X871872[8X [10XTransposedClasses([3Xg[103X[8X[10X)[110X[8X [108X873[33X[0;6Y[21XTrivial[121X.[133X874875[8X [10XView([3Xf[103X[8X[10X)[110X[8X [108X876[33X[0;6Y[21XTrivial[121X.[133X877878[8X [10XWreathProduct([3XG[103X[8X[10X,[3XP[103X[8X[10X)[110X[8X [108X879[33X[0;6YUses [10XDirectProduct[110X to embed the [10XNrMovedPoints([3XP[103X[10X)[110Xth direct power of [3XG[103X,880and [10XRcwaMapping[110X, Part (d) to embed the finite permutation group [3XP[103X.[133X881882[8X [10XWreathProduct([3XG[103X[8X[10X,[3XZ[103X[8X[10X)[110X[8X [108X883[33X[0;6YRestricts [3XG[103X to the residue class 3(4), and encodes the generator of [3XZ[103X884as [22Xτ_0(2),1(2) ⋅ τ_0(2),1(4)[122X. It is used that the images of 3(4) under885powers of this mapping are pairwise disjoint residue classes.[133X886887[8X [10XZero([3Xf[103X[8X[10X)[110X[8X [108X888[33X[0;6Y[21XTrivial[121X.[133X889890891892