HAP home

## ALPHABETICAL LIST OF HAP FUNCTIONS

AddFreeWords(v,w) | Inputs two words v,w in a free ZG-module and returns their sum v+w. If the characteristic of Z is greater than 0 then the next function should be more efficient.
AddFreeWordsModP(v,w,p) | Inputs two words v,w in a free ZG-module and the characteristic p of Z. It returns the sum v+w. If p=0 the previous function might be fractionally quicker.
AlgebraicReduction(w) AlgebraicReduction(w,p) | Inputs a word w in a free ZG-module and returns a reduced version of the word in which all pairs of mutually inverse letters have been cancelled. The reduction is performed in a free abelian group unless the characteristic p of Z is entered.

BaerInvariant(G,c)

Inputs a nilpotent group G and integer c>0. It returns the Baer invariant M(c)(G) defined as follows.
For an arbitrary group G let L*c+1(G) be the (c+1)-st term of the upper central series of the group U=F/[[[R,F],F]...] (with c copies of F in the denominator) where F/R is any free presentation of G. This is an invariant of G and we define M(c)(G) to be the kernel of the canonical homomorphism M(c)(G)→G. For c=1 the Baer invariant M(1)(G) is isomorphic to the second integral homology H2(G,Z).
This function requires the NQ package.

BigStepLCS(G,n) | Inputs a group G and a positive integer n. It returns a subseries G=L1>L2>...Lk=1 of the lower central series of G such that Li/Li+1 has order greater than n.
BoundaryMap(C) | Inputs a resolution, chain complex or cochain complex C and returns the function C!.boundary.
BoundaryMatrix(C,n) | Inputs a chain or cochain complex C and integer n>0. It returns the n-th boundary map of C as a matrix.

CayleyGraphDisplay(G,X)
CayleyGraphDisplay(G,X,"mozilla")

Inputs a finite group G together with a subset X of G. It displays the corresponding Cayley graph as a .gif file. It uses the Mozilla web browser as a default to view the diagram. An alternative browser can be set using a second argument.
The argument G can also be a finite set of elements in a (possibly infinite) group containing X. The edges of the graph are coloured according to which element of X they are labelled by. The list X corresponds to the list of colours [blue, red, green, yellow, brown, black] in that order.
This function requires Graphviz software.

ChevalleyEilenberg
Complex(X,n)

Inputs either a Lie algebra X=A (over the ring of integers Z or over a field K) or a homomorphism of Lie algebras X=(f:A→B), together with a positive integer n. It returns either the first n terms of the Chevalley-Eilenberg chain complex C(A), or the induced map of Chevalley-Eilenberg complexes C(f):C(A)→C(B).
(The homology of the Chevalley-Eilenberg complex C(A) is by definition the homology of the Lie algebra A with trivial coefficients in Z or K).
This function was written by Pablo Fernandez Ascariz

Coclass(G) | Inputs a group G of prime-power order pn and nilpotency class c say. It returns the integer r=n-c .
CocycleCondition(R,n) | Inputs a resolution R and an integer n>0. It returns an integer matrix M with the following property. Suppose d=R.dimension(n). An integer vector f=[f1, ..., fd] then represents a ZG-homomorphism Rn → Zq which sends the ith generator of Rn to the integer fi in the trivial ZG-module Zq (where possibly q=0). The homomorphism f is a cocycle if and only if Mtf=0 mod q.

Cohomology(X)

Inputs either a cochain complex X=C or a cochain map X=(C→D) over the integers Z.

- If X=C then the torsion coefficients of Hn(C) are retuned.
- If X=(C→D) then the induced homomorphism Hn(C) → Hn(D) is returned as a homomorphism of finitely presented groups.

Compose(f,g) | Inputs two FpG-module homomorphisms f:M→N and g:L→M with Source(f)=Target(g) . It returns the composite homomorphism fg:L→N . This also applies to group homomorphisms f,g.
CoxeterDiagram Components(D) | Inputs a Coxeter diagram D and returns a list [D1, ..., Dd] of the maximal connected subgraphs Di.
CoxeterDiagram Degree(D,v) | Inputs a Coxeter diagram D and vertex v. It returns the degree of v (i.e. the number of edges incident with v).
CoxeterDiagramDisplay(D) CoxeterDiagramDisplay(D,"mozilla") | Inputs a Coxeter diagram D and displays it as a .gif file. It uses the Mozilla web browser as a default to view the diagram. An alternative browser can be set using a second argument. This function requires Graphviz software.
CoxeterDiagram FpArtinGroup(D) | Inputs a Coxeter diagram D and returns the corresponding finitely presented Artin group.
CoxeterDiagram FpCoxeterGroup(D) | Inputs a Coxeter diagram D and returns the corresponding finitely presented Coxeter group.
CoxeterDiagram IsSpherical(D) | Inputs a Coxeter diagram D and returns "true" if the associated Coxeter groups is finite, and returns "false" otherwise.
CoxeterDiagram Matrix(D) | Inputs a Coxeter diagram D and returns a matrix representation of it. The matrix is given as a function DiagramMatrix(D)(i,j) where i,j can range over the vertices.
CoxeterSubDiagram(D,V) | Inputs a Coxeter diagram D and a subset V of its vertices. It returns the full sub-diagram of D with vertex set V.
CoxeterDiagram Vertices(D) | Inputs a Coxeter diagram D and returns its set of vertices.
Dimension(C) Dimension(M) | Inputs a resolution, chain complex or cochain complex C and returns the function C!.dimension . Alternatively, inputs an FpG-module M and returns its dimension as a vector space over the field of p elements.
DirectSumOfFpGModules(M,N) DirectSumOfFpG Modules([ M[1], M[2], ..., M[k] ])) | Inputs two FpG-modules M and N with common group G. It returns the direct sum of M and N as an FpGModule. Alternatively, the function can input a list of FpG-modules with common group G. It returns the direct sum of the list.

