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[1X3 [33X[0;0YInfrastructure[133X[101X23[33X[0;0YMost of the details in this chapter are of a technical nature; the user need4only skim over this chapter on a first reading. Mostly, it is enough to know5that[133X67[30X [33X[0;6Yyou must do a [10XLoadPackage("anupq");[110X before you can expect to use a8command defined by the [5XANUPQ[105X package (details are in Section [14X'[33X[0;0YLoading9the ANUPQ Package[133X'[114X);[133X1011[30X [33X[0;6Ypartial results of [5XANUPQ[105X commands and some other data are stored in12the [10XANUPQData[110X global variable (details are in Section [14X'[33X[0;0YThe ANUPQData13Record[133X'[114X);[133X1415[30X [33X[0;6Ydoing [10XSetInfoLevel(InfoANUPQ, [3Xn[103X[10X);[110X for [3Xn[103X greater than the default value161 will give progressively more information of what is going on [21Xbehind17the scenes[121X (details are in Section [14X'[33X[0;0YSetting the Verbosity of ANUPQ via18Info and InfoANUPQ[133X'[114X);[133X1920[30X [33X[0;6Yin Section [14X'[33X[0;0YUtility Functions[133X'[114X we describe some utility functions and21functions that run examples from the collection of examples of this22package;[133X2324[30X [33X[0;6Yin Section [14X'[33X[0;0YAttributes and a Property for fp and pc p-groups[133X'[114X we25describe the attributes and property [10XNuclearRank[110X, [10XMultiplicatorRank[110X26and [10XIsCapable[110X; and[133X2728[30X [33X[0;6Yin Section [14X'[33X[0;0YHints and Warnings regarding the use of Options[133X'[114X we29describe some troubleshooting strategies. Also this section explains30the utility of setting [10XANUPQWarnOfOtherOptions := true;[110X (particularly31for novice users) for detecting misspelt options and diagnosing other32option usage problems.[133X333435[1X3.1 [33X[0;0YLoading the ANUPQ Package[133X[101X3637[33X[0;0YTo use the [5XANUPQ[105X package, as with any [5XGAP[105X package, it must be requested38explicitly. This is done by calling[133X3940[4X[32X Example [32X[104X41[4X[25Xgap>[125X [27XLoadPackage( "anupq" );[127X[104X42[4X[28X---------------------------------------------------------------------------[128X[104X43[4X[28XLoading ANUPQ (ANU p-Quotient) 3.1[128X[104X44[4X[28XGAP code by Greg Gamble <[email protected]> (address for[128X[104X45[4X[28Xcorrespondence)[128X[104X46[4X[28X Werner Nickel (http://www.mathematik.tu-darmstadt.de/~nickel/)[128X[104X47[4X[28X [uses ANU pq binary (C code program) version: 1.9][128X[104X48[4X[28XC code by Eamonn O'Brien (http://www.math.auckland.ac.nz/~obrien)[128X[104X49[4X[28XCo-maintained by Max Horn <[email protected]>[128X[104X50[4X[28X[128X[104X51[4X[28X For help, type: ?ANUPQ[128X[104X52[4X[28X---------------------------------------------------------------------------[128X[104X53[4X[28Xtrue[128X[104X54[4X[32X[104X5556[33X[0;0YNote that since the [5XANUPQ[105X package uses the [10XAutomorphimGroupPGroup[110X function57of the [5XAutPGrp[105X package and, in any case, often needs other [5XAutPGrp[105X functions58when computing descendants, the user must ensure that the [5XAutPGrp[105X package is59also installed, at least version 1.5. If the [5XAutPGrp[105X package is not60installed, the [5XANUPQ[105X package will [9Xfail[109X to load.[133X6162[33X[0;0YAlso, if [5XGAP[105X cannot find a working [10Xpq[110X binary, the call to [10XLoadPackage[110X will63return [9Xfail[109X.[133X6465[33X[0;0YIf you want to load the [5XANUPQ[105X package by default, you can put the66[10XLoadPackage[110X command into your [10Xgap.ini[110X file (see Section [14XReference: The67gap.ini and gaprc files[114X in the [5XGAP[105X Reference Manual). By the way, the novice68user of the [5XANUPQ[105X package should probably also append the line[133X6970[4X[32X Example [32X[104X71[4X[28XANUPQWarnOfOtherOptions := true;[128X[104X72[4X[32X[104X7374[33X[0;0Yto their [10Xgap.ini[110X file, somewhere after the [10XLoadPackage( "anupq" );[110X command75(see [2XANUPQWarnOfOtherOptions[102X ([14X3.6-1[114X)).[133X767778[1X3.2 [33X[0;0YThe ANUPQData Record[133X[101X7980[33X[0;0YThis section contains fairly technical details which may be skipped on an81initial reading.[133X8283[1X3.2-1 ANUPQData[101X8485[33X[1;0Y[29X[2XANUPQData[102X[32X global variable[133X8687[33X[0;0Yis a [5XGAP[105X record in which the essential data for an [5XANUPQ[105X session within [5XGAP[105X88is stored; its fields are:[133X8990[8X[10Xbinary[110X[8X[108X91[33X[0;6Ythe path of the [10Xpq[110X binary;[133X9293[8X[10Xtmpdir[110X[8X[108X94[33X[0;6Ythe path of the temporary directory used by the [10Xpq[110X binary and [5XGAP[105X95(i.e. the directory in which all the [10Xpq[110X's temporary files are created)96(also see [2XANUPQDirectoryTemporary[102X ([14X3.2-2[114X) below);[133X9798[8X[10Xoutfile[110X[8X[108X99[33X[0;6Ythe full path of the default [10Xpq[110X output file;[133X100101[8X[10XSPimages[110X[8X[108X102[33X[0;6Ythe full path of the file [10XGAP_library[110X to which the [10Xpq[110X program writes103its Standard Presentation images;[133X104105[8X[10Xversion[110X[8X[108X106[33X[0;6Ythe version of the current [10Xpq[110X binary;[133X107108[8X[10Xni[110X[8X[108X109[33X[0;6Ya data record used by non-interactive functions (see below and110Chapter [14X'[33X[0;0YNon-interactive ANUPQ functions[133X'[114X);[133X111112[8X[10Xio[110X[8X[108X113[33X[0;6Ylist of data records for [10XPqStart[110X (see below and [2XPqStart[102X ([14X5.1-1[114X))114processes;[133X115116[8X[10Xtopqlogfile[110X[8X[108X117[33X[0;6Yname of file logged to by [10XToPQLog[110X (see [2XToPQLog[102X ([14X3.4-7[114X)); and[133X118119[8X[10Xlogstream[110X[8X[108X120[33X[0;6Ystream of file logged to by [10XToPQLog[110X (see [2XToPQLog[102X ([14X3.4-7[114X)).[133X121122[33X[0;0YEach time an interactive [5XANUPQ[105X process is initiated via [10XPqStart[110X (see [2XPqStart[102X123([14X5.1-1[114X)), an identifying number [3XioIndex[103X is generated for the interactive124process and a record [10XANUPQData.io[[3XioIndex[103X[10X][110X with some or all of the fields125listed below is created. Whenever a non-interactive function is called (see126Chapter [14X'[33X[0;0YNon-interactive ANUPQ functions[133X'[114X), the record [10XANUPQData.ni[110X is127updated with fields that, if bound, have exactly the same purpose as for a128[10XANUPQData.io[[3XioIndex[103X[10X][110X record.[133X129130[8X[10Xstream[110X[8X[108X131[33X[0;6Ythe IOStream opened for interactive [5XANUPQ[105X process [3XioIndex[103X or132non-interactive [5XANUPQ[105X function;[133X133134[8X[10Xgroup[110X[8X[108X135[33X[0;6Ythe group given as first argument to [10XPqStart[110X, [10XPq[110X, [10XPqEpimorphism[110X,136[10XPqDescendants[110X or [10XPqStandardPresentation[110X (or any synonymous methods);[133X137138[8X[10Xhaspcp[110X[8X[108X139[33X[0;6Yis bound and set to [9Xtrue[109X when a pc presentation is first set inside140the [10Xpq[110X program (e.g. by [10XPqPcPresentation[110X or [10XPqRestorePcPresentation[110X or141a higher order function like [10XPq[110X, [10XPqEpimorphism[110X, [10XPqPCover[110X,142[10XPqDescendants[110X or [10XPqStandardPresentation[110X that does a [10XPqPcPresentation[110X143operation, but [13Xnot[113X [10XPqStart[110X which only starts up an interactive [5XANUPQ[105X144process);[133X145146[8X[10Xgens[110X[8X[108X147[33X[0;6Ya list of the generators of the group [10Xgroup[110X as strings (the same as148those passed to the [10Xpq[110X program);[133X149150[8X[10Xrels[110X[8X[108X151[33X[0;6Ya list of the relators of the group [10Xgroup[110X as strings (the same as152those passed to the [10Xpq[110X program);[133X153154[8X[10Xname[110X[8X[108X155[33X[0;6Ythe name of the group whose pc presentation is defined by a call to156the [10Xpq[110X program (according to the [10Xpq[110X program -- unless you have used157the [10XGroupName[110X option (see e.g. [2XPq[102X ([14X4.1-1[114X)) or applied the function158[10XSetName[110X (see [2XSetName[102X ([14XReference: Name[114X)) to the group, the [21Xgeneric[121X name159[10X"[grp]"[110X is set as a default);[133X160161[8X[10Xgpnum[110X[8X[108X162[33X[0;6Yif not a null string, the [21Xnumber[121X (i.e. the unique label assigned by163the [10Xpq[110X program) of the last descendant processed;[133X164165[8X[10Xclass[110X[8X[108X166[33X[0;6Ythe largest lower exponent-[22Xp[122X central class of a quotient group of the167group (usually [10Xgroup[110X) found by a call to the [10Xpq[110X program;[133X168169[8X[10Xforder[110X[8X[108X170[33X[0;6Ythe factored order of the quotient group of largest lower exponent-[22Xp[122X171central class found for the group (usually [10Xgroup[110X) by a call to the [10Xpq[110X172program (this factored order is given as a list [10X[p,n][110X, indicating an173order of [22Xp^n[122X);[133X174175[8X[10Xpcoverclass[110X[8X[108X176[33X[0;6Ythe lower exponent-[22Xp[122X central class of the [22Xp[122X-covering group of a177[22Xp[122X-quotient of the group (usually [10Xgroup[110X) found by a call to the [10Xpq[110X178program;[133X179180[8X[10Xworkspace[110X[8X[108X181[33X[0;6Ythe workspace set for the [10Xpq[110X process (either given as a second182argument to [10XPqStart[110X, or set by default to 10000000);[133X183184[8X[10Xmenu[110X[8X[108X185[33X[0;6Ythe current menu of the [10Xpq[110X process (the [10Xpq[110X program is managed by186various menus, the details of which the user shouldn't normally need187to know about -- the [10Xmenu[110X field remembers which menu the [10Xpq[110X process is188currently [21Xin[121X);[133X189190[8X[10Xoutfname[110X[8X[108X191[33X[0;6Yis the file to which [10Xpq[110X output is directed, which is always192[10XANUPQData.outfile[110X, except when option [10XSetupFile[110X is used with a193non-interactive function, in which case [10Xoutfname[110X is set to194[10X"PQ_OUTPUT"[110X;[133X195196[8X[10XpQuotient[110X[8X[108X197[33X[0;6Yis set to the value returned by [10XPq[110X (see [2XPq[102X ([14X4.1-1[114X)) (the field [10XpQepi[110X198is also set at the same time);[133X199200[8X[10XpQepi[110X[8X[108X201[33X[0;6Yis set to the value returned by [10XPqEpimorphism[110X (see [2XPqEpimorphism[102X202([14X4.1-2[114X)) (the field [10XpQuotient[110X is also set at the same time);[133X203204[8X[10XpCover[110X[8X[108X205[33X[0;6Yis set to the value returned by [10XPqPCover[110X (see [2XPqPCover[102X ([14X4.1-3[114X));[133X206207[8X[10XSP[110X[8X[108X208[33X[0;6Yis set to the value returned by [10XPqStandardPresentation[110X or209[10XStandardPresentation[110X (see [2XPqStandardPresentation[102X ([14X5.3-4[114X)) when called210interactively, for process [3Xi[103X (the field [10XSPepi[110X is also set at the same211time);[133X212213[8X[10XSPepi[110X[8X[108X214[33X[0;6Yis set to the value returned by [10XEpimorphismPqStandardPresentation[110X or215[10XEpimorphismStandardPresentation[110X (see [2XEpimorphismPqStandardPresentation[102X216([14X5.3-5[114X)) when called interactively, for process [3Xi[103X (the field [10XSP[110X is217also set at the same time);[133X218219[8X[10Xdescendants[110X[8X[108X220[33X[0;6Yis set to the value returned by [10XPqDescendants[110X (see [2XPqDescendants[102X221([14X4.4-1[114X));[133X222223[8X[10Xtreepos[110X[8X[108X224[33X[0;6Yif set by a call to [10XPqDescendantsTreeCoclassOne[110X225(see [2XPqDescendantsTreeCoclassOne[102X ([14XA.4-1[114X)), it contains a record with226fields [10Xclass[110X, [10Xnode[110X and [10Xndes[110X being the information that determines the227last descendant with a non-zero number of descendants processed;[133X228229[8X[10Xxgapsheet[110X[8X[108X230[33X[0;6Yif set by a call to [10XPqDescendantsTreeCoclassOne[110X231(see [2XPqDescendantsTreeCoclassOne[102X ([14XA.4-1[114X)) during an [5XXGAP[105X session, it232contains the [5XXGAP[105X [10XSheet[110X on which the descendants tree is displayed;233and[133X234235[8X[10XnextX[110X[8X[108X236[33X[0;6Yif set by a call to [10XPqDescendantsTreeCoclassOne[110X237(see [2XPqDescendantsTreeCoclassOne[102X ([14XA.4-1[114X)) during an [5XXGAP[105X session, it238contains a list of integers, the [3Xi[103Xth entry of which is the239[3Xx[103X-coordinate of the next node (representing a descendant) for the [3Xi[103Xth240class.[133X241242[1X3.2-2 ANUPQDirectoryTemporary[101X243244[33X[1;0Y[29X[2XANUPQDirectoryTemporary[102X( [3Xdir[103X ) [32X function[133X245246[33X[0;0Ycalls the UNIX command [10Xmkdir[110X to create [3Xdir[103X, which must be a string, and if247successful a directory object for [3Xdir[103X is both assigned to [10XANUPQData.tmpdir[110X248and returned. The field [10XANUPQData.outfile[110X is also set to be a file in249[10XANUPQData.tmpdir[110X, and on exit from [5XGAP[105X [3Xdir[103X is removed. Most users will never250need this command; by default, [5XGAP[105X typically chooses a [21Xrandom[121X subdirectory251of [10X/tmp[110X for [10XANUPQData.tmpdir[110X which may occasionally have limits on what may252be written there. [10XANUPQDirectoryTemporary[110X permits the user to choose a253directory (object) where one is not so limited.[133X254255256[1X3.3 [33X[0;0YSetting the Verbosity of ANUPQ via Info and InfoANUPQ[133X[101X257258[1X3.3-1 InfoANUPQ[101X259260[33X[1;0Y[29X[2XInfoANUPQ[102X[32X info class[133X261262[33X[0;0YThe input to and the output from the [10Xpq[110X program is, by default, not263displayed. However the user may choose to see some, or all, of this264input/output. This is done via the [10XInfo[110X mechanism (see Section [14XReference:265Info Functions[114X in the [5XGAP[105X Reference Manual). For this purpose, there is the266[3XInfoClass[103X [10XInfoANUPQ[110X. If the [10XInfoLevel[110X of [10XInfoANUPQ[110X is high enough each line267of [10Xpq[110X input/output is directed to a call to [10XInfo[110X and will be displayed for268the user to see. By default, the [10XInfoLevel[110X of [10XInfoANUPQ[110X is 1, and it is269recommended that you leave it at this level, or higher. Messages that the270user should presumably want to see and output from the [10Xpq[110X program influenced271by the value of the option [10XOutputLevel[110X (see the options listed in Section [2XPq[102X272([14X4.1-1[114X)), other than timing and memory usage are directed to [10XInfo[110X at273[10XInfoANUPQ[110X level 1.[133X274275[33X[0;0YTo turn off [13Xall[113X [10XInfoANUPQ[110X messaging, set the [10XInfoANUPQ[110X level to 0.[133X276277[33X[0;0YThere are five other user-intended [10XInfoANUPQ[110X levels: 2, 3, 4, 5 and 6.[133X278279[4X[32X Example [32X[104X280[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 2);[127X[104X281[4X[32X[104X282283[33X[0;0Yenables the display of most timing and memory usage data from the [10Xpq[110X284program, and also the number of identity instances when the [10XIdentities[110X285option is used. (Some timing and memory usage data, particularly when286profuse in quantity, is [10XInfo[110X-ed at [10XInfoANUPQ[110X level 3 instead.) Note that the287the [5XGAP[105X functions [10Xtime[110X and [10XRuntime[110X (see [2XRuntime[102X ([14XReference: Runtime[114X) in the288[5XGAP[105X Reference Manual) count the time spent by [5XGAP[105X and [13Xnot[113X the time spent by289the (external) [10Xpq[110X program.[133X290291[4X[32X Example [32X[104X292[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 3);[127X[104X293[4X[32X[104X294295[33X[0;0Yenables the display of output of the nature of the first two [10XInfoANUPQ[110X that296was not directly invoked by the user (e.g. some commands require [5XGAP[105X to297discover something about the current state known to the [10Xpq[110X program). The298identity instances processed under the [10XIdentities[110X option are also displayed299at this level. In some cases, the [10Xpq[110X program produces a lot of output300despite the fact that the [10XOutputLevel[110X (see [14X6.2[114X) is unset or is set to 0;301such output is also [10XInfo[110X-ed at [10XInfoANUPQ[110X level 3.[133X302303[4X[32X Example [32X[104X304[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 4);[127X[104X305[4X[32X[104X306307[33X[0;0Yenables the display of all the commands directed to the [10Xpq[110X program, behind a308[21X[10XToPQ> [110X[121X prompt (so that you can distinguish it from the output from the [10Xpq[110X309program). See Section [14X'[33X[0;0YHints and Warnings regarding the use of Options[133X'[114X for310an example of how this can be a useful troubleshooting tool.[133X311312[4X[32X Example [32X[104X313[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 5);[127X[104X314[4X[32X[104X315316[33X[0;0Yenables the display of the [10Xpq[110X program's prompts for input. Finally,[133X317318[4X[32X Example [32X[104X319[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 6);[127X[104X320[4X[32X[104X321322[33X[0;0Yenables the display of all other output from the [10Xpq[110X program, namely the323banner and menus. However, the timing data printed when the [10Xpq[110X program exits324can never be observed.[133X325326327[1X3.4 [33X[0;0YUtility Functions[133X[101X328329[1X3.4-1 PqLeftNormComm[101X330331[33X[1;0Y[29X[2XPqLeftNormComm[102X( [3Xelts[103X ) [32X function[133X332333[33X[0;0Yreturns for a list of elements of some group (e.g. [3Xelts[103X may be a list of334words in the generators of a free or fp group) the left normed commutator of335[3Xelts[103X, e.g. if [3Xw1[103X, [3Xw2[103X, [3Xw3[103X are such elements then [10XPqLeftNormComm( [[3Xw1[103X[10X, [3Xw2[103X[10X, [3Xw3[103X[10X]336);[110X is equivalent to [10XComm( Comm( [3Xw1[103X[10X, [3Xw2[103X[10X ), [3Xw3[103X[10X );[110X.[133X337338[33X[0;0Y[13XNote:[113X [3Xelts[103X must contain at least two elements.[133X339340[1X3.4-2 PqGAPRelators[101X341342[33X[1;0Y[29X[2XPqGAPRelators[102X( [3Xgroup[103X, [3Xrels[103X ) [32X function[133X343344[33X[0;0Yreturns a list of words that [5XGAP[105X understands, given a list [3Xrels[103X of strings345in the string representations of the generators of the fp group [3Xgroup[103X346prepared as a list of relators for the [10Xpq[110X program.[133X347348[33X[0;0Y[13XNote:[113X The [10Xpq[110X program does not use [10X/[110X to indicate multiplication by an inverse349and uses square brackets to represent (left normed) commutators. Also, even350though the [10Xpq[110X program accepts relations, all elements of [3Xrels[103X [13Xmust[113X be in351relator form, i.e. a relation of form [10X[3Xw1[103X[10X = [3Xw2[103X[10X[110X must be written as [10X[3Xw1[103X[10X*([3Xw2[103X[10X)^-1[110X.[133X352353[33X[0;0YHere is an example:[133X354355[4X[32X Example [32X[104X356[4X[25Xgap>[125X [27XF := FreeGroup("a", "b");[127X[104X357[4X[28X<free group on the generators [ a, b ]>[128X[104X358[4X[25Xgap>[125X [27XPqGAPRelators(F, [ "a*b^2", "[a,b]^2*a", "([a,b,a,b,b]*a*b)^2*a" ]);[127X[104X359[4X[28X[ a*b^2, a^-1*b^-1*a*b*a^-1*b^-1*a*b*a, b^-1*a^-1*b^-1*a^-1*b*a*b^-1*a*b*a^[128X[104X360[4X[28X -1*b*a^-1*b^-1*a*b*a*b^-1*a^-1*b^-1*a^-1*b*a*b^-1*a*b^-1*a^-1*b*a^-1*b^[128X[104X361[4X[28X -1*a*b*a*b*a^-1*b*a*b^-1*a*b*a^-1*b*a^-1*b^-1*a*b*a*b^-1*a^-1*b^-1*a^[128X[104X362[4X[28X -1*b*a*b^-1*a*b^-1*a^-1*b*a^-1*b^-1*a*b*a*b^2*a*b*a ][128X[104X363[4X[32X[104X364365[1X3.4-3 PqParseWord[101X366367[33X[1;0Y[29X[2XPqParseWord[102X( [3Xword[103X, [3Xn[103X ) [32X function[133X368369[33X[0;0Yparses a [3Xword[103X, a string representing a word in the pc generators [10Xx1,...,x[3Xn[103X[10X[110X,370through [5XGAP[105X. This function is provided as a rough-and-ready check of [3Xword[103X371for syntax errors. A syntax error will cause the entering of a [10Xbreak[110X-loop,372in which the error message may or may not be meaningful (depending on373whether the syntax error gets caught at the [5XGAP[105X or kernel level).[133X374375[33X[0;0Y[13XNote:[113X The reason the generators [13Xmust[113X be [10Xx1,...,x[3Xn[103X[10X[110X is that these are the pc376generator names used by the [10Xpq[110X program (as distinct from the generator names377for the group provided by the user to a function like [10XPq[110X that invokes the [10Xpq[110X378program).[133X379380[1X3.4-4 PqExample[101X381382[33X[1;0Y[29X[2XPqExample[102X( ) [32X function[133X383[33X[1;0Y[29X[2XPqExample[102X( [3Xexample[103X[, [3XPqStart[103X][, [3XDisplay[103X] ) [32X function[133X384[33X[1;0Y[29X[2XPqExample[102X( [3Xexample[103X[, [3XPqStart[103X][, [3Xfilename[103X] ) [32X function[133X385386[33X[0;0YWith no arguments, or with single argument [10X"index"[110X, or a string [3Xexample[103X that387is not the name of a file in the [10Xexamples[110X directory, an index of available388examples is displayed.[133X389390[33X[0;0YWith just the one argument [3Xexample[103X that is the name of a file in the391[10Xexamples[110X directory, the example contained in that file is executed in its392simplest form. Some examples accept options which you may use to modify some393of the options used in the commands of the example. To find out which394options an example accepts, use one of the mechanisms for displaying the395example described below.[133X396397[33X[0;0YSome examples have both non-interactive and interactive forms; those that398are non-interactive only have a name ending in [10X-ni[110X; those that are399interactive only have a name ending in [10X-i[110X; examples with names ending in [10X.g[110X400also have only one form; all other examples have both non-interactive and401interactive forms and for these giving [10XPqStart[110X as second argument invokes402[10XPqStart[110X initially and makes the appropriate adjustments so that the example403is executed or displayed using interactive functions.[133X404405[33X[0;0YIf [10XPqExample[110X is called with last (second or third) argument [10XDisplay[110X then the406example is displayed without being executed. If the last argument is a407non-empty string [3Xfilename[103X then the example is also displayed without being408executed but is also written to a file with that name. Passing an empty409string as last argument has the same effect as passing [10XDisplay[110X.[133X410411[33X[0;0Y[13XNote:[113X The variables used in [10XPqExample[110X are local to the running of [10XPqExample[110X,412so there's no danger of having some of your variables over-written. However,413they are not completely lost either. They are saved to a record414[10XANUPQData.examples.vars[110X, i.e. if [10XF[110X is a variable used in the example then415you will be able to access it after [10XPqExample[110X has finished as416[10XANUPQData.examples.vars.F[110X.[133X417418[1X3.4-5 AllPqExamples[101X419420[33X[1;0Y[29X[2XAllPqExamples[102X( ) [32X function[133X421422[33X[0;0Yreturns a list of all currently available examples in default UNIX-listing423(i.e. alphabetic) order.[133X424425[1X3.4-6 GrepPqExamples[101X426427[33X[1;0Y[29X[2XGrepPqExamples[102X( [3Xstring[103X ) [32X function[133X428429[33X[0;0Yruns the UNIX command [10Xgrep [3Xstring[103X[10X[110X over the [5XANUPQ[105X examples and returns the430list of examples for which there is a match. The actual matches are [10XInfo[110X-ed431at [10XInfoANUPQ[110X level 2.[133X432433[1X3.4-7 ToPQLog[101X434435[33X[1;0Y[29X[2XToPQLog[102X( [[3Xfilename[103X] ) [32X function[133X436437[33X[0;0YWith string argument [3Xfilename[103X, [10XToPQLog[110X opens the file with name [3Xfilename[103X for438logging; all commands written to the [10Xpq[110X binary (that are [10XInfo[110X-ed behind a439[21X[10XToPQ> [110X[121X prompt at [10XInfoANUPQ[110X level 4) are then also written to that file (but440without prompts). With no argument, [10XToPQLog[110X stops logging to whatever file441was being logged to. If a file was already being logged to, that file is442closed and the file with name [3Xfilename[103X is opened for logging.[133X443444445[1X3.5 [33X[0;0YAttributes and a Property for fp and pc p-groups[133X[101X446447[1X3.5-1 NuclearRank[101X448449[33X[1;0Y[29X[2XNuclearRank[102X( [3XG[103X ) [32X attribute[133X450[33X[1;0Y[29X[2XMultiplicatorRank[102X( [3XG[103X ) [32X attribute[133X451[33X[1;0Y[29X[2XIsCapable[102X( [3XG[103X ) [32X property[133X452453[33X[0;0Yreturn the nuclear rank of [3XG[103X, [22Xp[122X-multiplicator rank of [3XG[103X, and whether [3XG[103X is454capable (i.e. [9Xtrue[109X if it is, or [9Xfalse[109X if it is not), respectively.[133X455456[33X[0;0YThese attributes and property are set automatically if [3XG[103X is one of the457following:[133X458459[30X [33X[0;6Yan fp group returned by [10XPqStandardPresentation[110X or [10XStandardPresentation[110X460(see [2XPqStandardPresentation[102X ([14X4.2-1[114X));[133X461462[30X [33X[0;6Ythe image (fp group) of the epimorphism returned by an463[10XEpimorphismPqStandardPresentation[110X or [10XEpimorphismStandardPresentation[110X464call (see [2XEpimorphismPqStandardPresentation[102X ([14X4.2-2[114X)); or[133X465466[30X [33X[0;6Yone of the pc groups of the list of descendants returned by467[10XPqDescendants[110X (see [2XPqDescendants[102X ([14X4.4-1[114X)).[133X468469[33X[0;0YIf [3XG[103X is an fp group or a pc [22Xp[122X-group and not one of the above and the470attribute or property has not otherwise been set for [3XG[103X, then471[10XPqStandardPresentation[110X is called to set all three of [10XNuclearRank[110X,472[10XMultiplicatorRank[110X and [10XIsCapable[110X, before returning the value of the attribute473or property actually called. Such a group [3XG[103X must know in advance that it is474a [22Xp[122X-group; this is the case for the groups returned by the functions [10XPq[110X and475[10XPqPCover[110X, and the image group of the epimorphism returned by [10XPqEpimorphism[110X.476Otherwise, if you know the group to be a [22Xp[122X-group, then this can be set by477typing[133X478479[4X[32X[104X480[4XSetIsPGroup( G, true );[104X481[4X[32X[104X482483[33X[0;0Yor by invoking [10XIsPGroup( [3XG[103X[10X )[110X. Note that for an fp group [3XG[103X, the latter may484result in a coset enumeration which might not terminate in a reasonable485time.[133X486487[33X[0;0Y[13XNote:[113X For [3XG[103X such that [10XHasNuclearRank([3XG[103X[10X) = true[110X, [10XIsCapable([3XG[103X[10X)[110X is equivalent488to (the truth or falsity of) [10XNuclearRank( [3XG[103X[10X ) = 0[110X.[133X489490491[1X3.6 [33X[0;0YHints and Warnings regarding the use of Options[133X[101X492493[33X[0;0YOn a first reading we recommend you skip this section and come back to it if494and when you run into trouble.[133X495496[33X[0;0Y[13XNote:[113X By [21Xoptions[121X we refer to [5XGAP[105X options. The [10Xpq[110X program also uses the term497[21Xoption[121X; to distinguish the two usages of [21Xoption[121X, in this manual we use the498term [13Xmenu item[113X to refer to what the [10Xpq[110X program refers to as an [21Xoption[121X.[133X499500[33X[0;0YOptions are passed to the [5XANUPQ[105X interface functions in either of the two501usual mechanisms provided by [5XGAP[105X, namely:[133X502503[30X [33X[0;6Yoptions may be set globally using the function [10XPushOptions[110X (see504Chapter [14XReference: Options Stack[114X in the [5XGAP[105X Reference Manual); or[133X505506[30X [33X[0;6Yoptions may be appended to the argument list of any function call,507separated by a colon from the argument list (see Chapter [14XReference:508Function Calls[114X in the [5XGAP[105X Reference Manual), in which case they are509then passed on recursively to any subsequent inner function call,510which may in turn have options of their own.[133X511512[33X[0;0YParticularly, when one is using the interactive functions of513Chapter [14X'[33X[0;0YInteractive ANUPQ functions[133X'[114X, one should, in general, avoid using514the global method of passing options. In fact, it is recommended that prior515to calling [10XPqStart[110X the [10XOptionsStack[110X be empty. The essential problem with516setting options globally using the function [10XPushOptions[110X is that options517pushed onto [10XOptionsStack[110X, in this way, (generally) remain there until an518explicit [10XPopOptions()[110X call is made.[133X519520[33X[0;0YIn contrast, options passed in the usual way behind a colon following a521function's arguments (see [14XReference: Function Call With Options[114X in the [5XGAP[105X522Reference Manual) are local, and disappear from [10XOptionsStack[110X after the523function has executed successfully. If the function does [13Xnot[113X execute524successfully, i.e. it runs into error and the user [9Xquit[109Xs the resulting [10Xbreak[110X525loop (see Section [14XReference: Break Loops[114X in the Reference Manual) rather526than attempting to repair the problem and typing [10Xreturn;[110X then, unless the527error at the kernel level, the [10XOptionsStack[110X is reset. If an error is528detected inside the kernel (hopefully, this should occur only rarely, if at529all) then the options of that function will [13Xnot[113X be cleared from530[10XOptionsStack[110X; in such cases:[133X531532[4X[32X Example [32X[104X533[4X[25Xgap>[125X [27XResetOptionsStack();[127X[104X534[4X[28X#I Options stack is already empty[128X[104X535[4X[32X[104X536537[33X[0;0Yis usually necessary (see Chapter [2XResetOptionsStack[102X ([14XReference:538ResetOptionsStack[114X) in the [5XGAP[105X Reference Manual), which recursively calls539[10XPopOptions()[110X until [10XOptionsStack[110X is empty, or as in the above case warns you540that the [10XOptionsStack[110X is already empty.[133X541542[33X[0;0YNote that a function, that is passed options after the colon, will also see543any global options or any options passed down recursively from functions544calling that function, unless those options are over-ridden by options545passed via the function. Also, note that duplication of option names for546different programs may lead to misinterpretations, and mis-spelled options547will not be [21Xseen[121X.[133X548549[33X[0;0YThe non-interactive functions of Chapter [14X'[33X[0;0YNon-interactive ANUPQ functions[133X'[114X550that have [10XPq[110X somewhere in their name provide an alternative method of551passing options as additional arguments. This has the advantages that552options can be abbreviated and mis-spelled options will be trapped.[133X553554[1X3.6-1 ANUPQWarnOfOtherOptions[101X555556[33X[1;0Y[29X[2XANUPQWarnOfOtherOptions[102X[32X global variable[133X557558[33X[0;0Yis a global variable that is by default [9Xfalse[109X. If it is set to [9Xtrue[109X then any559function provided by the [5XANUPQ[105X function that recognises at least one option,560will warn you of [21Xother[121X options, i.e. options that the function does not561recognise. These warnings are emitted at [10XInfoWarning[110X or [10XInfoANUPQ[110X level 1.562This is useful for detecting mis-spelled options. Here is an example using563the function [10XPq[110X (first described in Chapter [14X'[33X[0;0YNon-interactive ANUPQ564functions[133X'[114X):[133X565566[4X[32X Example [32X[104X567[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 1); # Set InfoANUPQ to default level[127X[104X568[4X[25Xgap>[125X [27XANUPQWarnOfOtherOptions := true;;[127X[104X569[4X[25Xgap>[125X [27X# The following makes entry into break loops very ``quiet'' ...[127X[104X570[4X[25Xgap>[125X [27XOnBreak := function() Where(0); end;;[127X[104X571[4X[25Xgap>[125X [27XF := FreeGroup( "a", "b" );[127X[104X572[4X[28X<free group on the generators [ a, b ]>[128X[104X573[4X[25Xgap>[125X [27XPq( F : Prime := 2, Classbound := 1 );[127X[104X574[4X[28X#I ANUPQ Warning: Options: [ "Classbound" ] ignored[128X[104X575[4X[28X#I (invalid for generic function: `Pq').[128X[104X576[4X[28Xuser interrupt at[128X[104X577[4X[28XmoreOfline := ReadLine( iostream );[128X[104X578[4X[28XEntering break read-eval-print loop ...[128X[104X579[4X[28Xyou can 'quit;' to quit to outer loop, or[128X[104X580[4X[28Xyou can 'return;' to continue[128X[104X581[4X[32X[104X582583[33X[0;0YHere we mistyped [10XClassBound[110X as [10XClassbound[110X, and after seeing the [10XInfo[110X-ed584warning that [10XClassbound[110X was ignored, we typed a [3Xcontrol[103X-C (that's the [21X[10Xuser585interrupt at[110X[121X message) which took us into a break loop. Since the [10XPq[110X command586was not able to finish, the options [10XPrime[110X and [10XClassbound[110X, in particular,587will still be on the [10XOptionsStack[110X:[133X588589[4X[32X Example [32X[104X590[4X[26Xbrk>[126X [27XOptionsStack;[127X[104X591[4X[28X[ rec( Prime := 2, Classbound := 1 ), [128X[104X592[4X[28X rec( Prime := 2, Classbound := 1, PqEpiOrPCover := "pQuotient" ) ][128X[104X593[4X[32X[104X594595[33X[0;0YThe option [10XPqEpiOrPCover[110X is a behind-the-scenes option that need not concern596the user. On [9Xquit[109Xting the [10Xbreak[110X-loop the [10XOptionsStack[110X is reset and a warning597telling you this is emitted:[133X598599[4X[32X Example [32X[104X600[4X[26Xbrk>[126X [27Xquit; # to get back to the `gap>' prompt[127X[104X601[4X[28X#I Options stack has been reset[128X[104X602[4X[32X[104X603604[33X[0;0YAbove, we altered [10XOnBreak[110X (see [2XOnBreak[102X ([14XReference: OnBreak[114X) in the Reference605manual) to reduce the back-tracing on entry into a break loop. We now606restore [10XOnBreak[110X to its usual value.[133X607608[4X[32X Example [32X[104X609[4X[25Xgap>[125X [27XOnBreak := Where;;[127X[104X610[4X[32X[104X611612[33X[0;0Y[13XNotes[113X[133X613614[33X[0;0YIn cases where functions recursively call others with options (e.g. when615using [10XPqExample[110X with options), setting [10XANUPQWarnOfOtherOptions := true[110X may616give rise to spurious [21Xother[121X option detections.[133X617618[33X[0;0YIt is recommended that the novice user set [10XANUPQWarnOfOtherOptions[110X to [9Xtrue[109X619in their [10Xgap.ini[110X file (see Section [14X'[33X[0;0YLoading the ANUPQ Package[133X'[114X).[133X620621[33X[0;0Y[13XOther Troubleshooting Strategies[113X[133X622623[33X[0;0YThere are some other strategies which may have helped us to see our error624above. The function [10XPq[110X recognises the option [10XOutputLevel[110X (see [14X6.2[114X); if this625option is set to at least 1, the [10Xpq[110X program provides information on each626class quotient as it is generated:[133X627628[4X[32X Example [32X[104X629[4X[25Xgap>[125X [27XANUPQWarnOfOtherOptions := false;; # Set back to normal[127X[104X630[4X[25Xgap>[125X [27XF := FreeGroup( "a", "b" );;[127X[104X631[4X[25Xgap>[125X [27XPq( F : Prime := 2, Classbound := 1, OutputLevel := 1 ); [127X[104X632[4X[28X#I Lower exponent-2 central series for [grp][128X[104X633[4X[28X#I Group: [grp] to lower exponent-2 central class 1 has order 2^2[128X[104X634[4X[28X#I Group: [grp] to lower exponent-2 central class 2 has order 2^5[128X[104X635[4X[28X#I Group: [grp] to lower exponent-2 central class 3 has order 2^10[128X[104X636[4X[28X#I Group: [grp] to lower exponent-2 central class 4 has order 2^18[128X[104X637[4X[28X#I Group: [grp] to lower exponent-2 central class 5 has order 2^32[128X[104X638[4X[28X#I Group: [grp] to lower exponent-2 central class 6 has order 2^55[128X[104X639[4X[28X#I Group: [grp] to lower exponent-2 central class 7 has order 2^96[128X[104X640[4X[28X#I Group: [grp] to lower exponent-2 central class 8 has order 2^167[128X[104X641[4X[28X#I Group: [grp] to lower exponent-2 central class 9 has order 2^294[128X[104X642[4X[28X#I Group: [grp] to lower exponent-2 central class 10 has order 2^520[128X[104X643[4X[28X#I Group: [grp] to lower exponent-2 central class 11 has order 2^932[128X[104X644[4X[28X#I Group: [grp] to lower exponent-2 central class 12 has order 2^1679[128X[104X645[4X[28X[... output truncated ...][128X[104X646[4X[32X[104X647648[33X[0;0YAfter seeing the information for the class 2 quotient we may have got the649idea that the [10XClassbound[110X option was not recognised and may have realised650that this was due to a mis-spelling. The above will ordinarily cause the651available space to be exhausted, necessitating user-intervention by typing652[3Xcontrol[103X-C and [10Xquit;[110X (to escape the break loop); otherwise [10XPq[110X terminates when653the class reaches 63 (the default value of [10XClassBound[110X).[133X654655[33X[0;0YIf you have some familiarity with [21Xkeyword[121X command input to the [10Xpq[110X binary,656then setting the level of [10XInfoANUPQ[110X to 4 would also have indicated a657problem:[133X658659[4X[32X Example [32X[104X660[4X[25Xgap>[125X [27XResetOptionsStack(); # Necessary, if a break-loop was entered above[127X[104X661[4X[25Xgap>[125X [27XSetInfoLevel(InfoANUPQ, 4);[127X[104X662[4X[25Xgap>[125X [27XPq( F : Prime := 2, Classbound := 1 );[127X[104X663[4X[28X#I ToPQ> 7 #to (Main) p-Quotient Menu[128X[104X664[4X[28X#I ToPQ> 1 #define group[128X[104X665[4X[28X#I ToPQ> name [grp][128X[104X666[4X[28X#I ToPQ> prime 2[128X[104X667[4X[28X#I ToPQ> class 63[128X[104X668[4X[28X#I ToPQ> exponent 0[128X[104X669[4X[28X#I ToPQ> output 0[128X[104X670[4X[28X#I ToPQ> generators { a,b }[128X[104X671[4X[28X#I ToPQ> relators { };[128X[104X672[4X[28X[... output truncated ...][128X[104X673[4X[32X[104X674675[33X[0;0YHere the line [21X[10X#I ToPQ> class 63[110X[121X indicates that a directive to set the676classbound to 63 was sent to the [10Xpq[110X program.[133X677678679680