<!-- 

  examples.xml            Forms package documentation
                                                                   John Bamberg
                                                               and Jan De Beule
                                                                 
  Copyright (C) 2007, Ghent University

This chapter gives examples for the usage of this package.

-->

<Chapter Label="examples">
<Heading>Examples</Heading>

Here we give some simple examples that display some of the functionality
of <Package>Forms</Package>.

<Section>
<Heading>A conic of PG(2,8)</Heading>

Consider the three-dimensional vector space <M>V=GF(8)^3</M> over
<M>GF(8)</M>, and consider the following quadratic polynomial
in 3 variables:
<Display>
x_1^2+x_2x_3.
</Display>
Then this polynomial defines a quadratic form in <M>V</M> and the zeros
form a <E>conic</E> of the associated projective plane. So in particular,
our quadratic form defines a degenerate parabolic quadric of Witt Index 1.
We will see now how we can use <Package>Forms</Package> to view this example.
<Example>
gap> gf := GF(8);
GF(2^3)
gap> vec := gf^3;
( GF(2^3)^3 )
gap> r := PolynomialRing( gf, 3 );
GF(2^3)[x_1,x_2,x_3]
gap> poly := r.1^2 + r.2 * r.3;
x_1^2+x_2*x_3
gap> form := QuadraticFormByPolynomial( poly, r );
&lt; quadratic form &gt;
gap> Display( form );
Quadratic form
Gram Matrix:
 1 . .
 . . 1
 . . .
Polynomial: x_1^2+x_2*x_3
gap> IsDegenerateForm( form );
true
gap> WittIndex( form );
1
gap> IsParabolicForm( form );
true
gap> RadicalOfForm( form );
&lt;vector space of dimension 1 over GF(2^3)&gt;
</Example>
Now our conic is stabilised by <M>GO(3,8)</M>, but not the same <M>GO(3,8)</M> that
is installed in GAP. However, our conic is the canonical conic given in <Package>Forms</Package>.
<Example>
gap> canonical := IsometricCanonicalForm( form );
&lt; quadratic form &gt;
gap> form = canonical;
true
</Example>
So we ``change forms''...
<Example>
gap> go := GO(3,8);
GO(0,3,8)
gap> mat := InvariantQuadraticForm( go )!.matrix;
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), 0*Z(2) ], 
[ 0*Z(2), Z(2)^0, 0*Z(2) ] ]
gap> gapform := QuadraticFormByMatrix( mat, GF(8) );
&lt; quadratic form &gt;
gap> b := BaseChangeToCanonical( gapform );
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2) ], 
[ 0*Z(2), 0*Z(2), Z(2)^0 ]  ]
gap> hom := BaseChangeHomomorphism( b, GF(8) );
^[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2) ], 
[ 0*Z(2), 0*Z(2), Z(2)^0 ] ]
gap> newgo := Image(hom, go);
Group([ [ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2^3), 0*Z(2) ], 
[ 0*Z(2), 0*Z(2), Z(2^3)^6 ] ],  [ [ Z(2)^0, 0*Z(2), 0*Z(2) ], 
[ Z(2)^0, Z(2)^0, Z(2)^0 ], [ 0*Z(2), Z(2)^0, 0*Z(2) ] ] ])
</Example>
Now we look at the action of our new <M>GO(3,8)</M> on the conic.
<Example>
gap> conic := Filtered(vec, x -> IsZero( x^form ));;
gap> Size( conic );
64
gap> orbs := Orbits(newgo, conic, OnRight);;
gap> List(orbs, Size);
[ 1, 63 ]
</Example> 
So we see that there is a fixed point, which is actually the
<E>nucleus</E> of the conic, or in other words, the radical
of the form.
</Section>

<Section>
<Heading>A form for W(5,3)</Heading>
The symplectic polar space <M>W(5,q)</M> is defined by an
alternating reflexive bilinear form on the
six-dimensional vector space <M>GF(q)^6</M>. Any invertible
<M>6\times 6</M> matrix <M>A</M> which satisfies
<M>A+A^T=0</M> is a candidate for the Gram matrix of
a symplectic polarity. The canonical form we adopt in
<Package>Forms</Package> for an alternating form is
<Display>f(x,y)=x_1y_2-x_2y_1+x_3y_4-x_4y_3\cdots+x_{2n-1}y_{2n}-x_{2n}y_{2n-1}.</Display>
  
<Example>
gap> f := GF(3);
GF(3)
gap> gram := [
[0,0,0,1,0,0], 
[0,0,0,0,1,0],
[0,0,0,0,0,1],
[-1,0,0,0,0,0],
[0,-1,0,0,0,0],
[0,0,-1,0,0,0]] * One(f);;
gap> form := BilinearFormByMatrix( gram, f );
&lt; bilinear form &gt;
gap> IsSymplecticForm( form );
true
gap> Display( form );
Bilinear form
Gram Matrix:
 . . . 1 . .
 . . . . 1 .
 . . . . . 1
 2 . . . . .
 . 2 . . . .
 . . 2 . . .
gap> b := BaseChangeToCanonical( form );;
gap> Display( b );
 . . . . . 1
 . . 2 . . .
 . . . . 1 .
 . 2 . . . .
 . . . 1 . .
 2 . . . . .
gap> Display( b * gram * TransposedMat(b) );
 . 1 . . . .
 2 . . . . .
 . . . 1 . .
 . . 2 . . .
 . . . . . 1
 . . . . 2 .
</Example>
</Section>

</Chapter>