EpiCentre(G,N)
EpiCentre(G)

Inputs a finite group G and normal subgroup N and returns a subgroup Z*(G,N) of the centre of N. The group Z*(G,N) is trivial if and only if there is a crossed module d:E → G with N=Image(d) and with Ker(d) equal to the subgroup of E consisting of those elements on which G acts trivially.
If no value for N is entered then it is assumed that N=G. In this case the group Z*(G,G) is trivial if and only if G is isomorphic to a quotient G=E/Z(E) of some group E by the centre of E. (See also the command UpperEpicentralSeries(G,c). )

EquivariantChain
Map(R,S,f)

Inputs a ZG-resolution R, a ZG'-resolution S, and a group homomorphism f : G → G'. It outputs a component object M with the following components.

- M!.source is the resolution R.
- M!.target is the resolution S.
- M!.mapping(w,n) is a function which gives the image in Sn, under a chain map induced by f, of a word w in Rn. (Here Rn and Sn are the n-th modules in the resolutions R and S.)
- F!.properties is a list of pairs such as ["type", "equivariantChainMap"].

The resolution S must have a contracting homotopy.

EvaluateProperty(X,"name") | Inputs a component object X (such as a ZG-resolution or chain map) and a string "name" (such as "characteristic" or "type"). It searches X.property for the pair ["name",value] and returns value. If X.property does not exist, or if ["name",value] does not exist, it returns fail.
EvenSubgroup(G) | Inputs a group G and returns a subgroup G+. The subgroup is that generated by all products xy where x and y range over the generating set for G stored by GAP. The subgroup is probably only meaningful when G is an Artin or Coxeter group.
ExpansionOfRational Function(f,n) | Inputs a positive integer n and a rational function f(x)=p(x)/q(x) where the degree of the polynomial p(x) is less than that of q(x). It returns a list [a0 , a1 , a2 , a3 , ... ,an] of the first n+1 coefficients of the infinite expansion f(x) = a0 + a1x + a2x2 + a3x3 + ... .
FpGModule(A,G) | Inputs a p-group G and a matrix A whose rows have length a multiple of the order of G. It returns an FpG-module generated by the rows of A.

FpGModuleDualBasis(M)

Inputs an FpG-module M. It returns a record R with two components:

- R.freeModule is the free module FG of rank one.
- R.basis is a list representing an F-basis for the module HomFG(M,FG). Each term in the list is a matrix A whose rows are vectors in FG such that M!.generators[i] → A[i] extends to a module homomorphism M→FG.

FpGModule
Homomorphism(M,N,A)
FpGModule
HomomorphismNC(M,N,A)

Inputs FpG-modules M and N over a common p-group G. Also inputs a list A of vectors in the vector space spanned by N!.matrix. It tests that the function
M!.generators[i] → A[i]
extends to a homomorphism of FpG-modules and, if the test is passed, returns the corresponding FpG-module homomorphism. If the test is failed it returns fail.
The "NC" version of the function assumes that the input defines a homomorphism and simply returns the FpG-module homomorphism.

FpGOmega(R,n) | Inputs a positive integer n and at least n terms of an FG-resolution R, where G is a finite p-group and F is the field of p elements. It returns the kernel of the nth boundary homomorphism as an FpG-module.
FpGRadicalModule(M) | Inputs an FpG-module M and returns the Radical of M as an FpG-module.
GeneratorsOfFpGModule(M) | Inputs an FpG-module M and returns a matrix whose rows correspond to a minimal generating set for M.
GraphOfGroupsDisplay(D) GraphOfGroupsDisplay(D,"mozilla") | Inputs a graph of groups D and displays it as a .gif file. It uses the Mozilla web browser as a default to view the diagram. An alternative browser can be set using a second argument. This function requires Graphviz software.
GraphOfGroupsTest(D) | Inputs an object D and tests whether it is a Graph of Groups. However, it DOES NOT test the injectivity of any homomorphisms. It returns true if D passes the test, and false otherwise.

GroupCohomology(X,n)
GroupCohomology(X,n,p)

Inputs a positive integer n and either a finite group X=G or a Coxeter diagram X=D representing an infinite Artin group G. It returns the torsion coefficients of the integral cohomology Hn(G,Z).
There is an optional third argument which, when set equal to a prime p, causes the function to return the the mod p cohomology Hn(G,Zp) as a list of length equal to its rank.
This function is a composite of more basic functions, and makes choices for a number of parameters. For a particular group you would almost certainly be better using the more basic functions and making the choices yourself!

GroupHomology(X,n)
GroupHomology(X,n,p)

Inputs a positive integer n and either a finite group X=G or a Coxeter diagram X=D representing an infinite Artin group G. It returns the torsion coefficients of the integral homology Hn(G,Z).
There is an optional third argument which, when set equal to a prime p, causes the function to return the mod p homology Hn(G,Zp) as a list of lenth equal to its rank..
This function is a composite of more basic functions, and makes choices for a number of parameters. For a particular group you would almost certainly be better using the more basic functions and making the choices yourself!

