From f2a750d11592bce154ea8f07f3e42c06b9ed0eb7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 6 Dec 2023 17:09:37 +0100 Subject: [PATCH] Copy examples to tests --- tst/examples/assocbilform.tst | 20 ++++++ tst/examples/basechangehom.tst | 28 +++++++++ tst/examples/basechangetocanonical.tst | 22 +++++++ tst/examples/bg_th_ex1.tst | 8 +++ tst/examples/bg_th_ex2.tst | 23 +++++++ tst/examples/bg_th_ex3.tst | 20 ++++++ tst/examples/bg_th_ex4.tst | 30 +++++++++ tst/examples/bg_th_ex5.tst | 84 +++++++++++++++++++++++++ tst/examples/bg_th_ex6.tst | 20 ++++++ tst/examples/bg_th_ex7.tst | 20 ++++++ tst/examples/bg_th_ex8.tst | 41 ++++++++++++ tst/examples/bg_th_ex9.tst | 28 +++++++++ tst/examples/bilformbymatrix.tst | 47 ++++++++++++++ tst/examples/bilformbypoly.tst | 27 ++++++++ tst/examples/bilformbyquadform.tst | 31 +++++++++ tst/examples/conic.tst | 62 ++++++++++++++++++ tst/examples/discofform.tst | 8 +++ tst/examples/evalform.tst | 24 +++++++ tst/examples/hermitianformbymatrix.tst | 29 +++++++++ tst/examples/hermitianformbypoly.tst | 21 +++++++ tst/examples/isisotropicvector.tst | 30 +++++++++ tst/examples/isometriccanonicalform.tst | 31 +++++++++ tst/examples/issingularvector.tst | 23 +++++++ tst/examples/istotallyisotropic.tst | 26 ++++++++ tst/examples/istotallysingular.tst | 17 +++++ tst/examples/orthogonaltovector.tst | 42 +++++++++++++ tst/examples/polyofform.tst | 12 ++++ tst/examples/pres_sesforms1.tst | 14 +++++ tst/examples/pres_sesforms2.tst | 25 ++++++++ tst/examples/preservedform.tst | 24 +++++++ tst/examples/quadformbybilform.tst | 45 +++++++++++++ tst/examples/quadformbymatrix.tst | 30 +++++++++ tst/examples/quadformbypoly.tst | 26 ++++++++ tst/examples/quadformfields.tst | 16 +++++ tst/examples/radicalofform.tst | 11 ++++ tst/examples/scalarfromsim.tst | 19 ++++++ tst/examples/trivialform.tst | 22 +++++++ tst/examples/trivialform2.tst | 15 +++++ tst/examples/trivialform_prop.tst | 31 +++++++++ tst/examples/typeofform.tst | 57 +++++++++++++++++ tst/examples/w53.tst | 41 ++++++++++++ tst/examples/wittindex.tst | 37 +++++++++++ 42 files changed, 1187 insertions(+) create mode 100644 tst/examples/assocbilform.tst create mode 100644 tst/examples/basechangehom.tst create mode 100644 tst/examples/basechangetocanonical.tst create mode 100644 tst/examples/bg_th_ex1.tst create mode 100644 tst/examples/bg_th_ex2.tst create mode 100644 tst/examples/bg_th_ex3.tst create mode 100644 tst/examples/bg_th_ex4.tst create mode 100644 tst/examples/bg_th_ex5.tst create mode 100644 tst/examples/bg_th_ex6.tst create mode 100644 tst/examples/bg_th_ex7.tst create mode 100644 tst/examples/bg_th_ex8.tst create mode 100644 tst/examples/bg_th_ex9.tst create mode 100644 tst/examples/bilformbymatrix.tst create mode 100644 tst/examples/bilformbypoly.tst create mode 100644 tst/examples/bilformbyquadform.tst create mode 100644 tst/examples/conic.tst create mode 100644 tst/examples/discofform.tst create mode 100644 tst/examples/evalform.tst create mode 100644 tst/examples/hermitianformbymatrix.tst create mode 100644 tst/examples/hermitianformbypoly.tst create mode 100644 tst/examples/isisotropicvector.tst create mode 100644 tst/examples/isometriccanonicalform.tst create mode 100644 tst/examples/issingularvector.tst create mode 100644 tst/examples/istotallyisotropic.tst create mode 100644 tst/examples/istotallysingular.tst create mode 100644 tst/examples/orthogonaltovector.tst create mode 100644 tst/examples/polyofform.tst create mode 100644 tst/examples/pres_sesforms1.tst create mode 100644 tst/examples/pres_sesforms2.tst create mode 100644 tst/examples/preservedform.tst create mode 100644 tst/examples/quadformbybilform.tst create mode 100644 tst/examples/quadformbymatrix.tst create mode 100644 tst/examples/quadformbypoly.tst create mode 100644 tst/examples/quadformfields.tst create mode 100644 tst/examples/radicalofform.tst create mode 100644 tst/examples/scalarfromsim.tst create mode 100644 tst/examples/trivialform.tst create mode 100644 tst/examples/trivialform2.tst create mode 100644 tst/examples/trivialform_prop.tst create mode 100644 tst/examples/typeofform.tst create mode 100644 tst/examples/w53.tst create mode 100644 tst/examples/wittindex.tst diff --git a/tst/examples/assocbilform.tst b/tst/examples/assocbilform.tst new file mode 100644 index 0000000..6692ded --- /dev/null +++ b/tst/examples/assocbilform.tst @@ -0,0 +1,20 @@ +gap> START_TEST("Forms: assocbilform.tst"); +gap> #Constructing form: AssociatedBilinearForm +gap> r:= PolynomialRing(GF(121),6); +GF(11^2)[x_1,x_2,x_3,x_4,x_5,x_6] +gap> poly := r.1*r.5-r.2*r.6+r.3*r.4; +x_1*x_5-x_2*x_6+x_3*x_4 +gap> form := QuadraticFormByPolynomial(poly,r); +< quadratic form > +gap> aform := AssociatedBilinearForm(form); +< bilinear form > +gap> Display(aform); +Bilinear form +Gram Matrix: + . . . . 1 . + . . . . . 10 + . . . 1 . . + . . 1 . . . + 1 . . . . . + . 10 . . . . +gap> STOP_TEST("assocbilform.tst", 10000 ); diff --git a/tst/examples/basechangehom.tst b/tst/examples/basechangehom.tst new file mode 100644 index 0000000..cc7cb96 --- /dev/null +++ b/tst/examples/basechangehom.tst @@ -0,0 +1,28 @@ +gap> START_TEST("Forms: basechangehom.tst"); +gap> #morphisms: BaseChangeHomomorphism +gap> gl:=GL(3,3); +GL(3,3) +gap> go:=GO(3,3); +GO(0,3,3) +gap> form := PreservedSesquilinearForms(go)[1]; +< bilinear form > +gap> gram := GramMatrix( form ); +[ [ 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) ] ] +gap> b := BaseChangeToCanonical(form);; +gap> hom := BaseChangeHomomorphism(b, GF(3)); +^[ [ 0*Z(3), 0*Z(3), Z(3) ], [ Z(3), Z(3), Z(3)^0 ], [ Z(3), 0*Z(3), Z(3) ] ] +gap> newgo := Image(hom, go); +Group( +[ + [ [ Z(3)^0, 0*Z(3), Z(3) ], [ Z(3)^0, Z(3), Z(3)^0 ], + [ 0*Z(3), 0*Z(3), Z(3) ] ], + [ [ Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), Z(3), 0*Z(3) ], + [ Z(3)^0, Z(3)^0, Z(3) ] ] ]) +gap> gens := GeneratorsOfGroup(newgo);; +gap> canonical := b * gram * TransposedMat(b); +[ [ 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) ] ] +gap> ForAll(gens, y -> y * canonical * TransposedMat(y) = canonical); +true +gap> STOP_TEST("basechangehom.tst", 10000 ); diff --git a/tst/examples/basechangetocanonical.tst b/tst/examples/basechangetocanonical.tst new file mode 100644 index 0000000..8fcd4e9 --- /dev/null +++ b/tst/examples/basechangetocanonical.tst @@ -0,0 +1,22 @@ +gap> START_TEST("Forms: basechangetocanonical.tst"); +gap> #morphisms: BaseChangeToCanonical +gap> gf := 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(gf);; +gap> form := BilinearFormByMatrix( gram, gf ); +< bilinear form > +gap> b := BaseChangeToCanonical( form );; +gap> Display( b * gram * TransposedMat(b) ); + . 1 . . . . + 2 . . . . . + . . . 1 . . + . . 2 . . . + . . . . . 1 + . . . . 2 . +gap> STOP_TEST("basechangetocanonical.tst", 10000 ); diff --git a/tst/examples/bg_th_ex1.tst b/tst/examples/bg_th_ex1.tst new file mode 100644 index 0000000..01ad110 --- /dev/null +++ b/tst/examples/bg_th_ex1.tst @@ -0,0 +1,8 @@ +gap> START_TEST("Forms: bg_th_ex1.tst"); +gap> #Background theory: example 1 +gap> mat := [[1,0,0],[0,1,4],[1,2,1]]*Z(5)^0; +[ [ Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, Z(5)^2 ], + [ Z(5)^0, Z(5), Z(5)^0 ] ] +gap> form := BilinearFormByMatrix(mat,GF(5)); +Error, Invalid Gram matrix +gap> STOP_TEST("bg_th_ex1.tst", 10000 ); diff --git a/tst/examples/bg_th_ex2.tst b/tst/examples/bg_th_ex2.tst new file mode 100644 index 0000000..f9965e4 --- /dev/null +++ b/tst/examples/bg_th_ex2.tst @@ -0,0 +1,23 @@ +gap> START_TEST("Forms: bg_th_ex2.tst"); +gap> #Background theory: example 2 +gap> mat := [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,-1]]*Z(9)^0; +[ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], + [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3) ] ] +gap> form := BilinearFormByMatrix(mat,GF(9)); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: + 1 . . . + . 1 . . + . . 1 . + . . . 2 +gap> IsReflexiveForm(form); +true +gap> IsSymmetricForm(form); +true +gap> IsAlternatingForm(form); +false +gap> Dimension(RadicalOfForm(form)); +0 +gap> STOP_TEST("bg_th_ex2.tst", 10000 ); diff --git a/tst/examples/bg_th_ex3.tst b/tst/examples/bg_th_ex3.tst new file mode 100644 index 0000000..b9044fa --- /dev/null +++ b/tst/examples/bg_th_ex3.tst @@ -0,0 +1,20 @@ +gap> START_TEST("Forms: bg_th_ex3.tst"); +gap> #Background theory: example 3 +gap> mat := [[0,0,-2],[0,0,1],[2,-1,0]]*Z(7)^0; +[ [ 0*Z(7), 0*Z(7), Z(7)^5 ], [ 0*Z(7), 0*Z(7), Z(7)^0 ], + [ Z(7)^2, Z(7)^3, 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat,GF(7)); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: + . . 5 + . . 1 + 2 6 . +gap> IsSymmetricForm(form); +false +gap> IsAlternatingForm(form); +true +gap> Dimension(RadicalOfForm(form)); +1 +gap> STOP_TEST("bg_th_ex3.tst", 10000 ); diff --git a/tst/examples/bg_th_ex4.tst b/tst/examples/bg_th_ex4.tst new file mode 100644 index 0000000..d01f0d2 --- /dev/null +++ b/tst/examples/bg_th_ex4.tst @@ -0,0 +1,30 @@ +gap> START_TEST("Forms: bg_th_ex4.tst"); +gap> #Background theory: example 4 +gap> mat := [[0,1,0,0,0,0],[1,0,0,0,0,0],[0,0,0,0,0,1], +> [0,0,0,0,1,0],[0,0,0,1,0,0],[0,0,1,0,0,0]]*Z(16)^0; +[ [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := BilinearFormByMatrix(mat,GF(16)); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: + . 1 . . . . + 1 . . . . . + . . . . . 1 + . . . . 1 . + . . . 1 . . + . . 1 . . . +gap> IsSymmetricForm(form); +true +gap> IsAlternatingForm(form); +true +gap> IsDegenerateForm(form); +false +gap> WittIndex(form); +3 +gap> STOP_TEST("bg_th_ex4.tst", 10000 ); diff --git a/tst/examples/bg_th_ex5.tst b/tst/examples/bg_th_ex5.tst new file mode 100644 index 0000000..794c116 --- /dev/null +++ b/tst/examples/bg_th_ex5.tst @@ -0,0 +1,84 @@ +gap> START_TEST("Forms: bg_th_ex5.tst"); +gap> #Background theory: example 5 +gap> mat := [[0*Z(5),0*Z(5),0*Z(25),Z(25)^3],[0*Z(5),0*Z(5),Z(25)^3,0*Z(25)], +> [0*Z(5),-Z(25)^3,0*Z(5),0*Z(5)],[-Z(25)^3,0*Z(5),0*Z(25),0*Z(25)]]; +[ [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5^2)^3 ], [ 0*Z(5), 0*Z(5), Z(5^2)^3, 0*Z(5) ], + [ 0*Z(5), Z(5^2)^15, 0*Z(5), 0*Z(5) ], + [ Z(5^2)^15, 0*Z(5), 0*Z(5), 0*Z(5) ] ] +gap> form := HermitianFormByMatrix(mat,GF(25)); +< hermitian form > +gap> Display(form); +Hermitian form +Gram Matrix: +z = Z(25) + . . . z^3 + . . z^3 . + . z^15 . . + z^15 . . . +gap> WittIndex(form); +2 +gap> form2 := BilinearFormByMatrix(mat,GF(25)); +< bilinear form > +gap> Display(form2); +Bilinear form +Gram Matrix: +z = Z(25) + . . . z^3 + . . z^3 . + . z^15 . . + z^15 . . . +gap> IsAlternatingForm(form2); +true +gap> Display(IsometricCanonicalForm(form)); +Hermitian form +Gram Matrix: + 1 . . . + . 1 . . + . . 1 . + . . . 1 +Witt Index: 2 +gap> Display(IsometricCanonicalForm(form2)); +Bilinear form +Gram Matrix: + . 1 . . + 4 . . . + . . . 1 + . . 4 . +Witt Index: 2 +gap> V := GF(25)^4; +( GF(5^2)^4 ) +gap> u := [Z(5)^0,Z(5^2)^11,Z(5)^3,Z(5^2)^13 ]; +[ Z(5)^0, Z(5^2)^11, Z(5)^3, Z(5^2)^13 ] +gap> [u,u]^form; +0*Z(5) +gap> v := [Z(5)^0,Z(5^2)^5,Z(5^2),Z(5^2)^13 ]; +[ Z(5)^0, Z(5^2)^5, Z(5^2), Z(5^2)^13 ] +gap> [v,v]^form; +0*Z(5) +gap> [u,v]^form; +Z(5^2)^7 +gap> ([v,u]^form)^5; +Z(5^2)^7 +gap> w := [Z(5^2)^21,Z(5^2)^19,Z(5^2)^4,Z(5)^3 ]; +[ Z(5^2)^21, Z(5^2)^19, Z(5^2)^4, Z(5)^3 ] +gap> [w,w]^form; +Z(5) +gap> v := [Z(5)^0,Z(5^2)^10,Z(5^2)^15,Z(5^2)^3 ]; +[ Z(5)^0, Z(5^2)^10, Z(5^2)^15, Z(5^2)^3 ] +gap> u := [Z(5)^3,Z(5^2)^9,Z(5^2)^4,Z(5^2)^16 ]; +[ Z(5)^3, Z(5^2)^9, Z(5^2)^4, Z(5^2)^16 ] +gap> w := [Z(5)^2,Z(5^2)^9,Z(5^2)^23,Z(5^2)^11 ]; +[ Z(5)^2, Z(5^2)^9, Z(5^2)^23, Z(5^2)^11 ] +gap> [u,v]^form; +0*Z(5) +gap> [u,w]^form; +0*Z(5) +gap> [v,w]^form; +0*Z(5) +gap> s := Subspace(V,[v,u,w]); + +gap> Dimension(s); +2 +gap> WittIndex(form); +2 +gap> STOP_TEST("bg_th_ex5.tst", 10000 ); diff --git a/tst/examples/bg_th_ex6.tst b/tst/examples/bg_th_ex6.tst new file mode 100644 index 0000000..c0f90d4 --- /dev/null +++ b/tst/examples/bg_th_ex6.tst @@ -0,0 +1,20 @@ +gap> START_TEST("Forms: bg_th_ex6.tst"); +gap> #Background theory: example 6 +gap> V := GF(4)^3; +( GF(2^2)^3 ) +gap> mat := [[Z(2^2)^2,Z(2^2),Z(2^2)^2],[Z(2^2)^2,Z(2)^0,Z(2)^0], +> [0*Z(2),Z(2)^0,0*Z(2)]]; +[ [ Z(2^2)^2, Z(2^2), Z(2^2)^2 ], [ Z(2^2)^2, Z(2)^0, Z(2)^0 ], + [ 0*Z(2), Z(2)^0, 0*Z(2) ] ] +gap> qform := QuadraticFormByMatrix(mat, GF(4)); +< quadratic form > +gap> Display( qform ); +Quadratic form +Gram Matrix: +z = Z(4) + z^2 1 z^2 + . 1 . + . . . +gap> PolynomialOfForm( qform ); +Z(2^2)^2*x_1^2+x_1*x_2+Z(2^2)^2*x_1*x_3+x_2^2 +gap> STOP_TEST("bg_th_ex6.tst", 10000 ); diff --git a/tst/examples/bg_th_ex7.tst b/tst/examples/bg_th_ex7.tst new file mode 100644 index 0000000..203b4c2 --- /dev/null +++ b/tst/examples/bg_th_ex7.tst @@ -0,0 +1,20 @@ +gap> START_TEST("Forms: bg_th_ex7.tst"); +gap> #Background theory: example 7 +gap> r := PolynomialRing(GF(8),4); +GF(2^3)[x_1,x_2,x_3,x_4] +gap> poly := r.1*r.2+r.3*r.4; +x_1*x_2+x_3*x_4 +gap> qform := QuadraticFormByPolynomial(poly, r); +< quadratic form > +gap> Display(qform); +Quadratic form +Gram Matrix: + . 1 . . + . . . . + . . . 1 + . . . . +Polynomial: x_1*x_2+x_3*x_4 + +gap> Dimension(RadicalOfForm(qform)); +0 +gap> STOP_TEST("bg_th_ex7.tst", 10000 ); diff --git a/tst/examples/bg_th_ex8.tst b/tst/examples/bg_th_ex8.tst new file mode 100644 index 0000000..f70d1c6 --- /dev/null +++ b/tst/examples/bg_th_ex8.tst @@ -0,0 +1,41 @@ +gap> START_TEST("Forms: bg_th_ex8.tst"); +gap> #Background theory: example 8 +gap> mat := [[Z(16)^3,1,0,0],[0,Z(16)^5,0,0], +> [0,0,Z(16)^3,1],[0,0,0,Z(16)^12]]*Z(16)^0; +[ [ Z(2^4)^3, Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2^2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2^4)^3, Z(2)^0 ], [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2^4)^12 ] + ] +gap> qform := QuadraticFormByMatrix(mat,GF(16)); +< quadratic form > +gap> Display( qform ); +Quadratic form +Gram Matrix: +z = Z(16) + z^3 1 . . + . z^5 . . + . . z^3 1 + . . . z^12 +gap> mat2 := [[Z(16)^7,1,0,0],[0,0,0,0], +> [0,0,Z(16)^2,1],[0,0,0,Z(16)^9]]*Z(16)^0; +[ [ Z(2^4)^7, Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2^4)^2, Z(2)^0 ], [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2^4)^9 ] ] +gap> qform2 := QuadraticFormByMatrix(mat2, GF(16)); +< quadratic form > +gap> Display( qform2 ); +Quadratic form +Gram Matrix: +z = Z(16) + z^7 1 . . + . . . . + . . z^2 1 + . . . z^9 +gap> biform := AssociatedBilinearForm( qform2 ); +< bilinear form > +gap> Display( biform ); +Bilinear form +Gram Matrix: + . 1 . . + 1 . . . + . . . 1 + . . 1 . +gap> STOP_TEST("bg_th_ex8.tst", 10000 ); diff --git a/tst/examples/bg_th_ex9.tst b/tst/examples/bg_th_ex9.tst new file mode 100644 index 0000000..861da31 --- /dev/null +++ b/tst/examples/bg_th_ex9.tst @@ -0,0 +1,28 @@ +gap> START_TEST("Forms: bg_th_ex9.tst"); +gap> #Background theory: example 9 +gap> mat := [ [ Z(2^2), Z(2^2), Z(2^2), Z(2^2), Z(2^2) ], +> [ 0*Z(2), Z(2^2), Z(2^2)^2, 0*Z(2), Z(2)^0 ], +> [ 0*Z(2), 0*Z(2), Z(2)^0, Z(2)^0, Z(2)^0 ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0, Z(2)^0 ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ] ];; +gap> qform := QuadraticFormByMatrix(mat,GF(4)); +< quadratic form > +gap> IsSingularForm(qform); +false +gap> IsDegenerateForm(qform); +#I Testing degeneracy of the *associated bilinear form* +true +gap> biform := AssociatedBilinearForm(qform); +< bilinear form > +gap> Display(biform); +Bilinear form +Gram Matrix: +z = Z(4) + . z^1 z^1 z^1 z^1 + z^1 . z^2 . 1 + z^1 z^2 . 1 1 + z^1 . 1 . 1 + z^1 1 1 1 . +gap> IsDegenerateForm(biform); +true +gap> STOP_TEST("bg_th_ex9.tst", 10000 ); diff --git a/tst/examples/bilformbymatrix.tst b/tst/examples/bilformbymatrix.tst new file mode 100644 index 0000000..a332a06 --- /dev/null +++ b/tst/examples/bilformbymatrix.tst @@ -0,0 +1,47 @@ +gap> START_TEST("Forms: bilformbymatrix.tst"); +gap> #Constructing form: BilinearFormByMatrix +gap> mat := IdentityMat(4, GF(9)); +[ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], + [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ] ] +gap> form := BilinearFormByMatrix(mat,GF(9)); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: + 1 . . . + . 1 . . + . . 1 . + . . . 1 +gap> mat := [[0*Z(2),Z(16)^12,0*Z(2),Z(4)^2,Z(16)^13], +> [Z(16)^12,0*Z(2),0*Z(2),Z(16)^11,Z(16)], +> [0*Z(2),0*Z(2),0*Z(2),Z(4)^2,Z(16)^3], +> [Z(4)^2,Z(16)^11,Z(4)^2,0*Z(2),Z(16)^3], +> [Z(16)^13,Z(16),Z(16)^3,Z(16)^3,0*Z(2) ]]; +[ [ 0*Z(2), Z(2^4)^12, 0*Z(2), Z(2^2)^2, Z(2^4)^13 ], + [ Z(2^4)^12, 0*Z(2), 0*Z(2), Z(2^4)^11, Z(2^4) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2^2)^2, Z(2^4)^3 ], + [ Z(2^2)^2, Z(2^4)^11, Z(2^2)^2, 0*Z(2), Z(2^4)^3 ], + [ Z(2^4)^13, Z(2^4), Z(2^4)^3, Z(2^4)^3, 0*Z(2) ] ] +gap> form := BilinearFormByMatrix(mat,GF(16)); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: +z = Z(16) + . z^12 . z^10 z^13 + z^12 . . z^11 z^1 + . . . z^10 z^3 + z^10 z^11 z^10 . z^3 + z^13 z^1 z^3 z^3 . +gap> mat := [[1,0,0,0],[0,1,0,0],[0,0,0,1],[0,0,1,0]]*Z(7)^0; +[ [ Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7) ], [ 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0 ], [ 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat); +< bilinear form > +gap> WittIndex(form); +1 +gap> form := BilinearFormByMatrix(mat,GF(49)); +< bilinear form > +gap> WittIndex(form); +2 +gap> STOP_TEST("bilformbymatrix.tst", 10000 ); diff --git a/tst/examples/bilformbypoly.tst b/tst/examples/bilformbypoly.tst new file mode 100644 index 0000000..9803ca3 --- /dev/null +++ b/tst/examples/bilformbypoly.tst @@ -0,0 +1,27 @@ +gap> START_TEST("Forms: bilformbypoly.tst"); +gap> #Constructing form: BilinearFormByPolynomial +gap> r := PolynomialRing( GF(11), 4); +GF(11)[x_1,x_2,x_3,x_4] +gap> vars := IndeterminatesOfPolynomialRing( r ); +[ x_1, x_2, x_3, x_4 ] +gap> pol := vars[1]*vars[2]+vars[3]*vars[4]; +x_1*x_2+x_3*x_4 +gap> form := BilinearFormByPolynomial(pol, r, 4); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: + . 6 . . + 6 . . . + . . . 6 + . . 6 . +Polynomial: x_1*x_2+x_3*x_4 + +gap> r := PolynomialRing(GF(4),2); +GF(2^2)[x_1,x_2] +gap> pol := r.1*r.2; +x_1*x_2 +gap> form := BilinearFormByPolynomial(pol,r); +Error, No orthogonal form can be associated with a quadratic polynomial in eve\ +n characteristic +gap> STOP_TEST("bilformbypoly.tst", 10000 ); diff --git a/tst/examples/bilformbyquadform.tst b/tst/examples/bilformbyquadform.tst new file mode 100644 index 0000000..79c568d --- /dev/null +++ b/tst/examples/bilformbyquadform.tst @@ -0,0 +1,31 @@ +gap> START_TEST("Forms: bilformbyquadform.tst"); +gap> #Constructing form: BilinearFormByQuadraticForm +gap> r := PolynomialRing(GF(9),4); +GF(3^2)[x_1,x_2,x_3,x_4] +gap> poly := -r.1*r.2+Z(3^2)*r.3^2+r.4^2; +-x_1*x_2+Z(3^2)*x_3^2+x_4^2 +gap> qform := QuadraticFormByPolynomial(poly,r); +< quadratic form > +gap> Display( qform ); +Quadratic form +Gram Matrix: +z = Z(9) + . 2 . . + . . . . + . . z^1 . + . . . 1 +Polynomial: -x_1*x_2+Z(3^2)*x_3^2+x_4^2 + +gap> form := BilinearFormByQuadraticForm( qform ); +< bilinear form > +gap> Display(form); +Bilinear form +Gram Matrix: +z = Z(9) + . 1 . . + 1 . . . + . . z^1 . + . . . 1 +gap> Set(GF(9)^4, x -> [x,x]^form = x^qform); +[ true ] +gap> STOP_TEST("bilformbyquadform.tst", 10000 ); diff --git a/tst/examples/conic.tst b/tst/examples/conic.tst new file mode 100644 index 0000000..937877a --- /dev/null +++ b/tst/examples/conic.tst @@ -0,0 +1,62 @@ +gap> START_TEST("Forms: conic.tst"); +gap> #A conic of PG(2,8) +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 ); +< 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> Dimension( RadicalOfForm( form ) ); +0 +gap> canonical := IsometricCanonicalForm( form ); +< parabolic quadratic form > +gap> form = canonical; +true +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) ] ] ]) +gap> conic := Filtered(vec, x -> IsZero( x^form ));; +gap> Size(conic); +64 +gap> orbs := Orbits(newgo, conic, OnRight);; +gap> List(orbs,Size); +[ 1, 63 ] +gap> STOP_TEST("conic.tst", 10000 ); diff --git a/tst/examples/discofform.tst b/tst/examples/discofform.tst new file mode 100644 index 0000000..089e215 --- /dev/null +++ b/tst/examples/discofform.tst @@ -0,0 +1,8 @@ +gap> START_TEST("Forms: discofform.tst"); +gap> #Discriminant of form: DiscriminantOfForm +gap> gram := InvariantQuadraticForm(GO(-1,4,5))!.matrix;; +gap> qform := QuadraticFormByMatrix(gram, GF(5)); +< quadratic form > +gap> DiscriminantOfForm( qform ); +"nonsquare" +gap> STOP_TEST("discofform.tst", 10000 ); diff --git a/tst/examples/evalform.tst b/tst/examples/evalform.tst new file mode 100644 index 0000000..908d47a --- /dev/null +++ b/tst/examples/evalform.tst @@ -0,0 +1,24 @@ +gap> START_TEST("Forms: evalform.tst"); +gap> #computing subspace orthogonal to given vector +gap> mat := [[Z(8),0,0,0],[0,0,Z(8)^4,0],[0,0,0,1],[0,0,0,0]]*Z(8)^0;; +gap> form := QuadraticFormByMatrix(mat,GF(8)); +< quadratic form > +gap> u := [ Z(2^3)^4, Z(2^3)^4, Z(2)^0, Z(2^3)^3 ]; +[ Z(2^3)^4, Z(2^3)^4, Z(2)^0, Z(2^3)^3 ] +gap> EvaluateForm( form, u ); +Z(2^3)^6 +gap> u^form; +Z(2^3)^6 +gap> 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],[0,2,0,0,0,0],[2,0,0,0,0,0]]*Z(3)^0;; +gap> form := BilinearFormByMatrix(gram,GF(3)); +< bilinear form > +gap> u := [ [ Z(3)^0, 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), Z(3)^0 ], +> [ 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, Z(3), 0*Z(3) ] ];; +gap> v := [ [ Z(3)^0, 0*Z(3), Z(3)^0, Z(3), 0*Z(3), Z(3) ], +> [ 0*Z(3), Z(3)^0, 0*Z(3), Z(3), Z(3), Z(3) ] ];; +gap> EvaluateForm( form, u, v); +[ [ Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3) ] ] +gap> [u,v]^form; +[ [ Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3) ] ] +gap> STOP_TEST("evalform.tst", 10000 ); diff --git a/tst/examples/hermitianformbymatrix.tst b/tst/examples/hermitianformbymatrix.tst new file mode 100644 index 0000000..b101c23 --- /dev/null +++ b/tst/examples/hermitianformbymatrix.tst @@ -0,0 +1,29 @@ +gap> START_TEST("Forms: hermitianformbymatrix.tst"); +gap> #Constructing form: HermitianFormByMatrix +gap> gf := GF(3^2); +GF(3^2) +gap> mat := IdentityMat(4, gf); +[ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], + [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ] ] +gap> form := HermitianFormByMatrix( mat, gf ); +< hermitian form > +gap> Display(form); +Hermitian form +Gram Matrix: + 1 . . . + . 1 . . + . . 1 . + . . . 1 +gap> mat := [[Z(11)^0,0*Z(11),0*Z(11)],[0*Z(11),0*Z(11),Z(11)], +> [0*Z(11),Z(11),0*Z(11)]]; +[ [ Z(11)^0, 0*Z(11), 0*Z(11) ], [ 0*Z(11), 0*Z(11), Z(11) ], + [ 0*Z(11), Z(11), 0*Z(11) ] ] +gap> form := HermitianFormByMatrix(mat,GF(121)); +< hermitian form > +gap> Display(form); +Hermitian form +Gram Matrix: + 1 . . + . . 2 + . 2 . +gap> STOP_TEST("hermitianformbymatrix.tst", 10000 ); diff --git a/tst/examples/hermitianformbypoly.tst b/tst/examples/hermitianformbypoly.tst new file mode 100644 index 0000000..536c86a --- /dev/null +++ b/tst/examples/hermitianformbypoly.tst @@ -0,0 +1,21 @@ +gap> START_TEST("Forms: hermitianformbypoly.tst"); +gap> #Constructing form: HermitianFormByPolynomial +gap> r := PolynomialRing( GF(9), 4); +GF(3^2)[x_1,x_2,x_3,x_4] +gap> vars := IndeterminatesOfPolynomialRing( r ); +[ x_1, x_2, x_3, x_4 ] +gap> poly := vars[1]*vars[2]^3+vars[1]^3*vars[2]+ +> vars[3]*vars[4]^3+vars[3]^3*vars[4]; +x_1^3*x_2+x_1*x_2^3+x_3^3*x_4+x_3*x_4^3 +gap> form := HermitianFormByPolynomial(poly,r); +< hermitian form > +gap> Display(form); +Hermitian form +Gram Matrix: + . 1 . . + 1 . . . + . . . 1 + . . 1 . +Polynomial: x_1^3*x_2+x_1*x_2^3+x_3^3*x_4+x_3*x_4^3 + +gap> STOP_TEST("hermitianformbypoly.tst", 10000 ); diff --git a/tst/examples/isisotropicvector.tst b/tst/examples/isisotropicvector.tst new file mode 100644 index 0000000..d64bf65 --- /dev/null +++ b/tst/examples/isisotropicvector.tst @@ -0,0 +1,30 @@ +gap> START_TEST("Forms: isisotropicvector.tst"); +gap> #testing isotropy for vectors. +gap> mat := [[1,0,0,0],[0,-1,0,0],[0,0,0,1],[0,0,1,0]]*Z(41)^0; +[ [ Z(41)^0, 0*Z(41), 0*Z(41), 0*Z(41) ], + [ 0*Z(41), Z(41)^20, 0*Z(41), 0*Z(41) ], + [ 0*Z(41), 0*Z(41), 0*Z(41), Z(41)^0 ], + [ 0*Z(41), 0*Z(41), Z(41)^0, 0*Z(41) ] ] +gap> form := BilinearFormByMatrix(mat); +< bilinear form > +gap> v := [1,1,0,0]*Z(41)^0; +[ Z(41)^0, Z(41)^0, 0*Z(41), 0*Z(41) ] +gap> IsIsotropicVector(form,v); +true +gap> mat := [[1,0,0,0,0],[0,0,0,0,1],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0]]*Z(8)^0; +[ [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := QuadraticFormByMatrix(mat); +< quadratic form > +gap> v1 := [1,0,0,0,0]*Z(8)^0; +[ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] +gap> v2 := [0,1,0,0,0]*Z(8)^0; +[ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ] +gap> IsIsotropicVector(form,v1); +true +gap> IsIsotropicVector(form,v2); +true +gap> STOP_TEST("isisotropicvector.tst", 10000 ); diff --git a/tst/examples/isometriccanonicalform.tst b/tst/examples/isometriccanonicalform.tst new file mode 100644 index 0000000..bf0c969 --- /dev/null +++ b/tst/examples/isometriccanonicalform.tst @@ -0,0 +1,31 @@ +gap> START_TEST("Forms: isometriccanonicalform.tst"); +gap> #morphisms: IsometricCanonicalForm +gap> mat := [ [ Z(8) , 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), Z(2)^0, Z(2^3)^5, 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ];; +gap> form := QuadraticFormByMatrix(mat,GF(8)); +< quadratic form > +gap> iso := IsometricCanonicalForm(form); +< parabolic quadratic form > +gap> Display(form); +Parabolic quadratic form +Gram Matrix: +z = Z(8) + z^1 . . . . + . 1 z^5 . . + . . . . . + . . . . 1 + . . . . . +Witt Index: 2 +gap> Display(iso); +Parabolic quadratic form +Gram Matrix: + 1 . . . . + . . 1 . . + . . . . . + . . . . 1 + . . . . . +Witt Index: 2 +gap> STOP_TEST("isometriccanonicalform.tst", 10000 ); diff --git a/tst/examples/issingularvector.tst b/tst/examples/issingularvector.tst new file mode 100644 index 0000000..5a37488 --- /dev/null +++ b/tst/examples/issingularvector.tst @@ -0,0 +1,23 @@ +gap> START_TEST("Forms: issingularvector.tst"); +gap> #testing singularity for vectors. +gap> mat := [[1,0,0,0,0],[0,0,0,0,1],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0]]*Z(8)^0; +[ [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := QuadraticFormByMatrix(mat); +< quadratic form > +gap> v1 := [1,0,0,0,0]*Z(8)^0; +[ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] +gap> v2 := [0,1,0,0,0]*Z(8)^0; +[ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ] +gap> IsSingularVector(form,v1); +false +gap> IsSingularVector(form,v2); +true +gap> IsIsotropicVector(form,v1); +true +gap> IsIsotropicVector(form,v2); +true +gap> STOP_TEST("issingularvector.tst", 10000 ); diff --git a/tst/examples/istotallyisotropic.tst b/tst/examples/istotallyisotropic.tst new file mode 100644 index 0000000..e17ebb9 --- /dev/null +++ b/tst/examples/istotallyisotropic.tst @@ -0,0 +1,26 @@ +gap> START_TEST("Forms: istotallyisotropic.tst"); +gap> #testing total isotropy for subspaces +gap> mat := [[1,0,0,0],[0,-1,0,0],[0,0,0,1],[0,0,1,0]]*Z(7)^0; +[ [ Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7) ], [ 0*Z(7), Z(7)^3, 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0 ], [ 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat); +< bilinear form > +gap> sub:= [[Z(7)^0,0*Z(7),Z(7)^0,Z(7)],[0*Z(7),Z(7)^0,Z(7)^0,Z(7)^4]]; +[ [ Z(7)^0, 0*Z(7), Z(7)^0, Z(7) ], [ 0*Z(7), Z(7)^0, Z(7)^0, Z(7)^4 ] ] +gap> IsTotallyIsotropicSubspace(form,sub); +true +gap> mat := IdentityMat(6,GF(2)); +[ , , + , , + , ] +gap> form := HermitianFormByMatrix(mat,GF(4)); +< hermitian form > +gap> sub := [[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),Z(2^2)^2,Z(2^2),Z(2)^0], +> [0*Z(2),0*Z(2),Z(2)^0,Z(2)^0,Z(2^2),Z(2^2)^2]]; +[ [ 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), Z(2^2)^2, Z(2^2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), Z(2)^0, Z(2)^0, Z(2^2), Z(2^2)^2 ] ] +gap> IsTotallyIsotropicSubspace(form,sub); +true +gap> STOP_TEST("istotallyisotropic.tst", 10000 ); diff --git a/tst/examples/istotallysingular.tst b/tst/examples/istotallysingular.tst new file mode 100644 index 0000000..156761f --- /dev/null +++ b/tst/examples/istotallysingular.tst @@ -0,0 +1,17 @@ +gap> START_TEST("Forms: istotallysingular.tst"); +gap> #testing singularity for subspaces. +gap> mat := [[1,0,0,0,0],[0,0,0,0,1],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0]]*Z(8)^0; +[ [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := QuadraticFormByMatrix(mat); +< quadratic form > +gap> sub := [[Z(2)^0,0*Z(2),Z(2^3)^6,Z(2^3),Z(2^3)^3], +> [0*Z(2),Z(2)^0,Z(2^3)^6,Z(2^3)^2,Z(2^3)]]; +[ [ Z(2)^0, 0*Z(2), Z(2^3)^6, Z(2^3), Z(2^3)^3 ], + [ 0*Z(2), Z(2)^0, Z(2^3)^6, Z(2^3)^2, Z(2^3) ] ] +gap> IsTotallySingularSubspace(form,sub); +true +gap> STOP_TEST("istotallysingular.tst", 10000 ); diff --git a/tst/examples/orthogonaltovector.tst b/tst/examples/orthogonaltovector.tst new file mode 100644 index 0000000..52f7423 --- /dev/null +++ b/tst/examples/orthogonaltovector.tst @@ -0,0 +1,42 @@ +gap> START_TEST("Forms: orthogonaltovector.tst"); +gap> #computing subspace orthogonal to given vector +gap> mat := [[0,0,0,-2],[0,0,-3,0],[0,3,0,0],[2,0,0,0]]*Z(7)^0; +[ [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^5 ], [ 0*Z(7), 0*Z(7), Z(7)^4, 0*Z(7) ], + [ 0*Z(7), Z(7), 0*Z(7), 0*Z(7) ], [ Z(7)^2, 0*Z(7), 0*Z(7), 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat); +< bilinear form > +gap> v := [0*Z(7),Z(7)^0,Z(7)^3,Z(7)^5]; +[ 0*Z(7), Z(7)^0, Z(7)^3, Z(7)^5 ] +gap> vperp := OrthogonalSubspaceMat(form,v); +[ [ Z(7)^0, Z(7)^0, 0*Z(7), 0*Z(7) ], [ Z(7)^0, 0*Z(7), Z(7)^0, 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0 ] ] +gap> List(vperp,x->[x,v]^form); +[ 0*Z(7), 0*Z(7), 0*Z(7) ] +gap> sub := [[1,1,0,0],[0,0,1,2]]*Z(7)^0; +[ [ Z(7)^0, Z(7)^0, 0*Z(7), 0*Z(7) ], [ 0*Z(7), 0*Z(7), Z(7)^0, Z(7)^2 ] ] +gap> subperp := OrthogonalSubspaceMat(form,sub); +[ [ Z(7)^0, Z(7)^0, 0*Z(7), 0*Z(7) ], [ 0*Z(7), 0*Z(7), Z(7)^4, Z(7)^0 ] ] +gap> List(subperp,x->List(sub,y->[x,y]^form)); +[ [ 0*Z(7), 0*Z(7) ], [ 0*Z(7), 0*Z(7) ] ] +gap> mat := [[1,0,0],[0,0,1],[0,0,0]]*Z(2)^0; +[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), Z(2)^0 ], + [ 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := QuadraticFormByMatrix(mat); +< quadratic form > +gap> v := [Z(2)^0,Z(2)^0,0*Z(2)]; +[ Z(2)^0, Z(2)^0, 0*Z(2) ] +gap> vperp := OrthogonalSubspaceMat(form,v); +[ , ] +gap> bil_form := AssociatedBilinearForm(form); +< bilinear form > +gap> List(vperp,x->[x,v]^bil_form); +[ 0*Z(2), 0*Z(2) ] +gap> sub := [[1,0,1],[1,0,0]]*Z(2)^0; +[ [ Z(2)^0, 0*Z(2), Z(2)^0 ], [ Z(2)^0, 0*Z(2), 0*Z(2) ] ] +gap> subperp := OrthogonalSubspaceMat(form,sub); +[ , ] +gap> List(subperp,x->List(sub,y->[x,y]^bil_form)); +[ [ 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2) ] ] +gap> STOP_TEST("orthogonaltovector.tst", 10000 ); diff --git a/tst/examples/polyofform.tst b/tst/examples/polyofform.tst new file mode 100644 index 0000000..7efe6b6 --- /dev/null +++ b/tst/examples/polyofform.tst @@ -0,0 +1,12 @@ +gap> START_TEST("Forms: polyofform.tst"); +gap> #Polynomial of form: PolynomialOfForm +gap> mat := [ [ Z(8) , 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), Z(2)^0, Z(2^3)^5, 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], +> [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ];; +gap> form := QuadraticFormByMatrix(mat,GF(8)); +< quadratic form > +gap> PolynomialOfForm(form); +Z(2^3)*x_1^2+x_2^2+Z(2^3)^5*x_2*x_3+x_4*x_5 +gap> STOP_TEST("polyofform.tst", 10000 ); diff --git a/tst/examples/pres_sesforms1.tst b/tst/examples/pres_sesforms1.tst new file mode 100644 index 0000000..32cd44c --- /dev/null +++ b/tst/examples/pres_sesforms1.tst @@ -0,0 +1,14 @@ +gap> START_TEST("Forms: pres_sesforms1.tst"); +gap> #Preserved Sesquilinear forms: example 1 +gap> g := SU(4,3); +SU(4,3) +gap> forms := PreservedSesquilinearForms(g); +[ < hermitian form > ] +gap> Display( forms[1] ); +Hermitian form +Gram Matrix: + . . . 2 + . . 2 . + . 2 . . + 2 . . . +gap> STOP_TEST("pres_sesforms1.tst", 10000 ); diff --git a/tst/examples/pres_sesforms2.tst b/tst/examples/pres_sesforms2.tst new file mode 100644 index 0000000..36c7810 --- /dev/null +++ b/tst/examples/pres_sesforms2.tst @@ -0,0 +1,25 @@ +gap> START_TEST("Forms: pres_sesforms2.tst"); +gap> #Preserved Sesquilinear forms: example 2 +gap> a := [ [ -1, 0, 0, -1, 0, 1 ], [ 0, -1, -1, 0, 0, 1 ], +> [ -1, 0, 0, 1, 0, 0 ], [ 0, -1, 1, 0, 0, -1 ], +> [ 0, 0, 0, 0, 0, -1 ], [ 0, -1, -1, 1, 1, 1 ] ] * One(GF(3));; +gap> b := [ [ 1, -1, 1, -1, 1, -1 ], [ 1, 1, -1, 1, 1, 0 ], +> [ -1, 0, 1, 0, 0, 0 ], [ 0, -1, 0, 0, 0, 1 ], +> [ 1, 1, 1, 1, 1, 1 ], [ -1, 1, 1, 1, -1, 0 ] ] * One(GF(3));; +gap> g := Group( a, b ); + +gap> forms := PreservedSesquilinearForms( g ); +[ < bilinear form > ] +gap> Display( forms[1] ); +Bilinear form +Gram Matrix: + . 1 . . . . + 1 . . . . . + . . . 1 . . + . . 1 . . . + . . . . . 1 + . . . . 1 . +gap> m := GModuleByMats( [a,b], GF(3) );; +gap> usemeataxe := MTX.InvariantBilinearForm(m); +fail +gap> STOP_TEST("pres_sesforms2.tst", 10000 ); diff --git a/tst/examples/preservedform.tst b/tst/examples/preservedform.tst new file mode 100644 index 0000000..b727d98 --- /dev/null +++ b/tst/examples/preservedform.tst @@ -0,0 +1,24 @@ +gap> START_TEST("Forms: preservedform.tst"); +gap> #What is the form preserved by this group? +gap> go := GO(5, 5); +GO(0,5,5) +gap> x := +> [ [ Z(5)^0, Z(5)^3, 0*Z(5), Z(5)^3, Z(5)^3 ], +> [ Z(5)^2, Z(5)^3, 0*Z(5), Z(5)^2, Z(5) ], +> [ Z(5)^2, Z(5)^2, Z(5)^0, Z(5), Z(5)^3 ], +> [ Z(5)^0, Z(5)^3, Z(5), Z(5)^0, Z(5)^3 ], +> [ Z(5)^3, 0*Z(5), Z(5)^0, 0*Z(5), Z(5) ] +> ];; +gap> go2 := go^x; + +gap> forms := PreservedSesquilinearForms( go2 ); +[ < bilinear form > ] +gap> Display( forms[1] ); +Bilinear form +Gram Matrix: + 2 1 2 4 4 + 1 1 1 4 4 + 2 1 4 3 2 + 4 4 3 1 2 + 4 4 2 2 4 +gap> STOP_TEST("preservedform.tst", 10000 ); diff --git a/tst/examples/quadformbybilform.tst b/tst/examples/quadformbybilform.tst new file mode 100644 index 0000000..70a7442 --- /dev/null +++ b/tst/examples/quadformbybilform.tst @@ -0,0 +1,45 @@ +gap> START_TEST("Forms: quadformbybilform.tst"); +gap> #Constructing form: QuadraticFormByBilinearForm +gap> mat := [ [ Z(3^2)^7, Z(3)^0, Z(3^2)^2, 0*Z(3), Z(3^2)^5 ], +> [ Z(3)^0, Z(3^2)^7, Z(3^2)^6, Z(3^2)^5, Z(3^2)^2 ], +> [ Z(3^2)^2, Z(3^2)^6, Z(3^2)^7, Z(3^2)^2, Z(3^2)^2 ], +> [ 0*Z(3), Z(3^2)^5, Z(3^2)^2, Z(3^2)^6, Z(3^2)^7 ], +> [ Z(3^2)^5, Z(3^2)^2, Z(3^2)^2, Z(3^2)^7, Z(3) ] ]; +[ [ Z(3^2)^7, Z(3)^0, Z(3^2)^2, 0*Z(3), Z(3^2)^5 ], + [ Z(3)^0, Z(3^2)^7, Z(3^2)^6, Z(3^2)^5, Z(3^2)^2 ], + [ Z(3^2)^2, Z(3^2)^6, Z(3^2)^7, Z(3^2)^2, Z(3^2)^2 ], + [ 0*Z(3), Z(3^2)^5, Z(3^2)^2, Z(3^2)^6, Z(3^2)^7 ], + [ Z(3^2)^5, Z(3^2)^2, Z(3^2)^2, Z(3^2)^7, Z(3) ] ] +gap> form := BilinearFormByMatrix(mat,GF(9)); +< bilinear form > +gap> Q := QuadraticFormByBilinearForm(form); +< quadratic form > +gap> Display(form); +Bilinear form +Gram Matrix: +z = Z(9) + z^7 1 z^2 . z^5 + 1 z^7 z^6 z^5 z^2 + z^2 z^6 z^7 z^2 z^2 + . z^5 z^2 z^6 z^7 + z^5 z^2 z^2 z^7 2 +gap> Display(Q); +Quadratic form +Gram Matrix: +z = Z(9) + z^7 2 z^6 . z^1 + . z^7 z^2 z^1 z^6 + . . z^7 z^6 z^6 + . . . z^6 z^3 + . . . . 2 +gap> Set(List(GF(9)^5),x->[x,x]^form=x^Q); +[ true ] +gap> PolynomialOfForm(form); +Z(3^2)^7*x_1^2-x_1*x_2+Z(3^2)^6*x_1*x_3+Z(3^2)*x_1*x_5+Z(3^2)^7*x_2^2+Z(3^2)^2\ +*x_2*x_3+Z(3^2)*x_2*x_4+Z(3^2)^6*x_2*x_5+Z(3^2)^7*x_3^2+Z(3^2)^6*x_3*x_4+Z(3^2\ +)^6*x_3*x_5+Z(3^2)^6*x_4^2+Z(3^2)^3*x_4*x_5-x_5^2 +gap> PolynomialOfForm(Q); +Z(3^2)^7*x_1^2-x_1*x_2+Z(3^2)^6*x_1*x_3+Z(3^2)*x_1*x_5+Z(3^2)^7*x_2^2+Z(3^2)^2\ +*x_2*x_3+Z(3^2)*x_2*x_4+Z(3^2)^6*x_2*x_5+Z(3^2)^7*x_3^2+Z(3^2)^6*x_3*x_4+Z(3^2\ +)^6*x_3*x_5+Z(3^2)^6*x_4^2+Z(3^2)^3*x_4*x_5-x_5^2 +gap> STOP_TEST("quadformbybilform.tst", 10000 ); diff --git a/tst/examples/quadformbymatrix.tst b/tst/examples/quadformbymatrix.tst new file mode 100644 index 0000000..9ee8d12 --- /dev/null +++ b/tst/examples/quadformbymatrix.tst @@ -0,0 +1,30 @@ +gap> START_TEST("Forms: quadformbymatrix.tst"); +gap> #Constructing form: QuadraticFormByMatrix +gap> mat := [[1,0,0,0],[0,3,0,0],[0,0,0,6],[0,0,6,0]]*Z(7)^0; +[ [ Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7) ], [ 0*Z(7), Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^3 ], [ 0*Z(7), 0*Z(7), Z(7)^3, 0*Z(7) ] ] +gap> form := QuadraticFormByMatrix(mat,GF(7)); +< quadratic form > +gap> Display(form); +Quadratic form +Gram Matrix: + 1 . . . + . 3 . . + . . . 5 + . . . . +gap> gf := GF(2^2); +GF(2^2) +gap> mat := InvariantQuadraticForm( SO(-1, 4, 4) )!.matrix; +[ [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ], + [ 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 ] ] +gap> form := QuadraticFormByMatrix( mat, gf ); +< quadratic form > +gap> Display(form); +Quadratic form +Gram Matrix: +z = Z(4) + . 1 . . + . . . . + . . z^2 1 + . . . z^2 +gap> STOP_TEST("quadformbymatrix.tst", 10000 ); diff --git a/tst/examples/quadformbypoly.tst b/tst/examples/quadformbypoly.tst new file mode 100644 index 0000000..092baea --- /dev/null +++ b/tst/examples/quadformbypoly.tst @@ -0,0 +1,26 @@ +gap> START_TEST("Forms: quadformbypoly.tst"); +gap> #Constructing form: QuadraticFormByPolynomial +gap> r := PolynomialRing( GF(8), 3); +GF(2^3)[x_1,x_2,x_3] +gap> poly := r.1^2 + r.2^2 + r.3^2; +x_1^2+x_2^2+x_3^2 +gap> form := QuadraticFormByPolynomial(poly, r); +< quadratic form > +gap> RadicalOfForm(form); + +gap> r := PolynomialRing(GF(9),4); +GF(3^2)[x_1,x_2,x_3,x_4] +gap> poly := Z(3)^2*r.1^2+r.2^2+r.3*r.4; +x_1^2+x_2^2+x_3*x_4 +gap> qform := QuadraticFormByPolynomial(poly,r); +< quadratic form > +gap> Display(qform); +Quadratic form +Gram Matrix: + 1 . . . + . 1 . . + . . . 1 + . . . . +Polynomial: x_1^2+x_2^2+x_3*x_4 + +gap> STOP_TEST("quadformbypoly.tst", 10000 ); diff --git a/tst/examples/quadformfields.tst b/tst/examples/quadformfields.tst new file mode 100644 index 0000000..5b722b2 --- /dev/null +++ b/tst/examples/quadformfields.tst @@ -0,0 +1,16 @@ +gap> START_TEST("Forms: quadformfields.tst"); +gap> #constructing the same form over different fields +gap> mat := +> [[Z(2)^0,Z(2)^0,0*Z(2),0*Z(2)],[0*Z(2),Z(2)^0,0*Z(2),0*Z(2)], +> [0*Z(2),0*Z(2),0*Z(2),Z(2)^0],[0*Z(2),0*Z(2),0*Z(2),0*Z(2)]]; +[ [ Z(2)^0, Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], [ 0*Z(2), 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := QuadraticFormByMatrix(mat); +< quadratic form > +gap> WittIndex(form); +1 +gap> form := QuadraticFormByMatrix(mat,GF(4)); +< quadratic form > +gap> WittIndex(form); +2 +gap> STOP_TEST("quadformfields.tst", 10000 ); diff --git a/tst/examples/radicalofform.tst b/tst/examples/radicalofform.tst new file mode 100644 index 0000000..912fbee --- /dev/null +++ b/tst/examples/radicalofform.tst @@ -0,0 +1,11 @@ +gap> START_TEST("Forms: radicalofform.tst"); +gap> #Radical of form: RadicalOfForm +gap> r := PolynomialRing( GF(8), 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 ); +< quadratic form > +gap> Dimension(RadicalOfForm(form)); +0 +gap> STOP_TEST("radicalofform.tst", 10000 ); diff --git a/tst/examples/scalarfromsim.tst b/tst/examples/scalarfromsim.tst new file mode 100644 index 0000000..e4dbd47 --- /dev/null +++ b/tst/examples/scalarfromsim.tst @@ -0,0 +1,19 @@ +gap> START_TEST("Forms: scalarfromsim.tst"); +gap> #ScalarOfSimilairty example +gap> gram := [ [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], +> [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], +> [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], +> [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], +> [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ], +> [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ] ];; +gap> form := BilinearFormByMatrix( gram, GF(3) ); +< bilinear form > +gap> m := [ [ Z(3)^0, Z(3)^0, Z(3), 0*Z(3), Z(3)^0, Z(3) ], +> [ Z(3), Z(3), Z(3)^0, 0*Z(3), Z(3)^0, Z(3) ], +> [ 0*Z(3), Z(3), 0*Z(3), Z(3), 0*Z(3), 0*Z(3) ], +> [ 0*Z(3), Z(3), Z(3)^0, Z(3), Z(3), Z(3) ], +> [ Z(3)^0, Z(3)^0, Z(3), Z(3), Z(3)^0, Z(3)^0 ], +> [ Z(3)^0, 0*Z(3), Z(3), Z(3)^0, Z(3), Z(3) ] ];; +gap> ScalarOfSimilarity( m, form ); +Z(3) +gap> STOP_TEST("scalarfromsim.tst", 10000 ); diff --git a/tst/examples/trivialform.tst b/tst/examples/trivialform.tst new file mode 100644 index 0000000..d15a19c --- /dev/null +++ b/tst/examples/trivialform.tst @@ -0,0 +1,22 @@ +gap> START_TEST("Forms: trivialform.tst"); +gap> #Constructing a trivial form +gap> mat := [[0,0,0],[0,0,0],[0,0,0]]*Z(7)^0; +[ [ 0*Z(7), 0*Z(7), 0*Z(7) ], [ 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7) ] ] +gap> form1 := BilinearFormByMatrix(mat,GF(7)); +< trivial form > +gap> form2 := QuadraticFormByMatrix(mat,GF(7)); +< trivial form > +gap> form1 = form2; +true +gap> IsQuadraticForm(form1); +false +gap> IsSesquilinearForm(form1); +false +gap> mat := [[0,0],[0,0]]*Z(4)^0; +[ [ 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2) ] ] +gap> form3 := BilinearFormByMatrix(mat,GF(4)); +< trivial form > +gap> form3 = form1; +false +gap> STOP_TEST("trivialform.tst", 10000 ); diff --git a/tst/examples/trivialform2.tst b/tst/examples/trivialform2.tst new file mode 100644 index 0000000..5dd9133 --- /dev/null +++ b/tst/examples/trivialform2.tst @@ -0,0 +1,15 @@ +gap> START_TEST("Forms: trivialform2.tst"); +gap> +gap> #Behaviour of a trivial form +gap> mat := [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]*Z(3)^0; +[ [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], + [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ] ] +gap> form := BilinearFormByMatrix(mat,GF(3)); +< trivial form > +gap> v := Random(GF(3)^4); +[ Z(3), Z(3), 0*Z(3), Z(3) ] +gap> [v,v]^form; +0*Z(3) +gap> v^form; +0*Z(3) +gap> STOP_TEST("trivialform2.tst", 10000 ); diff --git a/tst/examples/trivialform_prop.tst b/tst/examples/trivialform_prop.tst new file mode 100644 index 0000000..3d034c6 --- /dev/null +++ b/tst/examples/trivialform_prop.tst @@ -0,0 +1,31 @@ +gap> START_TEST("Forms: trivialform_prop.tst"); +gap> #attributes and properties of a trivial form +gap> mat := [[0,0,0],[0,0,0],[0,0,0]]*Z(11)^0; +[ [ 0*Z(11), 0*Z(11), 0*Z(11) ], [ 0*Z(11), 0*Z(11), 0*Z(11) ], + [ 0*Z(11), 0*Z(11), 0*Z(11) ] ] +gap> form := QuadraticFormByMatrix(mat,GF(121)); +< trivial form > +gap> IsReflexiveForm(form); +true +gap> IsAlternatingForm(form); +true +gap> IsSymmetricForm(form); +true +gap> IsOrthogonalForm(form); +false +gap> IsPseudoForm(form); +false +gap> IsSymplecticForm(form); +true +gap> IsDegenerateForm(form); +true +gap> IsSingularForm(form); +true +gap> BaseField(form); +GF(11^2) +gap> GramMatrix(form); +[ [ 0*Z(11), 0*Z(11), 0*Z(11) ], [ 0*Z(11), 0*Z(11), 0*Z(11) ], + [ 0*Z(11), 0*Z(11), 0*Z(11) ] ] +gap> Dimension(RadicalOfForm(form)); +3 +gap> STOP_TEST("trivialform_prop.tst", 10000 ); diff --git a/tst/examples/typeofform.tst b/tst/examples/typeofform.tst new file mode 100644 index 0000000..b21cb2b --- /dev/null +++ b/tst/examples/typeofform.tst @@ -0,0 +1,57 @@ +gap> START_TEST("Forms: typeofform.tst"); +gap> #Type Of Form +gap> mat := [[0,0,0,-1],[0,0,3,0],[0,-3,0,0],[1,0,0,0]]*Z(25)^0; +[ [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^2 ], [ 0*Z(5), 0*Z(5), Z(5)^3, 0*Z(5) ], + [ 0*Z(5), Z(5), 0*Z(5), 0*Z(5) ], [ Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5) ] ] +gap> form := BilinearFormByMatrix(mat,GF(25)); +< bilinear form > +gap> IsDegenerateForm(form); +false +gap> TypeOfForm(form); +0 +gap> mat := IdentityMat(3,GF(7)); +[ [ Z(7)^0, 0*Z(7), 0*Z(7) ], [ 0*Z(7), Z(7)^0, 0*Z(7) ], + [ 0*Z(7), 0*Z(7), Z(7)^0 ] ] +gap> form := QuadraticFormByMatrix(mat,GF(7)); +< quadratic form > +gap> IsSingularForm(form); +false +gap> TypeOfForm(form); +0 +gap> mat := [[0,1,0,0],[-1,0,0,0],[0,0,0,0],[0,0,0,0]]*Z(5)^0; +[ [ 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5) ], [ Z(5)^2, 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ] ] +gap> form := BilinearFormByMatrix(mat,GF(5)); +< bilinear form > +gap> IsDegenerateForm(form); +true +gap> TypeOfForm(form); +0 +gap> mat := [[1,0,0,0],[0,1,0,0],[0,0,0,1],[0,0,1,0]]*Z(7)^0; +[ [ Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7) ], [ 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0 ], [ 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat,GF(7)); +< bilinear form > +gap> IsDegenerateForm(form); +false +gap> TypeOfForm(form); +-1 +gap> mat := IdentityMat(3,GF(9)); +[ [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3) ], + [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] +gap> form := HermitianFormByMatrix(mat,GF(9)); +< hermitian form > +gap> IsDegenerateForm(form); +false +gap> TypeOfForm(form); +-1/2 +gap> mat := [[0,0,0,1],[0,1,0,0],[0,0,1,0],[1,0,0,0]]*Z(8)^0; +[ [ 0*Z(2), 0*Z(2), 0*Z(2), Z(2)^0 ], [ 0*Z(2), Z(2)^0, 0*Z(2), 0*Z(2) ], + [ 0*Z(2), 0*Z(2), Z(2)^0, 0*Z(2) ], [ Z(2)^0, 0*Z(2), 0*Z(2), 0*Z(2) ] ] +gap> form := BilinearFormByMatrix(mat,GF(8)); +< bilinear form > +gap> IsDegenerateForm(form); +false +gap> TypeOfForm(form); +Error, is a pseudo form and has no defined type +gap> STOP_TEST("typeofform.tst", 10000 ); diff --git a/tst/examples/w53.tst b/tst/examples/w53.tst new file mode 100644 index 0000000..e46c5b2 --- /dev/null +++ b/tst/examples/w53.tst @@ -0,0 +1,41 @@ +gap> START_TEST("Forms: w53.tst"); +gap> #A form for W(5,3) +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 ); +< bilinear form > +gap> IsSymplecticForm( form ); +true +gap> Display( form ); +Symplectic form +Gram Matrix: + . . . 1 . . + . . . . 1 . + . . . . . 1 + 2 . . . . . + . 2 . . . . + . . 2 . . . +gap> b := BaseChangeToCanonical( form ); +< immutable compressed matrix 6x6 over GF(3) > +gap> Display( b ); + 1 . . . . . + . . . 1 . . + . . 1 . . . + . . . . . 1 + . . . . 1 . + . 2 . . . . +gap> Display( b * gram * TransposedMat(b) ); + . 1 . . . . + 2 . . . . . + . . . 1 . . + . . 2 . . . + . . . . . 1 + . . . . 2 . +gap> STOP_TEST("w53.tst", 10000 ); diff --git a/tst/examples/wittindex.tst b/tst/examples/wittindex.tst new file mode 100644 index 0000000..323ffaa --- /dev/null +++ b/tst/examples/wittindex.tst @@ -0,0 +1,37 @@ +gap> START_TEST("Forms: wittindex.tst"); +gap> # Witt index. Also of degenerated forms +gap> mat := [[0,0,1,0,0],[0,0,0,0,0],[-1,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]*Z(7)^0; +[ [ 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ], + [ Z(7)^3, 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ] ] +gap> form := BilinearFormByMatrix(mat,GF(7)); +< bilinear form > +gap> WittIndex(form); +1 +gap> Dimension(RadicalOfForm(form)); +3 +gap> mat := IdentityMat(6,GF(5)); +[ [ Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5) ], + [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0 ] ] +gap> form := QuadraticFormByMatrix(mat,GF(5)); +< quadratic form > +gap> WittIndex(form); +3 +gap> mat := IdentityMat(6,GF(7)); +[ [ Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7), 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0, 0*Z(7) ], + [ 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), 0*Z(7), Z(7)^0 ] ] +gap> form := QuadraticFormByMatrix(mat,GF(7)); +< quadratic form > +gap> WittIndex(form); +2 +gap> STOP_TEST("wittindex.tst", 10000 );