  
  [1X3 [33X[0;0YMal'cev collection[133X[101X
  
  [33X[0;0YLet  [22XG[122X  be an infinite polycyclic group. It is well-known that there exist a
  normal [22XT[122X-group [22XN[122X and a [22XT[122X-group [22XC[122X such that [22XH=CN[122X is normal of finite index in
  [22XG[122X and [22XH/N[122X is free abelian of finite rank [Seg83]. In this chapter we present
  an  effective  collection  method  for an infinite polycyclic group which is
  given  by  a polycyclic presentation with respect to a polycyclic sequence [22XP[122X
  going  through  the  normal series [22X1 ≤ N ≤ H ≤ G[122X. This polycyclic sequence [22XP[122X
  must  be  chosen  as follows. Let [22X(n_1,dots,n_l)[122X be a Mal'cev basis of [22XN[122X and
  let  [22X(c_1N,dots,c_k  N)[122X  be  a  basis  for the free abelian group [22XCN/N[122X. Then
  [22X(c_1,dots,c_k,n_1,dots,n_l)[122X is a polycyclic sequence for [22XH=CN[122X. Further there
  exists  [22Xf_1,dots,  f_j  ∈  G[122X  such that [22X(f_1 H, dots, f_j H)[122X is a polycyclic
  sequence for [22XG/H[122X. Now we set[133X
  
  
  [24X[33X[0;6YP = (f_1,\dots,f_j, c_1, \dots , c_k, n_1, \dots, n_l )[133X
  
  [124X
  
  
  [1X3.1 [33X[0;0YThe main functions[133X[101X
  
  [1X3.1-1 MalcevCollectorConstruction[101X
  
  [33X[1;0Y[29X[2XMalcevCollectorConstruction[102X( [3XG[103X, [3Xinds[103X, [3XC[103X, [3XCC[103X, [3XN[103X, [3XNN[103X ) [32X function[133X
  
  [33X[0;0YReturns  a Mal'cev collector for the infinite polycyclically presented group
  [22XG[122X.  The  group  [22XG[122X  must  be  given  with  respect  to  a polycyclic sequence
  [22X(g_1,dots,g_r,   c_r+1,  dots,  c_r+s,  n_r+s+1,  dots,  n_r+s+t)[122X  with  the
  following properties:[133X
  
  [30X    [33X[0;6Y(a) [22X(n_r+s+1, dots, n_r+s+t)[122X is a Mal'cev basis for the [22XT[122X-group [22XN ≤ G[122X,[133X
  
  [30X    [33X[0;6Y(b)  [22X(c_r+1N, dots, c_r+sN)[122X is a basis for the free-abelian group [22XCN/N[122X
        where [22XC ≤ G[122X is a [22XT[122X-group generated by [22Xc_r+1, dots, c_r+s[122X,[133X
  
  [30X    [33X[0;6Y(c)  [22X(g_1  CN,  dots,  g_r CN)[122X is a polycyclic sequence for the finite
        group [22XG/CN[122X.[133X
  
  [33X[0;0YThe  list  [3Xinds[103X is equal to [22X[ [1,dots,r],[r+1,dots,r+s],[r+s+1,dots,r+s+t]][122X.
  The  group [22XCC[122X is isomorphic to [22XC[122X via [3XCC[103X!.bijection and given by a polycyclic
  presentation  with  respect  to  a  Mal'cev basis starting with [22Xc_r+1, dots,
  c_r+s[122X.  The  group  [22XNN[122X  is isomorphic to [22XN[122X via [3XNN[103X!.bijection. and given by a
  polycyclic  presentation  with respect to the Mal'cev basis [22X( n_r+s+1, dots,
  n_r+s+t)[122X.[133X
  
  [1X3.1-2 GUARANA.Tr_n_O1[101X
  
  [33X[1;0Y[29X[2XGUARANA.Tr_n_O1[102X( [3Xn[103X ) [32X function[133X
  [33X[1;0Y[29X[2XGUARANA.Tr_n_O2[102X( [3Xn[103X ) [32X function[133X
  
  [33X[0;0Yfor  a positive integer [3Xn[103X these functions construct polycyclically presented
  groups  that  can  be used to test the Mal'cev collector. They return a list
  which can be used as input for the function MalcevCollectorConstruction. The
  constructed groups are isomorphic to triangular matrix groups of dimension [3Xn[103X
  over  the ring [22XO_1[122X, respectively [22XO_2[122X. The ring [22XO_1[122X, respectively [22XO_2[122X, is the
  maximal  order  of  [22XQ(θ_i)[122X  where  [22Xθ_1[122X,  respectively  [22Xθ_2[122X, is a zero of the
  polynomial [22Xp_1(x) = x^2-3[122X, respectively [22Xp_2(x)=x^3 -x^2 +4[122X.[133X
  
  [1X3.1-3 GUARANA.F_2c_Aut1[101X
  
  [33X[1;0Y[29X[2XGUARANA.F_2c_Aut1[102X( [3Xc[103X ) [32X function[133X
  [33X[1;0Y[29X[2XGUARANA.F_3c_Aut1[102X( [3Xc[103X ) [32X function[133X
  
  [33X[0;0Yfor  a positive integer [3Xc[103X these functions construct polycyclically presented
  groups  that  can  be used to test the Mal'cev collector. They return a list
  which  can  be  used  as input for the function MalcevCollectorConstruction.
  These  groups are constructed as follows: Let [22XF_n,c[122X be the free nilpotent of
  class  [22Xc[122X  group  on  [22Xn[122X  generators.  An automorphism [22Xφ[122X of the free group [22XF_n[122X
  naturally induces an automorphism [22Xbarφ[122X of [22XF_n,c[122X. We use the automorphism [22Xφ_1[122X
  of  [22XF_2[122X  which  maps [22Xf_1[122X to [22Xf_2^-1[122X and [22Xf_2[122X to [22Xf_1 f_2^3[122X and the automorphism
  [22Xφ_2[122X  of [22XF_3[122X mapping [22Xf_1[122X to [22Xf_2^-1[122X, [22Xf_2[122X to [22Xf_3^-1[122X and [22Xf_3[122X to [22Xf_2^-3f_1^-1[122X for
  our  construction.  The returned group F_2c_Aut1, respectively F_3c_Aut2, is
  isomorphic to the semidirect product [22X⟨ φ_1 ⟩ ⋉ F_2,c[122X, respectively [22X⟨ φ_2 ⟩ ⋉
  F_3,c[122X.[133X
  
  [1X3.1-4 MalcevGElementByExponents[101X
  
  [33X[1;0Y[29X[2XMalcevGElementByExponents[102X( [3XmalCol[103X, [3Xexps[103X ) [32X function[133X
  
  [33X[0;0YFor a Mal'cev collector [3XmalCol[103X of a group [22XG[122X and an exponent vector [3Xexps[103X with
  integer  entries,  this  functions returns the group element of [22XG[122X, which has
  exponents [3Xexps[103X with respect to the polycyclic sequence underlying [3XmalCol[103X.[133X
  
  [1X3.1-5 Random[101X
  
  [33X[1;0Y[29X[2XRandom[102X( [3XmalCol[103X, [3Xrange[103X ) [32X function[133X
  
  [33X[0;0YFor  a  Mal'cev  collector  [3XmalCol[103X  this  function  returns  the  output  of
  MalcevGElementByExponents(  [3XmalCol[103X, [3Xexps[103X ), where [3Xexps[103X is an exponent vector
  whose entries are randomly chosen integers between -[3Xrange[103X and [3Xrange[103X.[133X
  
  [1X3.1-6 *[101X
  
  [33X[1;0Y[29X[2X*[102X( [3Xg[103X, [3Xh[103X ) [32X function[133X
  
  [33X[0;0YReturns  the  product  of group elements which are defined with respect to a
  Mal'cev collector by the the function MalcevGElementByExponents.[133X
  
  [1X3.1-7 GUARANA.AverageRuntimeCollec[101X
  
  [33X[1;0Y[29X[2XGUARANA.AverageRuntimeCollec[102X( [3XmalCol[103X, [3Xranges[103X, [3Xno[103X ) [32X function[133X
  
  [33X[0;0YFor  a  Mal'cev  collector  [3XmalCol[103X, a list of positive integers [3Xranges[103X and a
  positive  integer  [3Xno[103X this function computes for each number [3Xr[103X in [3Xranges[103X the
  average  runtime  of  [3Xno[103X multiplications of two random elements of [3XmalCol[103X of
  range [3Xr[103X, as generated by Random( [3XmalCol[103X, [3Xr[103X ).[133X
  
  
  [1X3.2 [33X[0;0YAn example application[133X[101X
  
  [4X[32X  Example  [32X[104X
    [4X[28X		gap> ll := GUARANA.Tr_n_O1( 3 );[128X[104X
    [4X[28X		[ Pcp-group with orders [ 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],[128X[104X
    [4X[28X		  [ [ 1 .. 3 ], [ 4 .. 6 ], [ 7 .. 12 ] ],[128X[104X
    [4X[28X		  Pcp-group with orders [ 0, 0, 0, 0, 0, 0 ],[128X[104X
    [4X[28X		  Pcp-group with orders [ 0, 0, 0, 0, 0, 0 ],[128X[104X
    [4X[28X		  Pcp-group with orders [ 0, 0, 0 ], Pcp-group with orders [ 0, 0, 0 ] ][128X[104X
    [4X[28X		gap> malCol := MalcevCollectorConstruction( ll );[128X[104X
    [4X[28X		<<Malcev collector>>[128X[104X
    [4X[28X		  F : [ 2, 2, 2 ][128X[104X
    [4X[28X		  C : <<Malcev object of dimension 3>>[128X[104X
    [4X[28X		  N : <<Malcev object of dimension 6>>[128X[104X
    [4X[28X		[128X[104X
    [4X[28X		gap> exps_g := [ 1, 1, 1, -3, -2, 1, -2, -1, 0, 3, -1,3 ];[128X[104X
    [4X[28X		[ 1, 1, 1, -3, -2, 1, -2, -1, 0, 3, -1, 3 ][128X[104X
    [4X[28X		gap> exps_h := [ 1, 0, 1, -1, 0, 2, 0, 4, -1, 5, 9,-5 ];[128X[104X
    [4X[28X		[ 1, 0, 1, -1, 0, 2, 0, 4, -1, 5, 9, -5 ][128X[104X
    [4X[28X		gap> g := MalcevGElementByExponents( malCol, exps_g );[128X[104X
    [4X[28X		[ 1, 1, 1, -3, -2, 1, -2, -1, 0, 3, -1, 3 ][128X[104X
    [4X[28X		gap> h := MalcevGElementByExponents( malCol, exps_h );[128X[104X
    [4X[28X		[ 1, 0, 1, -1, 0, 2, 0, 4, -1, 5, 9, -5 ][128X[104X
    [4X[28X		[128X[104X
    [4X[28X		gap> k := g*h;[128X[104X
    [4X[28X		[ 0, 1, 0, -4, -2, 3, -7, 0, -37, -16, -352, -212 ][128X[104X
    [4X[28X				[128X[104X
    [4X[28X		gap> Random( malCol, 10 );[128X[104X
    [4X[28X		[ 0, 0, 1, 9, 5, 5, 2, -2, 7, -10, 7, -6 ][128X[104X
    [4X[28X		[128X[104X
    [4X[28X		[128X[104X
  [4X[32X[104X
  