GroupOfResolution(R) | Inputs a ZG-resolution R and returns the group G.
HAPcopyright() | This function provides details of HAP'S GNU public copyright licence.

Homology(X,n)

Inputs either a chain complex X=C or a chain map X=(C→D).

- If X=C then the torsion coefficients of Hn(C) are retuned.
- If X=(C→D) then the induced homomorphism Hn(C) → Hn(D) is returned as a homomorphism of finitely presented groups.

HomologyPb(C,n)

This is a back-up function which might work in some instances where Homology(C,n) fails. It is most useful for chain complexes whose boundary homomorphisms are sparse.
It inputs a chain complex C in characteristic 0 and returns the torsion coefficients of Hn(C) . There is a small probability that an incorrect answer could be returned. The computation relies on probabilistic Smith Normal Form algorithms implemented in the Simplicial Homology GAP package. This package therefore needs to be loaded.
The choice of probabalistic algorithm can be changed using the command
SetHomologyAlgorithm(HomologyAlgorithm[i]);
where i = 1,2,3 or 4. The upper limit for the probability of an incorrect answer can be set to any rational number 0<e<=1 using the following command.
SetUncertaintyTolerence(e);
See the Simplicial Homology package manual for further details.

HomToIntegers(X) | Inputs either a ZG-resolution X =R, or an equivariant chain map X = (F:R→S). It returns the cochain complex or cochain map obtained by applying HomZG( _ , Z) where Z is the trivial module of integers (characteristic 0).
HomToIntegersModP(R) | Inputs a ZG-resolution R and returns the cochain complex obtained by applying HomZG( _ , Zp) where Zp is the trivial module of integers mod p. (At present this function does handle equivariant chain maps.)
HomToIntegralModule(R,f) | Inputs a ZG-resolution R and a group homomorphism f:G → GLn(Z) to the group of n×n invertible integer matrices. Here Z must have characteristic 0. It returns the cochain complex obtained by applying HomZG( _ , A) where A is the ZG-module Zn with G action via f. (At present this function does not handle equivariant chain maps.)
ImageOfFpGModule Homomorphism(f) | Inputs an FpG-module homomorphism f:M→N and returns its image f(M) as an FpG-module.

IntegralRingGenerators(R,n)

Inputs at least n+1 terms of a ZG-resolution and integer n>0. It returns a minimal list of cohomology classes in Hn(G,Z) which, together with all cup products of lower degree classes, generate the group Hn(G,Z) .
(Let ai be the i-th canonical generator of the d-generator abelian group Hn(G,Z). The cohomology class n1a1 + ... +ndad is represented by the integer vector u=(n1, ..., nd). )

IntegralCup
Product(R,u,v,p,q)
IntegralCup
Product(R,u,v,p,q,P,Q,N)
Various functions used to construct the cup product
are also available.

Inputs a ZG-resolution R, a vector u representing an element in Hp(G,Z), a vector v representing an element in Hq(G,Z) and the two integers p,q > 0. It returns a vector w representing the cup product u·v in Hp+q(G,Z). This product is associative and u·v = (-1)pqv·u . It provides H*(G,Z) with the structure of an anti-commutative graded ring. The cup product is currently implemented for characteristic 0 only.
The resolution R needs a contracting homotopy.
To save the function from having to calculate the abelian groupsHn(G,Z) additional input variables can be used in the form IntegralCupProduct(R,u,v,p,q,P,Q,N) , where

- P is the output of the command CR_CocyclesAndCoboundaries(R,p,true)
- Q is the output of the command CR_CocyclesAndCoboundaries(R,q,true)
- N is the output of the command CR_CocyclesAndCoboundaries(R,p+q,true) .

IntersectionOfFpG Modules(M,N) | Inputs two FpG-modules M, N arising as submodules in a common free module (FG)n where G is a p-group and F the field of p-elements. It returns the FpG-Module arising as the intersection of M and N.

IsAspherical(F,R)

Inputs a free group F and a set R of words in F. It performs a test on the 2-dimensional CW-space K associated to this presentation for the group G=F/<R>F.
The function returns "true" if K has trivial second homotopy group. In this case it prints: Presentation is aspherical.
Otherwise it returns "fail" and prints: Presentation is NOT piece-wise Euclidean non-positively curved. (In this case K may or may not have trivial second homotopy group. But it is NOT possible to impose a metric on K which restricts to a Euclidean metric on each 2-cell.)
The function uses Polymake software.

IsFpGModule HomomorphismData(M,N,A) | Inputs FpG-modules M and N over a common p-group G. Also inputs a list A of vectors in the vector space spanned by N!.matrix. It returns true if the function M!.generators[i] → A[i] extends to a homomorphism of FpG-modules. Otherwise it returns false.
IsLieAlgebraHomomorphism(f) | Inputs an object f and returns true if f is a homomorphism f:A→B of Lie algebras (preserving the Lie bracket).
IsSuperperfect(G) | Inputs a group G and returns "true" if both the first and second integral homology of G is trivial. Otherwise, it returns "false".

LeibnizComplex(X,n)

