Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X18 [33X[0;0YCyclotomic Numbers[133X[101X23[33X[0;0Y[5XGAP[105X admits computations in abelian extension fields of the rational number4field [22Xℚ[122X, that is fields with abelian Galois group over [22Xℚ[122X. These fields are5subfields of [13Xcyclotomic fields[113X [22Xℚ(e_n)[122X where [22Xe_n = exp(2 π i/n)[122X is a6primitive complex [22Xn[122X-th root of unity. The elements of these fields are7called [13Xcyclotomics[113X.[133X89[33X[0;0YInformation concerning operations for domains of cyclotomics, for example10certain integral bases of fields of cyclotomics, can be found in Chapter [14X60[114X.11For more general operations that take a field extension as a –possibly12optional– argument, e.g., [2XTrace[102X ([14X58.3-5[114X) or [2XCoefficients[102X ([14X61.6-3[114X), see13Chapter [14X58[114X.[133X141516[1X18.1 [33X[0;0YOperations for Cyclotomics[133X[101X1718[1X18.1-1 E[101X1920[33X[1;0Y[29X[2XE[102X( [3Xn[103X ) [32X operation[133X2122[33X[0;0Y[2XE[102X returns the primitive [3Xn[103X-th root of unity [22Xe_n = exp(2π i/n)[122X. Cyclotomics23are usually entered as sums of roots of unity, with rational coefficients,24and irrational cyclotomics are displayed in such a way. (For special25cyclotomics, see [14X18.4[114X.)[133X2627[4X[32X Example [32X[104X28[4X[25Xgap>[125X [27XE(9); E(9)^3; E(6); E(12) / 3;[127X[104X29[4X[28X-E(9)^4-E(9)^7[128X[104X30[4X[28XE(3)[128X[104X31[4X[28X-E(3)^2[128X[104X32[4X[28X-1/3*E(12)^7[128X[104X33[4X[32X[104X3435[33X[0;0YA particular basis is used to express cyclotomics, see [14X60.3[114X; note that [10XE(9)[110X36is [13Xnot[113X a basis element, as the above example shows.[133X3738[1X18.1-2 Cyclotomics[101X3940[33X[1;0Y[29X[2XCyclotomics[102X[32X global variable[133X4142[33X[0;0Yis the domain of all cyclotomics.[133X4344[4X[32X Example [32X[104X45[4X[25Xgap>[125X [27XE(9) in Cyclotomics; 37 in Cyclotomics; true in Cyclotomics;[127X[104X46[4X[28Xtrue[128X[104X47[4X[28Xtrue[128X[104X48[4X[28Xfalse[128X[104X49[4X[32X[104X5051[33X[0;0YAs the cyclotomics are field elements, the usual arithmetic operators [10X+[110X, [10X-[110X,52[10X*[110X and [10X/[110X (and [10X^[110X to take powers by integers) are applicable. Note that [10X^[110X does53[13Xnot[113X denote the conjugation of group elements, so it is [13Xnot[113X possible to54explicitly construct groups of cyclotomics. (However, it is possible to55compute the inverse and the multiplicative order of a nonzero cyclotomic.)56Also, taking the [22Xk[122X-th power of a root of unity [22Xz[122X defines a Galois57automorphism if and only if [22Xk[122X is coprime to the conductor (see [2XConductor[102X58([14X18.1-7[114X)) of [22Xz[122X.[133X5960[4X[32X Example [32X[104X61[4X[25Xgap>[125X [27XE(5) + E(3); (E(5) + E(5)^4) ^ 2; E(5) / E(3); E(5) * E(3);[127X[104X62[4X[28X-E(15)^2-2*E(15)^8-E(15)^11-E(15)^13-E(15)^14[128X[104X63[4X[28X-2*E(5)-E(5)^2-E(5)^3-2*E(5)^4[128X[104X64[4X[28XE(15)^13[128X[104X65[4X[28XE(15)^8[128X[104X66[4X[25Xgap>[125X [27XOrder( E(5) ); Order( 1+E(5) );[127X[104X67[4X[28X5[128X[104X68[4X[28Xinfinity[128X[104X69[4X[32X[104X7071[1X18.1-3 IsCyclotomic[101X7273[33X[1;0Y[29X[2XIsCyclotomic[102X( [3Xobj[103X ) [32X Category[133X74[33X[1;0Y[29X[2XIsCyc[102X( [3Xobj[103X ) [32X Category[133X7576[33X[0;0YEvery object in the family [10XCyclotomicsFamily[110X lies in the category77[2XIsCyclotomic[102X. This covers integers, rationals, proper cyclotomics, the78object [2Xinfinity[102X ([14X18.2-1[114X), and unknowns (see Chapter [14X74[114X). All these objects79except [2Xinfinity[102X ([14X18.2-1[114X) and unknowns lie also in the category [2XIsCyc[102X,80[2Xinfinity[102X ([14X18.2-1[114X) lies in (and can be detected from) the category [2XIsInfinity[102X81([14X18.2-1[114X), and unknowns lie in [2XIsUnknown[102X ([14X74.1-3[114X).[133X8283[4X[32X Example [32X[104X84[4X[25Xgap>[125X [27XIsCyclotomic(0); IsCyclotomic(1/2*E(3)); IsCyclotomic( infinity );[127X[104X85[4X[28Xtrue[128X[104X86[4X[28Xtrue[128X[104X87[4X[28Xtrue[128X[104X88[4X[25Xgap>[125X [27XIsCyc(0); IsCyc(1/2*E(3)); IsCyc( infinity );[127X[104X89[4X[28Xtrue[128X[104X90[4X[28Xtrue[128X[104X91[4X[28Xfalse[128X[104X92[4X[32X[104X9394[1X18.1-4 IsIntegralCyclotomic[101X9596[33X[1;0Y[29X[2XIsIntegralCyclotomic[102X( [3Xobj[103X ) [32X property[133X9798[33X[0;0YA cyclotomic is called [13Xintegral[113X or a [13Xcyclotomic integer[113X if all coefficients99of its minimal polynomial over the rationals are integers. Since the100underlying basis of the external representation of cyclotomics is an101integral basis (see [14X60.3[114X), the subring of cyclotomic integers in a102cyclotomic field is formed by those cyclotomics for which the external103representation is a list of integers. For example, square roots of integers104are cyclotomic integers (see [14X18.4[114X), any root of unity is a cyclotomic105integer, character values are always cyclotomic integers, but all rationals106which are not integers are not cyclotomic integers.[133X107108[4X[32X Example [32X[104X109[4X[25Xgap>[125X [27Xr:= ER( 5 ); # The square root of 5 ...[127X[104X110[4X[28XE(5)-E(5)^2-E(5)^3+E(5)^4[128X[104X111[4X[25Xgap>[125X [27XIsIntegralCyclotomic( r ); # ... is a cyclotomic integer.[127X[104X112[4X[28Xtrue[128X[104X113[4X[25Xgap>[125X [27Xr2:= 1/2 * r; # This is not a cyclotomic integer, ...[127X[104X114[4X[28X1/2*E(5)-1/2*E(5)^2-1/2*E(5)^3+1/2*E(5)^4[128X[104X115[4X[25Xgap>[125X [27XIsIntegralCyclotomic( r2 );[127X[104X116[4X[28Xfalse[128X[104X117[4X[25Xgap>[125X [27Xr3:= 1/2 * r - 1/2; # ... but this is one.[127X[104X118[4X[28XE(5)+E(5)^4[128X[104X119[4X[25Xgap>[125X [27XIsIntegralCyclotomic( r3 );[127X[104X120[4X[28Xtrue[128X[104X121[4X[32X[104X122123[1X18.1-5 Int[101X124125[33X[1;0Y[29X[2XInt[102X( [3Xcyc[103X ) [32X method[133X126127[33X[0;0YThe operation [2XInt[102X can be used to find a cyclotomic integer near to an128arbitrary cyclotomic, by applying [2XInt[102X ([14X14.2-3[114X) to the coefficients.[133X129130[4X[32X Example [32X[104X131[4X[25Xgap>[125X [27XInt( E(5)+1/2*E(5)^2 ); Int( 2/3*E(7)-3/2*E(4) );[127X[104X132[4X[28XE(5)[128X[104X133[4X[28X-E(4)[128X[104X134[4X[32X[104X135136[1X18.1-6 String[101X137138[33X[1;0Y[29X[2XString[102X( [3Xcyc[103X ) [32X method[133X139140[33X[0;0YThe operation [2XString[102X returns for a cyclotomic [3Xcyc[103X a string corresponding to141the way the cyclotomic is printed by [2XViewObj[102X ([14X6.3-5[114X) and [2XPrintObj[102X ([14X6.3-5[114X).[133X142143[4X[32X Example [32X[104X144[4X[25Xgap>[125X [27XString( E(5)+1/2*E(5)^2 ); String( 17/3 );[127X[104X145[4X[28X"E(5)+1/2*E(5)^2"[128X[104X146[4X[28X"17/3"[128X[104X147[4X[32X[104X148149[1X18.1-7 Conductor[101X150151[33X[1;0Y[29X[2XConductor[102X( [3Xcyc[103X ) [32X attribute[133X152[33X[1;0Y[29X[2XConductor[102X( [3XC[103X ) [32X attribute[133X153154[33X[0;0YFor an element [3Xcyc[103X of a cyclotomic field, [2XConductor[102X returns the smallest155integer [22Xn[122X such that [3Xcyc[103X is contained in the [22Xn[122X-th cyclotomic field. For a156collection [3XC[103X of cyclotomics (for example a dense list of cyclotomics or a157field of cyclotomics), [2XConductor[102X returns the smallest integer [22Xn[122X such that158all elements of [3XC[103X are contained in the [22Xn[122X-th cyclotomic field.[133X159160[4X[32X Example [32X[104X161[4X[25Xgap>[125X [27XConductor( 0 ); Conductor( E(10) ); Conductor( E(12) );[127X[104X162[4X[28X1[128X[104X163[4X[28X5[128X[104X164[4X[28X12[128X[104X165[4X[32X[104X166167[1X18.1-8 AbsoluteValue[101X168169[33X[1;0Y[29X[2XAbsoluteValue[102X( [3Xcyc[103X ) [32X attribute[133X170171[33X[0;0Yreturns the absolute value of a cyclotomic number [3Xcyc[103X. At the moment only172methods for rational numbers exist.[133X173174[4X[32X Example [32X[104X175[4X[25Xgap>[125X [27XAbsoluteValue(-3);[127X[104X176[4X[28X3[128X[104X177[4X[32X[104X178179[1X18.1-9 RoundCyc[101X180181[33X[1;0Y[29X[2XRoundCyc[102X( [3Xcyc[103X ) [32X operation[133X182183[33X[0;0Yis a cyclotomic integer [22Xz[122X (see [2XIsIntegralCyclotomic[102X ([14X18.1-4[114X)) near to the184cyclotomic [3Xcyc[103X in the following sense: Let [10Xc[110X be the [22Xi[122X-th coefficient in the185external representation (see [2XCoeffsCyc[102X ([14X18.1-10[114X)) of [3Xcyc[103X. Then the [22Xi[122X-th186coefficient in the external representation of [22Xz[122X is [10XInt( c + 1/2 )[110X or [10XInt( c187- 1/2 )[110X, depending on whether [10Xc[110X is nonnegative or negative, respectively.[133X188189[33X[0;0YExpressed in terms of the Zumbroich basis (see [14X60.3[114X), rounding the190coefficients of [3Xcyc[103X w.r.t. this basis to the nearest integer yields the191coefficients of [22Xz[122X.[133X192193[4X[32X Example [32X[104X194[4X[25Xgap>[125X [27XRoundCyc( E(5)+1/2*E(5)^2 ); RoundCyc( 2/3*E(7)+3/2*E(4) );[127X[104X195[4X[28XE(5)+E(5)^2[128X[104X196[4X[28X-2*E(28)^3+E(28)^4-2*E(28)^11-2*E(28)^15-2*E(28)^19-2*E(28)^23[128X[104X197[4X[28X -2*E(28)^27[128X[104X198[4X[32X[104X199200[1X18.1-10 CoeffsCyc[101X201202[33X[1;0Y[29X[2XCoeffsCyc[102X( [3Xcyc[103X, [3XN[103X ) [32X function[133X203204[33X[0;0YLet [3Xcyc[103X be a cyclotomic with conductor [22Xn[122X (see [2XConductor[102X ([14X18.1-7[114X)). If [3XN[103X is205not a multiple of [22Xn[122X then [2XCoeffsCyc[102X returns [9Xfail[109X because [3Xcyc[103X cannot be206expressed in terms of [3XN[103X-th roots of unity. Otherwise [2XCoeffsCyc[102X returns a207list of length [3XN[103X with entry at position [22Xj[122X equal to the coefficient of [22Xexp(2208π i (j-1)/[3XN[103X)[122X if this root belongs to the [3XN[103X-th Zumbroich basis (see [14X60.3[114X),209and equal to zero otherwise. So we have [3Xcyc[103X = [10XCoeffsCyc([110X [3Xcyc[103X, [3XN[103X [10X) * List(210[1..[110X[3XN[103X[10X], j -> E([110X[3XN[103X[10X)^(j-1) )[110X.[133X211212[4X[32X Example [32X[104X213[4X[25Xgap>[125X [27Xcyc:= E(5)+E(5)^2;[127X[104X214[4X[28XE(5)+E(5)^2[128X[104X215[4X[25Xgap>[125X [27XCoeffsCyc( cyc, 5 ); CoeffsCyc( cyc, 15 ); CoeffsCyc( cyc, 7 );[127X[104X216[4X[28X[ 0, 1, 1, 0, 0 ][128X[104X217[4X[28X[ 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, -1, 0 ][128X[104X218[4X[28Xfail[128X[104X219[4X[32X[104X220221[1X18.1-11 DenominatorCyc[101X222223[33X[1;0Y[29X[2XDenominatorCyc[102X( [3Xcyc[103X ) [32X function[133X224225[33X[0;0YFor a cyclotomic number [3Xcyc[103X (see [2XIsCyclotomic[102X ([14X18.1-3[114X)), this function226returns the smallest positive integer [22Xn[122X such that [22Xn[122X[10X * [110X[3Xcyc[103X is a cyclotomic227integer (see [2XIsIntegralCyclotomic[102X ([14X18.1-4[114X)). For rational numbers [3Xcyc[103X, the228result is the same as that of [2XDenominatorRat[102X ([14X17.2-5[114X).[133X229230[1X18.1-12 ExtRepOfObj[101X231232[33X[1;0Y[29X[2XExtRepOfObj[102X( [3Xcyc[103X ) [32X method[133X233234[33X[0;0YThe external representation of a cyclotomic [3Xcyc[103X with conductor [22Xn[122X (see235[2XConductor[102X ([14X18.1-7[114X) is the list returned by [2XCoeffsCyc[102X ([14X18.1-10[114X), called with236[3Xcyc[103X and [22Xn[122X.[133X237238[4X[32X Example [32X[104X239[4X[25Xgap>[125X [27XExtRepOfObj( E(5) ); CoeffsCyc( E(5), 5 );[127X[104X240[4X[28X[ 0, 1, 0, 0, 0 ][128X[104X241[4X[28X[ 0, 1, 0, 0, 0 ][128X[104X242[4X[25Xgap>[125X [27XCoeffsCyc( E(5), 15 );[127X[104X243[4X[28X[ 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0 ][128X[104X244[4X[32X[104X245246[1X18.1-13 DescriptionOfRootOfUnity[101X247248[33X[1;0Y[29X[2XDescriptionOfRootOfUnity[102X( [3Xroot[103X ) [32X function[133X249250[33X[0;0YGiven a cyclotomic [3Xroot[103X that is known to be a root of unity (this is [13Xnot[113X251checked), [2XDescriptionOfRootOfUnity[102X returns a list [22X[ n, e ][122X of coprime252positive integers such that [3Xroot[103X [22X=[122X [10XE[110X[22X(n)^e[122X holds.[133X253254[4X[32X Example [32X[104X255[4X[25Xgap>[125X [27XE(9); DescriptionOfRootOfUnity( E(9) );[127X[104X256[4X[28X-E(9)^4-E(9)^7[128X[104X257[4X[28X[ 9, 1 ][128X[104X258[4X[25Xgap>[125X [27XDescriptionOfRootOfUnity( -E(3) );[127X[104X259[4X[28X[ 6, 5 ][128X[104X260[4X[32X[104X261262[1X18.1-14 IsGaussInt[101X263264[33X[1;0Y[29X[2XIsGaussInt[102X( [3Xx[103X ) [32X function[133X265266[33X[0;0Y[2XIsGaussInt[102X returns [9Xtrue[109X if the object [3Xx[103X is a Gaussian integer267(see [2XGaussianIntegers[102X ([14X60.5-1[114X)), and [9Xfalse[109X otherwise. Gaussian integers are268of the form [22Xa + b[122X[10X*E(4)[110X, where [22Xa[122X and [22Xb[122X are integers.[133X269270[1X18.1-15 IsGaussRat[101X271272[33X[1;0Y[29X[2XIsGaussRat[102X( [3Xx[103X ) [32X function[133X273274[33X[0;0Y[2XIsGaussRat[102X returns [9Xtrue[109X if the object [3Xx[103X is a Gaussian rational275(see [2XGaussianRationals[102X ([14X60.1-3[114X)), and [9Xfalse[109X otherwise. Gaussian rationals276are of the form [22Xa + b[122X[10X*E(4)[110X, where [22Xa[122X and [22Xb[122X are rationals.[133X277278[1X18.1-16 DefaultField[101X279280[33X[1;0Y[29X[2XDefaultField[102X( [3Xlist[103X ) [32X function[133X281282[33X[0;0Y[2XDefaultField[102X for cyclotomics is defined to return the smallest [13Xcyclotomic[113X283field containing the given elements.[133X284285[33X[0;0YNote that [2XField[102X ([14X58.1-3[114X) returns the smallest field containing all given286elements, which need not be a cyclotomic field. In both cases, the fields287represent vector spaces over the rationals (see [14X60.3[114X).[133X288289[4X[32X Example [32X[104X290[4X[25Xgap>[125X [27XField( E(5)+E(5)^4 ); DefaultField( E(5)+E(5)^4 );[127X[104X291[4X[28XNF(5,[ 1, 4 ])[128X[104X292[4X[28XCF(5)[128X[104X293[4X[32X[104X294295296[1X18.2 [33X[0;0YInfinity and negative Infinity[133X[101X297298[1X18.2-1 IsInfinity[101X299300[33X[1;0Y[29X[2XIsInfinity[102X( [3Xobj[103X ) [32X Category[133X301[33X[1;0Y[29X[2XIsNegInfinity[102X( [3Xobj[103X ) [32X Category[133X302[33X[1;0Y[29X[2Xinfinity[102X[32X global variable[133X303[33X[1;0Y[29X[2X-infinity[102X[32X global variable[133X304305[33X[0;0Y[2Xinfinity[102X and [2X-infinity[102X are special [5XGAP[105X objects that lie in306[10XCyclotomicsFamily[110X. They are larger or smaller than all other objects in this307family respectively. [2Xinfinity[102X is mainly used as return value of operations308such as [2XSize[102X ([14X30.4-6[114X) and [2XDimension[102X ([14X57.3-3[114X) for infinite and infinite309dimensional domains, respectively.[133X310311[33X[0;0YSome arithmetic operations are provided for convenience when using [2Xinfinity[102X312and [2X-infinity[102X as top and bottom element respectively.[133X313314[4X[32X Example [32X[104X315[4X[25Xgap>[125X [27X-infinity + 1;[127X[104X316[4X[28X-infinity[128X[104X317[4X[25Xgap>[125X [27Xinfinity + infinity;[127X[104X318[4X[28Xinfinity[128X[104X319[4X[32X[104X320321[33X[0;0YOften it is useful to distinguish [2Xinfinity[102X from [21Xproper[121X cyclotomics. For322that, [2Xinfinity[102X lies in the category [2XIsInfinity[102X but not in [2XIsCyc[102X ([14X18.1-3[114X),323and the other cyclotomics lie in the category [2XIsCyc[102X ([14X18.1-3[114X) but not in324[2XIsInfinity[102X.[133X325326[4X[32X Example [32X[104X327[4X[25Xgap>[125X [27Xs:= Size( Rationals );[127X[104X328[4X[28Xinfinity[128X[104X329[4X[25Xgap>[125X [27Xs = infinity; IsCyclotomic( s ); IsCyc( s ); IsInfinity( s );[127X[104X330[4X[28Xtrue[128X[104X331[4X[28Xtrue[128X[104X332[4X[28Xfalse[128X[104X333[4X[28Xtrue[128X[104X334[4X[25Xgap>[125X [27Xs in Rationals; s > 17;[127X[104X335[4X[28Xfalse[128X[104X336[4X[28Xtrue[128X[104X337[4X[25Xgap>[125X [27XSet( [ s, 2, s, E(17), s, 19 ] );[127X[104X338[4X[28X[ 2, 19, E(17), infinity ][128X[104X339[4X[32X[104X340341342[1X18.3 [33X[0;0YComparisons of Cyclotomics[133X[101X343344[33X[0;0YTo compare cyclotomics, the operators [10X<[110X, [10X<=[110X, [10X=[110X, [10X>=[110X, [10X>[110X, and [10X<>[110X can be used,345the result will be [9Xtrue[109X if the first operand is smaller, smaller or equal,346equal, larger or equal, larger, or unequal, respectively, and [9Xfalse[109X347otherwise.[133X348349[33X[0;0YCyclotomics are ordered as follows: The relation between rationals is the350natural one, rationals are smaller than irrational cyclotomics, and [2Xinfinity[102X351([14X18.2-1[114X) is the largest cyclotomic. For two irrational cyclotomics with352different conductors (see [2XConductor[102X ([14X18.1-7[114X)), the one with smaller353conductor is regarded as smaller. Two irrational cyclotomics with same354conductor are compared via their external representation (see [2XExtRepOfObj[102X355([14X18.1-12[114X)).[133X356357[33X[0;0YFor comparisons of cyclotomics and other [5XGAP[105X objects, see Section [14X4.12[114X.[133X358359[4X[32X Example [32X[104X360[4X[25Xgap>[125X [27XE(5) < E(6); # the latter value has conductor 3[127X[104X361[4X[28Xfalse[128X[104X362[4X[25Xgap>[125X [27XE(3) < E(3)^2; # both have conductor 3, compare the ext. repr.[127X[104X363[4X[28Xfalse[128X[104X364[4X[25Xgap>[125X [27X3 < E(3); E(5) < E(7);[127X[104X365[4X[28Xtrue[128X[104X366[4X[28Xtrue[128X[104X367[4X[32X[104X368369370[1X18.4 [33X[0;0YATLAS Irrationalities[133X[101X371372373[1X18.4-1 [33X[0;0YEB, EC, [22X...[122X[101X[1X, EH[133X[101X374375[33X[1;0Y[29X[2XEB[102X( [3XN[103X ) [32X function[133X376[33X[1;0Y[29X[2XEC[102X( [3XN[103X ) [32X function[133X377[33X[1;0Y[29X[2XED[102X( [3XN[103X ) [32X function[133X378[33X[1;0Y[29X[2XEE[102X( [3XN[103X ) [32X function[133X379[33X[1;0Y[29X[2XEF[102X( [3XN[103X ) [32X function[133X380[33X[1;0Y[29X[2XEG[102X( [3XN[103X ) [32X function[133X381[33X[1;0Y[29X[2XEH[102X( [3XN[103X ) [32X function[133X382383[33X[0;0YFor a positive integer [3XN[103X, let [22Xz =[122X [10XE([110X[3XN[103X[10X)[110X [22X= exp(2 π i/[3XN[103X)[122X. The following384so-called [13Xatomic irrationalities[113X (see [CCN+85, Chapter 7, Section 10]) can385be entered using functions. (Note that the values are not necessary386irrational.)[133X387388[10XEB([110X[3XN[103X[10X)[110X = [22Xb_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^2} ) / 2[122X , [22X[3XN[103X ≡ 1 mod 2[122X389[10XEC([110X[3XN[103X[10X)[110X = [22Xc_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^3} ) / 3[122X , [22X[3XN[103X ≡ 1 mod 3[122X390[10XED([110X[3XN[103X[10X)[110X = [22Xd_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^4} ) / 4[122X , [22X[3XN[103X ≡ 1 mod 4[122X391[10XEE([110X[3XN[103X[10X)[110X = [22Xe_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^5} ) / 5[122X , [22X[3XN[103X ≡ 1 mod 5[122X392[10XEF([110X[3XN[103X[10X)[110X = [22Xf_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^6} ) / 6[122X , [22X[3XN[103X ≡ 1 mod 6[122X393[10XEG([110X[3XN[103X[10X)[110X = [22Xg_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^7} ) / 7[122X , [22X[3XN[103X ≡ 1 mod 7[122X394[10XEH([110X[3XN[103X[10X)[110X = [22Xh_[3XN[103X[122X = [22X( ∑_{j = 1}^{[3XN[103X-1} z^{j^8} ) / 8[122X , [22X[3XN[103X ≡ 1 mod 8[122X395396[33X[0;0Y(Note that in [10XEC([110X[3XN[103X[10X)[110X, [22X...[122X, [10XEH([110X[3XN[103X[10X)[110X, [3XN[103X must be a prime.)[133X397398[4X[32X Example [32X[104X399[4X[25Xgap>[125X [27XEB(5); EB(9);[127X[104X400[4X[28XE(5)+E(5)^4[128X[104X401[4X[28X1[128X[104X402[4X[32X[104X403404405[1X18.4-2 [33X[0;0YEI and ER[133X[101X406407[33X[1;0Y[29X[2XEI[102X( [3XN[103X ) [32X function[133X408[33X[1;0Y[29X[2XER[102X( [3XN[103X ) [32X function[133X409410[33X[0;0YFor a rational number [3XN[103X, [2XER[102X returns the square root [22Xsqrt{[3XN[103X}[122X of [3XN[103X, and [2XEI[102X411returns [22Xsqrt{-[3XN[103X}[122X. By the chosen embedding of cyclotomic fields into the412complex numbers, [2XER[102X returns the positive square root if [3XN[103X is positive, and413if [3XN[103X is negative then [10XER([110X[3XN[103X[10X) = EI(-[110X[3XN[103X[10X)[110X holds. In any case, [10XEI([110X[3XN[103X[10X) = E(4) *414ER([110X[3XN[103X[10X)[110X.[133X415416[33X[0;0Y[2XER[102X is installed as method for the operation [2XSqrt[102X ([14X31.12-5[114X), for rational417argument.[133X418419[33X[0;0YFrom a theorem of Gauss we know that [22Xb_[3XN[103X =[122X[133X420421[22X(-1 + sqrt{[3XN[103X}) / 2[122X if [22X[3XN[103X ≡ 1 mod 4[122X422[22X(-1 + i sqrt{[3XN[103X}) / 2[122X if [22X[3XN[103X ≡ -1 mod 4[122X423424[33X[0;0YSo [22Xsqrt{[3XN[103X}[122X can be computed from [22Xb_[3XN[103X[122X, see [2XEB[102X ([14X18.4-1[114X).[133X425426[4X[32X Example [32X[104X427[4X[25Xgap>[125X [27XER(3); EI(3);[127X[104X428[4X[28X-E(12)^7+E(12)^11[128X[104X429[4X[28XE(3)-E(3)^2[128X[104X430[4X[32X[104X431432433[1X18.4-3 [33X[0;0YEY, EX, [22X...[122X[101X[1X, ES[133X[101X434435[33X[1;0Y[29X[2XEY[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X436[33X[1;0Y[29X[2XEX[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X437[33X[1;0Y[29X[2XEW[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X438[33X[1;0Y[29X[2XEV[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X439[33X[1;0Y[29X[2XEU[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X440[33X[1;0Y[29X[2XET[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X441[33X[1;0Y[29X[2XES[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X442443[33X[0;0YFor the given integer [3XN[103X [22X> 2[122X, let [22X[3XN[103X_k[122X denote the first integer with444multiplicative order exactly [22Xk[122X modulo [3XN[103X, chosen in the order of preference[133X445446447[24X[33X[0;6Y1, -1, 2, -2, 3, -3, 4, -4, ... .[133X[124X448449[33X[0;0YWe define (with [22Xz = exp(2 π i/[3XN[103X)[122X)[133X450451[10XEY([110X[3XN[103X[10X)[110X = [22Xy_[3XN[103X[122X = [22Xz + z^n[122X [22X(n = [3XN[103X_2)[122X452[10XEX([110X[3XN[103X[10X)[110X = [22Xx_[3XN[103X[122X = [22Xz + z^n + z^{n^2}[122X [22X(n = [3XN[103X_3)[122X453[10XEW[110X([3XN[103X[10X)[110X = [22Xw_[3XN[103X[122X = [22Xz + z^n + z^{n^2} + z^{n^3}[122X [22X(n = [3XN[103X_4)[122X454[10XEV([110X[3XN[103X[10X)[110X = [22Xv_[3XN[103X[122X = [22Xz + z^n + z^{n^2} + z^{n^3} + z^{n^4}[122X [22X(n = [3XN[103X_5)[122X455[10XEU([110X[3XN[103X[10X)[110X = [22Xu_[3XN[103X[122X = [22Xz + z^n + z^{n^2} + ... + z^{n^5}[122X [22X(n = [3XN[103X_6)[122X456[10XET([110X[3XN[103X[10X)[110X = [22Xt_[3XN[103X[122X = [22Xz + z^n + z^{n^2} + ... + z^{n^6}[122X [22X(n = [3XN[103X_7)[122X457[10XES([110X[3XN[103X[10X)[110X = [22Xs_[3XN[103X[122X = [22Xz + z^n + z^{n^2} + ... + z^{n^7}[122X [22X(n = [3XN[103X_8)[122X458459[33X[0;0YFor the two-argument versions of the functions, see Section [2XNK[102X ([14X18.4-5[114X).[133X460461[4X[32X Example [32X[104X462[4X[25Xgap>[125X [27XEY(5);[127X[104X463[4X[28XE(5)+E(5)^4[128X[104X464[4X[25Xgap>[125X [27XEW(16,3); EW(17,2);[127X[104X465[4X[28X0[128X[104X466[4X[28XE(17)+E(17)^4+E(17)^13+E(17)^16[128X[104X467[4X[32X[104X468469470[1X18.4-4 [33X[0;0YEM, EL, [22X...[122X[101X[1X, EJ[133X[101X471472[33X[1;0Y[29X[2XEM[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X473[33X[1;0Y[29X[2XEL[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X474[33X[1;0Y[29X[2XEK[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X475[33X[1;0Y[29X[2XEJ[102X( [3XN[103X[, [3Xd[103X] ) [32X function[133X476477[33X[0;0YLet [3XN[103X be an integer, [3XN[103X [22X> 2[122X. We define (with [22Xz = exp(2 π i/[3XN[103X)[122X)[133X478479[10XEM([110X[3XN[103X[10X)[110X = [22Xm_[3XN[103X[122X = [22Xz - z^n[122X [22X(n = [3XN[103X_2)[122X480[10XEL([110X[3XN[103X[10X)[110X = [22Xl_[3XN[103X[122X = [22Xz - z^n + z^{n^2} - z^{n^3}[122X [22X(n = [3XN[103X_4)[122X481[10XEK([110X[3XN[103X[10X)[110X = [22Xk_[3XN[103X[122X = [22Xz - z^n + ... - z^{n^5}[122X [22X(n = [3XN[103X_6)[122X482[10XEJ([110X[3XN[103X[10X)[110X = [22Xj_[3XN[103X[122X = [22Xz - z^n + ... - z^{n^7}[122X [22X(n = [3XN[103X_8)[122X483484[33X[0;0YFor the two-argument versions of the functions, see Section [2XNK[102X ([14X18.4-5[114X).[133X485486[1X18.4-5 NK[101X487488[33X[1;0Y[29X[2XNK[102X( [3XN[103X, [3Xk[103X, [3Xd[103X ) [32X function[133X489490[33X[0;0YLet [22X[3XN[103X_[3Xk[103X^([3Xd[103X)[122X be the [22X([3Xd[103X+1)[122X-th integer with multiplicative order exactly [3Xk[103X491modulo [3XN[103X, chosen in the order of preference defined in Section [14X18.4-3[114X; [2XNK[102X492returns [22X[3XN[103X_[3Xk[103X^([3Xd[103X)[122X; if there is no integer with the required multiplicative493order, [2XNK[102X returns [9Xfail[109X.[133X494495[33X[0;0YWe write [22X[3XN[103X_[3Xk[103X = [3XN[103X_[3Xk[103X^(0), [3XN[103X_[3Xk[103X^' = [3XN[103X_[3Xk[103X^(1), [3XN[103X_[3Xk[103X^'' = [3XN[103X_[3Xk[103X^(2)[122X and so on.[133X496497[33X[0;0YThe algebraic numbers[133X498499500[24X[33X[0;6Yy_[3XN[103X^' = y_[3XN[103X^(1), y_[3XN[103X^'' = y_[3XN[103X^(2), ..., x_[3XN[103X^', x_[3XN[103X^'', ..., j_[3XN[103X^', j_[3XN[103X^'', ...[133X[124X501502[33X[0;0Yare obtained on replacing [22X[3XN[103X_[3Xk[103X[122X in the definitions in the sections [14X18.4-3[114X and503[14X18.4-4[114X by [22X[3XN[103X_[3Xk[103X^', [3XN[103X_[3Xk[103X^'', ...[122X; they can be entered as[133X504505[10XEY([110X[3XN[103X,[3Xd[103X[10X)[110X = [22Xy_[3XN[103X^([3Xd[103X)[122X506[10XEX([110X[3XN[103X,[3Xd[103X[10X)[110X = [22Xx_[3XN[103X^([3Xd[103X)[122X507[22X...[122X508[10XEJ([110X[3XN[103X,[3Xd[103X[10X)[110X = [22Xj_[3XN[103X^([3Xd[103X)[122X509510[1X18.4-6 AtlasIrrationality[101X511512[33X[1;0Y[29X[2XAtlasIrrationality[102X( [3Xirratname[103X ) [32X function[133X513514[33X[0;0YLet [3Xirratname[103X be a string that describes an irrational value as a linear515combination in terms of the atomic irrationalities introduced in the516sections [14X18.4-1[114X, [14X18.4-2[114X, [14X18.4-3[114X, [14X18.4-4[114X. These irrational values are defined517in [CCN+85, Chapter 6, Section 10], and the following description is mainly518copied from there. If [22Xq_N[122X is such a value (e.g. [22Xy_24^''[122X) then linear519combinations of algebraic conjugates of [22Xq_N[122X are abbreviated as in the520following examples:[133X521522[10X2qN+3&5-4&7+&9[110X means [22X2 q_N + 3 q_N^{*5} - 4 q_N^{*7} + q_N^{*9}[122X523[10X4qN&3&5&7-3&4[110X means [22X4 (q_N + q_N^{*3} + q_N^{*5} + q_N^{*7}) - 3 q_N^{*11}[122X524[10X4qN*3&5+&7[110X means [22X4 (q_N^{*3} + q_N^{*5}) + q_N^{*7}[122X525526[33X[0;0YTo explain the [21Xampersand[121X syntax in general we remark that [21X&k[121X is interpreted527as [22Xq_N^{*k}[122X, where [22Xq_N[122X is the most recently named atomic irrationality, and528that the scope of any premultiplying coefficient is broken by a [22X+[122X or [22X-[122X sign,529but not by [22X&[122X or [22X*k[122X. The algebraic conjugations indicated by the ampersands530apply directly to the [13Xatomic[113X irrationality [22Xq_N[122X, even when, as in the last531example, [22Xq_N[122X first appears with another conjugacy [22X*k[122X.[133X532533[4X[32X Example [32X[104X534[4X[25Xgap>[125X [27XAtlasIrrationality( "b7*3" );[127X[104X535[4X[28XE(7)^3+E(7)^5+E(7)^6[128X[104X536[4X[25Xgap>[125X [27XAtlasIrrationality( "y'''24" );[127X[104X537[4X[28XE(24)-E(24)^19[128X[104X538[4X[25Xgap>[125X [27XAtlasIrrationality( "-3y'''24*13&5" );[127X[104X539[4X[28X3*E(8)-3*E(8)^3[128X[104X540[4X[25Xgap>[125X [27XAtlasIrrationality( "3y'''24*13-2&5" );[127X[104X541[4X[28X-3*E(24)-2*E(24)^11+2*E(24)^17+3*E(24)^19[128X[104X542[4X[25Xgap>[125X [27XAtlasIrrationality( "3y'''24*13-&5" );[127X[104X543[4X[28X-3*E(24)-E(24)^11+E(24)^17+3*E(24)^19[128X[104X544[4X[25Xgap>[125X [27XAtlasIrrationality( "3y'''24*13-4&5&7" );[127X[104X545[4X[28X-7*E(24)-4*E(24)^11+4*E(24)^17+7*E(24)^19[128X[104X546[4X[25Xgap>[125X [27XAtlasIrrationality( "3y'''24&7" );[127X[104X547[4X[28X6*E(24)-6*E(24)^19[128X[104X548[4X[32X[104X549550551[1X18.5 [33X[0;0YGalois Conjugacy of Cyclotomics[133X[101X552553[1X18.5-1 GaloisCyc[101X554555[33X[1;0Y[29X[2XGaloisCyc[102X( [3Xcyc[103X, [3Xk[103X ) [32X operation[133X556[33X[1;0Y[29X[2XGaloisCyc[102X( [3Xlist[103X, [3Xk[103X ) [32X operation[133X557558[33X[0;0YFor a cyclotomic [3Xcyc[103X and an integer [3Xk[103X, [2XGaloisCyc[102X returns the cyclotomic559obtained by raising the roots of unity in the Zumbroich basis representation560of [3Xcyc[103X to the [3Xk[103X-th power. If [3Xk[103X is coprime to the integer [22Xn[122X, [10XGaloisCyc( ., [3Xk[103X[10X561)[110X acts as a Galois automorphism of the [22Xn[122X-th cyclotomic field (see [14X60.4[114X); to562get the Galois automorphisms themselves, use [2XGaloisGroup[102X ([14X58.3-1[114X).[133X563564[33X[0;0YThe [13Xcomplex conjugate[113X of [3Xcyc[103X is [10XGaloisCyc( [3Xcyc[103X[10X, -1 )[110X, which can also be565computed using [2XComplexConjugate[102X ([14X18.5-2[114X).[133X566567[33X[0;0YFor a list or matrix [3Xlist[103X of cyclotomics, [2XGaloisCyc[102X returns the list568obtained by applying [2XGaloisCyc[102X to the entries of [3Xlist[103X.[133X569570[1X18.5-2 ComplexConjugate[101X571572[33X[1;0Y[29X[2XComplexConjugate[102X( [3Xz[103X ) [32X attribute[133X573[33X[1;0Y[29X[2XRealPart[102X( [3Xz[103X ) [32X attribute[133X574[33X[1;0Y[29X[2XImaginaryPart[102X( [3Xz[103X ) [32X attribute[133X575576[33X[0;0YFor a cyclotomic number [3Xz[103X, [2XComplexConjugate[102X returns [10XGaloisCyc( [3Xz[103X[10X, -1 )[110X,577see [2XGaloisCyc[102X ([14X18.5-1[114X). For a quaternion [22X[3Xz[103X = c_1 e + c_2 i + c_3 j + c_4 k[122X,578[2XComplexConjugate[102X returns [22Xc_1 e - c_2 i - c_3 j - c_4 k[122X, see [2XIsQuaternion[102X579([14X62.8-8[114X).[133X580581[33X[0;0YWhen [2XComplexConjugate[102X is called with a list then the result is the list of582return values of [2XComplexConjugate[102X for the list entries in the corresponding583positions.[133X584585[33X[0;0YWhen [2XComplexConjugate[102X is defined for an object [3Xz[103X then [2XRealPart[102X and586[2XImaginaryPart[102X return [10X([3Xz[103X[10X + ComplexConjugate( [3Xz[103X[10X )) / 2[110X and [10X([3Xz[103X[10X -587ComplexConjugate( [3Xz[103X[10X )) / 2 i[110X, respectively, where [10Xi[110X denotes the588corresponding imaginary unit.[133X589590[4X[32X Example [32X[104X591[4X[25Xgap>[125X [27XGaloisCyc( E(5) + E(5)^4, 2 );[127X[104X592[4X[28XE(5)^2+E(5)^3[128X[104X593[4X[25Xgap>[125X [27XGaloisCyc( E(5), -1 ); # the complex conjugate[127X[104X594[4X[28XE(5)^4[128X[104X595[4X[25Xgap>[125X [27XGaloisCyc( E(5) + E(5)^4, -1 ); # this value is real[127X[104X596[4X[28XE(5)+E(5)^4[128X[104X597[4X[25Xgap>[125X [27XGaloisCyc( E(15) + E(15)^4, 3 );[127X[104X598[4X[28XE(5)+E(5)^4[128X[104X599[4X[25Xgap>[125X [27XComplexConjugate( E(7) );[127X[104X600[4X[28XE(7)^6[128X[104X601[4X[32X[104X602603[1X18.5-3 StarCyc[101X604605[33X[1;0Y[29X[2XStarCyc[102X( [3Xcyc[103X ) [32X function[133X606607[33X[0;0YIf the cyclotomic [3Xcyc[103X is an irrational element of a quadratic extension of608the rationals then [2XStarCyc[102X returns the unique Galois conjugate of [3Xcyc[103X that609is different from [3Xcyc[103X, otherwise [9Xfail[109X is returned. In the first case, the610return value is often called [3Xcyc[103X[22X*[122X (see [14X71.13[114X).[133X611612[4X[32X Example [32X[104X613[4X[25Xgap>[125X [27XStarCyc( EB(5) ); StarCyc( E(5) );[127X[104X614[4X[28XE(5)^2+E(5)^3[128X[104X615[4X[28Xfail[128X[104X616[4X[32X[104X617618[1X18.5-4 Quadratic[101X619620[33X[1;0Y[29X[2XQuadratic[102X( [3Xcyc[103X ) [32X function[133X621622[33X[0;0YLet [3Xcyc[103X be a cyclotomic integer that lies in a quadratic extension field of623the rationals. Then we have [3Xcyc[103X[22X= (a + b sqrt{n}) / d[122X, for integers [22Xa[122X, [22Xb[122X, [22Xn[122X,624[22Xd[122X, such that [22Xd[122X is either [22X1[122X or [22X2[122X. In this case, [2XQuadratic[102X returns a record625with the components [10Xa[110X, [10Xb[110X, [10Xroot[110X, [10Xd[110X, [10XATLAS[110X, and [10Xdisplay[110X; the values of the626first four are [22Xa[122X, [22Xb[122X, [22Xn[122X, and [22Xd[122X, the [10XATLAS[110X value is a (not necessarily627shortest) representation of [3Xcyc[103X in terms of the [5XAtlas[105X irrationalities628[22Xb_{|n|}[122X, [22Xi_{|n|}[122X, [22Xr_{|n|}[122X, and the [10Xdisplay[110X value is a string that expresses629[3Xcyc[103X in [5XGAP[105X notation, corresponding to the value of the [10XATLAS[110X component.[133X630631[33X[0;0YIf [3Xcyc[103X is not a cyclotomic integer or does not lie in a quadratic extension632field of the rationals then [9Xfail[109X is returned.[133X633634[33X[0;0YIf the denominator [22Xd[122X is [22X2[122X then necessarily [22Xn[122X is congruent to [22X1[122X modulo [22X4[122X, and635[22Xr_n[122X, [22Xi_n[122X are not possible; we have [10X[3Xcyc[103X[10X = x + y * EB( root )[110X with [10Xy = b[110X, [10Xx =636( a + b ) / 2[110X.[133X637638[33X[0;0YIf [22Xd = 1[122X, we have the possibilities [22Xi_{|n|}[122X for [22Xn < -1[122X, [22Xa + b * i[122X for [22Xn =639-1[122X, [22Xa + b * r_n[122X for [22Xn > 0[122X. Furthermore if [22Xn[122X is congruent to [22X1[122X modulo [22X4[122X, also640[3Xcyc[103X [22X= (a+b) + 2 * b * b_{|n|}[122X is possible; the shortest string of these is641taken as the value for the component [10XATLAS[110X.[133X642643[4X[32X Example [32X[104X644[4X[25Xgap>[125X [27XQuadratic( EB(5) ); Quadratic( EB(27) );[127X[104X645[4X[28Xrec( ATLAS := "b5", a := -1, b := 1, d := 2, [128X[104X646[4X[28X display := "(-1+Sqrt(5))/2", root := 5 )[128X[104X647[4X[28Xrec( ATLAS := "1+3b3", a := -1, b := 3, d := 2, [128X[104X648[4X[28X display := "(-1+3*Sqrt(-3))/2", root := -3 )[128X[104X649[4X[25Xgap>[125X [27XQuadratic(0); Quadratic( E(5) );[127X[104X650[4X[28Xrec( ATLAS := "0", a := 0, b := 0, d := 1, display := "0", root := 1 )[128X[104X651[4X[28Xfail[128X[104X652[4X[32X[104X653654[1X18.5-5 GaloisMat[101X655656[33X[1;0Y[29X[2XGaloisMat[102X( [3Xmat[103X ) [32X attribute[133X657658[33X[0;0YLet [3Xmat[103X be a matrix of cyclotomics. [2XGaloisMat[102X calculates the complete orbits659under the operation of the Galois group of the (irrational) entries of [3Xmat[103X,660and the permutations of rows corresponding to the generators of the Galois661group.[133X662663[33X[0;0YIf some rows of [3Xmat[103X are identical, only the first one is considered for the664permutations, and a warning will be printed.[133X665666[33X[0;0Y[2XGaloisMat[102X returns a record with the components [10Xmat[110X, [10Xgaloisfams[110X, and667[10Xgenerators[110X.[133X668669[8X[10Xmat[110X[8X[108X670[33X[0;6Ya list with initial segment being the rows of [3Xmat[103X ([13Xnot[113X shallow copies671of these rows); the list consists of full orbits under the action of672the Galois group of the entries of [3Xmat[103X defined above. The last rows in673the list are those not contained in [3Xmat[103X but must be added in order to674complete the orbits; so if the orbits were already complete, [3Xmat[103X and675[10Xmat[110X have identical rows.[133X676677[8X[10Xgaloisfams[110X[8X[108X678[33X[0;6Ya list that has the same length as the [10Xmat[110X component, its entries are679either 1, 0, -1, or lists.[133X680681[8X[10Xgaloisfams[i] = 1[110X[8X[108X682[33X[0;12Ymeans that [10Xmat[i][110X consists of rationals, i.e., [10X[ mat[i] ][110X forms683an orbit;[133X684685[8X[10Xgaloisfams[i] = -1[110X[8X[108X686[33X[0;12Ymeans that [10Xmat[i][110X contains unknowns (see Chapter [14X74[114X); in this687case [10X[ mat[i] ][110X is regarded as an orbit, too, even if [10Xmat[i][110X688contains irrational entries;[133X689690[8X[10Xgaloisfams[i] = [110X[8X[22X[ l_1, l_2 ][122X[108X691[33X[0;12Y(a list) means that [10Xmat[i][110X is the first element of its orbit in692[10Xmat[110X, [22Xl_1[122X is the list of positions of rows that form the orbit,693and [22Xl_2[122X is the list of corresponding Galois automorphisms (as694exponents, not as functions); so we have [10Xmat[110X[22X[ l_1[j] ][k] =[122X695[10XGaloisCyc( mat[110X[22X[i][k], l_2[j][122X[10X )[110X;[133X696697[8X[10Xgaloisfams[i] = 0[110X[8X[108X698[33X[0;12Ymeans that [10Xmat[i][110X is an element of a nontrivial orbit but not699the first element of it.[133X700701[8X[10Xgenerators[110X[8X[108X702[33X[0;6Ya list of permutations generating the permutation group corresponding703to the action of the Galois group on the rows of [10Xmat[110X.[133X704705[4X[32X Example [32X[104X706[4X[25Xgap>[125X [27XGaloisMat( [ [ E(3), E(4) ] ] );[127X[104X707[4X[28Xrec( galoisfams := [ [ [ 1, 2, 3, 4 ], [ 1, 7, 5, 11 ] ], 0, 0, 0 ], [128X[104X708[4X[28X generators := [ (1,2)(3,4), (1,3)(2,4) ], [128X[104X709[4X[28X mat := [ [ E(3), E(4) ], [ E(3), -E(4) ], [ E(3)^2, E(4) ], [128X[104X710[4X[28X [ E(3)^2, -E(4) ] ] )[128X[104X711[4X[25Xgap>[125X [27XGaloisMat( [ [ 1, 1, 1 ], [ 1, E(3), E(3)^2 ] ] );[127X[104X712[4X[28Xrec( galoisfams := [ 1, [ [ 2, 3 ], [ 1, 2 ] ], 0 ], [128X[104X713[4X[28X generators := [ (2,3) ], [128X[104X714[4X[28X mat := [ [ 1, 1, 1 ], [ 1, E(3), E(3)^2 ], [ 1, E(3)^2, E(3) ] ] )[128X[104X715[4X[32X[104X716717[1X18.5-6 RationalizedMat[101X718719[33X[1;0Y[29X[2XRationalizedMat[102X( [3Xmat[103X ) [32X attribute[133X720721[33X[0;0Yreturns the list of rationalized rows of [3Xmat[103X, which must be a matrix of722cyclotomics. This is the set of sums over orbits under the action of the723Galois group of the entries of [3Xmat[103X (see [2XGaloisMat[102X ([14X18.5-5[114X)), so the724operation may be viewed as a kind of trace on the rows.[133X725726[33X[0;0YNote that no two rows of [3Xmat[103X should be equal.[133X727728[4X[32X Example [32X[104X729[4X[25Xgap>[125X [27Xmat:= [ [ 1, 1, 1 ], [ 1, E(3), E(3)^2 ], [ 1, E(3)^2, E(3) ] ];;[127X[104X730[4X[25Xgap>[125X [27XRationalizedMat( mat );[127X[104X731[4X[28X[ [ 1, 1, 1 ], [ 2, -1, -1 ] ][128X[104X732[4X[32X[104X733734735[1X18.6 [33X[0;0YInternally Represented Cyclotomics[133X[101X736737[33X[0;0YThe implementation of an [13Xinternally represented cyclotomic[113X is based on a738list of length equal to its conductor. This means that the internal739representation of a cyclotomic does [13Xnot[113X refer to the smallest number field740but the smallest [13Xcyclotomic[113X field containing it. The reason for this is the741wish to reflect the natural embedding of two cyclotomic fields into a larger742one that contains both. With such embeddings, it is easy to construct the743sum or the product of two arbitrary cyclotomics (in possibly different744fields) as an element of a cyclotomic field.[133X745746[33X[0;0YThe disadvantage of this approach is that the arithmetical operations are747quite expensive, so the use of internally represented cyclotomics is not748recommended for doing arithmetics over number fields, such as calculations749with matrices of cyclotomics. But internally represented cyclotomics are750good enough for dealing with irrationalities in character tables (see751chapter [14X71[114X).[133X752753[33X[0;0YFor the representation of cyclotomics one has to recall that the [22Xn[122X-th754cyclotomic field [22Xℚ(e_n)[122X is a vector space of dimension [22Xφ(n)[122X over the755rationals where [22Xφ[122X denotes Euler's phi-function (see [2XPhi[102X ([14X15.2-2[114X)).[133X756757[33X[0;0YA special integral basis of cyclotomic fields is chosen that allows one to758easily convert arbitrary sums of roots of unity into the basis, as well as759to convert a cyclotomic represented w.r.t. the basis into the smallest760possible cyclotomic field. This basis is accessible in [5XGAP[105X, see [14X60.3[114X for761more information and references.[133X762763[33X[0;0YNote that the set of all [22Xn[122X-th roots of unity is linearly dependent for [22Xn >7641[122X, so multiplication is [13Xnot[113X the multiplication of the group ring [22Xℚ⟨ e_n ⟩[122X;765given a [22Xℚ[122X-basis of [22Xℚ(e_n)[122X the result of the multiplication (computed as766multiplication of polynomials in [22Xe_n[122X, using [22X(e_n)^n = 1[122X) will be converted767to the basis.[133X768769[4X[32X Example [32X[104X770[4X[25Xgap>[125X [27XE(5) * E(5)^2; ( E(5) + E(5)^4 ) * E(5)^2;[127X[104X771[4X[28XE(5)^3[128X[104X772[4X[28XE(5)+E(5)^3[128X[104X773[4X[25Xgap>[125X [27X( E(5) + E(5)^4 ) * E(5);[127X[104X774[4X[28X-E(5)-E(5)^3-E(5)^4[128X[104X775[4X[32X[104X776777[33X[0;0YAn internally represented cyclotomic is always represented in the smallest778cyclotomic field it is contained in. The internal coefficients list779coincides with the external representation returned by [2XExtRepOfObj[102X780([14X18.1-12[114X).[133X781782[33X[0;0YTo avoid calculations becoming unintentionally very long, or consuming very783large amounts of memory, there is a limit on the conductor of internally784represented cyclotomics, by default set to one million. This can be raised785(although not lowered) using [2XSetCyclotomicsLimit[102X ([14X18.6-1[114X) and accessed using786[2XGetCyclotomicsLimit[102X ([14X18.6-1[114X). The maximum value of the limit is [22X2^28-1[122X on [22X32[122X787bit systems, and [22X2^32[122X on [22X64[122X bit systems. So the maximal cyclotomic field788implemented in [5XGAP[105X is not really the field [22Xℚ^ab[122X.[133X789790[33X[0;0YIt should be emphasized that one disadvantage of representing a cyclotomic791in the smallest [13Xcyclotomic[113X field (and not in the smallest field) is that792arithmetic operations in a fixed small extension field of the rational793number field are comparatively expensive. For example, take a prime integer794[22Xp[122X and suppose that we want to work with a matrix group over the field795[22Xℚ(sqrt{p})[122X. Then each matrix entry could be described by two rational796coefficients, whereas the representation in the smallest cyclotomic field797requires [22Xp-1[122X rational coefficients for each entry. So it is worth thinking798about using elements in a field constructed with [2XAlgebraicExtension[102X ([14X67.1-1[114X)799when natural embeddings of cyclotomic fields are not needed.[133X800801[1X18.6-1 SetCyclotomicsLimit[101X802803[33X[1;0Y[29X[2XSetCyclotomicsLimit[102X( [3Xnewlimit[103X ) [32X function[133X804[33X[1;0Y[29X[2XGetCyclotomicsLimit[102X( ) [32X function[133X805806[33X[0;0Y[2XGetCyclotomicsLimit[102X returns the current limit on conductors of internally807represented cyclotomic numbers[133X808809[33X[0;0Y[2XSetCyclotomicsLimit[102X can be called to increase the limit on conductors of810internally represented cyclotomic numbers. Note that computing in large811cyclotomic fields using this representation can be both slow and812memory-consuming, and that other approaches may be better for some problems.813See [14X18.6[114X.[133X814815816817