2 Mathematical Background and Terminology In this chapter we will give a brief description of the mathematical notions used in the algorithms implemented in the ANU pq program that are made accessible from GAP through this package. For proofs and details we will point to relevant places in the published literature. Also we will try to give some explanation of terminology that may help to use the low-level interactive functions described in Section 'Low-level Interactive ANUPQ functions based on menu items of the pq program'. However, users who intend to use these functions are strongly advised to acquire a thorough understanding of the algorithms from the quoted literature. There is little or no checking done in these functions and naive use may result in incorrect results. 2.1 Basic notions 2.1-1 pc Presentations and Consistency For details, see e.g. [NNN98]. Every finite p-group G has a presentation of the form: \{a_1,\dots,a_n \mid a_i^p = v_{ii}, 1 \le i \le n, [a_k, a_j] = v_{jk}, 1 \le j < k \le n \}.  where v_jk is a word in the elements a_k+1,dots,a_n for 1 le j ≤ k le n. This is called a power-commutator presentation (or pc presentation or pcp) of G, generators from such a presentation will be referred to as pc generators. In terms of such pc generators every element of G can be written in a normal form a_1^e_1dots a_n^e_n with 0 le e_i < p. Moreover any given product of the generators can be brought into such a normal form using the defining relations in the above presentation as rewrite rules. Any such process is called collection. For the discussion of various collection methods see [LGS90] and [VL90b]. Every p-group of order p^n has such a pcp on n generators and conversely every such presentation defines a p-group. However a p-group defined by a pcp on n generators can be of smaller order p^m with m d one relation, having this generator as its right hand side, is marked as definition of this generator. As described in [NNN98], a weighted labelled pcp of a p-group can be obtained stepping down its p-central series. So let us assume that a weighted labelled pcp of G_i is given. A straightforward way of of writing down a (not necessarily consistent) pcp for its p-cover is to add generators, one for each relation which is not a definition, and modify the right hand side of each such relation by multiplying it on the right by one of the new generators -- a different generator for each such relation. Further relations are then added to make the new generators central and of order p. This procedure is called adding tails. A more formal description of it is again given in [NNN98]. It is important to realise that the new generators will generate an elementary abelian group, that is, in additive notation, a vector space over the field of p elements. As said, the pcp of the p-cover obtained in this way need not be consistent. Since the pcp of G_i was consistent, applying the consistency conditions to the pcp of the p-cover, in case the presentation obtained for p-cover is not consistent, will produce a set of equations between the new generators, that, written additively, are linear equations over the field of p elements and can hence be used to remove redundant generators until a consistent pcp is obtained. In reality, to follow this straightforward procedure would be forbiddingly inefficient except for very small examples. There are many ways of a priori reducing the number of new generators to be introduced, using e.g. the weights attached to the generators, and the main part of [NNN98] is devoted to a detailed discussion with proofs of these possibilities. 2.2-2 Imposing the Relations of the fp Group In order to obtain G/P_i+1(G) from the pcp of the p-cover of G_i = G/P_i(G), the defining relations from the original presentation of G must be imposed. Since G_i is a homomorphic image of G, these relations again yield relations between the new generators in the presentation of the p-cover of G_i. 2.2-3 Imposing Laws While we have so far only considered the computation of the factor groups of a given fp group by the groups of its descending p-central series, the p-quotient algorithm allows a very important variant of this idea: laws can be prescribed that should be fulfilled by the p-factor groups computed by the algorithm. The key observation here is the fact that at each step down the descending p-central series it suffices to impose these laws only for a finite number of words. Again for efficiency of the method it is crucial to keep the number of such words small, and much of [NO96] and the literature quoted in this paper is devoted to this problem. In this form, starting with a free group and imposing an exponent law (also referred to as an exponent check) the pq program has, in fact, found its most noted application in the determination of (restricted) Burnside groups (as reported in e.g. [HN80], [NO96] and [VL90a]). Via a GAP program using the local interactive functions of the pq program made available through this interface also arbitrary laws can be imposed via the option Identities (see 6.2). 2.3 The p-group generation Algorithm, Standard Presentation, Isomorphism Testing For details, see [New77] and [O'B90]. The p-group generation algorithm determines the immediate descendants of a given p-group G up to isomorphism. From what has been explained in Section 'Basic notions', it is clear that this amounts to the construction of the p-cover, the extension of the automorphisms of G to the p-cover and the determination of representatives of the orbits of the action of these automorphisms on the set of supplements of the nucleus in the p-multiplicator. The main practical problem here is the determination of these representatives. [O'B90] describes methods for this and the pq program allows choices according to whether space or time limitations must be met. As well as the descendants of G, the pq program determines their automorphism groups from that of G (see [O'B95]), which is important for an iteration of the process; this has been used by Eamonn O'Brien, e.g. in the classification of the 2-groups that are now also part of the Small Groups library available through GAP. A variant of the p-group generation algorithm is also used to define a standard presentation of a given p-group. This is done by constructing an isomorphic copy of the given group through a chain of descendants and at each step making a choice of a particular representative for the respective orbit of capable groups. In a fairly delicate process, subgroups of the p-multiplicator are represented by echelonised matrices and a first among the labels for standard matrices is chosen (this is described in detail in [O'B94]). Finally, the standard presentation provides a way of testing if two given p-groups are isomorphic: the standard presentations of the groups are computed, for practical purposes compacted and the results compared for being identical, i.e. the groups are isomorphic if and only if their standard presentations are identical.