Inputs either a Lie or Leibniz algebra X=A (over the ring of integers Z or over a field K) or a homomorphism of Lie or Leibniz algebras X=(f:A→B), together with a positive integer n. It returns either the first n terms of the Leibniz chain complex C(A), or the induced map of Leibniz complexes C(f):C(A)→C(B).
(The Leibniz complex C(A) was defined by J.-L.Loday. Its homology is by definition the Leibniz homology of the algebra A).
This function was written by Pablo Fernandez Ascariz

LeibnizAlgebraHomology(A,n) | Inputs a Lie or Leibniz algebra X=A (over the ring of integers Z or over a field K), together with a positive integer n. It returns the n-dimensional Leibniz homology of A
Length(R) | Inputs a resolution R and returns its length (i.e. the number of terms of R that Hap has computed).
LieAlgebraHomology(A,n) | Inputs a Lie algebra A (over the integers or a field) and a positive integer n. It returns the homology Hn(A,k) where k denotes the ground ring.

LowerCentralSeries
LieAlgebra(G)
LowerCentralSeries
LieAlgebra(f)

Inputs a pcp group G. If each quotient Gc/Gc+1 of the lower central series is free abelian or p-elementary abelian (for fixed prime p) then a Lie algebra L(G) is returned. The abelian group underlying L(G) is the direct sum of the quotients Gc/Gc+1 . The Lie bracket on L(G) is induced by the commutator in G. (Here G1=G, Gc+1=[Gc,G] .)
The function can also be applied to a group homomorphism f:G→G' . In this case the induced homomorphism of Lie algebras L(f):L(G) → L(G') is returned.
If the quotients of the lower central series are not all free or p-elementary abelian then the function returns fail.
This function was written by Pablo Fernandez Ascariz

Map(f) | Inputs a chain map, or cochain map or equivariant chain map f and returns the mapping function (as opposed to the target or the source of f) .

ModPCohomologyRing(G,n)
ModPCohomologyRing(R)

Inputs either a p-group G and positive integer n, or else n terms of a minimal ZpG-resolution R of Zp. It returns the cohomology ring A=H*(G,Zp) modulo all elements in degree greater than n.
The ring is returned as a structure constant algebra A.
The ring A is graded. It has a component A!.degree(x) which is a function returning the degree of each (homogeneous) element x in GeneratorsOfAlgebra(A).

ModPRingGenerators(A) | Inputs a mod p cohomology ring A (created using the preceeding function). It returns a generating set for the ring A. Each generator is homogeneous.
MultipleOfFpGModule(w,M) | Inputs an FpG-module M and a list w:=[g1 , ..., gt] of elements in the group G=M!.group. The list w can be thought of as representing the element w=g1 + ...+ gt in the group algebra FG, and the function returns a semi-echelon matrix B which is a basis for the vector subspace wM .
MultiplyWord(n,w) | Inputs a word w and integer n. It returns the scalar multiple n·w .
Negate([i,j]) | Inputs a pair [i,j] of integers and returns [-i,j].
NegateWord(w) | Inputs a word w in a free ZG-module and returns the negated word -w.

NonabelianExterior
Product(G,N)

Inputs a finite group G and normal subgroup N. It returns a record E with the following components.

- E.homomorphism is a group homomorphism µ : G^N → G from the nonabelian exterior product G^N to G. The kernel of µ is the relative Schur multiplier.
- E.pairing(x,y) is a function which inputs an element x in G and an element y in N and returns x ^ y in the exterior product G^N .

This function should work for reasonably small nilpotent groups or extremely small non-nilpotent groups.

NonabelianTensor
Product(G,N)

Inputs a finite group G and normal subgroup N. It returns a record E with the following components.

- E.homomorphism is a group homomorphism µ : G(×)N → G from the nonabelian exterior product G(×)N to G.
- E.pairing(x,y) is a function which inputs an element x in G and an element y in N and returns x (×) y in the tensor product G(×)N .

This function should work for reasonably small nilpotent groups or extremely small non-nilpotent groups.

NonabelianTensorSquare(G)
NonabelianTensorSquare(G,m)

Inputs a finite or nilpotent infinite group G and returns a record T with the following components.

- T.homomorphism is a group homomorphism µ : G(×)G → G from the nonabelian tensor square of G to G. The kernel of µ is isomorphic to the third homotopy group of the suspension SK(G,1) of an Eilenberg-Mac Lane space.
- T.pairing(x,y) is a function which inputs two elements x, y in G and returns the tensor x (×) y in the tensor square G (×) G .

An optional second varible m can be set equal to a multiple of the order of the tensor square G(×)G . This might help when G is solvable but not nilpotent (especially if the estimated upper bound m is reasonable accurate) as the bound is used in the solvable quotient algorithm.
The optional second variable m can also be set equal to 0. In this case the Todd-Coxeter procedure will be used to enumerate the tensor square even when G is solvable.
This function should work for reasonably small solvable groups or extremely small non-solvable groups.

OrbitPolytope(G,v,L)

Inputs a permutation group or matrix group G of degree n and a rational vector v of length n. In both cases there is a natural action of G on v. Let P(G,v) be the convex polytope arising as the convex hull of the Euclidean points in the orbit of v under the action of G. The function also inputs a sublist L of the following list of strings:
["dimension","vertex_degree", "visual_graph", "schlegel","visual"]
Depending on the sublist, the function:

- prints the dimension of the orbit polytope P(G,v);
- prints the degree of a vertex in the graph of P(G,v);
- visualizes the graph of P(G,v);
- visualizes the Schlegel diagram of P(G,v);
- visualizes P(G,v) if the polytope is of dimension 2 or 3.

