GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1X5 [33X[0;0YResidue-Class-Wise Affine Mappings, Groups and Monoids over [22Xℤ^2[122X[101X[1X[133X[101X23[33X[0;0YThis chapter describes how to compute with residue-class-wise affine4mappings of [22Xℤ^2[122X and with groups and monoids formed by them.[133X56[33X[0;0YThe rings on which we have defined residue-class-wise affine mappings so far7have all been principal ideal domains, and it has been crucial that all8nontrivial principal ideals had finite index. However, the rings [22Xℤ^d[122X, [22Xd > 1[122X9are not principal ideal domains. Furthermore, their principal ideals have10infinite index. Therefore as moduli of residue-class-wise affine mappings we11can only use lattices of full rank, for these are precisely the ideals of12[22Xℤ^d[122X of finite index. However, on the other hand we can also be more13permissive and look at [22Xℤ^d[122X not as a ring, but rather as a free ℤ-module. The14consequence of this is that then an affine mapping of [22Xℤ^d[122X is not just given15by [22Xv ↦ (av+b)/c[122X for some [22Xa, b, c ∈ ℤ^d[122X, but rather by [22Xv ↦ (vA+b)/c[122X, where [22XA16∈ ℤ^d × d[122X. Also for technical reasons concerning the implementation in [5XGAP[105X,17looking at [22Xℤ^d[122X as a free ℤ-module is preferable -- in [5XGAP[105X, [10XIntegers^d[110X is not18a ring, and multiplying lists of integers means forming their scalar19product.[133X202122[1X5.1 [33X[0;0YThe definition of residue-class-wise affine mappings of [22Xℤ^d[122X[101X[1X[133X[101X2324[33X[0;0YLet [22Xd ∈ ℕ[122X. We call a mapping [22Xf: ℤ^d → ℤ^d[122X [13Xresidue-class-wise affine[113X if there25is a lattice [22XL = ℤ^d M[122X where [22XM ∈ ℤ^d × d[122X is a matrix of full rank, such that26the restrictions of [22Xf[122X to the residue classes [22Xr + L ∈ ℤ^d/L[122X are all affine.27This means that for any residue class [22Xr + L ∈ ℤ^d/L[122X, there is a matrix [22XA_r+L28∈ ℤ^d × d[122X, a vector [22Xb_r+L ∈ ℤ^d[122X and a positive integer [22Xc_r+L[122X such that the29restriction of [22Xf[122X to [22Xr + L[122X is given by [22Xf|_r + L: r + L → ℤ^d, v ↦ (v ⋅ A_r+L30+ b_r+L)/c_r+L[122X. For reasons of uniqueness, we assume that [22XL[122X is chosen31maximal with respect to inclusion, and that no prime factor of [22Xc_r+L[122X divides32all coefficients of [22XA_r+L[122X and [22Xb_r+L[122X.[133X3334[33X[0;0YWe call the lattice [22XL[122X the [13Xmodulus[113X of [22Xf[122X, written Mod([22Xf[122X). Further we define35the [13Xprime set[113X of [22Xf[122X as the set of all primes which divide the determinant of36at least one of the coefficients [22XA_r+L[122X or which divide the determinant of [22XM[122X,37and we call the mapping [22Xf[122X [13Xclass-wise translating[113X if all coefficients [22XA_r+L[122X38are identity matrices and all coefficients [22Xc_r+L[122X are equal to 1.[133X3940[33X[0;0YFor the sake of simplicity, we identify a lattice with the Hermite normal41form of the matrix by whose rows it is spanned.[133X424344[1X5.2 [33X[0;0YEntering residue-class-wise affine mappings of [22Xℤ^2[122X[101X[1X[133X[101X4546[33X[0;0YResidue-class-wise affine mappings of [22Xℤ^2[122X can be entered using the general47constructor [2XRcwaMapping[102X ([14X2.2-5[114X) or the more specialized functions48[2XClassTransposition[102X ([14X2.2-3[114X), [2XClassRotation[102X ([14X2.2-4[114X) and [2XClassShift[102X ([14X2.2-1[114X).49The arguments differ only slightly.[133X505152[1X5.2-1 [33X[0;0YRcwaMapping (the general constructor; methods for [22Xℤ^2[122X[101X[1X)[133X[101X5354[29X[2XRcwaMapping[102X( [3XR[103X, [3XL[103X, [3Xcoeffs[103X ) [32X method55[29X[2XRcwaMapping[102X( [3XP1[103X, [3XP2[103X ) [32X method56[29X[2XRcwaMapping[102X( [3Xcycles[103X ) [32X method57[29X[2XRcwaMapping[102X( [3Xf[103X, [3Xg[103X ) [32X method58[6XReturns:[106X [33X[0;10Yan rcwa mapping of [22Xℤ^2[122X.[133X5960[33X[0;0YThe above methods return[133X6162[8X(a)[108X63[33X[0;6Ythe rcwa mapping of [10X[3XR[103X[10X = Integers^2[110X with modulus [3XL[103X and coefficients64[3Xcoeffs[103X,[133X6566[8X(b)[108X67[33X[0;6Yan rcwa permutation which induces a bijection between the partitions68[3XP1[103X and [3XP2[103X of [22Xℤ^2[122X into residue classes and which is affine on the69elements of [3XP1[103X,[133X7071[8X(c)[108X72[33X[0;6Yan rcwa permutation with [21Xresidue class cycles[121X given by a list [3Xcycles[103X73of lists of pairwise disjoint residue classes of [22Xℤ^2[122X each of which it74permutes cyclically, and[133X7576[8X(d)[108X77[33X[0;6Ythe rcwa mapping of [22Xℤ^2[122X whose projections to the coordinates are given78by [3Xf[103X and [3Xg[103X,[133X7980[33X[0;0Yrespectively.[133X8182[33X[0;0YThe modulus of an rcwa mapping of [22Xℤ^2[122X is a lattice of full rank. It is83represented by a matrix [3XL[103X in Hermite normal form, whose rows are the84spanning vectors.[133X8586[33X[0;0YA coefficient list for an rcwa mapping of [22Xℤ^2[122X with modulus [3XL[103X consists of87[22X|det([3XL[103X)|[122X coefficient triples [10X[[110X[22XA_r+ℤ^2[3XL[103X[122X, [22Xb_r+ℤ^2[3XL[103X[122X, [22Xc_r+ℤ^2[3XL[103X[122X[10X][110X. The entries88[22XA_r+ℤ^2[3XL[103X[122X are [22X2 × 2[122X integer matrices, the [22Xb_r+ℤ^2[3XL[103X[122X are elements of [22Xℤ^2[122X, i.e.89lists of two integers, and the [22Xc_r+ℤ^2[3XL[103X[122X are integers. The ordering of the90coefficient triples is determined by the ordering of the representatives of91the residue classes [22Xr+ℤ^2[3XL[103X[122X in the sorted list returned by92[10XAllResidues(Integers^2,[3XL[103X[10X)[110X.[133X9394[33X[0;0YThe methods for the operation [10XRcwaMapping[110X perform a number of argument95checks, which can be skipped by using [10XRcwaMappingNC[110X instead.[133X9697[33X[0;0YLast but not least, regarding Method (d) it should be mentioned that only98very special rcwa mappings of [22Xℤ^2[122X have projections to coordinates.[133X99100[4X[32X Example [32X[104X101[4X[28X[128X[104X102[4X[25Xgap>[125X [27XR := Integers^2;;[127X[104X103[4X[25Xgap>[125X [27Xtwice := RcwaMapping(R,[[1,0],[0,1]],[127X[104X104[4X[25X>[125X [27X [[[[2,0],[0,2]],[0,0],1]]); # method (a)[127X[104X105[4X[28XRcwa mapping of Z^2: (m,n) -> (2m,2n)[128X[104X106[4X[25Xgap>[125X [27X[4,5]^twice;[127X[104X107[4X[28X[ 8, 10 ][128X[104X108[4X[25Xgap>[125X [27Xtwice1 := RcwaMapping(R,[[1,0],[0,1]],[127X[104X109[4X[25X>[125X [27X [[[[2,0],[0,1]],[0,0],1]]); # method (a)[127X[104X110[4X[28XRcwa mapping of Z^2: (m,n) -> (2m,n)[128X[104X111[4X[25Xgap>[125X [27X[4,5]^twice1;[127X[104X112[4X[28X[ 8, 5 ][128X[104X113[4X[25Xgap>[125X [27XImage(twice1);[127X[104X114[4X[28X(0,0)+(2,0)Z+(0,1)Z[128X[104X115[4X[25Xgap>[125X [27Xhyperbolic := RcwaMapping(R,[[1,0],[0,2]],[127X[104X116[4X[25X>[125X [27X [[[[4,0],[0,1]],[0, 0],2],[127X[104X117[4X[25X>[125X [27X [[[4,0],[0,1]],[2,-1],2]]); # method (a)[127X[104X118[4X[28X<rcwa mapping of Z^2 with modulus (1,0)Z+(0,2)Z>[128X[104X119[4X[25Xgap>[125X [27XIsBijective(hyperbolic);[127X[104X120[4X[28Xtrue[128X[104X121[4X[25Xgap>[125X [27XDisplay(hyperbolic);[127X[104X122[4X[28X[128X[104X123[4X[28XRcwa permutation of Z^2 with modulus (1,0)Z+(0,2)Z[128X[104X124[4X[28X[128X[104X125[4X[28X /[128X[104X126[4X[28X | (2m,n/2) if (m,n) in (0,0)+(1,0)Z+(0,2)Z[128X[104X127[4X[28X (m,n) |-> < (2m+1,(n-1)/2) if (m,n) in (0,1)+(1,0)Z+(0,2)Z[128X[104X128[4X[28X |[128X[104X129[4X[28X \[128X[104X130[4X[28X[128X[104X131[4X[25Xgap>[125X [27XTrajectory(hyperbolic,[0,10000],20);[127X[104X132[4X[28X[ [ 0, 10000 ], [ 0, 5000 ], [ 0, 2500 ], [ 0, 1250 ], [ 0, 625 ], [128X[104X133[4X[28X [ 1, 312 ], [ 2, 156 ], [ 4, 78 ], [ 8, 39 ], [ 17, 19 ], [ 35, 9 ], [128X[104X134[4X[28X [ 71, 4 ], [ 142, 2 ], [ 284, 1 ], [ 569, 0 ], [ 1138, 0 ], [128X[104X135[4X[28X [ 2276, 0 ], [ 4552, 0 ], [ 9104, 0 ], [ 18208, 0 ] ][128X[104X136[4X[25Xgap>[125X [27XP1 := AllResidueClassesModulo(R,[[2,1],[0,2]]);[127X[104X137[4X[28X[ (0,0)+(2,1)Z+(0,2)Z, (0,1)+(2,1)Z+(0,2)Z, (1,0)+(2,1)Z+(0,2)Z,[128X[104X138[4X[28X (1,1)+(2,1)Z+(0,2)Z ][128X[104X139[4X[25Xgap>[125X [27XP2 := AllResidueClassesModulo(R,[[1,0],[0,4]]);[127X[104X140[4X[28X[ (0,0)+(1,0)Z+(0,4)Z, (0,1)+(1,0)Z+(0,4)Z, (0,2)+(1,0)Z+(0,4)Z,[128X[104X141[4X[28X (0,3)+(1,0)Z+(0,4)Z ][128X[104X142[4X[25Xgap>[125X [27Xg := RcwaMapping(P1,P2); # method (b)[127X[104X143[4X[28X<rcwa permutation of Z^2 with modulus (2,1)Z+(0,2)Z>[128X[104X144[4X[25Xgap>[125X [27XP1^g = P2;[127X[104X145[4X[28Xtrue[128X[104X146[4X[25Xgap>[125X [27XDisplay(g:AsTable);[127X[104X147[4X[28X[128X[104X148[4X[28XRcwa permutation of Z^2 with modulus (2,1)Z+(0,2)Z[128X[104X149[4X[28X[128X[104X150[4X[28X [m,n] mod (2,1)Z+(0,2)Z | Image of [m,n][128X[104X151[4X[28X-----------------------------+-------------------------------------------[128X[104X152[4X[28X [0,0] | [m/2,-m+2n][128X[104X153[4X[28X [0,1] | [m/2,-m+2n-1][128X[104X154[4X[28X [1,0] | [(m-1)/2,-m+2n+3][128X[104X155[4X[28X [1,1] | [(m-1)/2,-m+2n+2][128X[104X156[4X[28X[128X[104X157[4X[25Xgap>[125X [27Xclasses := List([[[0,0],[[2,1],[0,2]]],[[1,0],[[2,1],[0,4]]],[127X[104X158[4X[25X>[125X [27X [[1,1],[[4,2],[0,4]]]],ResidueClass);[127X[104X159[4X[28X[ (0,0)+(2,1)Z+(0,2)Z, (1,0)+(2,1)Z+(0,4)Z, (1,1)+(4,2)Z+(0,4)Z ][128X[104X160[4X[25Xgap>[125X [27Xg := RcwaMapping([classes]); # method (c)[127X[104X161[4X[28X<rcwa permutation of Z^2 with modulus (4,2)Z+(0,4)Z, of order 3>[128X[104X162[4X[25Xgap>[125X [27XPermutation(g,classes);[127X[104X163[4X[28X(1,2,3)[128X[104X164[4X[25Xgap>[125X [27XSupport(g);[127X[104X165[4X[28X(0,0)+(2,1)Z+(0,2)Z U (1,0)+(2,1)Z+(0,4)Z U (1,1)+(4,2)Z+(0,4)Z[128X[104X166[4X[25Xgap>[125X [27XDisplay(g);[127X[104X167[4X[28X[128X[104X168[4X[28XRcwa permutation of Z^2 with modulus (4,2)Z+(0,4)Z, of order 3[128X[104X169[4X[28X[128X[104X170[4X[28X /[128X[104X171[4X[28X | (m+1,(-m+4n)/2) if (m,n) in (0,0)+(2,1)Z+(0,2)Z[128X[104X172[4X[28X | (2m-1,(m+2n+1)/2) if (m,n) in (1,0)+(2,1)Z+(0,4)Z[128X[104X173[4X[28X (m,n) |-> < ((m-1)/2,(n-1)/2) if (m,n) in (1,1)+(4,2)Z+(0,4)Z[128X[104X174[4X[28X | (m,n) otherwise[128X[104X175[4X[28X |[128X[104X176[4X[28X \[128X[104X177[4X[28X[128X[104X178[4X[25Xgap>[125X [27Xg := RcwaMapping(ClassTransposition(0,2,1,2),[127X[104X179[4X[25X>[125X [27X ClassReflection(0,2)); # method (d)[127X[104X180[4X[28X<rcwa mapping of Z^2 with modulus (2,0)Z+(0,2)Z>[128X[104X181[4X[25Xgap>[125X [27XDisplay(g);[127X[104X182[4X[28X[128X[104X183[4X[28XRcwa mapping of Z^2 with modulus (2,0)Z+(0,2)Z[128X[104X184[4X[28X[128X[104X185[4X[28X /[128X[104X186[4X[28X | (m+1,-n) if (m,n) in (0,0)+(2,0)Z+(0,2)Z[128X[104X187[4X[28X | (m+1,n) if (m,n) in (0,1)+(2,0)Z+(0,2)Z[128X[104X188[4X[28X (m,n) |-> < (m-1,-n) if (m,n) in (1,0)+(2,0)Z+(0,2)Z[128X[104X189[4X[28X | (m-1,n) if (m,n) in (1,1)+(2,0)Z+(0,2)Z[128X[104X190[4X[28X |[128X[104X191[4X[28X \[128X[104X192[4X[28X[128X[104X193[4X[25Xgap>[125X [27Xg^2;[127X[104X194[4X[28XIdentityMapping( ( Integers^2 ) )[128X[104X195[4X[25Xgap>[125X [27XList(ProjectionsToCoordinates(g),Factorization);[127X[104X196[4X[28X[ [ ( 0(2), 1(2) ) ], [ ClassReflection( 0(2) ) ] ][128X[104X197[4X[28X[128X[104X198[4X[32X[104X199200201[1X5.2-2 [33X[0;0YClassTransposition (for [22Xℤ^2[122X[101X[1X)[133X[101X202203[29X[2XClassTransposition[102X( [3Xr1[103X, [3XL1[103X, [3Xr2[103X, [3XL2[103X ) [32X function204[29X[2XClassTransposition[102X( [3Xcl1[103X, [3Xcl2[103X ) [32X function205[6XReturns:[106X [33X[0;10Ythe class transposition [22Xτ_r_1+ℤ^2L_1,r_2+ℤ^2L_2[122X.[133X206207[33X[0;0YLet [22Xd ∈ ℕ[122X, and let [22XL_1, L_2 ∈ ℤ^d × d[122X be matrices of full rank which are in208Hermite normal form. Further let [22Xr_1 + ℤ^d L_1[122X and [22Xr_2 + ℤ^d L_2[122X be disjoint209residue classes, and assume that the representatives [22Xr_1[122X and [22Xr_2[122X are reduced210modulo [22Xℤ^d L_1[122X and [22Xℤ^d L_2[122X, respectively. Then we define the [13Xclass211transposition[113X [22Xτ_r_1+ℤ^d L_1, r_2+ℤ^d L_2 ∈ Sym(ℤ^d)[122X as the involution which212interchanges [22Xr_1 + k L_1[122X and [22Xr_2 + k L_2[122X for all [22Xk ∈ ℤ^d[122X.[133X213214[33X[0;0YThe class transposition [22Xτ_r_1+ℤ^d L_1, r_2+ℤ^d L_2[122X interchanges the residue215classes [22Xr_1+ℤ^d L_1[122X and [22Xr_2+ℤ^d L_2[122X, and fixes the complement of their union216pointwise. The set of all class transpositions of [22Xℤ^d[122X generates the simple217group CT([22Xℤ^d[122X) (cf. [Koh13]).[133X218219[33X[0;0YIn the four-argument form, the arguments [3Xr1[103X, [3XL1[103X, [3Xr2[103X and [3XL2[103X stand for [22Xr_1[122X,220[22XL_1[122X, [22Xr_2[122X and [22XL_2[122X, respectively. In the two-argument form, the arguments [3Xcl1[103X221and [3Xcl2[103X stand for the residue classes [22Xr_1+ℤ^2 L_1[122X and [22Xr_2+ℤ^2 L_2[122X,222respectively. Enclosing the argument list in list brackets is permitted. The223residue classes [22Xr_1+ℤ^2 L_1[122X and [22Xr_2+ℤ^2 L_2[122X are stored as an attribute224[10XTransposedClasses[110X.[133X225226[33X[0;0YThere is also a method for [10XSplittedClassTransposition[110X available for class227transpositions of [22Xℤ^2[122X. This method takes as first argument the class228transposition, and as second argument a list of two integers. These integers229are the numbers of parts into which the class transposition is to be sliced230in each dimension. Note that the product of the returned class231transpositions is not always equal to the class transposition passed as232first argument. However this equality holds if the first entry of the second233argument is 1.[133X234235[4X[32X Example [32X[104X236[4X[28X[128X[104X237[4X[25Xgap>[125X [27Xct := ClassTransposition([0,0],[[2,1],[0,2]],[1,0],[[2,1],[0,4]]);[127X[104X238[4X[28X( (0,0)+(2,1)Z+(0,2)Z, (1,0)+(2,1)Z+(0,4)Z )[128X[104X239[4X[25Xgap>[125X [27XDisplay(ct);[127X[104X240[4X[28X[128X[104X241[4X[28XRcwa permutation of Z^2 with modulus (2,1)Z+(0,4)Z, of order 2[128X[104X242[4X[28X[128X[104X243[4X[28X /[128X[104X244[4X[28X | (m+1,(-m+4n)/2) if (m,n) in (0,0)+(2,1)Z+(0,2)Z[128X[104X245[4X[28X (m,n) |-> < (m-1,(m+2n-1)/4) if (m,n) in (1,0)+(2,1)Z+(0,4)Z[128X[104X246[4X[28X | (m,n) otherwise[128X[104X247[4X[28X \[128X[104X248[4X[28X[128X[104X249[4X[25Xgap>[125X [27XTransposedClasses(ct);[127X[104X250[4X[28X[ (0,0)+(2,1)Z+(0,2)Z, (1,0)+(2,1)Z+(0,4)Z ][128X[104X251[4X[25Xgap>[125X [27Xct = ClassTransposition(last);[127X[104X252[4X[28Xtrue[128X[104X253[4X[25Xgap>[125X [27XSplittedClassTransposition(ct,[1,2]);[127X[104X254[4X[28X[ ( (0,0)+(2,1)Z+(0,4)Z, (1,0)+(2,1)Z+(0,8)Z ), [128X[104X255[4X[28X ( (0,2)+(2,1)Z+(0,4)Z, (1,4)+(2,1)Z+(0,8)Z ) ][128X[104X256[4X[25Xgap>[125X [27XProduct(last) = ct;[127X[104X257[4X[28Xtrue[128X[104X258[4X[25Xgap>[125X [27XSplittedClassTransposition(ct,[2,1]);[127X[104X259[4X[28X[ ( (0,0)+(4,0)Z+(0,2)Z, (1,0)+(4,2)Z+(0,4)Z ), [128X[104X260[4X[28X ( (2,1)+(4,0)Z+(0,2)Z, (3,1)+(4,2)Z+(0,4)Z ) ][128X[104X261[4X[25Xgap>[125X [27XProduct(last) = ct;[127X[104X262[4X[28Xfalse[128X[104X263[4X[28X[128X[104X264[4X[32X[104X265266267[1X5.2-3 [33X[0;0YClassRotation (for [22Xℤ^2[122X[101X[1X)[133X[101X268269[29X[2XClassRotation[102X( [3Xr[103X, [3XL[103X, [3Xu[103X ) [32X function270[29X[2XClassRotation[102X( [3Xcl[103X, [3Xu[103X ) [32X function271[6XReturns:[106X [33X[0;10Ythe class rotation [22Xρ_r(m),u[122X.[133X272273[33X[0;0YLet [22Xd ∈ ℕ[122X. Given a residue class [22Xr+ℤ^dL[122X and a matrix [22Xu ∈ GL(d,ℤ)[122X, the [13Xclass274rotation[113X [22Xρ_r+ℤ^dL,u[122X is the rcwa mapping which maps [22Xv ∈ r+ℤ^dL[122X to [22Xvu + r(1-u)[122X275and which fixes [22Xℤ^d ∖ r+ℤ^dL[122X pointwise. In the two-argument form, the276argument [3Xcl[103X stands for the residue class [22Xr+ℤ^dL[122X. Enclosing the argument list277in list brackets is permitted. The argument [3Xu[103X is stored as an attribute278[10XRotationFactor[110X.[133X279280[4X[32X Example [32X[104X281[4X[28X[128X[104X282[4X[25Xgap>[125X [27Xinterchange := ClassRotation([0,0],[[1,0],[0,1]],[[0,1],[1,0]]);[127X[104X283[4X[28XClassRotation( Z^2, [ [ 0, 1 ], [ 1, 0 ] ] )[128X[104X284[4X[25Xgap>[125X [27XDisplay(interchange);[127X[104X285[4X[28XRcwa permutation of Z^2: (m,n) -> (n,m)[128X[104X286[4X[25Xgap>[125X [27Xclasses := AllResidueClassesModulo(Integers^2,[[2,1],[0,3]]);[127X[104X287[4X[28X[ (0,0)+(2,1)Z+(0,3)Z, (0,1)+(2,1)Z+(0,3)Z, (0,2)+(2,1)Z+(0,3)Z, [128X[104X288[4X[28X (1,0)+(2,1)Z+(0,3)Z, (1,1)+(2,1)Z+(0,3)Z, (1,2)+(2,1)Z+(0,3)Z ][128X[104X289[4X[25Xgap>[125X [27Xtransvection := ClassRotation(classes[5],[[1,1],[0,1]]);[127X[104X290[4X[28XClassRotation((1,1)+(2,1)Z+(0,3)Z,[[1,1],[0,1]])[128X[104X291[4X[25Xgap>[125X [27XDisplay(transvection);[127X[104X292[4X[28X[128X[104X293[4X[28XTame rcwa permutation of Z^2 with modulus (2,1)Z+(0,3)Z, of order infinity[128X[104X294[4X[28X[128X[104X295[4X[28X /[128X[104X296[4X[28X | (m,(3m+2n-3)/2) if (m,n) in (1,1)+(2,1)Z+(0,3)Z[128X[104X297[4X[28X (m,n) |-> < (m,n) otherwise[128X[104X298[4X[28X |[128X[104X299[4X[28X \[128X[104X300[4X[28X[128X[104X301[4X[32X[104X302303304[1X5.2-4 [33X[0;0YClassShift (for [22Xℤ^2[122X[101X[1X)[133X[101X305306[29X[2XClassShift[102X( [3Xr[103X, [3XL[103X, [3Xk[103X ) [32X function307[29X[2XClassShift[102X( [3Xcl[103X, [3Xk[103X ) [32X function308[6XReturns:[106X [33X[0;10Ythe class shift [22Xν_r+ℤ^dL,k[122X.[133X309310[33X[0;0YLet [22Xd ∈ ℕ[122X. Given a residue class [22Xr+ℤ^dL[122X and an integer [22Xk ∈ {1, dots, d}[122X, the311[13Xclass shift[113X [22Xν_r+ℤ^dL,k[122X is the rcwa mapping which maps [22Xv ∈ r+ℤ^dL[122X to [22Xv + L_k[122X312and which fixes [22Xℤ^d ∖ r+ℤ^dL[122X pointwise. Here [22XL_k[122X denotes the [22Xk[122Xth row of [22XL[122X.[133X313314[33X[0;0YIn the two-argument form, the argument [3Xcl[103X stands for the residue315class [22Xr+ℤ^dL[122X. Enclosing the argument list in list brackets is permitted.[133X316317[4X[32X Example [32X[104X318[4X[28X[128X[104X319[4X[25Xgap>[125X [27Xshift1 := ClassShift([0,0],[[1,0],[0,1]],1);[127X[104X320[4X[28XClassShift( Z^2, 1 )[128X[104X321[4X[25Xgap>[125X [27XDisplay(shift1);[127X[104X322[4X[28XTame rcwa permutation of Z^2: (m,n) -> (m+1,n)[128X[104X323[4X[25Xgap>[125X [27Xs := ClassShift(ResidueClass([1,1],[[2,1],[0,2]]),2);[127X[104X324[4X[28XClassShift((1,1)+(2,1)Z+(0,2)Z,2)[128X[104X325[4X[25Xgap>[125X [27XDisplay(s);[127X[104X326[4X[28X[128X[104X327[4X[28XTame rcwa permutation of Z^2 with modulus (2,1)Z+(0,2)Z, of order infinity[128X[104X328[4X[28X[128X[104X329[4X[28X /[128X[104X330[4X[28X | (m,n+2) if (m,n) in (1,1)+(2,1)Z+(0,2)Z[128X[104X331[4X[28X (m,n) |-> < (m,n) if (m,n) in (0,0)+(2,0)Z+(0,1)Z U [128X[104X332[4X[28X | (1,0)+(2,1)Z+(0,2)Z[128X[104X333[4X[28X \[128X[104X334[4X[28X[128X[104X335[4X[32X[104X336337[33X[0;0YAs for other rings, class transpositions, class rotations and class shifts338of [22Xℤ^2[122X have the distinguishing properties [10XIsClassTransposition[110X,339[10XIsClassRotation[110X and [10XIsClassShift[110X.[133X340341342[1X5.3 [33X[0;0YMethods for residue-class-wise affine mappings of [22Xℤ^2[122X[101X[1X[133X[101X343344[33X[0;0YThere are methods available for rcwa mappings of [22Xℤ^2[122X for the following345general operations:[133X346347[8X Output [108X348[33X[0;6Y[10XView[110X, [10XDisplay[110X, [10XPrint[110X, [10XString[110X, [10XLaTeXStringRcwaMapping[110X, [10XLaTeXAndXDVI[110X.[133X349350[8X Access to components [108X351[33X[0;6Y[10XModulus[110X, [10XCoefficients[110X.[133X352353[8X Attributes [108X354[33X[0;6Y[10XSupport[110X / [10XMovedPoints[110X, [10XOrder[110X, [10XMultiplier[110X, [10XDivisor[110X, [10XPrimeSet[110X, [10XOne[110X,355[10XZero[110X.[133X356357[8X Properties [108X358[33X[0;6Y[10XIsInjective[110X, [10XIsSurjective[110X, [10XIsBijective[110X, [10XIsTame[110X, [10XIsIntegral[110X,359[10XIsBalanced[110X, [10XIsClassWiseOrderPreserving[110X, [10XIsOne[110X, [10XIsZero[110X.[133X360361[8X Action on [22Xℤ^d[122X [108X362[33X[0;6Y[10X^[110X (for points / finite sets / residue class unions), [10XTrajectory[110X,363[10XShortCycles[110X, [10XMultpk[110X, [10XClassWiseOrderPreservingOn[110X,364[10XClassWiseOrderReversingOn[110X, [10XClassWiseConstantOn[110X.[133X365366[8X Arithmetical operations [108X367[33X[0;6Y[10X=[110X, [10X*[110X (multiplication / composition and multiplication by a [22X2 × 2[122X368matrix or an integer), [10X^[110X (exponentiation and conjugation), [10XInverse[110X, [10X+[110X369(addition of a constant).[133X370371[33X[0;0YThe above operations are documented either in the [5XGAP[105X Reference Manual or372earlier in this manual. The operations which are special for rcwa mappings373of [22Xℤ^2[122X are described in the sequel.[133X374375[1X5.3-1 ProjectionsToCoordinates[101X376377[29X[2XProjectionsToCoordinates[102X( [3Xf[103X ) [32X attribute378[6XReturns:[106X [33X[0;10Ythe projections of the rcwa mapping [3Xf[103X of [22Xℤ^2[122X to the coordinates if379such projections exist, and [10Xfail[110X otherwise.[133X380381[33X[0;0YAn rcwa mapping can be projected to the first / second coordinate if and382only if the first / second coordinate of the image of a point depends only383on the first / second coordinate of the preimage. Note that this is a very384strong and restrictive condition.[133X385386[4X[32X Example [32X[104X387[4X[28X[128X[104X388[4X[25Xgap>[125X [27Xf := RcwaMapping(ClassTransposition(0,2,1,2),ClassReflection(0,2));;[127X[104X389[4X[25Xgap>[125X [27XDisplay(f);[127X[104X390[4X[28X[128X[104X391[4X[28XRcwa mapping of Z^2 with modulus (2,0)Z+(0,2)Z[128X[104X392[4X[28X[128X[104X393[4X[28X /[128X[104X394[4X[28X | (m+1,-n) if (m,n) in (0,0)+(2,0)Z+(0,2)Z[128X[104X395[4X[28X | (m+1,n) if (m,n) in (0,1)+(2,0)Z+(0,2)Z[128X[104X396[4X[28X (m,n) |-> < (m-1,-n) if (m,n) in (1,0)+(2,0)Z+(0,2)Z[128X[104X397[4X[28X | (m-1,n) if (m,n) in (1,1)+(2,0)Z+(0,2)Z[128X[104X398[4X[28X |[128X[104X399[4X[28X \[128X[104X400[4X[28X[128X[104X401[4X[25Xgap>[125X [27XList(ProjectionsToCoordinates(f),Factorization);[127X[104X402[4X[28X[ [ ( 0(2), 1(2) ) ], [ ClassReflection( 0(2) ) ] ][128X[104X403[4X[28X[128X[104X404[4X[32X[104X405406407[1X5.4 [33X[0;0YMethods for residue-class-wise affine groups and -monoids over [22Xℤ^2[122X[101X[1X[133X[101X408409[33X[0;0YResidue-class-wise affine groups over [22Xℤ^2[122X can be entered by [10XGroup[110X,410[10XGroupByGenerators[110X and [10XGroupWithGenerators[110X, like any groups in [5XGAP[105X. Likewise,411residue-class-wise affine monoids over [22Xℤ^2[122X can be entered by [10XMonoid[110X and412[10XMonoidByGenerators[110X. The groups RCWA([22Xℤ^2[122X) and CT([22Xℤ^2[122X) are entered as413[10XRCWA(Integers^2)[110X and [10XCT(Integers^2)[110X, respectively. The monoid Rcwa([22Xℤ^2[122X) is414entered as [10XRcwa(Integers^2)[110X.[133X415416[33X[0;0YThere are methods provided for the operations [10XSize[110X, [10XIsIntegral[110X,417[10XIsClassWiseTranslating[110X, [10XIsTame[110X, [10XModulus[110X, [10XMultiplier[110X and [10XDivisor[110X.[133X418419[33X[0;0YThere are methods for [2XIsomorphismRcwaGroup[102X ([14X3.1-1[114X) which embed the groups420SL(2,ℤ) and GL(2,ℤ) into RCWA([22Xℤ^2[122X) in such a way that the support of the421image is a specified residue class:[133X422423424[1X5.4-1 [33X[0;0YIsomorphismRcwaGroup (Embeddings of SL(2,ℤ) and GL(2,ℤ))[133X[101X425426[29X[2XIsomorphismRcwaGroup[102X( [3Xsl2z[103X, [3Xcl[103X ) [32X attribute427[29X[2XIsomorphismRcwaGroup[102X( [3Xgl2z[103X, [3Xcl[103X ) [32X attribute428[6XReturns:[106X [33X[0;10Ya monomorphism from [3Xsl2z[103X respectively [3Xgl2z[103X to RCWA([22Xℤ^2[122X), such that429the support of the image is the residue class [3Xcl[103X and the430generators are affine on [3Xcl[103X.[133X431432[4X[32X Example [32X[104X433[4X[28X[128X[104X434[4X[25Xgap>[125X [27Xsl := SL(2,Integers);[127X[104X435[4X[28XSL(2,Integers)[128X[104X436[4X[25Xgap>[125X [27Xphi := IsomorphismRcwaGroup(sl,ResidueClass([1,0],[[2,2],[0,3]]));[127X[104X437[4X[28X[ [ [ 0, 1 ], [ -1, 0 ] ], [ [ 1, 1 ], [ 0, 1 ] ] ] -> [128X[104X438[4X[28X[ ClassRotation((1,0)+(2,2)Z+(0,3)Z,[[0,1],[-1,0]]), [128X[104X439[4X[28X ClassRotation((1,0)+(2,2)Z+(0,3)Z,[[1,1],[0,1]]) ][128X[104X440[4X[25Xgap>[125X [27XSupport(Image(phi));[127X[104X441[4X[28X(1,0)+(2,2)Z+(0,3)Z[128X[104X442[4X[25Xgap>[125X [27Xgl := GL(2,Integers);[127X[104X443[4X[28XGL(2,Integers)[128X[104X444[4X[25Xgap>[125X [27Xphi := IsomorphismRcwaGroup(gl,ResidueClass([1,0],[[2,2],[0,3]]));[127X[104X445[4X[28X[ [ [ 0, 1 ], [ 1, 0 ] ], [ [ -1, 0 ], [ 0, 1 ] ], [128X[104X446[4X[28X [ [ 1, 1 ], [ 0, 1 ] ] ] -> [128X[104X447[4X[28X[ ClassRotation((1,0)+(2,2)Z+(0,3)Z,[[0,1],[1,0]]), [128X[104X448[4X[28X ClassRotation((1,0)+(2,2)Z+(0,3)Z,[[-1,0],[0,1]]), [128X[104X449[4X[28X ClassRotation((1,0)+(2,2)Z+(0,3)Z,[[1,1],[0,1]]) ][128X[104X450[4X[25Xgap>[125X [27X[[-47,-37],[61,48]]^phi;[127X[104X451[4X[28XClassRotation((1,0)+(2,2)Z+(0,3)Z,[[-47,-37],[61,48]])[128X[104X452[4X[25Xgap>[125X [27XDisplay(last:AsTable);[127X[104X453[4X[28X[128X[104X454[4X[28XRcwa permutation of Z^2 with modulus (2,2)Z+(0,3)Z, of order 6[128X[104X455[4X[28X[128X[104X456[4X[28X [m,n] mod (2,2)Z+(0,3)Z | Image of [m,n][128X[104X457[4X[28X-----------------------------+-------------------------------------------[128X[104X458[4X[28X [0,0] [0,1] [0,2] [1,1] |[128X[104X459[4X[28X [1,2] | [m,n][128X[104X460[4X[28X [1,0] | [(-263m+122n+266)/3,(-1147m+532n+1147)/6][128X[104X461[4X[28X[128X[104X462[4X[32X[104X463464[33X[0;0YThe function [2XDrawOrbitPicture[102X ([14X3.3-3[114X) can also be used to depict orbits465under the action of rcwa groups over [22Xℤ^2[122X. Further there is a function which466depicts residue class unions of [22Xℤ^2[122X and partitions of [22Xℤ^2[122X into such:[133X467468469[1X5.4-2 [33X[0;0YDrawGrid[133X[101X470471[29X[2XDrawGrid[102X( [3XU[103X, [3Xyrange[103X, [3Xxrange[103X, [3Xfilename[103X ) [32X function472[29X[2XDrawGrid[102X( [3XP[103X, [3Xyrange[103X, [3Xxrange[103X, [3Xfilename[103X ) [32X function473[6XReturns:[106X [33X[0;10Ynothing.[133X474475[33X[0;0YThis function depicts the residue class union [3XU[103X of [22Xℤ^2[122X or the partition [3XP[103X476of [22Xℤ^2[122X into residue class unions, respectively. The arguments [3Xyrange[103X and477[3Xxrange[103X are the coordinate ranges of the rectangular snippet to be drawn, and478the argument [3Xfilename[103X is the name, i.e. the full path name, of the output479file. If the first argument is a residue class union, the output picture is480black-and-white, where black pixels represent members of [3XU[103X and white pixels481represent non-members. If the first argument is a partition of [22Xℤ^2[122X into482residue class unions, the produced picture is colored, and different colors483are used to denote membership in different parts.[133X484485486487