<!-- 

  examples.xml            Forms package documentation
                                                                   John Bamberg
                                                               and Jan De Beule
                                                                 
  Copyright (C) 2021, The University of Western Australia
  Copyright (C) 2021, Vrije Universiteit Brussel

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 <Alt Only="Text"><M>PG(2,8)</M></Alt><Alt Only="LaTeX"><M>&pg;(2,8)</M></Alt>
<Alt Only="HTML MathJax"><M>&pg;(2,8)</M></Alt><Alt Only="HTML noMathJax">PG(2,8)</Alt>
</Heading>

Consider the three-dimensional vector space <M>V</M> over the finite field
<Alt Only="Text"><M>GF(8)</M></Alt><Alt Only="LaTeX"><M>&gf;(8)</M></Alt><Alt Only="HTML MathJax"><M>&gf;(8)</M></Alt>
<Alt Only="HTML noMathJax">GF(8)</Alt>, and
consider the following quadratic polynomial in 3 variables:
<Alt Only="HTML MathJax"><Display>x_1^2+x_2x_3.</Display></Alt>
<Alt Only="LaTeX"><Display>x_1^2+x_2x_3.</Display></Alt>
<Alt Only="Text"><Display>x_1^2+x_2x_3.</Display></Alt>
<Alt Only="HTML noMathJax">&lt;center>x&lt;sub>1&lt;/sub>&lt;sup>2&lt;/sup>+x&lt;sub>2&lt;/sub>x&lt;sub>3&lt;/sub>.&lt;/center></Alt>
Then this polynomial defines a quadratic form on <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><![CDATA[
gap> gf := GF(8);
GF(2^3)
gap> vec := gf^3;
( GF(2^3)^3 )
gap> r := PolynomialRing( gf, 3);
PolynomialRing(..., [ 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 );
< quadratic form >
gap> Display( form );
Quadratic form
Gram Matrix:
 1 . .
 . . 1
 . . .
Polynomial: x_1^2+x_2*x_3
gap> IsDegenerateForm( form );
#I  Testing degeneracy of the *associated bilinear form*
true
gap> IsSingularForm( form );
false
gap> WittIndex( form );
1
gap> IsParabolicForm( form );
true
gap> RadicalOfForm( form );
<vector space over GF(2^3), with 0 generators>
]]></Example>
Now our conic is stabilised by a group isomorphic to
<Alt Only="Text"><M>GO(3,8)</M></Alt><Alt Only="LaTeX"><M>&go;(3,8)</M></Alt>
<Alt Only="HTML MathJax"><M>&go;(3,8)</M></Alt><Alt Only="HTML noMathJax">GO(3,8)</Alt>,
but which is not identical to the group returned by the GAP command
<C>GO(3,8)</C>. However, our conic is the canonical conic given in <Package>Forms</Package>.
<Example><![CDATA[
gap> canonical := IsometricCanonicalForm( form );
< parabolic quadratic form >
gap> form = canonical;
true
]]></Example>
So we ``change forms''...
<Example><![CDATA[
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) );
< quadratic form >
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
<Alt Only="Text"><M>GO(3,8)</M></Alt><Alt Only="LaTeX"><M>&go;(3,8)</M></Alt>
<Alt Only="HTML MathJax"><M>&go;(3,8)</M></Alt><Alt Only="HTML noMathJax">GO(3,8)</Alt> on the conic.
<Example><![CDATA[
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 <Alt Only="Text"><M>W(5,3)</M></Alt><Alt Only="LaTeX"><M>\mathrm{W}(5,3)</M></Alt>
<Alt Only="HTML MathJax"><M>\mathrm{W}(5,3)</M></Alt><Alt Only="HTML noMathJax">W(5,3)</Alt></Heading>
The symplectic polar space <Alt Only="Text"><M>W(5,q)</M></Alt><Alt Only="LaTeX"><M>\mathrm{W}(5,q)</M></Alt>
<Alt Only="HTML MathJax"><M>\mathrm{W}(5,q)</M></Alt><Alt Only="HTML noMathJax">W(5,q)</Alt> is defined by an
alternating reflexive bilinear form on the
six-dimensional vector space over the finite field &gfq;. Any invertible
<M>6 \times 6</M> matrix <M>A</M> which satisfies
<Alt Only="Text"><M>A+A^T=0</M></Alt><Alt Only="LaTeX"><M>A+A^T=0</M></Alt>
<Alt Only="HTML MathJax"><M>A+A^T=0</M></Alt><Alt Only="HTML noMathJax">A+A&lt;sup>T&lt;/sup>=0</Alt>
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
<Alt Only="Text"><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></Alt>
<Alt Only="LaTeX"><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></Alt>
<Alt Only="HTML MathJax"><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></Alt>
<Alt Only="HTML noMathJax">&lt;center>
f(x,y)=x&lt;sub>1&lt;/sub>y&lt;sub>2&lt;/sub>&lt;font face="symbol">-&lt;/font
>x&lt;sub>2&lt;/sub>y&lt;sub>1&lt;/sub>+x&lt;sub>3&lt;/sub>y&lt;sub>4&lt;/sub>&lt;font face="symbol">-&lt;/font
>x&lt;sub>4&lt;/sub>y&lt;sub>3&lt;/sub>+ ... +x&lt;sub>2n&lt;font face="symbol">-&lt;/font
>1&lt;/sub>y&lt;sub>2n&lt;/sub>&lt;font face="symbol">-&lt;/font
>x&lt;sub>2n&lt;/sub>y&lt;sub>2n&lt;font face="symbol">-&lt;/font
>1&lt;/sub>&lt;/center></Alt>
<Example>
<#Include SYSTEM "../examples/include/w53.include"> 
</Example>
</Section>

<Section>
<Heading>What is the form preserved by this group?</Heading>
Here we start with a matrix group which is available in GAP,
namely <Alt Only="Text"><M>GO(5,5)</M></Alt><Alt Only="LaTeX"><M>\mathrm{GO}(5,5)</M></Alt>
<Alt Only="HTML MathJax"><M>\mathrm{GO}(5,5)</M></Alt><Alt Only="HTML noMathJax"><M>GO(5,5)</M></Alt>.
We then conjugate this group by an
element of <Alt Only="Text"><M>GL(5,5)</M></Alt><Alt Only="LaTeX"><M>\mathrm{GL}(5,5)</M></Alt>
<Alt Only="HTML MathJax"><M>\mathrm{GL}(5,5)</M></Alt><Alt Only="HTML noMathJax"><M>GL(5,5)</M></Alt>,
and then we find the forms left invariant by this copy
of <Alt Only="Text"><M>GO(5,5)</M></Alt><Alt Only="LaTeX"><M>\mathrm{GO}(5,5)</M></Alt>
<Alt Only="HTML MathJax"><M>\mathrm{GO}(5,5)</M></Alt><Alt Only="HTML noMathJax"><M>GO(5,5)</M></Alt>
(which we expect to be a symmetric bilinear form).
<Example>
<#Include SYSTEM "../examples/include/preservedform.include"> 
</Example>
</Section>
</Chapter>