PermToMatrixGroup(G,n) | Inputs a permutation group G and its degree n. Returns a bijective homomorphism f:G → M where M is a group of permutation matrices.

PoincareSeries(G,n)
PoincareSeries(R,n)
PoincareSeries(L,n)
PoincareSeries(G)

Inputs a finite p-group G and a positive integer n. It returns a quotient of polynomials f(x)=P(x)/Q(x) whose coefficient of xk equals the rank of the vector space Hk(G,Zp) for all k in the range k=1 to k=n. (The second input variable can be omitted, in which case the function tries to choose a "reasonable" value for n.)
In place of the group G the function can also input (at least n terms of) a minimal mod p resolution R for G.
Alternatively, the first input variable can be a list L of integers. In this case the coefficient of xk in f(x) is equal to the (k+1)st term in the list.

PoincareSeriesPrimePart(G,p,n) | Inputs a finite group G, a prime p, and a positive integer n. It returns a quotient of polynomials f(x)=P(x)/Q(x) whose coefficient of xk equals the rank of the vector space Hk(G,Zp) for all k in the range k=1 to k=n. The efficiency of this function needs to be improved.

PolytopalComplex(G,v)
PolytopalComplex(G,v,n)

Inputs a permutation group or matrix group G of degree n and a rational vector v of length n. In both cases there is a natural action of G on v. Let P(G,v) be the convex polytope arising as the convex hull of the Euclidean points in the orbit of v under the action of G. The cellular chain complex C*=C*(P(G,v)) is an exact sequence of (not necessarily free) ZG-modules. The function returns a component object R with components:

- R!.dimension(k) is a function which returns the number of G-orbits of the k-dimensional faces in P(G,v). If each k-face has trivial stabilizer subgroup in G then Ck is a free ZG-module of rank R.dimension(k).
- R!.stabilizer(k,n) is a function which returns the stabilizer subgroup for a face in the n-th orbit of k-faces.
- If all faces of dimension <k+1 have trivial stabilizer group then the first k terms of C* constitute part of a free ZG-resolution. The boundary map is described by the function boundary(k,n) . (If some faces have non-trivial stabilizer group then C* is not free and no attempt is made to determine signs for the boundary map.)
- R!.elements, R!.group, R!.properties are as in a ZG-resolution.

If an optional third input variable n is used, then only the first n terms of the resolution C* will be computed.
The function uses Polymake software.

PolytopalGenerators(G,v)

Inputs a permutation group or matrix group G of degree n and a rational vector v of length n. In both cases there is a natural action of G on v, and the vector v must be chosen so that it has trivial stabilizer subgroup in G. Let P(G,v) be the convex polytope arising as the convex hull of the Euclidean points in the orbit of v under the action of G. The function returns a record P with components:

- P.generators is a list of all those elements g in G such that g·v has an edge in common with v. The list is a generating set for G.
- P.vector is the vector v.
- P.hasseDiagram is the Hasse diagram of the cone at v.

The function uses Polymake software.
The function is joint work with Seamus Kelly.

Prank(G) | Inputs a p-group G and returns the rank of the largest elementary abelian subgroup. (The implementation of this function is extremely naive!!)

PresentationOfResolution(R)

Inputs at least two terms of a reduced ZG-resolution R and returns a record P with components

- P.freeGroup is a free group F
- P.relators is a list S of words in F

where G is isomorphic to F modulo the normal closure of S. This presentation for G corresponds to the 2-skeleton of the classifying CW-space from which R was constructed. The resolution R requires no contracting homotopy.

PrimePartDerived
Functor(G,R,F,n)

Inputs a finite group G, a positive integer n, at least n+1 terms of a ZP-resolution for a Sylow subgroup P<G and a "mathematically suitable" covariant additive functor F such as TensorWithIntegers . It returns the abelian invariants of the p-component of the homology Hn(F(R)) .
Warning: All calculations are assumed to be in characteristic 0. The function should not be used if the coefficient module is over the field of p elements.
"Mathematically suitable" means that the Cartan-Eilenberg double coset formula must hold.

PrintZGword(w,elts) | Inputs a word w in a free ZG-module and a (possibly partial but sufficient) listing elts of the elements of G. The function prints the word w to the screen in the form r1E1 + ... + rnEn where ri are elements in the group ring ZG, and Ei denotes the i-th free generator of the module.
ProjectedFpGModule(M,k) | Inputs an FpG-module M of ambient dimension n|G|, and an integer k between 1 and n. The module M is a submodule of the free module (FG)n . Let Mk denote the intersection of M with the k-th summand of (FG)n . The function returns Mk as an FpG-module with ambient diemnsio n|G|.
RandomHomomorphismOf FpGModules(M,N) | Inputs two FpG-modules M and N over a common group G. It returns a random matrix A whose rows are vectors in N such that the function M!.generators[i] → A[i] extends to a homomorphism M→N of FpG-modules.
Rank(f) | Inputs an FpG-module homomorphism f:M→N and returns the dimension of the image of f as a vector space over the field F of p elements.

RankHomologyPGroup(G,n)
RankHomologyPGroup(R,n)
RankHomology
PGroup(G,n,"empirical")

Inputs a (smallish) p-group G, or n terms of a minimal ZpG-resolution R of Zp , together with a positive integer n. It returns the minimal number of generators of the integral homology group Hn(G,Z).
If an option third string argument "empirical" is included then an empirical algorithm will be used. This is one which always seems to yield the right answer but which we can't prove yields the correct answer.

