  
  [1X6 [33X[0;0YLinear machines and elements[133X[101X
  
  [33X[0;0Y[13XLinear[113X  machines are a special class of FR machines, in which the stateset [22XQ[122X
  and  the  alphabet [22XX[122X are vector spaces over a field [22XBbbk[122X, and the transition
  map  [22Xϕ:  Q⊗  X->  X⊗  Q[122X  is a linear map; furthermore, there is a functional
  [22Xπ:Q->Bbbk[122X called the [13Xoutput[113X.[133X
  
  [33X[0;0YAs  before,  a  choice  of  initial state [22Xq∈ Q[122X induces a linear map [22Xq:T(X)->
  T(X)[122X,  where  [22XT(X)=⨁ X^⊗ n[122X is the tensor algebra generated by [22XX[122X. This map is
  defined  as  follows:  given [22Xx=x_1⊗dots⊗ x_n∈ T(X)[122X, rewrite [22Xq⊗ x[122X as a sum of
  expressions  of  the form [22Xy⊗ r[122X with [22Xy∈ T(X)[122X and [22Xr∈ Q[122X; then [22Xq[122X, by definition,
  maps [22Xx[122X to the sum of the [22Xπ(r)y[122X.[133X
  
  [33X[0;0YThere are two sorts of linear machines: [13Xvector machines[113X, for which the state
  space  is  a  finite-dimensional  vector  space  over  a  field; and [13Xalgebra
  machines[113X,  for  which  the  state space is a free algebra in a finite set of
  variables.[133X
  
  [33X[0;0YIn  a  vector machine, the transition and output maps are stored as a matrix
  and  a  vector respectively. Minimization algorithms are implemented, as for
  Mealy machines.[133X
  
  [33X[0;0YIn an algebra machine, the transition and output maps are stored as words in
  the algebra. These machines are natural extensions of group/monoid/semigroup
  machines.[133X
  
  [33X[0;0YLinear elements are given by a linear machine and an initial state. They can
  be  added  and  multiplied,  and  act on the tensor algebra of the alphabet,
  admitting natural representations as matrices.[133X
  
  
  [1X6.1 [33X[0;0YMethods and operations for [10XLinearFRMachine[110X[101X[1Xs and [10XLinearFRElement[110X[101X[1Xs[133X[101X
  
  [1X6.1-1 VectorMachine[101X
  
  [29X[2XVectorMachine[102X( [3Xdomain[103X, [3Xtransitions[103X, [3Xoutput[103X ) [32X operation
  [29X[2XVectorElement[102X( [3Xdomain[103X, [3Xtransitions[103X, [3Xoutput[103X, [3Xinit[103X ) [32X operation
  [29X[2XVectorMachineNC[102X( [3Xfam[103X, [3Xtransitions[103X, [3Xoutput[103X ) [32X operation
  [29X[2XVectorElementNC[102X( [3Xfam[103X, [3Xtransitions[103X, [3Xoutput[103X, [3Xinit[103X, [3Xcategory[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA new vector machine/element.[133X
  
  [33X[0;0YThis function constructs a new linear machine or element, of vector type.[133X
  
  [33X[0;0Y[3Xtransitions[103X is a matrix of matrices; for [10Xa,b[110X indices of basis vectors of the
  alphabet,  [10Xtransitions[a][b][110X  is  a  square  matrix indexed by the stateset,
  which  is  the transition to be effected on the stateset upon the output [22Xa->
  b[122X.[133X
  
  [33X[0;0YThe    optional    last    argument    [3Xcategory[103X    specifies    a   category
  ([2XIsAssociativeElement[102X  ([14XReference:  IsAssociativeElement[114X), [2XIsJacobianElement[102X
  ([14XReference: IsJacobianElement[114X),...) to which the new element should belong.[133X
  
  [33X[0;0Y[3Xoutput[103X and [3Xinit[103X are vectors in the stateset.[133X
  
  [33X[0;0YIn  the  "NC"  version,  no  tests are performed to check that the arguments
  contain  values  within bounds, or even of the right type (beyond the simple
  checking performed by [5XGAP[105X's method selection algorithms). The first argument
  should  be the family of the resulting object. These "NC" methods are mainly
  used internally by the package.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XM := VectorMachine(Rationals,[[[[1]],[[2]]],[[[3]],[[4]]]],[1]);[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^2 with 1-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(M);[127X[104X
    [4X[28X Rationals | 1 | 2 |[128X[104X
    [4X[28X-----------+---+---+[128X[104X
    [4X[28X         1 | 1 | 2 |[128X[104X
    [4X[28X-----------+---+---+[128X[104X
    [4X[28X         2 | 3 | 4 |[128X[104X
    [4X[28X-----------+---+---+[128X[104X
    [4X[28XOutput: 1[128X[104X
    [4X[25Xgap>[125X [27XA := VectorElement(Rationals,[[[[1]],[[2]]],[[[3]],[[4]]]],[1],[1]);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^2 with 1-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(A,2));[127X[104X
    [4X[28X[ [   1,   2,   2,   4 ],[128X[104X
    [4X[28X  [   3,   4,   6,   8 ],[128X[104X
    [4X[28X  [   3,   6,   4,   8 ],[128X[104X
    [4X[28X  [   9,  12,  12,  16 ] ][128X[104X
    [4X[25Xgap>[125X [27XDecompositionOfFRElement(A);[127X[104X
    [4X[28X[ [ <Linear element on alphabet Rationals^2 with 1-dimensional stateset>,[128X[104X
    [4X[28X      <Linear element on alphabet Rationals^2 with 1-dimensional stateset> ],[128X[104X
    [4X[28X  [ <Linear element on alphabet Rationals^2 with 1-dimensional stateset>,[128X[104X
    [4X[28X      <Linear element on alphabet Rationals^2 with 1-dimensional stateset> ] ][128X[104X
    [4X[25Xgap>[125X [27Xlast=[[A,2*A],[3*A,4*A]];[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-2 AssociativeObject[101X
  
  [29X[2XAssociativeObject[102X( [3Xx[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YAn associative object related to [3Xx[103X.[133X
  
  [33X[0;0YIf  [3Xx[103X  belongs  to a family that admits a non-associative and an associative
  product,  and the product of [3Xx[103X is non-associative, this function returns the
  object corresponding to [3Xx[103X, but with associative product.[133X
  
  [33X[0;0YA  typical  example is that [3Xx[103X is a derivation of a vector space. The product
  of  derivations  is  [22Xa∘  b-b∘ a[122X, and is not associative; but derivations are
  endomorphisms   of   the   vector   space,  and  as  such  can  be  composed
  associatively.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := VectorElement(Rationals,[[[[0]],[[1]]],[[[1]],[[0]]]],[1],[1],IsJacobianElement);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^2 with 1-dimensional stateset->[128X[104X
    [4X[25Xgap>[125X [27XA^2;[127X[104X
    [4X[28X<Zero linear element on alphabet Rationals^2->[128X[104X
    [4X[25Xgap>[125X [27XAssociativeObject(A)^2;[127X[104X
    [4X[28X<Identity linear element on alphabet Rationals^2>[128X[104X
  [4X[32X[104X
  
  [1X6.1-3 AlgebraMachine[101X
  
  [29X[2XAlgebraMachine[102X( [[3Xdomain[103X, ][3Xring[103X, [3Xtransitions[103X, [3Xoutput[103X ) [32X operation
  [29X[2XAlgebraElement[102X( [[3Xdomain[103X, ][3Xring[103X, [3Xtransitions[103X, [3Xoutput[103X, [3Xinit[103X ) [32X operation
  [29X[2XAlgebraMachineNC[102X( [3Xfam[103X, [3Xring[103X, [3Xtransitions[103X, [3Xoutput[103X ) [32X operation
  [29X[2XAlgebraElementNC[102X( [3Xfam[103X, [3Xring[103X, [3Xtransitions[103X, [3Xoutput[103X, [3Xinit[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA new algebra machine/element.[133X
  
  [33X[0;0YThis function constructs a new linear machine or element, of algebra type.[133X
  
  [33X[0;0Y[3Xring[103X  is  a  free  associative  algebra,  optionally with one. [3Xdomain[103X is the
  vector  space  on  which  the  alphabet is defined. If absent, this argument
  defaults to the [2XLeftActingDomain[102X ([14XReference: LeftActingDomain[114X) of [3Xring[103X.[133X
  
  [33X[0;0Y[3Xtransitions[103X  is a list of matrices; for each generator number [22Xi[122X of [3Xring[103X, the
  matrix  [10Xtransitions[i][110X, with entries in [3Xring[103X, describes the decomposition of
  generator [22Xi[122X as a matrix.[133X
  
  [33X[0;0Y[3Xoutput[103X is a vector over [3Xdomain[103X, and [3Xinit[103X is a vector over [3Xring[103X.[133X
  
  [33X[0;0YIn  the  "NC"  version,  no  tests are performed to check that the arguments
  contain  values  within bounds, or even of the right type (beyond the simple
  checking performed by [5XGAP[105X's method selection algorithms). The first argument
  should  be the family of the resulting object. These "NC" methods are mainly
  used internally by the package.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XF := FreeAssociativeAlgebraWithOne(Rationals,1);;[127X[104X
    [4X[25Xgap>[125X [27XA := AlgebraMachine(F,[[[F.1,F.1^2+F.1],[One(F),Zero(F)]]],[1]);[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^2 with generators [ (1)*x.1 ]>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(A);[127X[104X
    [4X[28X Rationals |     1     |     2     |[128X[104X
    [4X[28X-----------+-----------+-----------+[128X[104X
    [4X[28X         1 |       x.1 | x.1+x.1^2 |[128X[104X
    [4X[28X-----------+-----------+-----------+[128X[104X
    [4X[28X         2 |         1 |         0 |[128X[104X
    [4X[28X-----------+-----------+-----------+[128X[104X
    [4X[28XOutput: 1[128X[104X
    [4X[25Xgap>[125X [27XM := AlgebraElement(F,[[[F.1,F.1^2+F.1],[One(F),Zero(F)]]],[1],F.1);[127X[104X
    [4X[28X<Rationals^2|(1)*x.1>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(M,2));[127X[104X
    [4X[28X[ [  1,  2,  4,  4 ],[128X[104X
    [4X[28X  [  1,  0,  2,  2 ],[128X[104X
    [4X[28X  [  1,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  1,  0,  0 ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-4 Transition[101X
  
  [29X[2XTransition[102X( [3Xm[103X, [3Xs[103X, [3Xa[103X, [3Xb[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YAn element of [3Xm[103X's stateset.[133X
  
  [33X[0;0YThis  function  returns  the  state reached by [3Xm[103X when started in state [3Xs[103X and
  performing output [22Xa-> b[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XM := AsVectorMachine(Rationals,FRMachine(GuptaSidkiGroup.2));[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^3 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XTransition(M,[1,0,0,0],[1,0,0],[1,0,0]);[127X[104X
    [4X[28X[ 0, 1, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XTransition(M,[1,0,0,0],[0,1,0],[0,1,0]);[127X[104X
    [4X[28X[ 0, 0, 1, 0 ][128X[104X
    [4X[25Xgap>[125X [27XTransition(M,[1,0,0,0],[0,0,1],[0,0,1]);[127X[104X
    [4X[28X[ 1, 0, 0, 0 ][128X[104X
    [4X[25Xgap>[125X [27XA := AsVectorElement(Rationals,GuptaSidkiGroup.2);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^3 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XTransition(A,[1,0,0],[1,0,0]);[127X[104X
    [4X[28X[ 0, 1, 0, 0 ][128X[104X
  [4X[32X[104X
  
  [1X6.1-5 Transitions[101X
  
  [29X[2XTransitions[102X( [3Xm[103X, [3Xs[103X, [3Xa[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YAn vector of elements of [3Xm[103X's stateset.[133X
  
  [33X[0;0YThis  function  returns  the  state reached by [3Xm[103X when started in state [3Xs[103X and
  receiving  input [3Xa[103X. The output is a vector, indexed by the alphabet's basis,
  of output states.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XM := AsVectorMachine(Rationals,FRMachine(GuptaSidkiGroup.2));[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^3 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XTransitions(M,[1,0,0,0],[1,0,0]);[127X[104X
    [4X[28X[ [ 0, 1, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ][128X[104X
    [4X[25Xgap>[125X [27XA := AsVectorElement(Rationals,GuptaSidkiGroup.2);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^3 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XTransitions(A,[1,0,0]);[127X[104X
    [4X[28X[ [ 0, 1, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-6 NestedMatrixState[101X
  
  [29X[2XNestedMatrixState[102X( [3Xe[103X, [3Xi[103X, [3Xj[103X ) [32X operation
  [29X[2XNestedMatrixCoefficient[102X( [3Xe[103X, [3Xi[103X, [3Xj[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA coefficent of an iterated decomposition of [3Xe[103X.[133X
  
  [33X[0;0YThe  first  form  returns  the entry at position [22X(i,j)[122X of [3Xe[103X's decomposition.
  Both of [3Xi,j[103X are lists. The second form returns the output of the state.[133X
  
  [33X[0;0YIn particular, [10Xe=NestedMatrixState(e,[],[])[110X, and[133X
  [33X[0;0Y[10XActivity(e,1)[i][j]=NestedMatrixCoefficient(e,[i],[j])[110X, and[133X
  [33X[0;0Y[10XDecompositionOfFRElement(e,1)[i][j]=NestedMatrixState(e,[i],[j])[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := AsVectorElement(Rationals,GuptaSidkiGroup.2);;[127X[104X
    [4X[25Xgap>[125X [27XA=NestedMatrixState(A,[3,3],[3,3]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsOne(NestedMatrixState(A,[3,3,3,3,1,1],[3,3,3,3,1,2]));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XList([1..3],i->List([1..3],j->NestedMatrixCoefficient(A,[i],[j])))=Activity(A,1);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-7 ActivitySparse[101X
  
  [29X[2XActivitySparse[102X( [3Xm[103X, [3Xi[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA sparse matrix.[133X
  
  [33X[0;0Y[10XActivity(m,i)[110X returns an [22Xn^i× n^i[122X matrix describing the action on the [22Xi[122X-fold
  tensor  power  of the alphabet. This matrix can also be returned as a sparse
  matrix,  and this is performed by this command. A sparse matrix is described
  as  a list of expressions of the form [10X[[i,j],c][110X, representing the elementary
  matrix  with  entry [22Xc[122X at position [22X(i,j)[122X. The activity matrix is then the sum
  of these elementary matrices.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := AsVectorElement(Rationals,GuptaSidkiGroup.2);;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(A,2));[127X[104X
    [4X[28X[ [  0,  1,  0,  0,  0,  0,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  1,  0,  0,  0,  0,  0,  0 ],[128X[104X
    [4X[28X  [  1,  0,  0,  0,  0,  0,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  0,  0,  1,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  1,  0,  0,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  0,  1,  0,  0,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  0,  0,  0,  1,  0,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  0,  0,  0,  0,  1,  0 ],[128X[104X
    [4X[28X  [  0,  0,  0,  0,  0,  0,  0,  0,  1 ] ][128X[104X
    [4X[25Xgap>[125X [27XActivitySparse(A,2);[127X[104X
    [4X[28X[ [ [ 1, 2 ], 1 ], [ [ 2, 3 ], 1 ], [ [ 3, 1 ], 1 ], [ [ 4, 6 ], 1 ],[128X[104X
    [4X[28X[ [ 5, 4 ], 1 ], [ [ 6, 5 ], 1 ], [ [ 7, 7 ], 1 ], [ [ 8, 8 ], 1 ],[128X[104X
    [4X[28X[ [ 9, 9 ], 1 ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-8 Activities[101X
  
  [29X[2XActivities[102X( [3Xm[103X, [3Xi[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YActivities of [3Xm[103X on the first [3Xi[103X levels.[133X
  
  [33X[0;0Y[10XActivity(m,i)[110X returns an [22Xn^i× n^i[122X matrix describing the action on the [22Xi[122X-fold
  tensor     power     of     the     alphabet.     This    command    returns
  [10XList([0..i-1],j->Activity(m,j))[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := AsVectorElement(Rationals,GrigorchukGroup.2);;[127X[104X
    [4X[25Xgap>[125X [27XActivities(A,3);[127X[104X
    [4X[28X[ [ [ 1 ] ],[128X[104X
    [4X[28X  [ [ 1, 0 ], [ 0, 1 ] ],[128X[104X
    [4X[28X  [ [ 0, 1, 0, 0 ], [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-9 IsConvergent[101X
  
  [29X[2XIsConvergent[102X( [3Xe[103X ) [32X property
  [6XReturns:[106X  [33X[0;10YWhether the linear element [3Xe[103X is convergent.[133X
  
  [33X[0;0YA  linear  element  is [13Xconvergent[113X if its state at position [22X(1,1)[122X is equal to
  itself.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xn := 3;;[127X[104X
    [4X[25Xgap>[125X [27Xshift := VectorElement(CyclotomicField(n), [[[[1,0],[0,0]],[127X[104X
    [4X[28X     [[0,0],[0,1]]],[[[0,1],[0,0]],[[1,0],[0,0]]]],[1,E(n)],[1,0]);[128X[104X
    [4X[28X<Linear element on alphabet CF(3)^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XIsConvergent(shift);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(shift,2));[127X[104X
    [4X[28X[ [     1,     0,     0,     0 ],[128X[104X
    [4X[28X  [  E(3),     1,     0,     0 ],[128X[104X
    [4X[28X  [     0,  E(3),     1,     0 ],[128X[104X
    [4X[28X  [     0,     0,  E(3),     1 ] ][128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(shift,3));[127X[104X
    [4X[28X[ [     1,     0,     0,     0,     0,     0,     0,     0 ],[128X[104X
    [4X[28X  [  E(3),     1,     0,     0,     0,     0,     0,     0 ],[128X[104X
    [4X[28X  [     0,  E(3),     1,     0,     0,     0,     0,     0 ],[128X[104X
    [4X[28X  [     0,     0,  E(3),     1,     0,     0,     0,     0 ],[128X[104X
    [4X[28X  [     0,     0,     0,  E(3),     1,     0,     0,     0 ],[128X[104X
    [4X[28X  [     0,     0,     0,     0,  E(3),     1,     0,     0 ],[128X[104X
    [4X[28X  [     0,     0,     0,     0,     0,  E(3),     1,     0 ],[128X[104X
    [4X[28X  [     0,     0,     0,     0,     0,     0,  E(3),     1 ] ][128X[104X
  [4X[32X[104X
  
  [1X6.1-10 TransposedFRElement[101X
  
  [29X[2XTransposedFRElement[102X( [3Xe[103X ) [32X operation
  [29X[2XIsSymmetricFRElement[102X( [3Xe[103X ) [32X property
  [29X[2XIsAntisymmetricFRElement[102X( [3Xe[103X ) [32X property
  [29X[2XIsLowerTriangularFRElement[102X( [3Xe[103X ) [32X property
  [29X[2XIsUpperTriangularFRElement[102X( [3Xe[103X ) [32X property
  [29X[2XIsDiagonalFRElement[102X( [3Xe[103X ) [32X property
  [6XReturns:[106X  [33X[0;10YThe elementary matrix operation/property.[133X
  
  [33X[0;0YSince  linear  FR elements may be interpreted as infinite matrices, it makes
  sense  to  transpose  them,  test  whether they're symmetric, antisymmetric,
  diagonal, or triangular.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xn := 3;;[127X[104X
    [4X[25Xgap>[125X [27Xshift := VectorElement(CyclotomicField(n), [[[[1,0],[0,0]],[127X[104X
    [4X[28X     [[0,0],[0,1]]],[[[0,1],[0,0]],[[1,0],[0,0]]]],[1,E(n)],[1,0]);[128X[104X
    [4X[28X<Linear element on alphabet CF(3)^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(shift,2));[127X[104X
    [4X[28X[ [     1,     0,     0,     0 ],[128X[104X
    [4X[28X  [  E(3),     1,     0,     0 ],[128X[104X
    [4X[28X  [     0,  E(3),     1,     0 ],[128X[104X
    [4X[28X  [     0,     0,  E(3),     1 ] ][128X[104X
    [4X[25Xgap>[125X [27XDisplay(Activity(TransposedFRElement(shift),2));[127X[104X
    [4X[28X[ [     1,  E(3),     0,     0 ],[128X[104X
    [4X[28X  [     0,     1,  E(3),     0 ],[128X[104X
    [4X[28X  [     0,     0,     1,  E(3) ],[128X[104X
    [4X[28X  [     0,     0,     0,     1 ] ][128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricFRElement(shift);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricFRElement(shift+TransposedFRElement(shift));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsLowerTriangularFRElement(shift);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsUpperTriangularFRElement(shift);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X6.1-11 LDUDecompositionFRElement[101X
  
  [29X[2XLDUDecompositionFRElement[102X( [3Xe[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YA factorization [22Xe=LDU[122X.[133X
  
  [33X[0;0YGiven  a  linear element [3Xe[103X, this command attempts to find a decomposition of
  the  form  [22Xe=LDU[122X, where [22XL[122X is lower triangular, [22XD[122X is diagonal, and [22XU[122X is upper
  triangular (see [2XIsLowerTriangularFRElement[102X ([14X6.1-10[114X) etc.).[133X
  
  [33X[0;0YThe  result  is returned thas a list with entries [22XL,D,U[122X. Note that it is not
  guaranteed to succeed. For more examples, see Section [14X9.4[114X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XList([0..7],s->List([0..7],t->E(4)^ValuationInt(Binomial(s+t,s),2)));;[127X[104X
    [4X[25Xgap>[125X [27XA := GuessVectorElement(last);[127X[104X
    [4X[28X<Linear element on alphabet GaussianRationals^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XLDU := LDUDecompositionFRElement(A);[127X[104X
    [4X[28X[ <Linear element on alphabet GaussianRationals^2 with 4-dimensional stateset>,[128X[104X
    [4X[28X  <Linear element on alphabet GaussianRationals^2 with 3-dimensional stateset>,[128X[104X
    [4X[28X  <Linear element on alphabet GaussianRationals^2 with 4-dimensional stateset> ][128X[104X
    [4X[25Xgap>[125X [27XIsLowerTriangularFRElement(LDU[1]); IsDiagonalFRElement(LDU[2]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XTransposedFRElement(LDU[1])=LDU[3];[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XProduct(LDU)=A;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-12 GuessVectorElement[101X
  
  [29X[2XGuessVectorElement[102X( [3Xm[103X ) [32X function
  [6XReturns:[106X  [33X[0;10YA vector element that acts like [3Xm[103X.[133X
  
  [33X[0;0YThe  arguments to this function include a matrix or list of matrices, and an
  optional ring. The return value is a vector element, over the ring if it was
  specified, that acts like the sequence of matrices.[133X
  
  [33X[0;0YIf  a  single  matrix  is  specified,  then  it  is  assumed  to represent a
  convergent element (see [2XIsConvergent[102X ([14X6.1-9[114X)).[133X
  
  [33X[0;0YThis  function  returns  [9Xfail[109X  if  it  believes that it does not have enough
  information to make a reasonable guess.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xn := 3;;[127X[104X
    [4X[25Xgap>[125X [27Xshift := VectorElement(CyclotomicField(n), [[[[1,0],[0,0]],[127X[104X
    [4X[28X     [[0,0],[0,1]]],[[[0,1],[0,0]],,[[1,0],[0,0]]]],[1,E(n)],[1,0]);;[128X[104X
    [4X[28X<Linear element on alphabet CF(3)^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XGuessVectorElement(Activity(shift,3)); last=shift;[127X[104X
    [4X[28X<Linear element on alphabet CF(3)^2 with 2-dimensional stateset>[128X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XGuessVectorElement(Inverse(Activity(shift,4)));[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XGuessVectorElement(Inverse(Activity(shift,5)));[127X[104X
    [4X[28X<Linear element on alphabet CF(3)^2 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XIsOne(last*shift);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-13 AsLinearMachine[101X
  
  [29X[2XAsLinearMachine[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [29X[2XAsLinearElement[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe linear machine/element associated with [3Xm[103X.[133X
  
  [33X[0;0YThis   command  accepts  a  domain  and  an  ordinary  machine/element,  and
  constructs  the  corresponding  linear machine/element, defined by extending
  linearly the action on [22X[1..d][122X to an action on [22Xr^d[122X.[133X
  
  [33X[0;0YIf  [3Xm[103X is a Mealy machine/element, the result is a vector machine/element. If
  [3Xm[103X  is  a  group/monoid/semigroup  machine/element,  the result is an algebra
  machine/element.  To  obtain explicitly a vector or algebra machine/element,
  see [2XAsVectorMachine[102X ([14X6.1-14[114X) and [2XAsAlgebraMachine[102X ([14X6.1-15[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDisplay(I4Machine);[127X[104X
    [4X[28X   |  1     2[128X[104X
    [4X[28X---+-----+-----+[128X[104X
    [4X[28X a | c,2   c,1[128X[104X
    [4X[28X b | a,1   b,1[128X[104X
    [4X[28X c | c,1   c,2[128X[104X
    [4X[28X---+-----+-----+[128X[104X
    [4X[25Xgap>[125X [27XA := AsLinearMachine(Rationals,I4Machine);[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^2 with 3-dimensional stateset>[128X[104X
    [4X[28XCorrespondence(A);[128X[104X
    [4X[28X[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XDisplay(A);[127X[104X
    [4X[28X Rationals |   1   |   2   |[128X[104X
    [4X[28X-----------+-------+-------+[128X[104X
    [4X[28X         1 | 0 0 0 | 0 0 1 |[128X[104X
    [4X[28X           | 1 0 0 | 0 0 0 |[128X[104X
    [4X[28X           | 0 0 1 | 0 0 0 |[128X[104X
    [4X[28X-----------+-------+-------+[128X[104X
    [4X[28X         2 | 0 0 1 | 0 0 0 |[128X[104X
    [4X[28X           | 0 1 0 | 0 0 0 |[128X[104X
    [4X[28X           | 0 0 0 | 0 0 1 |[128X[104X
    [4X[28X-----------+-------+-------+[128X[104X
    [4X[28XOutput: 1 1 1[128X[104X
    [4X[25Xgap>[125X [27XB := AsLinearMachine(Rationals,AsMonoidFRMachine(I4Machine));[127X[104X
    [4X[28X<Linear machine on alphabet Rationals^2 with generators [ (1)*m1, (1)*m2 ]>[128X[104X
    [4X[25Xgap>[125X [27XCorrespondence(B);[127X[104X
    [4X[28XMappingByFunction( <free monoid on the generators [ m1, m2 ]>,[128X[104X
    [4X[28X<algebra-with-one over Rationals, with 2 generators>, function( w ) ... end )[128X[104X
    [4X[25Xgap>[125X [27XDisplay(B);[127X[104X
    [4X[28X Rationals | 1  | 2  |[128X[104X
    [4X[28X-----------+----+----+[128X[104X
    [4X[28X         1 |  0 |  1 |[128X[104X
    [4X[28X           | m1 |  0 |[128X[104X
    [4X[28X-----------+----+----+[128X[104X
    [4X[28X         2 |  1 |  0 |[128X[104X
    [4X[28X           | m2 |  0 |[128X[104X
    [4X[28X-----------+----+----+[128X[104X
    [4X[28XOutput: 1 1[128X[104X
    [4X[25Xgap>[125X [27XAsLinearElement(Rationals,I4Monoid.1)*AsLinearElement(Rationals,I4Monoid.2);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^2 with 4-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27Xlast=AsLinearElement(Rationals,I4Monoid.1*I4Monoid.2);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-14 AsVectorMachine[101X
  
  [29X[2XAsVectorMachine[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [29X[2XAsVectorElement[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe vector machine/element associated with [3Xm[103X.[133X
  
  [33X[0;0YThis   command  accepts  a  domain  and  an  ordinary  machine/element,  and
  constructs  the  corresponding  linear machine/element, defined by extending
  linearly  the  action  on  [22X[1..d][122X  to  an action on [22Xr^d[122X. For this command to
  succeed,  the  machine/element  [3Xm[103X  must  be  finite  state. For examples see
  [2XAsLinearMachine[102X ([14X6.1-13[114X).[133X
  
  [1X6.1-15 AsAlgebraMachine[101X
  
  [29X[2XAsAlgebraMachine[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [29X[2XAsAlgebraElement[102X( [3Xr[103X, [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe algebra machine/element associated with [3Xm[103X.[133X
  
  [33X[0;0YThis   command  accepts  a  domain  and  an  ordinary  machine/element,  and
  constructs  the  corresponding  linear machine/element, defined by extending
  linearly  the  action  on  [22X[1..d][122X  to  an  action  on  [22Xr^d[122X. For examples see
  [2XAsLinearMachine[102X ([14X6.1-13[114X).[133X
  
  [1X6.1-16 AsVectorMachine[101X
  
  [29X[2XAsVectorMachine[102X( [3Xm[103X ) [32X operation
  [29X[2XAsVectorElement[102X( [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe machine/element [3Xm[103X in vector form.[133X
  
  [33X[0;0YThis  command accepts a linear machine, and converts it to vector form. This
  command is not guaranteed to terminate.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := AsLinearElement(Rationals,I4Monoid.1);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XB := AsAlgebraElement(A);[127X[104X
    [4X[28X<Rationals^2|(1)*x.1>[128X[104X
    [4X[25Xgap>[125X [27XC := AsVectorElement(B);[127X[104X
    [4X[25Xgap>[125X [27XA=B; B=C;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X6.1-17 AsAlgebraMachine[101X
  
  [29X[2XAsAlgebraMachine[102X( [3Xm[103X ) [32X operation
  [29X[2XAsAlgebraElement[102X( [3Xm[103X ) [32X operation
  [6XReturns:[106X  [33X[0;10YThe machine/element [3Xm[103X in algebra form.[133X
  
  [33X[0;0YThis command accepts a linear machine, and converts it to algebra form.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XA := AsLinearElement(Rationals,I4Monoid.1);[127X[104X
    [4X[28X<Linear element on alphabet Rationals^2 with 2-dimensional stateset>[128X[104X
    [4X[25Xgap>[125X [27XAsAlgebraElement(A)=AsAlgebraElement(Rationals,I4Monoid.1);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XA=AsAlgebraElement(A);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
