  
  [1m[4m[31m4. Functionality[0m
  
  
  [1m[4m[31m4.1 Functions for creating forms[0m
  
  [1m[4m[31m4.1-1 BilinearFormByMatrix[0m
  
  [1m[34m> BilinearFormByMatrix( [0m[22m[34mm, f[0m[1m[34m ) ____________________________________[0moperation
  [1mReturns:[0m  a bilinear form
  
  The  argument  [22m[34mm[0m  must be a square matrix over the finite field [22m[34mf[0m. The field
  must be specified, as only the characteristic of the underlying field can be
  determined  by  the  entries  of [22m[34mm[0m. The output will be a record rec( matrix,
  basefield, type ).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gf := GF(3^2);[0m
    [22m[35mGF(3^2)[0m
    [22m[35mgap> mat := IdentityMat(4, gf);[0m
    [22m[35m[ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], [0m
    [22m[35m  [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ] ][0m
    [22m[35mgap> f := BilinearFormByMatrix( mat, gf );[0m
    [22m[35m< bilinear form >[0m
    [22m[35mgap> Display(f);[0m
    [22m[35mBilinear form[0m
    [22m[35mGram Matrix:[0m
    [22m[35m 1 . . .[0m
    [22m[35m . 1 . .[0m
    [22m[35m . . 1 .[0m
    [22m[35m . . . 1[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-2 QuadraticFormByMatrix[0m
  
  [1m[34m> QuadraticFormByMatrix( [0m[22m[34mm, f[0m[1m[34m ) ___________________________________[0moperation
  [1mReturns:[0m  a quadratic form
  
  The  argument  [22m[34mm[0m  must be a square matrix over the finite field [22m[34mf[0m. The field
  must be specified, as only the characteristic of the underlying field can be
  determined  by  the  entries  of [22m[34mm[0m. The output will be a record rec( matrix,
  basefield, type ).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gf := GF(2^2);[0m
    [22m[35mGF(2^2)[0m
    [22m[35mgap> mat := InvariantQuadraticForm( SO(-1, 4, 4) )!.matrix;[0m
    [22m[35m[ [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], [0m
    [22m[35m  [ 0*Z(2), 0*Z(2), Z(2^2)^2, Z(2)^0 ], [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2^2)^2 ] ][0m
    [22m[35mgap> f := QuadraticFormByMatrix( mat, gf );[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> Display(f);[0m
    [22m[35mQuadratic form[0m
    [22m[35mGram Matrix:[0m
    [22m[35mz = Z(4)[0m
    [22m[35m   .   1   .   .[0m
    [22m[35m   .   .   .   .[0m
    [22m[35m   .   . z^2   1[0m
    [22m[35m   .   .   . z^2[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-3 HermitianFormByMatrix[0m
  
  [1m[34m> HermitianFormByMatrix( [0m[22m[34mm, f[0m[1m[34m ) ___________________________________[0moperation
  [1mReturns:[0m  a quadratic form
  
  The  argument  [22m[34mm[0m  must  be a square matrix over the finite field [22m[34mf[0m of square
  order.  The  field  must  be  specified,  as  only the characteristic of the
  underlying field can be determined by the entries of [22m[34mm[0m. The output will be a
  record rec( matrix, basefield, type ).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gf := GF(3^2);[0m
    [22m[35mgap> mat := IdentityMat(4, gf);[0m
    [22m[35mgap> f := HermitianFormByMatrix( mat, gf );[0m
    [22m[35m< hermitian form >[0m
    [22m[35mgap> Display(f);[0m
    [22m[35mHermitian form[0m
    [22m[35mGram Matrix:[0m
    [22m[35m 1 . . .[0m
    [22m[35m . 1 . .[0m
    [22m[35m . . 1 .[0m
    [22m[35m . . . 1[0m
    [22m[35mWitt Index: 2[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-4 BilinearFormByPolynomial[0m
  
  [1m[34m> BilinearFormByPolynomial( [0m[22m[34mpoly, r, n[0m[1m[34m ) __________________________[0moperation
  [1m[34m> BilinearFormByPolynomial( [0m[22m[34mpoly, r[0m[1m[34m ) _____________________________[0moperation
  [1mReturns:[0m  a bilinear form
  
  The  argument  [22m[34mpoly[0m  must  be  a  polynomial  in  the polynomial ring [22m[34mr[0m. The
  (optional) last argument is the dimension for the underlying vector space of
  the  resulting  form,  which  by  default  is  the  number of indeterminates
  specified by [22m[34mpoly[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> r := PolynomialRing( GF(11), 4);[0m
    [22m[35mGF(11)[x_1,x_2,x_3,x_4][0m
    [22m[35mgap> vars := IndeterminatesOfPolynomialRing( r );[0m
    [22m[35m[ x_1, x_2, x_3, x_4 ][0m
    [22m[35mgap> pol := vars[1]*vars[2]+vars[3]*vars[4];[0m
    [22m[35mx_1*x_2+x_3*x_4[0m
    [22m[35mgap> form := BilinearFormByPolynomial(pol, r, 4);[0m
    [22m[35m< bilinear form >[0m
    [22m[35mgap> Display(form);[0m
    [22m[35mBilinear form[0m
    [22m[35mGram Matrix:[0m
    [22m[35m  .  6  .  .[0m
    [22m[35m  6  .  .  .[0m
    [22m[35m  .  .  .  6[0m
    [22m[35m  .  .  6  .[0m
    [22m[35mPolynomial: x_1*x_2+x_3*x_4[0m
    [22m[35mgap> ## Projective Points...[0m
    [22m[35mgap> projpoints := List(Subspaces( GF(11)^4, 1 ), Representative);;[0m
    [22m[35mgap> ## Number of totally isotropic points[0m
    [22m[35mgap> Number(projpoints, t -> IsZero( [t, t]^form ));[0m
    [22m[35m144[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-5 QuadraticFormByPolynomial[0m
  
  [1m[34m> QuadraticFormByPolynomial( [0m[22m[34mpoly, r, n[0m[1m[34m ) _________________________[0moperation
  [1m[34m> QuadraticFormByPolynomial( [0m[22m[34mpoly, r[0m[1m[34m ) ____________________________[0moperation
  [1mReturns:[0m  a quadratic form
  
  The  argument  [22m[34mpoly[0m  must  be  a  polynomial  in  the polynomial ring [22m[34mr[0m. The
  (optional) last argument is the dimension for the underlying vector space of
  the  resulting  form,  which  by  default  is  the  number of indeterminates
  specified by [22m[34mpoly[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> r := PolynomialRing( GF(8), 3);[0m
    [22m[35mGF(2^3)[x_1,x_2,x_3][0m
    [22m[35mgap> poly := r.1^2 + r.2^2 + r.3^2;[0m
    [22m[35mx_1^2+x_2^2+x_3^2[0m
    [22m[35mgap> form := QuadraticFormByPolynomial(poly, r);[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> RadicalOfForm(form);[0m
    [22m[35m<vector space over GF(2^3), with 3 generators>[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.1-6 HermitianFormByPolynomial[0m
  
  [1m[34m> HermitianFormByPolynomial( [0m[22m[34mpoly, r, n[0m[1m[34m ) _________________________[0moperation
  [1m[34m> HermitianFormByPolynomial( [0m[22m[34mpoly, r[0m[1m[34m ) ____________________________[0moperation
  [1mReturns:[0m  an hermitian form
  
  The  argument  [22m[34mpoly[0m  must  be a polynomial in the polynomial ring [22m[34mr[0m (defined
  over  a  finite  field of square order). The (optional) last argument is the
  dimension  for  the  underlying vector space of the resulting form, which by
  default is the number of indeterminates specified by [22m[34mpoly[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> r := PolynomialRing( GF(9), 4);[0m
    [22m[35mGF(3^2)[x_1,x_2,x_3,x_4][0m
    [22m[35mgap> vars := IndeterminatesOfPolynomialRing( r );[0m
    [22m[35m[ x_1, x_2, x_3, x_4 ][0m
    [22m[35mgap> poly := vars[1]*vars[2]^3+vars[1]^3*vars[2]+vars[3]*vars[4]^3+vars[3]^3*vars[4];[0m
    [22m[35mx_1^3*x_2+x_1*x_2^3+x_3^3*x_4+x_3*x_4^3[0m
    [22m[35mgap> form := HermitianFormByPolynomial(poly,r);[0m
    [22m[35m< hermitian form >[0m
    [22m[35mgap> Display(form);[0m
    [22m[35mHermitian form[0m
    [22m[35mGram Matrix:[0m
    [22m[35m . 1 . .[0m
    [22m[35m 1 . . .[0m
    [22m[35m . . . 1[0m
    [22m[35m . . 1 .[0m
    [22m[35mPolynomial: x_1^3*x_2+x_1*x_2^3+x_3^3*x_4+x_3*x_4^3[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.2 Attributes and properties of forms[0m
  
  [1m[4m[31m4.2-1 IsReflexiveForm[0m
  
  [1m[34m> IsReflexiveForm( [0m[22m[34mf[0m[1m[34m ) ____________________________________________[0mattribute
  [1mReturns:[0m  true or false.
  
  A  sesquilinear  form  f  is [22m[36mreflexive[0m if whenever we have f(u,v)=0, then we
  also have f(v,u)=0. This operation simply returns [22m[34mtrue[0m or [22m[34mfalse[0m.
  
  [1m[4m[31m4.2-2 IsAlternatingForm[0m
  
  [1m[34m> IsAlternatingForm( [0m[22m[34mf[0m[1m[34m ) __________________________________________[0mattribute
  [1mReturns:[0m  true or false.
  
  A  bilinear  form  f  is  [22m[36malternating[0m  if f(v,v)=0 for all v. This operation
  simply returns [22m[34mtrue[0m or [22m[34mfalse[0m.
  
  [1m[4m[31m4.2-3 IsSymmetricForm[0m
  
  [1m[34m> IsSymmetricForm( [0m[22m[34mf[0m[1m[34m ) ____________________________________________[0mattribute
  [1mReturns:[0m  true or false.
  
  A  bilinear  form f is [22m[36msymmetric[0m if f(u,v)=f(v,u) for all pairs of vectors u
  and v. This operation simply returns [22m[34mtrue[0m or [22m[34mfalse[0m.
  
  [1m[4m[31m4.2-4 IsDegenerateForm[0m
  
  [1m[34m> IsDegenerateForm( [0m[22m[34mf[0m[1m[34m ) ___________________________________________[0mattribute
  [1mReturns:[0m  true or false.
  
  A sesquilinear form f is [22m[36mdegenerate[0m if there exists a nonzero vector v which
  is  orthogonal to every other vector. That is, f(v,w)=0 for all w. Likewise,
  a  quadratic  form  Q is degenerate if there is a nonzero vector v such that
  Q(v)=0. This operation simply returns [22m[34mtrue[0m or [22m[34mfalse[0m.
  
  [1m[4m[31m4.2-5 BaseField[0m
  
  [1m[34m> BaseField( [0m[22m[34mf[0m[1m[34m ) __________________________________________________[0mattribute
  [1mReturns:[0m  the underlying field of [22m[34mf[0m.
  
  [1m[4m[31m4.2-6 GramMatrix[0m
  
  [1m[34m> GramMatrix( [0m[22m[34mf[0m[1m[34m ) _________________________________________________[0mattribute
  [1mReturns:[0m  the associated Gram matrix of [22m[34mf[0m.
  
  [1m[4m[31m4.2-7 WittIndex[0m
  
  [1m[34m> WittIndex( [0m[22m[34mf[0m[1m[34m ) __________________________________________________[0mattribute
  [1mReturns:[0m  the Witt index of [22m[34mf[0m.
  
  The  Witt  index is the maximum dimension of a totally singular subspace. So
  for  example,  if  [22m[34mf[0m  is  a  symplectic  form  and d is the dimension of its
  underlying vector space, then the Witt index of [22m[34mf[0m is d/2.
  
  [1m[4m[31m4.2-8 RadicalOfForm[0m
  
  [1m[34m> RadicalOfForm( [0m[22m[34mf[0m[1m[34m ) ______________________________________________[0mattribute
  [1mReturns:[0m  a subspace, the radical, of the vectors space associated with [22m[34mf[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> r := PolynomialRing( GF(8), 3 );[0m
    [22m[35mGF(2^3)[x_1,x_2,x_3][0m
    [22m[35mgap> poly := r.1^2 + r.2 * r.3;[0m
    [22m[35mx_1^2+x_2*x_3[0m
    [22m[35mgap> form := QuadraticFormByPolynomial( poly, r );[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> RadicalOfForm( form );[0m
    [22m[35m<vector space of dimension 1 over GF(2^3)>[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.2-9 PolynomialOfForm[0m
  
  [1m[34m> PolynomialOfForm( [0m[22m[34mf[0m[1m[34m ) ___________________________________________[0mattribute
  [1mReturns:[0m  the polynomial associated with [22m[34mf[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> mat := [ [ Z(8) , 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], [0m
    [22m[35m [ 0*Z(2), Z(2)^0, Z(2^3)^5, 0*Z(2), 0*Z(2) ], [0m
    [22m[35m [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], [0m
    [22m[35m [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], [0m
    [22m[35m [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ];;[0m
    [22m[35mgap> form := QuadraticFormByMatrix(mat,GF(8));[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> PolynomialOfForm(form);[0m
    [22m[35mZ(2^3)*x_1^2+x_2^2+Z(2^3)^5*x_2*x_3+x_4*x_5[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.2-10 DiscriminantOfForm[0m
  
  [1m[34m> DiscriminantOfForm( [0m[22m[34mf[0m[1m[34m ) _________________________________________[0mattribute
  [1mReturns:[0m  a string
  
  Given  a  quadratic or sesquilinear form [22m[34mf[0m, this operation returns a string:
  ``square''  or  ``nonsquare''.  Discriminants  can  be used to delineate the
  isometry type of an orthogonal form in even (algebraic) dimension.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gram := InvariantQuadraticForm(GO(-1,4,5))!.matrix;;[0m
    [22m[35mgap> f := QuadraticFormByMatrix(gram, GF(5));[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> DiscriminantOfForm(f);[0m
    [22m[35m"nonsquare"[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.3 Functions for changing forms[0m
  
  [1m[4m[31m4.3-1 BaseChangeToCanonical[0m
  
  [1m[34m> BaseChangeToCanonical( [0m[22m[34mf[0m[1m[34m ) ______________________________________[0moperation
  [1mReturns:[0m  a base-transition matrix
  
  The argument [22m[34mf[0m is a sesquilinear or quadratic form. For every isometry class
  of  forms,  there  is a canonical representative, which is in block diagonal
  form.  If  [22m[34mM[0m is the Gram matrix of the form [22m[34mf[0m, then [22m[34mb * M * TransposedMat(b)[0m
  is the Gram matrix of the canonical representative.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> f := GF(3);[0m
    [22m[35mGF(3)[0m
    [22m[35mgap> gram := [[0m
    [22m[35m[0,0,0,1,0,0], [0m
    [22m[35m[0,0,0,0,1,0],[0m
    [22m[35m[0,0,0,0,0,1],[0m
    [22m[35m[-1,0,0,0,0,0],[0m
    [22m[35m[0,-1,0,0,0,0],[0m
    [22m[35m[0,0,-1,0,0,0]] * One(f);;[0m
    [22m[35mgap> form := BilinearFormByMatrix( gram, f );[0m
    [22m[35m< bilinear form >[0m
    [22m[35mgap> b := BaseChangeToCanonical( form );;[0m
    [22m[35mgap> Display( b * gram * TransposedMat(b) );[0m
    [22m[35m . 1 . . . .[0m
    [22m[35m 2 . . . . .[0m
    [22m[35m . . . 1 . .[0m
    [22m[35m . . 2 . . .[0m
    [22m[35m . . . . . 1[0m
    [22m[35m . . . . 2 .[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.3-2 IsometricCanonicalForm[0m
  
  [1m[34m> IsometricCanonicalForm( [0m[22m[34mf[0m[1m[34m ) _____________________________________[0mattribute
  [1mReturns:[0m  the canonical form isometric to the sesquilinear or quadratic form
            [22m[34mf[0m.
  
  For  every  isometry  type  of  sesquilinear  or  quadratic form, there is a
  canonical  one.  In  [1mForms[0m,  the  canonical form of each class is that which
  preserves the natural hyperbolic line decomposition (see Secton [1m3.5[0m).
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> mat := [ [ Z(8) , 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], [0m
    [22m[35m[ 0*Z(2), Z(2)^0, Z(2^3)^5, 0*Z(2), 0*Z(2) ], [0m
    [22m[35m[ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], [0m
    [22m[35m[ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], [0m
    [22m[35m[ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ];;[0m
    [22m[35mgap> form := QuadraticFormByMatrix(mat,GF(8));[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> iso := IsometricCanonicalForm(form);[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> Display(form);[0m
    [22m[35mQuadratic form[0m
    [22m[35mGram Matrix:[0m
    [22m[35mz = Z(8)[0m
    [22m[35m z^1   .   .   .   .[0m
    [22m[35m   .   1 z^5   .   .[0m
    [22m[35m   .   .   .   .   .[0m
    [22m[35m   .   .   .   .   1[0m
    [22m[35m   .   .   .   .   .[0m
    [22m[35mWitt Index: 2[0m
    [22m[35mgap> Display(iso);[0m
    [22m[35mQuadratic form[0m
    [22m[35mGram Matrix:[0m
    [22m[35m 1 . . . .[0m
    [22m[35m . . 1 . .[0m
    [22m[35m . . . . .[0m
    [22m[35m . . . . 1[0m
    [22m[35m . . . . .[0m
    [22m[35mWitt Index: 2[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.4 Operations on forms[0m
  
  [1m[4m[31m4.4-1 BaseChangeHomomorphism[0m
  
  [1m[34m> BaseChangeHomomorphism( [0m[22m[34mb, gf[0m[1m[34m ) _________________________________[0moperation
  [1mReturns:[0m  the    inner   automorphism   of   GL(d,q)   associated   to   the
            base-transition [22m[34mb[0m.
  
  The argument [22m[34mb[0m must be an invertible matrix over the finite field [22m[34mgf[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gl:=GL(3,3);[0m
    [22m[35mGL(3,3)[0m
    [22m[35mgap> go:=GO(3,3);[0m
    [22m[35mGO(0,3,3)[0m
    [22m[35mgap> gram:=InvariantBilinearForm(go)!.matrix;[0m
    [22m[35m[ [ 0*Z(3), Z(3)^0, 0*Z(3) ], [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3) ] ][0m
    [22m[35mgap> f:=FormByMatrix(gram,GF(3),"parabolic");[0m
    [22m[35m< bilinear form >[0m
    [22m[35mgap> b:=BaseChangeToCanonical(f);;[0m
    [22m[35mgap> hom := BaseChangeHomomorphism(b, GF(3));[0m
    [22m[35m^[ [ 0*Z(3), 0*Z(3), Z(3) ], [ Z(3), Z(3), Z(3)^0 ], [ Z(3), 0*Z(3), Z(3) ] ][0m
    [22m[35mgap> newgo := Image(hom, go); [0m
    [22m[35mGroup([0m
    [22m[35m[ [ [ Z(3)^0, 0*Z(3), Z(3) ], [ Z(3)^0, Z(3), Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3) ] ], [0m
    [22m[35m  [ [ Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), Z(3), 0*Z(3) ], [ Z(3)^0, Z(3)^0, Z(3) ] ] ])[0m
    [22m[35mgap> gens:=GeneratorsOfGroup(newgo);;[0m
    [22m[35mgap> canonical := b * gram * TransposedMat(b);[0m
    [22m[35m[ [ Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3)^0 ], [ 0*Z(3), Z(3)^0, 0*Z(3) ] ][0m
    [22m[35mgap> ForAll(gens, y -> y * canonical * TransposedMat(y) = canonical);[0m
    [22m[35mtrue[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m4.4-2 EvaluateForm[0m
  
  [1m[34m> EvaluateForm( [0m[22m[34mf, u, v[0m[1m[34m ) _________________________________________[0moperation
  [1m[34m> EvaluateForm( [0m[22m[34mf, u[0m[1m[34m ) ____________________________________________[0moperation
  [1mReturns:[0m  a finite field element
  
  The  argument  [22m[34mf[0m  is  either a sesquilinear or quadratic form defined over a
  finite  field GF(q). The other argument is a pair of vectors or matrices, or
  a  single  vector or matrix, which represent the bases of given subspaces of
  GF(q)^d.  There  is also an overloading of the operation [22m[34m\^[0m which we show in
  the following example:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> mat := [[Z(8),0,0,0],[0,0,Z(8)^4,0],[0,0,0,1],[0,0,0,0]]*Z(8)^0;;[0m
    [22m[35mgap> form := QuadraticFormByMatrix(mat,GF(8));[0m
    [22m[35m< quadratic form >[0m
    [22m[35mgap> u := [ Z(2^3)^4, Z(2^3)^4, Z(2)^0, Z(2^3)^3 ];[0m
    [22m[35m[ Z(2^3)^4, Z(2^3)^4, Z(2)^0, Z(2^3)^3 ][0m
    [22m[35mgap> EvaluateForm( form, u );[0m
    [22m[35mZ(2^3)^6[0m
    [22m[35mgap> u^form;[0m
    [22m[35mZ(2^3)^6[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Here is an example using sesquilinear forms...
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> gram := [[0,0,0,0,0,2],[0,0,0,0,2,0],[0,0,0,1,0,0],[0,0,1,0,0,0],[0m
    [22m[35m [0,2,0,0,0,0],[2,0,0,0,0,0]]*Z(3)^0;;[0m
    [22m[35mgap> form := BilinearFormByMatrix(gram,GF(3));[0m
    [22m[35m< bilinear form >[0m
    [22m[35mgap> u := [ [ Z(3)^0, 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), Z(3)^0 ], [0m
    [22m[35m  [ 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, Z(3), 0*Z(3) ] ];;[0m
    [22m[35mgap> v := [ [ Z(3)^0, 0*Z(3), Z(3)^0, Z(3), 0*Z(3), Z(3) ], [0m
    [22m[35m  [ 0*Z(3), Z(3)^0, 0*Z(3), Z(3), Z(3), Z(3) ] ];;[0m
    [22m[35mgap> EvaluateForm( form, u, v);[0m
    [22m[35m[ [ Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3) ] ][0m
    [22m[35mgap> [u,v]^form;[0m
    [22m[35m[ [ Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3) ] ][0m
  [22m[35m------------------------------------------------------------------[0m
  