RankPrimeHomology(G,n) | Inputs a (smallish) p-group G together with a positive integer n. It returns a function dim(k) which gives the rank of the vector space Hk(G,Zp) for all 0 <= k <= n
RelativeSchurMultiplierG,N) | Inputs a finite group G and normal subgroup N. It returns the homology group H2(G,N,Z) that fits into the exact sequence ··· → H3(G,Z) → H3(G/N,Z) → H2(G,N,Z) → H3(G,Z) → H3(G/N,Z) → ···. This function should work for reasonably small nilpotent groups G or extremely small non-nilpotent groups.
ResolutionAbelianGroup(L,n) ResolutionAbelianGroup(G,n) | Inputs a list L:=[m1,m2, ..., md] of nonnegative integers, and a positive integer n. It returns n terms of a ZG-resolution for the abelian group G=ZL[1]+ZL[2]+···+ZL[d] . If G is finite then the first argument can also be the abelian group G itself.
ResolutionAlmostCrystalGroup(G,n) | Inputs a positive integer n and an almost crystallographic pcp group G. It returns n terms of a free ZG-resolution. (A group is almost crystallographic if it nilpotent-by-finite and has no non-trivial finite normal subgroup. Such groups can be constructed using the ACLIB package.)

ResolutionAlmostCrystal
Quotient(G,n,c)
ResolutionAlmostCrystal
Quotient(G,n,c,false)

An almost crystallographic group G is an extension of a finite group P by a nilpotent group T, and has no non-trivial finite normal subgroup. We define the relative lower central series by setting T1=T and Ti+1=[Ti,G].
This function inputs an almost crystallographic group G together with positive integers n and c. It returns n terms of a free ZQ-resolution R for the group Q=G/Tc .
In addition to the usual components, the resolution R has the component R.quotientHomomorphism which gives the quotient homomorphism G→Q.
If a fourth optional variable is set equal to "false" then the the function omits to test whether Q is finite and a "more canonical" resolution is constructed.

ResolutionArtinGroup(D,n)

Inputs a Coxeter diagram D and an integer n>1. It returns n terms of a free ZG-resolution R where G is the Artin monoid associated to D. It is conjectured that R is also a free resolution for the Artin group G. The conjecture is known to hold in certain cases.
G=R.group is infinite and returned as a finitely presented group. The list R.elts is a partial listing of the elements of G which grows as R is used. Initially R.elts is empty and then, any time the boundary of a resolution generator is called, R.elts is updated to include elements of G involved in the boundary.
The contracting homotopy on R has not yet been implemented! Furthermore, the group G is currently returned only as a finitely presented group (without any method for solving the word problem).

ResolutionAspherical
Presentation(F,R,n)

Inputs a free group F, a set R of words in F which constitute an aspherical presentation for a group G, and a positive integer n. (Asphericity can be a difficult property to verify. The function IsAspherical(F,R) could be of help.)
The function returns n terms of a free ZG-resolution R which has generators in dimensions <3 only. No contracting homotopy on R will be returned.

ResolutionDirectProduct(R,S) ResolutionDirect Product(R,S,"internal") | Inputs a ZG-resolution R and ZH-resolution S. It outputs a ZD-resolution for the direct product D=G×H. If G and H lie in a common group K, and if they commute and have trivial intersection, then an optional third variable "internal" can be used. This will force D to be the subgroup GH in K.

ResolutionExtension(g,R,S)
ResolutionExtension
(g,R,S,"TestFiniteness")
ResolutionExtension
(g,R,S,"NoTest",GmapE)

Inputs a surjective group homomorphism g:E→G with kernel N. It also inputs a ZN-resolution R and a ZG-resolution S. It returns a ZE-resolution. The groups E and G can be infinite.
If an optional fourth argument is set equal to "TestFiniteness" then the groups N and G will be tested to see if they are finite. If they are finite then some speed saving routines will be invoked.
If the homomorphism g is such that the GAP function PreImagesElement(g,x) doesn't work, then a function GmapE() should be included as a fifth input. For any x in G this function should return an element GmapE(x) in E which gets mapped onto x by g.
The contracting homotopy on the ZE-resolution has not yet been fully implemented for infinite groups!

ResolutionFiniteDirectProduct(R,S)
ResolutionFiniteDirect
Product(R,S,"internal")

Inputs a ZG-resolution R and ZH-resolution S where G and H are finite groups. It outputs a ZD-resolution for the direct product D=G×H.
If G and H lie in a common group K, and if they commute and have trivial intersection, then an optional third variable "internal" can be used. This will force D to be the subgroup GH in K.

ResolutionFiniteExtension
(gensE,gensG,R,n)
ResolutionFiniteExtension
(gensE,gensG,R,n,true)
ResolutionFiniteExtension
(gensE,gensG,R,n,false,S)

Inputs: a set gensE of generators for a finite group E; a set gensG equal to the image of gensE in a quotient group G of E; a ZG-resolution R up to dimension at least n; a positive integer n. It uses the TwistedTensorProduct() construction to return n terms of a ZE-resolution.
The function has an optional fourth argument which, when set equal to true, invokes tietze reductions in the construction of a resolution for the kernel of E-->G.
If a ZN-resolution S is available, where N is the kernel of the quotient E→G, then this can be incorporated into the computations using an optional fifth argument.

