Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563501 views
1
<Chapter Label="Infrastructure">
2
<Heading>Infrastructure</Heading>
3
4
Most of the details in this chapter are of a technical nature; the user
5
need only skim over this chapter on a first reading. Mostly, it is enough
6
to know that
7
<List>
8
<Item>
9
you must do a <C>LoadPackage("anupq");</C> before you can expect to use a
10
command defined by the &ANUPQ; package
11
(details are in Section&nbsp;<Ref Sect="Loading the ANUPQ Package" Style="Text"/>);
12
</Item>
13
14
<Item>
15
partial results of &ANUPQ; commands and some other data are stored in
16
the <C>ANUPQData</C> global variable
17
(details are in Section&nbsp;<Ref Sect="The ANUPQData Record" Style="Text"/>);
18
</Item>
19
20
<Item>
21
doing <C>SetInfoLevel(InfoANUPQ, <A>n</A>);</C> for <A>n</A> greater than the default
22
value 1 will give progressively more information of what is going on
23
<Q>behind the scenes</Q> (details are in
24
Section&nbsp;<Ref Sect="Setting the Verbosity of ANUPQ via Info and InfoANUPQ" Style="Text"/>);
25
</Item>
26
27
<Item>
28
in Section&nbsp;<Ref Sect="Utility-Functions" Style="Text"/> we describe some utility functions and
29
functions that run examples from the collection of examples of this
30
package;
31
</Item>
32
33
<Item>
34
in Section&nbsp;<Ref Sect="Attributes and a Property for fp and pc p-groups" Style="Text"/> we describe
35
the attributes and property <C>NuclearRank</C>, <C>MultiplicatorRank</C> and
36
<C>IsCapable</C>; and
37
</Item>
38
39
<Item>
40
in Section&nbsp;<Ref Sect="Hints and Warnings regarding the use of Options" Style="Text"/> we describe
41
some troubleshooting strategies. Also this section explains the utility
42
of setting <C>ANUPQWarnOfOtherOptions := true;</C> (particularly for novice
43
users) for detecting misspelt options and diagnosing other option usage
44
problems.
45
</Item>
46
</List>
47
48
<Section Label="Loading the ANUPQ Package">
49
<Heading>Loading the ANUPQ Package</Heading>
50
51
<Index>banner</Index>
52
To use the &ANUPQ; package, as with any &GAP; package, it must be
53
requested explicitly. This is done by calling
54
55
<Example><![CDATA[
56
gap> LoadPackage( "anupq" );
57
---------------------------------------------------------------------------
58
Loading ANUPQ (ANU p-Quotient) 3.1
59
GAP code by Greg Gamble <[email protected]> (address for
60
correspondence)
61
Werner Nickel (http://www.mathematik.tu-darmstadt.de/~nickel/)
62
[uses ANU pq binary (C code program) version: 1.9]
63
C code by Eamonn O'Brien (http://www.math.auckland.ac.nz/~obrien)
64
Co-maintained by Max Horn <[email protected]>
65
66
For help, type: ?ANUPQ
67
---------------------------------------------------------------------------
68
true
69
]]></Example>
70
71
Note that since the &ANUPQ; package uses the <C>AutomorphimGroupPGroup</C>
72
function of the &AutPGrp; package and, in any case, often needs other
73
&AutPGrp; functions when computing descendants, the user must ensure
74
that the &AutPGrp; package is also installed, at least version 1.5. If
75
the &AutPGrp; package is not installed, the &ANUPQ; package will <K>fail</K>
76
to load.
77
<P/>
78
79
Also, if &GAP; cannot find a working <C>pq</C> binary, the call to
80
<C>LoadPackage</C> will return <K>fail</K>.
81
<P/>
82
83
If you want to load the &ANUPQ; package by default, you can put the
84
<C>LoadPackage</C> command into your <C>gap.ini</C> file (see
85
Section&nbsp;<Ref BookName="ref" Label="The gap.ini and gaprc files" Style="Text"/>
86
in the &GAP; Reference Manual). By the way, the novice user
87
of the &ANUPQ; package should probably also append the line
88
89
<Log><![CDATA[
90
ANUPQWarnOfOtherOptions := true;
91
]]></Log>
92
93
to their <C>gap.ini</C> file, somewhere after the <C>LoadPackage( "anupq" );</C>
94
command (see&nbsp;<Ref Func="ANUPQWarnOfOtherOptions" Style="Text"/>).
95
96
</Section>
97
98
99
100
<Section Label="The ANUPQData Record">
101
<Heading>The ANUPQData Record</Heading>
102
103
This section contains fairly technical details which may be skipped on an
104
initial reading.
105
106
<ManSection>
107
<Var Name="ANUPQData"/>
108
<Description>
109
is a &GAP; record in which the essential data for an &ANUPQ; session
110
within &GAP; is stored; its fields are:
111
112
<List>
113
<Mark><C>binary</C></Mark>
114
<Item>
115
the path of the <C>pq</C> binary;
116
</Item>
117
<Mark><C>tmpdir</C></Mark>
118
<Item>
119
the path of the temporary directory used by the <C>pq</C>
120
binary and &GAP; (i.e.&nbsp;the directory in which all the <C>pq</C>'s temporary
121
files are created) (also see <Ref Func="ANUPQDirectoryTemporary" Style="Text"/> below);
122
</Item>
123
<Mark><C>outfile</C></Mark>
124
<Item>
125
the full path of the default <C>pq</C> output file;
126
</Item>
127
<Mark><C>SPimages</C></Mark>
128
<Item>
129
the full path of the file <C>GAP_library</C> to which the
130
<C>pq</C> program writes its Standard Presentation images;
131
</Item>
132
<Mark><C>version</C></Mark>
133
<Item>
134
the version of the current <C>pq</C> binary;
135
</Item>
136
<Mark><C>ni</C></Mark>
137
<Item>
138
a data record used by non-interactive functions (see below
139
and Chapter&nbsp;<Ref Chap="non-interact" Style="Text"/>);
140
</Item>
141
<Mark><C>io</C></Mark>
142
<Item>
143
list of data records for <C>PqStart</C> (see below and&nbsp;<Ref Func="PqStart" Style="Text"/>)
144
processes;
145
</Item>
146
<Mark><C>topqlogfile</C></Mark>
147
<Item>
148
name of file logged to by <C>ToPQLog</C> (see&nbsp;<Ref Func="ToPQLog" Style="Text"/>);
149
and
150
</Item>
151
<Mark><C>logstream</C></Mark>
152
<Item>
153
stream of file logged to by <C>ToPQLog</C> (see&nbsp;<Ref Func="ToPQLog" Style="Text"/>).
154
</Item>
155
</List>
156
157
Each time an interactive &ANUPQ; process is initiated via <C>PqStart</C>
158
(see&nbsp;<Ref Func="PqStart" Style="Text"/>), an identifying number <A>ioIndex</A> is generated for the
159
interactive process and a record <C>ANUPQData.io[<A>ioIndex</A>]</C> with some or
160
all of the fields listed below is created. Whenever a non-interactive
161
function is called (see Chapter&nbsp;<Ref Chap="non-interact" Style="Text"/>), the
162
record <C>ANUPQData.ni</C> is updated with fields that, if bound, have exactly
163
the same purpose as for a <C>ANUPQData.io[<A>ioIndex</A>]</C> record.
164
165
<List>
166
<Mark><C>stream</C></Mark>
167
<Item>
168
the IOStream opened for interactive &ANUPQ; process
169
<A>ioIndex</A> or non-interactive &ANUPQ; function;
170
</Item>
171
<Mark><C>group</C></Mark>
172
<Item>
173
the group given as first argument to <C>PqStart</C>, <C>Pq</C>,
174
<C>PqEpimorphism</C>, <C>PqDescendants</C> or <C>PqStandardPresentation</C> (or any
175
synonymous methods);
176
</Item>
177
<Mark><C>haspcp</C></Mark>
178
<Item>
179
is bound and set to <K>true</K> when a pc presentation is first
180
set inside the <C>pq</C> program (e.g.&nbsp;by <C>PqPcPresentation</C> or
181
<C>PqRestorePcPresentation</C> or a higher order function like <C>Pq</C>,
182
<C>PqEpimorphism</C>, <C>PqPCover</C>, <C>PqDescendants</C> or <C>PqStandardPresentation</C>
183
that does a <C>PqPcPresentation</C> operation, but <E>not</E> <C>PqStart</C> which only
184
starts up an interactive &ANUPQ; process);
185
</Item>
186
<Mark><C>gens</C></Mark>
187
<Item>
188
a list of the generators of the group <C>group</C> as strings
189
(the same as those passed to the <C>pq</C> program);
190
</Item>
191
<Mark><C>rels</C></Mark>
192
<Item>
193
a list of the relators of the group <C>group</C> as strings (the
194
same as those passed to the <C>pq</C> program);
195
</Item>
196
<Mark><C>name</C></Mark>
197
<Item>
198
the name of the group whose pc presentation is defined by a
199
call to the <C>pq</C> program (according to the <C>pq</C> program -- unless you
200
have used the <C>GroupName</C> option (see e.g.&nbsp;<Ref Func="Pq" Style="Text"/>) or applied the function
201
<C>SetName</C> (see&nbsp;<Ref BookName="ref" Func="SetName" Style="Text"/>) to the group, the <Q>generic</Q> name
202
<C>"[grp]"</C> is set as a default);
203
</Item>
204
<Mark><C>gpnum</C></Mark>
205
<Item>
206
if not a null string, the <Q>number</Q> (i.e.&nbsp;the unique label
207
assigned by the <C>pq</C> program) of the last descendant processed;
208
</Item>
209
<Mark><C>class</C></Mark>
210
<Item>
211
the largest lower exponent-<M>p</M> central class of a quotient
212
group of the group (usually <C>group</C>) found by a call to the <C>pq</C> program;
213
</Item>
214
<Mark><C>forder</C></Mark>
215
<Item>
216
the factored order of the quotient group of largest lower
217
exponent-<M>p</M> central class found for the group (usually <C>group</C>) by a
218
call to the <C>pq</C> program (this factored order is given as a list
219
<!-- FIXME: [p,n] reformatted -->
220
<C>[p,n]</C>, indicating an order of <M>p^n</M>);
221
</Item>
222
<Mark><C>pcoverclass</C></Mark>
223
<Item>
224
the lower exponent-<M>p</M> central class of the
225
<M>p</M>-covering group of a <M>p</M>-quotient of the group (usually <C>group</C>) found
226
by a call to the <C>pq</C> program;
227
</Item>
228
<Mark><C>workspace</C></Mark>
229
<Item>
230
the workspace set for the <C>pq</C> process (either given as
231
a second argument to <C>PqStart</C>, or set by default to 10000000);
232
</Item>
233
<Mark><C>menu</C></Mark>
234
<Item>
235
the current menu of the <C>pq</C> process (the <C>pq</C> program is
236
managed by various menus, the details of which the user shouldn't
237
normally need to know about -- the <C>menu</C> field remembers which menu the
238
<C>pq</C> process is currently <Q>in</Q>);
239
</Item>
240
<Mark><C>outfname</C></Mark>
241
<Item>
242
is the file to which <C>pq</C> output is directed, which is
243
always <C>ANUPQData.outfile</C>, except when option <C>SetupFile</C> is used with a
244
non-interactive function, in which case <C>outfname</C> is set to
245
<C>"PQ_OUTPUT"</C>;
246
</Item>
247
<Mark><C>pQuotient</C></Mark>
248
<Item>
249
is set to the value returned by <C>Pq</C> (see&nbsp;<Ref Func="Pq" Style="Text"/>) (the
250
field <C>pQepi</C> is also set at the same time);
251
</Item>
252
<Mark><C>pQepi</C></Mark>
253
<Item>
254
is set to the value returned by <C>PqEpimorphism</C>
255
(see&nbsp;<Ref Func="PqEpimorphism" Style="Text"/>) (the field <C>pQuotient</C> is also set at the same
256
time);
257
</Item>
258
<Mark><C>pCover</C></Mark>
259
<Item>
260
is set to the value returned by <C>PqPCover</C>
261
(see&nbsp;<Ref Func="PqPCover" Style="Text"/>);
262
</Item>
263
<Mark><C>SP</C></Mark>
264
<Item>
265
is set to the value returned by <C>PqStandardPresentation</C> or
266
<C>StandardPresentation</C> (see&nbsp;<Ref Func="PqStandardPresentation" Label="interactive" Style="Text"/>) when
267
called interactively, for process <A>i</A> (the field <C>SPepi</C> is also set at
268
the same time);
269
</Item>
270
<Mark><C>SPepi</C></Mark>
271
<Item>
272
is set to the value returned by
273
<C>EpimorphismPqStandardPresentation</C> or <C>EpimorphismStandardPresentation</C>
274
(see&nbsp;<Ref Func="EpimorphismPqStandardPresentation" Label="interactive" Style="Text"/>) when called
275
interactively, for process <A>i</A> (the field <C>SP</C> is also set at the same
276
time);
277
</Item>
278
<Mark><C>descendants</C></Mark>
279
<Item>
280
is set to the value returned by
281
<C>PqDescendants</C> (see&nbsp;<Ref Func="PqDescendants" Style="Text"/>);
282
</Item>
283
<Mark><C>treepos</C></Mark>
284
<Item>
285
if set by a call to <C>PqDescendantsTreeCoclassOne</C>
286
(see&nbsp;<Ref Func="PqDescendantsTreeCoclassOne" Style="Text"/>), it contains a record with fields
287
<C>class</C>, <C>node</C> and <C>ndes</C> being the information that determines the last
288
descendant with a non-zero number of descendants processed;
289
</Item>
290
<Mark><C>xgapsheet</C></Mark>
291
<Item>
292
if set by a call to <C>PqDescendantsTreeCoclassOne</C>
293
(see&nbsp;<Ref Func="PqDescendantsTreeCoclassOne" Style="Text"/>) during an &XGAP; session, it
294
contains the &XGAP; <C>Sheet</C> on which the descendants tree is displayed;
295
and
296
</Item>
297
<Mark><C>nextX</C></Mark>
298
<Item>
299
if set by a call to <C>PqDescendantsTreeCoclassOne</C>
300
(see&nbsp;<Ref Func="PqDescendantsTreeCoclassOne" Style="Text"/>) during an &XGAP; session, it
301
contains a list of integers, the <A>i</A>th entry of which is the
302
<A>x</A>-coordinate of the next node (representing a descendant) for the <A>i</A>th
303
class.
304
</Item>
305
</List>
306
</Description>
307
</ManSection>
308
309
310
<ManSection>
311
<Func Name="ANUPQDirectoryTemporary" Arg="dir"/>
312
<Description>
313
calls the UNIX command <C>mkdir</C> to create <A>dir</A>, which must be a string,
314
and if successful a directory object for <A>dir</A> is both assigned to
315
<C>ANUPQData.tmpdir</C> and returned. The field <C>ANUPQData.outfile</C> is also
316
set to be a file in <C>ANUPQData.tmpdir</C>, and on exit from &GAP; <A>dir</A> is
317
removed. Most users will never need this command; by default, &GAP;
318
typically chooses a <Q>random</Q> subdirectory of <C>/tmp</C> for
319
<C>ANUPQData.tmpdir</C> which may occasionally have limits on what may be
320
written there. <C>ANUPQDirectoryTemporary</C> permits the user to choose a
321
directory (object) where one is not so limited.
322
</Description>
323
</ManSection>
324
325
</Section>
326
327
328
<Section Label="Setting the Verbosity of ANUPQ via Info and InfoANUPQ">
329
<Heading>Setting the Verbosity of ANUPQ via Info and InfoANUPQ</Heading>
330
331
<ManSection>
332
<InfoClass Name="InfoANUPQ"/>
333
<Description>
334
The input to and the output from the <C>pq</C> program is, by default, not
335
displayed. However the user may choose to see some, or all, of this
336
input/output. This is done via the <C>Info</C> mechanism (see
337
Section&nbsp;<Ref BookName="ref" Label="Info Functions" Style="Text"/> in the &GAP; Reference Manual). For this
338
purpose, there is the <A>InfoClass</A> <C>InfoANUPQ</C>. If the <C>InfoLevel</C> of
339
<C>InfoANUPQ</C> is high enough each line of <C>pq</C> input/output is directed to
340
a call to <C>Info</C> and will be displayed for the user to see. By default,
341
the <C>InfoLevel</C> of <C>InfoANUPQ</C> is 1, and it is recommended that you leave
342
it at this level, or higher. Messages that the user should presumably
343
want to see and output from the <C>pq</C> program influenced by the value of
344
the option <C>OutputLevel</C> (see the options listed in Section&nbsp;<Ref Func="Pq" Style="Text"/>), other
345
than timing and memory usage are directed to <C>Info</C> at <C>InfoANUPQ</C> level
346
1.
347
<P/>
348
349
To turn off <E>all</E> <C>InfoANUPQ</C> messaging, set the <C>InfoANUPQ</C> level to 0.
350
<P/>
351
352
There are five other user-intended <C>InfoANUPQ</C> levels: 2, 3, 4, 5 and 6.
353
354
<Example><![CDATA[
355
gap> SetInfoLevel(InfoANUPQ, 2);
356
]]></Example>
357
358
enables the display of most timing and memory usage data from the <C>pq</C>
359
program, and also the number of identity instances when the <C>Identities</C>
360
option is used. (Some timing and memory usage data, particularly when
361
profuse in quantity, is <C>Info</C>-ed at <C>InfoANUPQ</C> level 3 instead.) Note
362
that the the &GAP; functions <C>time</C> and <C>Runtime</C>
363
(see&nbsp;<Ref BookName="ref" Func="Runtime" Style="Text"/> in
364
the &GAP; Reference Manual) count the time spent by &GAP; and <E>not</E> the
365
time spent by the (external) <C>pq</C> program.
366
367
<Example><![CDATA[
368
gap> SetInfoLevel(InfoANUPQ, 3);
369
]]></Example>
370
371
enables the display of output of the nature of the first two <C>InfoANUPQ</C>
372
that was not directly invoked by the user (e.g.&nbsp;some commands require
373
&GAP; to discover something about the current state known to the <C>pq</C>
374
program). The identity instances processed under the <C>Identities</C> option
375
are also displayed at this level. In some cases, the <C>pq</C> program
376
produces a lot of output despite the fact that the <C>OutputLevel</C>
377
(see&nbsp;<Ref Label="option OutputLevel" Style="Text"/>) is unset or is set to 0; such output is also
378
<C>Info</C>-ed at <C>InfoANUPQ</C> level 3.
379
380
<Example><![CDATA[
381
gap> SetInfoLevel(InfoANUPQ, 4);
382
]]></Example>
383
384
enables the display of all the commands directed to the <C>pq</C> program,
385
behind a <Q><C>ToPQ> </C></Q> prompt (so that you can distinguish it from the
386
output from the <C>pq</C> program). See Section&nbsp;<Ref Sect="Hints and Warnings regarding the use of Options" Style="Text"/> for an example of how this can be a useful
387
troubleshooting tool.
388
389
<Example><![CDATA[
390
gap> SetInfoLevel(InfoANUPQ, 5);
391
]]></Example>
392
393
enables the display of the <C>pq</C> program's prompts for input. Finally,
394
395
<Example><![CDATA[
396
gap> SetInfoLevel(InfoANUPQ, 6);
397
]]></Example>
398
399
enables the display of all other output from the <C>pq</C> program, namely the
400
banner and menus. However, the timing data printed when the <C>pq</C> program
401
exits can never be observed.
402
403
</Description>
404
</ManSection>
405
406
</Section>
407
408
409
<Section Label="Utility-Functions">
410
<Heading>Utility Functions</Heading>
411
412
<ManSection>
413
<Func Name="PqLeftNormComm" Arg="elts"/>
414
<Description>
415
returns for a list of elements of some group (e.g.&nbsp;<A>elts</A> may be a list
416
of words in the generators of a free or fp group) the left normed
417
commutator of <A>elts</A>, e.g.&nbsp;if <A>w1</A>, <A>w2</A>, <A>w3</A> are such elements then
418
<C>PqLeftNormComm( [<A>w1</A>, <A>w2</A>, <A>w3</A>] );</C> is equivalent to <C>Comm( Comm(
419
<A>w1</A>, <A>w2</A> ), <A>w3</A> );</C>.
420
<P/>
421
422
<E>Note:</E> <A>elts</A> must contain at least two elements.
423
</Description>
424
</ManSection>
425
426
<ManSection>
427
<Func Name="PqGAPRelators" Arg="group, rels"/>
428
<Description>
429
returns a list of words that &GAP; understands, given a list <A>rels</A> of
430
strings in the string representations of the generators of the fp group
431
<A>group</A> prepared as a list of relators for the <C>pq</C> program.
432
<P/>
433
434
<E>Note:</E>
435
The <C>pq</C> program does not use <C>/</C> to indicate multiplication by an
436
inverse and uses square brackets to represent (left normed) commutators.
437
Also, even though the <C>pq</C> program accepts relations, all elements of
438
<A>rels</A> <E>must</E> be in relator form, i.e.&nbsp;a relation of form <C><A>w1</A> = <A>w2</A></C>
439
must be written as <C><A>w1</A>*(<A>w2</A>)^-1</C>.
440
<P/>
441
442
Here is an example:
443
444
<Example><![CDATA[
445
gap> F := FreeGroup("a", "b");
446
<free group on the generators [ a, b ]>
447
gap> PqGAPRelators(F, [ "a*b^2", "[a,b]^2*a", "([a,b,a,b,b]*a*b)^2*a" ]);
448
[ 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^
449
-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^
450
-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^
451
-1*b*a*b^-1*a*b^-1*a^-1*b*a^-1*b^-1*a*b*a*b^2*a*b*a ]
452
]]></Example>
453
</Description>
454
</ManSection>
455
456
<ManSection>
457
<Func Name="PqParseWord" Arg="word, n"/>
458
<Description>
459
parses a <A>word</A>, a string representing a word in the pc generators
460
<C>x1,...,x<A>n</A></C>, through &GAP;. This function is provided as a
461
rough-and-ready check of <A>word</A> for syntax errors. A syntax error will
462
cause the entering of a <C>break</C>-loop, in which the error message may or
463
may not be meaningful (depending on whether the syntax error gets caught
464
at the &GAP; or kernel level).
465
<P/>
466
467
<E>Note:</E>
468
The reason the generators <E>must</E> be <C>x1,...,x<A>n</A></C> is that these are the
469
pc generator names used by the <C>pq</C> program (as distinct from the
470
generator names for the group provided by the user to a function like
471
<C>Pq</C> that invokes the <C>pq</C> program).
472
</Description>
473
</ManSection>
474
475
<ManSection>
476
<Func Name="PqExample" Arg="" Label="no arguments"/>
477
<Func Name="PqExample" Arg="example[, PqStart][, Display]"/>
478
<Func Name="PqExample" Arg="example[, PqStart][, filename]" Label="with filename"/>
479
<Description>
480
With no arguments, or with single argument <C>"index"</C>, or a string
481
<A>example</A> that is not the name of a file in the <C>examples</C> directory, an
482
index of available examples is displayed.
483
<P/>
484
485
With just the one argument <A>example</A> that is the name of a file in the
486
<C>examples</C> directory, the example contained in that file is executed in
487
its simplest form. Some examples accept options which you may use to
488
modify some of the options used in the commands of the example. To find
489
out which options an example accepts, use one of the mechanisms for
490
displaying the example described below.
491
<P/>
492
493
Some examples have both non-interactive and interactive forms; those that
494
are non-interactive only have a name ending in <C>-ni</C>; those that are
495
interactive only have a name ending in <C>-i</C>; examples with names ending
496
in <C>.g</C> also have only one form; all other examples have both
497
non-interactive and interactive forms and for these giving <C>PqStart</C> as
498
second argument invokes <C>PqStart</C> initially and makes the appropriate
499
adjustments so that the example is executed or displayed using
500
interactive functions.
501
<P/>
502
503
If <C>PqExample</C> is called with last (second or third) argument <C>Display</C>
504
then the example is displayed without being executed. If the last
505
argument is a non-empty string <A>filename</A> then the example is also
506
displayed without being executed but is also written to a file with that
507
name. Passing an empty string as last argument has the same effect as
508
passing <C>Display</C>.
509
<P/>
510
511
<E>Note:</E>
512
The variables used in <C>PqExample</C> are local to the running of
513
<C>PqExample</C>, so there's no danger of having some of your variables
514
over-written. However, they are not completely lost either. They are
515
saved to a record <C>ANUPQData.examples.vars</C>, i.e.&nbsp;if <C>F</C> is a variable
516
used in the example then you will be able to access it after <C>PqExample</C>
517
has finished as <C>ANUPQData.examples.vars.F</C>.
518
</Description>
519
</ManSection>
520
521
<ManSection>
522
<Func Name="AllPqExamples" Arg=""/>
523
<Description>
524
returns a list of all currently available examples in default
525
UNIX-listing (i.e.&nbsp;alphabetic) order.
526
</Description>
527
</ManSection>
528
529
<ManSection>
530
<Func Name="GrepPqExamples" Arg="string"/>
531
<Description>
532
runs the UNIX command <C>grep <A>string</A></C> over the &ANUPQ; examples and
533
returns the list of examples for which there is a match. The actual
534
matches are <C>Info</C>-ed at <C>InfoANUPQ</C> level 2.
535
</Description>
536
</ManSection>
537
538
<ManSection>
539
<Func Name="ToPQLog" Arg="[ filename ]"/>
540
<Description>
541
With string argument <A>filename</A>, <C>ToPQLog</C> opens the file with name
542
<A>filename</A> for logging; all commands written to the <C>pq</C> binary (that are
543
<C>Info</C>-ed behind a <Q><C>ToPQ> </C></Q> prompt at <C>InfoANUPQ</C> level 4) are then
544
also written to that file (but without prompts). With no argument,
545
<C>ToPQLog</C> stops logging to whatever file was being logged to. If a file
546
was already being logged to, that file is closed and the file with name
547
<A>filename</A> is opened for logging.
548
</Description>
549
</ManSection>
550
551
</Section>
552
553
554
<Section Label="Attributes and a Property for fp and pc p-groups">
555
<Heading>Attributes and a Property for fp and pc p-groups</Heading>
556
557
<ManSection>
558
<Attr Name="NuclearRank" Arg="G"/>
559
<Attr Name="MultiplicatorRank" Arg="G"/>
560
<Prop Name="IsCapable" Arg="G"/>
561
<Description>
562
return the nuclear rank of <A>G</A>, <M>p</M>-multiplicator rank of <A>G</A>, and
563
whether <A>G</A> is capable (i.e.&nbsp;<K>true</K> if it is, or <K>false</K> if it is not),
564
respectively.
565
<P/>
566
567
These attributes and property are set automatically if <A>G</A> is one of the
568
following:
569
570
<List>
571
<Item>
572
an fp group returned by <C>PqStandardPresentation</C> or
573
<C>StandardPresentation</C> (see&nbsp;<Ref Func="PqStandardPresentation" Style="Text"/>);
574
</Item>
575
<Item>
576
the image (fp group) of the epimorphism returned by an
577
<C>EpimorphismPqStandardPresentation</C> or <C>EpimorphismStandardPresentation</C>
578
call (see&nbsp;<Ref Func="EpimorphismPqStandardPresentation" Style="Text"/>); or
579
</Item>
580
<Item>
581
one of the pc groups of the list of descendants returned by
582
<C>PqDescendants</C> (see&nbsp;<Ref Func="PqDescendants" Style="Text"/>).
583
</Item>
584
</List>
585
586
If <A>G</A> is an fp group or a pc <M>p</M>-group and not one of the above and the
587
attribute or property has not otherwise been set for <A>G</A>, then
588
<C>PqStandardPresentation</C> is called to set all three of <C>NuclearRank</C>,
589
<C>MultiplicatorRank</C> and <C>IsCapable</C>, before returning the value of the
590
attribute or property actually called. Such a group <A>G</A> must know in
591
advance that it is a <M>p</M>-group; this is the case for the groups returned
592
by the functions <C>Pq</C> and <C>PqPCover</C>, and the image group of the
593
epimorphism returned by <C>PqEpimorphism</C>. Otherwise, if you know the group
594
to be a <M>p</M>-group, then this can be set by typing
595
<Listing><![CDATA[
596
SetIsPGroup( G, true );
597
]]></Listing>
598
or by invoking <C>IsPGroup( <A>G</A> )</C>. Note that for an fp group <A>G</A>, the
599
latter may result in a coset enumeration which might not terminate in a
600
reasonable time.
601
<P/>
602
603
<E>Note:</E> For <A>G</A> such that <C>HasNuclearRank(<A>G</A>) = true</C>, <C>IsCapable(<A>G</A>)</C>
604
is equivalent to (the truth or falsity of) <C>NuclearRank( <A>G</A> ) = 0</C>.
605
</Description>
606
</ManSection>
607
608
</Section>
609
610
611
<Section Label="Hints and Warnings regarding the use of Options">
612
<Heading>Hints and Warnings regarding the use of Options</Heading>
613
614
On a first reading we recommend you skip this section and come back to it
615
if and when you run into trouble.
616
<P/>
617
<Index Subkey="of pq program">menu item</Index>
618
<Index Subkey="of pq program is a menu item">option</Index> <!-- FIXME: is this right? -->
619
<E>Note:</E>
620
By <Q>options</Q> we refer to &GAP; options. The <C>pq</C> program also uses the
621
term <Q>option</Q>; to distinguish the two usages of <Q>option</Q>, in this
622
manual we use the term <E>menu item</E> to refer to what the <C>pq</C> program
623
refers to as an <Q>option</Q>.
624
<P/>
625
626
Options are passed to the &ANUPQ; interface functions in either of the
627
two usual mechanisms provided by &GAP;, namely:
628
629
<List>
630
<Item>
631
options may be set globally using the function <C>PushOptions</C>
632
(see Chapter&nbsp;<Ref BookName="ref" Label="Options Stack" Style="Text"/> in the &GAP; Reference Manual); or
633
</Item>
634
<Item>
635
options may be appended to the argument list of any function
636
call, separated by a colon from the argument list (see
637
Chapter&nbsp;<Ref BookName="ref" Label="Function Calls" Style="Text"/> in the &GAP; Reference Manual), in which
638
case they are then passed on recursively to any subsequent inner function
639
call, which may in turn have options of their own.
640
</Item>
641
</List>
642
643
Particularly, when one is using the interactive functions of
644
Chapter&nbsp;<Ref Chap="Interactive ANUPQ functions" Style="Text"/>, one should, in general, avoid
645
using the global method of passing options. In fact, it is recommended
646
that prior to calling <C>PqStart</C> the <C>OptionsStack</C> be empty. The
647
essential problem with setting options globally using the function
648
<C>PushOptions</C> is that options pushed onto <C>OptionsStack</C>, in this way,
649
(generally) remain there until an explicit <C>PopOptions()</C> call is made.
650
<P/>
651
652
In contrast, options passed in the usual way behind a colon following a
653
function's arguments (see <Ref BookName="ref" Label="Function Call With Options" Style="Text"/> in the &GAP; Reference
654
Manual) are local, and disappear from <C>OptionsStack</C> after the function
655
has executed successfully. If the function does <E>not</E> execute
656
successfully, i.e.&nbsp;it runs into error and the user <K>quit</K>s the resulting
657
<C>break</C> loop (see Section&nbsp;<Ref BookName="ref" Label="Break loops" Style="Text"/> in the Reference Manual)
658
rather than attempting to repair the problem and typing <C>return;</C> then,
659
unless the error at the kernel level, the
660
<C>OptionsStack</C> is reset. If an error is detected inside the kernel
661
(hopefully, this should occur only rarely, if at all) then the options of
662
that function will <E>not</E> be cleared from <C>OptionsStack</C>; in such cases:
663
<Example><![CDATA[
664
gap> ResetOptionsStack();
665
#I Options stack is already empty
666
]]></Example>
667
668
is usually necessary (see Chapter&nbsp;<Ref BookName="ref" Func="ResetOptionsStack" Style="Text"/> in the &GAP;
669
Reference Manual), which recursively calls <C>PopOptions()</C> until
670
<C>OptionsStack</C> is empty, or as in the above case warns you that the
671
<C>OptionsStack</C> is already empty.
672
<P/>
673
674
Note that a function, that is passed options after the colon, will also
675
see any global options or any options passed down recursively from
676
functions calling that function, unless those options are over-ridden by
677
options passed via the function. Also, note that duplication of option
678
names for different programs may lead to misinterpretations, and
679
mis-spelled options will not be <Q>seen</Q>.
680
<P/>
681
682
The non-interactive functions of Chapter&nbsp;<Ref Chap="non-interact" Style="Text"/> that have <C>Pq</C> somewhere in their name provide an alternative
683
method of passing options as additional arguments. This has the
684
advantages that options can be abbreviated and mis-spelled options will
685
be trapped.
686
687
<Index>troubleshooting tips</Index>
688
<ManSection>
689
<Var Name="ANUPQWarnOfOtherOptions"/>
690
<Description>
691
is a global variable that is by default <K>false</K>. If it is set to <K>true</K>
692
then any function provided by the &ANUPQ; function that recognises at
693
least one option, will warn you of <Q>other</Q> options, i.e.&nbsp;options that
694
the function does not recognise. These warnings are emitted at
695
<C>InfoWarning</C> or <C>InfoANUPQ</C> level 1. This is useful for detecting
696
mis-spelled options. Here is an example using the function <C>Pq</C> (first
697
described in Chapter&nbsp;<Ref Chap="non-interact" Style="Text"/>):
698
<Log><![CDATA[
699
gap> SetInfoLevel(InfoANUPQ, 1); # Set InfoANUPQ to default level
700
gap> ANUPQWarnOfOtherOptions := true;;
701
gap> # The following makes entry into break loops very ``quiet'' ...
702
gap> OnBreak := function() Where(0); end;;
703
gap> F := FreeGroup( "a", "b" );
704
<free group on the generators [ a, b ]>
705
gap> Pq( F : Prime := 2, Classbound := 1 );
706
#I ANUPQ Warning: Options: [ "Classbound" ] ignored
707
#I (invalid for generic function: `Pq').
708
user interrupt at
709
moreOfline := ReadLine( iostream );
710
Entering break read-eval-print loop ...
711
you can 'quit;' to quit to outer loop, or
712
you can 'return;' to continue
713
]]></Log>
714
715
Here we mistyped <C>ClassBound</C> as <C>Classbound</C>, and after seeing the
716
<C>Info</C>-ed warning that <C>Classbound</C> was ignored, we typed a <A>control</A>-C
717
(that's the <Q><C>user interrupt at</C></Q> message) which took us into a break
718
loop. Since the <C>Pq</C> command was not able to finish, the options <C>Prime</C>
719
and <C>Classbound</C>, in particular, will still be on the <C>OptionsStack</C>:
720
<Log><![CDATA[
721
brk> OptionsStack;
722
[ rec( Prime := 2, Classbound := 1 ),
723
rec( Prime := 2, Classbound := 1, PqEpiOrPCover := "pQuotient" ) ]
724
]]></Log>
725
726
The option <C>PqEpiOrPCover</C> is a behind-the-scenes option that need not
727
concern the user. On <K>quit</K>ting the <C>break</C>-loop the
728
<C>OptionsStack</C> is reset and a warning telling you this is emitted:
729
<Log><![CDATA[
730
brk> quit; # to get back to the `gap>' prompt
731
#I Options stack has been reset
732
]]></Log>
733
734
Above, we altered <C>OnBreak</C> (see&nbsp;<Ref BookName="ref" Func="OnBreak" Style="Text"/> in the Reference manual)
735
to reduce the back-tracing on entry into a break loop. We now restore
736
<C>OnBreak</C> to its usual value.
737
<Example><![CDATA[
738
gap> OnBreak := Where;;
739
]]></Example>
740
741
<E>Notes</E>
742
<P/>
743
744
In cases where functions recursively call others with options (e.g.&nbsp;when
745
using <C>PqExample</C> with options), setting <C>ANUPQWarnOfOtherOptions :=
746
true</C> may give rise to spurious <Q>other</Q> option detections.
747
<P/>
748
749
It is recommended that the novice user set <C>ANUPQWarnOfOtherOptions</C> to
750
<K>true</K> in their <C>gap.ini</C> file (see Section&nbsp;<Ref Sect="Loading the ANUPQ Package" Style="Text"/>).
751
</Description>
752
</ManSection>
753
754
<E>Other Troubleshooting Strategies</E>
755
<P/>
756
757
There are some other strategies which may have helped us to see our error
758
above. The function <C>Pq</C> recognises the option <C>OutputLevel</C>
759
(see&nbsp;<Ref Label="option OutputLevel" Style="Text"/>); if this option is set to at least 1, the <C>pq</C> program
760
provides information on each class quotient as it is generated:
761
<Log><![CDATA[
762
gap> ANUPQWarnOfOtherOptions := false;; # Set back to normal
763
gap> F := FreeGroup( "a", "b" );;
764
gap> Pq( F : Prime := 2, Classbound := 1, OutputLevel := 1 );
765
#I Lower exponent-2 central series for [grp]
766
#I Group: [grp] to lower exponent-2 central class 1 has order 2^2
767
#I Group: [grp] to lower exponent-2 central class 2 has order 2^5
768
#I Group: [grp] to lower exponent-2 central class 3 has order 2^10
769
#I Group: [grp] to lower exponent-2 central class 4 has order 2^18
770
#I Group: [grp] to lower exponent-2 central class 5 has order 2^32
771
#I Group: [grp] to lower exponent-2 central class 6 has order 2^55
772
#I Group: [grp] to lower exponent-2 central class 7 has order 2^96
773
#I Group: [grp] to lower exponent-2 central class 8 has order 2^167
774
#I Group: [grp] to lower exponent-2 central class 9 has order 2^294
775
#I Group: [grp] to lower exponent-2 central class 10 has order 2^520
776
#I Group: [grp] to lower exponent-2 central class 11 has order 2^932
777
#I Group: [grp] to lower exponent-2 central class 12 has order 2^1679
778
[... output truncated ...]
779
]]></Log>
780
781
After seeing the information for the class 2 quotient we may have got the
782
idea that the <C>Classbound</C> option was not recognised and may have
783
realised that this was due to a mis-spelling. The above will ordinarily
784
cause the available space to be exhausted, necessitating
785
user-intervention by typing <A>control</A>-C and <C>quit;</C> (to escape the break
786
loop); otherwise <C>Pq</C> terminates when the class reaches 63 (the default
787
value of <C>ClassBound</C>).
788
<P/>
789
790
If you have some familiarity with <Q>keyword</Q> command input to the <C>pq</C>
791
binary, then setting the level of <C>InfoANUPQ</C> to 4 would also have
792
indicated a problem:
793
<Log><![CDATA[
794
gap> ResetOptionsStack(); # Necessary, if a break-loop was entered above
795
gap> SetInfoLevel(InfoANUPQ, 4);
796
gap> Pq( F : Prime := 2, Classbound := 1 );
797
#I ToPQ> 7 #to (Main) p-Quotient Menu
798
#I ToPQ> 1 #define group
799
#I ToPQ> name [grp]
800
#I ToPQ> prime 2
801
#I ToPQ> class 63
802
#I ToPQ> exponent 0
803
#I ToPQ> output 0
804
#I ToPQ> generators { a,b }
805
#I ToPQ> relators { };
806
[... output truncated ...]
807
]]></Log>
808
809
Here the line <Q><C>#I ToPQ> class 63</C></Q> indicates that a directive to set
810
the classbound to 63 was sent to the <C>pq</C> program.
811
812
</Section>
813
</Chapter>
814
815