diff --git a/grp/classic.gi b/grp/classic.gi index e7f6dd553e..bee80c129e 100644 --- a/grp/classic.gi +++ b/grp/classic.gi @@ -1589,11 +1589,18 @@ BindGlobal( "OmegaZero", function( d, q ) fi; SetSize( g, q^(m^2) * s ); - # construct the bilinear form -#T add the form! - - # and the quadratic form -#T add the form! + # construct the forms + if q mod 2 = 0 then + # FIXME: add forms for even characteristic, if that is possible at all + # (it doesn't seem to be) + else + x:= NullMat( d, d, f ); + for i in [ 1 .. m ] do + x[i,d-i+1] := o; + od; + x[m+1,m+1] := (Characteristic(f)+1)/4*o; + SetInvariantQuadraticFormFromMatrix(g, ImmutableMatrix( f, x, true ) ); + fi; # and return return g; @@ -1700,11 +1707,13 @@ BindGlobal( "OmegaPlus", function( d, q ) fi; SetSize( g, q^(m*(m-1)) * (q^m-1) * s ); - # construct the bilinear form -#T add the form! - - # and the quadratic form -#T add the form! + # construct the forms + x:= NullMat( d, d, f ); + for i in [ 1 .. m ] do + x[i,d-i+1] := o; + od; + x:= ImmutableMatrix( f, x, true ); + SetInvariantQuadraticFormFromMatrix( g, x ); # and return return g; @@ -1783,11 +1792,18 @@ BindGlobal( "OmegaMinus", function( d, q ) fi; SetSize( g, q^(m*(m-1)) * (q^m+1) * s ); - # construct the bilinear form -#T add the form! - - # and the quadratic form -#T add the form! + # construct the forms + x:= NullMat( d, d, f ); + for i in [ 1 .. m-1 ] do + x[i,d-i+1] := o; + od; + x[m,d-m+1] := -nu - nubar; + if q mod 2 = 1 then + x[m,d-m] := -o; + x[m+1,d-m+1] := xi^( (q+1)/2 ); + fi; + x:= ImmutableMatrix( f, x, true ); + SetInvariantQuadraticFormFromMatrix( g, x ); # and return return g; diff --git a/tst/testinstall/grp/classic-forms.tst b/tst/testinstall/grp/classic-forms.tst index 49ad9baca4..d8587cb1eb 100644 --- a/tst/testinstall/grp/classic-forms.tst +++ b/tst/testinstall/grp/classic-forms.tst @@ -1,6 +1,5 @@ # # Tests invariant forms of classic groups -# TODO: also test quadratic forms # gap> START_TEST("classic-forms.tst"); @@ -117,7 +116,6 @@ true # # Omega subgroups of special orthogonal groups # -# TODO: add forms to Omega, check them here # odd-dimensional gap> grps:=[];; @@ -129,10 +127,16 @@ gap> for d in [3,5,7] do gap> ForAll(grps, CheckGeneratorsSpecial); true -#gap> ForAll(grps, CheckBilinearForm); -#true -#gap> ForAll(grps, CheckQuadraticForm); -#true +# FIXME: forms are not implemented for odd d, even q +# gap> ForAll(grps, CheckBilinearForm); +# true +# gap> ForAll(grps, CheckQuadraticForm); +# true +# +gap> ForAll(Filtered(grps, g -> Characteristic(g)<>2), CheckBilinearForm); +true +gap> ForAll(Filtered(grps, g -> Characteristic(g)<>2), CheckQuadraticForm); +true gap> ForAll(grps, CheckSize); true @@ -146,11 +150,10 @@ gap> for d in [2,4,6,8] do > od; gap> ForAll(grps, CheckGeneratorsSpecial); true - -#gap> ForAll(grps, CheckBilinearForm); -#true -#gap> ForAll(grps, CheckQuadraticForm); -#true +gap> ForAll(grps, CheckBilinearForm); +true +gap> ForAll(grps, CheckQuadraticForm); +true gap> ForAll(grps, CheckSize); true