ResolutionFinite
Group(gens,n)
ResolutionFinite
Group(gens,n,true)
ResolutionFinite
Group(gens,n,false,p)

Inputs a set gens of generators for a finite group G and a positive integer n. It outputs n terms of a ZG-resolution.
The function has an optional third argument which, when set equal to true, invokes tietze reductions in the construction of the resolution.
The function has an optional fourth argument which, when set equal to a prime p, records the fact that the resolution will only be used for mod p calculations. This could speed up subsequent constructions.

ResolutionFinite
Subgroup(R,K)
ResolutionFinite
Subgroup(R,gensG,gensK)

Inputs a ZG-resolution for a finite group G and a subgroup K of index |G:K|. It returns a free ZK-resolution whose ZK-rank is |G:K| times the ZG-rank in each dimension.
Generating sets gensG, gensK for G and K can also be input to the function (though the method does not depend on a choice of generators).
This ZK-resolution is not reduced. ie.e it has more than one generator in dimension 0.

ResolutionFpGModule(M,n) | Inputs an FpG-module M and a positive integer n. It returns n terms of a minimal free FG-resolution of the module M (where G is a finite p-group and F the field of p elements).

ResolutionGraphOfGroups(D,n)
ResolutionGraphOfGroups(D,n,L)

Inputs a graph of groups D and a positive integer n. It returns n terms of a free ZG-resolution for the fundamental group G of D.
An optional third argument L=[R1 , ..., Rt] can be used to list (in any order) free resolutions for some/all of the vertex and edge groups in D. If for some vertex or edge group no resolution is listed in L then the function ResolutionFiniteGroup() will be used to try to construct the resolution.
The ZG-resolution is usually not reduced. i.e. it has more than one generator in dimension 0.
The contracting homotopy on the ZG-resolution has not yet been implemented! Furthermore, the group G is currently returned only as a finitely presented group (without any method for solving the word problem).

ResolutionNilpotentGroup(G,n)
ResolutionNilpotentGroup
(G,n,"TestFiniteness")

Inputs a nilpotent group G and positive integer n. It returns n terms of a free ZG-resolution. The resolution is computed using a divide-and-conquer technique involving the lower central series.
This function can be applied to infinite groups G. For finite groups the function ResolutionNormalSeries() probably gives better results.
If an optional third argument is set equal to "TestFiniteness" then the groups N and G will be tested to see if they are finite. If they are finite then some speed saving routines will be invoked.
The contracting homotopy on the ZE-resolution has not yet been fully implemented for infinite groups.

ResolutionNormalSeries(L,n)
ResolutionNormalSeries
(L,n,true)
ResolutionNormalSeries
(L,n,false,p)

Inputs a positive integer n and a list L = [L1 , ..., Lk] of normal subgroups Li of a finite group G satisfying G = L1>L2 ... >Lk. Alternatively, L = [gensL1, ... gensLk] can be a list of generating sets for the Li (and these particular generators will be used in the construction of resolutions). It returns a Z(G)-resolution by repeatedly using the function ResolutionFiniteExtension().
The function has an optional third argument which, if set equal to true, invokes tietze reductions in the construction of resolutions.
The function has an optional fourth argument which, if set equal to p>0, produces a resolution which is only valid for mod p calculations.

ResolutionPrimePowerGroup(G,n)
ResolutionPrimePower
Group(G,n,"save space")

Inputs a p-group G and integer n>0. It uses GAP's standard linear algebra functions over the field Zp to construct a ZG-resolution for mod p calculations only. The resolution is minimal - meaning that the number of generators of Rn equals the rank of Hn(G,Zp).
If an optional third variable is set equal to the string "save space" then the resolution will take a little longer to compute but less space will be needed.

ResolutionSmallFpGroup(G,n)
ResolutionSmallFpGroup(G,n,p)

Inputs a small finitely presented group G and an integer n>0. It returns n terms of a ZG-resolution which, in dimensions 1 and 2, corresponds to the given presentation for G. The method returns no contracting homotopy for the resolution.
The function has an optional fourth argument which, when set equal to a prime p, records the fact that the resolution will only be used for mod p calculations. This could speed up subsequent constructions.
This function was written by Irina Kholodna.

Resolution
Subgroup(R,K)

Inputs a ZG-resolution for an (infinite) group G and a subgroup K of finite index |G:K|. It returns a free ZK-resolution whose ZK-rank is |G:K| times the ZG-rank in each dimension.
If G is finite then the function ResolutionFiniteSubgroup(R,G,K) will probably work better. In particular, resolutions from this function probably won't work with the function EquivariantChainMap().
This ZK-resolution is not reduced. i.e. it has more than one generator in dimension 0.

ResolutionSubnormalSeries(L,n)

Inputs a positive integer n and a list L = [L1 , ..., Lk] of subgroups Li of a finite group G=L1 such that L1>L2 ... >Lk is a subnormal series in G (meaning that each Li+1 must be normal in Li). It returns a Z(G)-resolution by repeatedly using the function ResolutionFiniteExtension().
If L is a series of normal subgroups in G then the function ResolutionNormalSeries(L,n) will possibly work more efficiently.

SolutionsMatDestructive(M,B) | Inputs an m×n matrix M and a k×n matrix B over a field. It returns a k×m matrix S satisfying SM=B. The function will leave matrix M unchanged but will probably change matrix B. (This is a trivial rewrite of the standard GAP function SolutionMatDestructive(<mat>,<vec>) .)
Source(f) | Inputs a chain map, or cochain map, or equivariant chain map, or FpG-module homomorphism f and returns it source.

StandardCocycle(R,f,n)
StandardCocycle(R,f,n,q)

Inputs a ZG-resolution R (with contracting homotopy), a positive integer n and an integer vector f representing an n-cocycle Rn → Zq where G acts trivially on Zq. It is assumed q=0 unless a value for q is entered. The command returns a function F(g1, ..., gn) which is the standard cocycle Gn → Zq corresponding to f. At present the command is implemented only for n=2 or 3.

SumOfFpGModules(M,N) | Inputs two FpG-modules M, N arising as submodules in a common free module (FG)n where G is a p-group and F the field of p-elements. It returns the FpG-Module arising as the sum of M and N.
SumOp(f,g) | Inputs two FpG-module homomorphisms f,g:M→N with common sorce and common target. It returns the sum f+g:M→N . (This operation is also available using "+".
Syzygy(R,g) | Inputs a ZG-resolution R (with contracting homotopy) and a list g = [g[1], ..., g[n]] of elements in G. It returns a word w in Rn. The word w is the image of the n-simplex in the standard bar resolution corresponding to the n-tuple g. This function can be used to construct explicit standard n-cocycles. (Currently implemented only for n<4.)
Target(f) | Inputs a chain map, or cochain map, or equivariant chain map, or FpG-module homomorphism f and returns its target.
TensorCentre(G) | Inputs a group G and returns the largest central subgroup N such that the induced homomorphism of nonabelian tensor squares G (×) G → G/N (×) G/N is an isomorphism. Equivalently, N is the largest central subgroup such that pi3(SK(G,1)) → pi3(SK(G/N,1)) is injective.
TensorWithIntegers(X) | Inputs either a ZG-resolution X =R, or an equivariant chain map X = (F:R→S). It returns the chain complex or chain map obtained by tensoring with the trivial module of integers (characteristic 0).
TensorWith IntegersModP(X,p) | Inputs either a ZG-resolution X =R, or an equivariant chain map X = (F:R→S), and a prime p. It returns the chain complex or chain map obtained by tensoring with the trivial module of integers modulo p.
TensorWithRationals(R) | Inputs a ZG-resolution R and returns the chain complex obtained by tensoring with the trivial module of rational numbers.
TestHap() | This runs a representative sample of HAP functions and checks to see that they produce the correct output.

ThirdHomotopyGroup
OfSuspensionB(G)
ThirdHomotopyGroup
OfSuspensionB(G,m)

Inputs a finite or nilpotent infinite group G and returns the abelian invariants of the third homotopy group JG of the suspension SK(G,1) of the Eilenberg-Mac Lane space K(G,1).
For non-nilpotent groups the implementation of the function ThirdHomotopyGroupOfSuspensionB(G) is far from optimal and will soon be improved. As a temporary solution to this problem, an optional second variable m can be set equal to 0, and then the function efficiently returns the abelian invariants of groups A and B such that there is an exact sequence 0 → B → JG → A →0.
Alternatively, the optional second varible m can be set equal to a positive multiple of the order of the tensor square G(×)G . In this case the function returns the abelian invariants of JG. This might help when G is solvable but not nilpotent (especially if the estimated upper bound m is reasonable accurate).

TietzeReduction(S,w) | Inputs a set S of words in a free ZG-module, and a word w in the module. The function returns a word w' such that {S,w'} generates the same abelian group as {S,w}. The word w' is possibly shorter (and certainly no longer) than w. This function needs to be improved!
TorsionGeneratorsAbelianGroup(G) | Inputs an abelian group G and returns a generating set [x1, ...,xn] where no pair of generators have coprime orders.

TwistedTensorProduct(R,S,
EhomG,GmapE,NhomE,
NEhomN,EltsE,Mult,InvE)

Inputs a ZG-resolution R, a ZN-resolution S, and other data relating to a short exact sequence 1→N→E→G→1. It uses a perturbation technique of CTC Wall to construct a ZE-resolution F. Both G and N could be infinite. The "length" of F is equal to the minimum of the "length"s of R and S. The resolution R needs no contracting homotopy if no such homotopy is requied for F.

UpperEpicentralSeries(G,c)

Inputs a nilpotent group G and an integer c. It returns the c-th term of the upper epicentral series 1 < Z1*(G) < Z2*(G) < ... .
The upper epicentral series is defined for an arbitrary group G. The group Zc*(G) is the image in G of the c-th term Zc(U) of the upper central series of the group U=F/[[[R,F],F]...] (with c copies of F in the denominator) where F/R is any free presentation of G.
This functions requires the NQ package.

VectorStabilizer(G,v) | Inputs a permutation group or matrix group G of degree n and a rational vector of degree n. In both cases there is a natural action of G on v and the function returns the group of elements in G that fix v.

VectorsToFpGModule
Words(M,L)

Inputs an FpG-module M and a list L=[v1,...,vk] of vectors in M. It returns a list L'= [x1,...,xk] . Each xj=[[w1,g1],...,[wt,gt]] is a list of integer pairs corresponding to an expression of vj as a word
vj = g1*w1 + g2*w1 + ... + gt*wt
where

- gi=Elements(M!.group)[ gi]
- wi=GeneratorsOfFpGModule(M)[wi] .