Skip to content

Commit b6213c8

Browse files
committed
Test manual examples
1 parent ef2320c commit b6213c8

File tree

9 files changed

+1302
-29
lines changed

9 files changed

+1302
-29
lines changed

doc/construct_basic.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,9 @@ GF(2^2)[x_1,x_2]
286286
gap> pol := r.1*r.2;
287287
x_1*x_2
288288
gap> form := BilinearFormByPolynomial(pol,r);
289-
Error, No orthogonal form can be associated with a quadratic polynomial in even chara\
290-
cteristic
291-
called from
292-
BilinearFormByPolynomial( pol, pring, n
293-
) at ./pkg/forms/lib/forms.gi:470 called from
294-
<function "unknown">( <arguments> )
295-
called from read-eval loop at line 14 of *stdin*
296-
you can 'return;' to continue
289+
Error, No orthogonal form can be associated with a quadratic polynomial in eve\
290+
n characteristic
291+
297292
]]></Example>
298293
</Description>
299294
</ManSection>
@@ -1202,14 +1197,12 @@ itself is none of these, although it can behave as a sesquilinear or a quadratic
12021197
form, depending on its arguments.
12031198

12041199
<Example><![CDATA[
1205-
gap>
12061200
gap> mat := [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]*Z(3)^0;
12071201
[ [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ],
12081202
[ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ] ]
12091203
gap> form := BilinearFormByMatrix(mat,GF(3));
12101204
< trivial form >
1211-
gap> v := Random(GF(3)^4);
1212-
[ Z(3), Z(3), 0*Z(3), Z(3) ]
1205+
gap> v := Random(GF(3)^4);;
12131206
gap> [v,v]^form;
12141207
0*Z(3)
12151208
gap> v^form;

doc/examples.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ gap> gf := GF(8);
3939
GF(2^3)
4040
gap> vec := gf^3;
4141
( GF(2^3)^3 )
42-
gap> r := PolynomialRing( gf, 3);
43-
PolynomialRing(..., [ x_1, x_2, x_3 ])
42+
gap> r := PolynomialRing( gf, 3);;
4443
gap> poly := r.1^2 + r.2 * r.3;
4544
x_1^2+x_2*x_3
4645
gap> form := QuadraticFormByPolynomial( poly, r );
@@ -52,6 +51,7 @@ Gram Matrix:
5251
. . 1
5352
. . .
5453
Polynomial: x_1^2+x_2*x_3
54+
5555
gap> IsDegenerateForm( form );
5656
#I Testing degeneracy of the *associated bilinear form*
5757
true
@@ -92,8 +92,9 @@ gap> hom := BaseChangeHomomorphism( b, GF(8) );
9292
[ 0*Z(2), 0*Z(2), Z(2)^0 ] ]
9393
gap> newgo := Image(hom, go);
9494
Group(
95-
[ [ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2^3), 0*Z(2) ], [ 0*Z(2), 0*Z(2),
96-
Z(2^3)^6 ] ],
95+
[
96+
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2^3), 0*Z(2) ],
97+
[ 0*Z(2), 0*Z(2), Z(2^3)^6 ] ],
9798
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ Z(2)^0, Z(2)^0, Z(2)^0 ],
9899
[ 0*Z(2), Z(2)^0, 0*Z(2) ] ] ])
99100
]]></Example>

doc/morphisms.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,10 +910,7 @@ gap> form := BilinearFormByMatrix(mat,GF(8));
910910
gap> IsDegenerateForm(form);
911911
false
912912
gap> TypeOfForm(form);
913-
Error, <f> is a pseudo form and has no defined type called from
914-
<function "unknown">( <arguments> )
915-
called from read-eval loop at line 30 of *stdin*
916-
you can 'return;' to continue
913+
Error, <f> is a pseudo form and has no defined type
917914
]]></Example>
918915

919916
</Description>

doc/theory.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,7 @@ gap> mat := [[1,0,0],[0,1,4],[1,2,1]]*Z(5)^0;
188188
[ Z(5)^0, Z(5), Z(5)^0 ] ]
189189
gap> form := BilinearFormByMatrix(mat,GF(5));
190190
Error, Invalid Gram matrix
191-
called from
192-
BilinearFormByMatrixOp( MutableCopyMat( m ), f
193-
) at ./pkg/forms/lib/forms.gi:164 called from
194-
<function "unknown">( <arguments> )
195-
called from read-eval loop at line 8 of *stdin*
196-
you can 'return;' to continue
191+
197192
]]></Example>
198193
It is clear that the matrix used is not defining a reflexive bilinear form,
199194
which causes the system to generate the error message.

makedoc.g

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
## tree. Under decent operating systems, you need sufficient permissions to do.
88
## Executing this is NOT necessary for the installation of the package "forms".
99

10-
if fail = LoadPackage("AutoDoc", ">= 2016.01.21") then
11-
Error("AutoDoc 2016.01.21 or newer is required");
10+
if fail = LoadPackage("AutoDoc", ">= 2019.04.10") then
11+
Error("AutoDoc 2019.04.10 or newer is required");
1212
fi;
13-
AutoDoc("forms");
14-
QUIT;
1513

14+
AutoDoc(rec(
15+
extract_examples := true,
16+
));
17+
QUIT;

tst/forms01.tst

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Forms, chapter 2
2+
#
3+
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
4+
#
5+
# This file has been generated by AutoDoc. It contains examples extracted from
6+
# the package documentation. Each example is preceded by a comment which gives
7+
# the name of a GAPDoc XML file and a line range from which the example were
8+
# taken. Note that the XML file in turn may have been generated by AutoDoc
9+
# from some other input.
10+
#
11+
gap> START_TEST( "forms01.tst");
12+
13+
# doc/examples.xml:37-66
14+
gap> gf := GF(8);
15+
GF(2^3)
16+
gap> vec := gf^3;
17+
( GF(2^3)^3 )
18+
gap> r := PolynomialRing( gf, 3);;
19+
gap> poly := r.1^2 + r.2 * r.3;
20+
x_1^2+x_2*x_3
21+
gap> form := QuadraticFormByPolynomial( poly, r );
22+
< quadratic form >
23+
gap> Display( form );
24+
Quadratic form
25+
Gram Matrix:
26+
1 . .
27+
. . 1
28+
. . .
29+
Polynomial: x_1^2+x_2*x_3
30+
31+
gap> IsDegenerateForm( form );
32+
#I Testing degeneracy of the *associated bilinear form*
33+
true
34+
gap> IsSingularForm( form );
35+
false
36+
gap> WittIndex( form );
37+
1
38+
gap> IsParabolicForm( form );
39+
true
40+
gap> RadicalOfForm( form );
41+
<vector space over GF(2^3), with 0 generators>
42+
43+
# doc/examples.xml:72-77
44+
gap> canonical := IsometricCanonicalForm( form );
45+
< parabolic quadratic form >
46+
gap> form = canonical;
47+
true
48+
49+
# doc/examples.xml:79-99
50+
gap> go := GO(3,8);
51+
GO(0,3,8)
52+
gap> mat := InvariantQuadraticForm( go )!.matrix;
53+
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), 0*Z(2), 0*Z(2) ],
54+
[ 0*Z(2), Z(2)^0, 0*Z(2) ] ]
55+
gap> gapform := QuadraticFormByMatrix( mat, GF(8) );
56+
< quadratic form >
57+
gap> b := BaseChangeToCanonical( gapform );
58+
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2) ],
59+
[ 0*Z(2), 0*Z(2), Z(2)^0 ] ]
60+
gap> hom := BaseChangeHomomorphism( b, GF(8) );
61+
^[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2)^0, 0*Z(2) ],
62+
[ 0*Z(2), 0*Z(2), Z(2)^0 ] ]
63+
gap> newgo := Image(hom, go);
64+
Group(
65+
[ [ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ 0*Z(2), Z(2^3), 0*Z(2) ], [ 0*Z(2), 0*Z(2),
66+
Z(2^3)^6 ] ],
67+
[ [ Z(2)^0, 0*Z(2), 0*Z(2) ], [ Z(2)^0, Z(2)^0, Z(2)^0 ],
68+
[ 0*Z(2), Z(2)^0, 0*Z(2) ] ] ])
69+
70+
# doc/examples.xml:103-110
71+
gap> conic := Filtered(vec, x -> IsZero( x^form ));;
72+
gap> Size(conic);
73+
64
74+
gap> orbs := Orbits(newgo, conic, OnRight);;
75+
gap> List(orbs,Size);
76+
[ 1, 63 ]
77+
78+
# doc/examples.xml:138-182
79+
gap> f := GF(3);
80+
GF(3)
81+
gap> gram := [
82+
> [0,0,0,1,0,0],
83+
> [0,0,0,0,1,0],
84+
> [0,0,0,0,0,1],
85+
> [-1,0,0,0,0,0],
86+
> [0,-1,0,0,0,0],
87+
> [0,0,-1,0,0,0]] * One(f);;
88+
gap> form := BilinearFormByMatrix( gram, f );
89+
< bilinear form >
90+
gap> IsSymplecticForm( form );
91+
true
92+
gap> Display( form );
93+
Symplectic form
94+
Gram Matrix:
95+
. . . 1 . .
96+
. . . . 1 .
97+
. . . . . 1
98+
2 . . . . .
99+
. 2 . . . .
100+
. . 2 . . .
101+
gap> b := BaseChangeToCanonical( form );
102+
[ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ],
103+
[ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ],
104+
[ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ],
105+
[ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ],
106+
[ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ],
107+
[ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ] ]
108+
gap> Display( b );
109+
1 . . . . .
110+
. . . 1 . .
111+
. 1 . . . .
112+
. . . . 1 .
113+
. . 1 . . .
114+
. . . . . 1
115+
gap> Display( b * gram * TransposedMat(b) );
116+
. 1 . . . .
117+
2 . . . . .
118+
. . . 1 . .
119+
. . 2 . . .
120+
. . . . . 1
121+
. . . . 2 .
122+
123+
# doc/examples.xml:197-219
124+
gap> go := GO(5, 5);
125+
GO(0,5,5)
126+
gap> x :=
127+
> [ [ Z(5)^0, Z(5)^3, 0*Z(5), Z(5)^3, Z(5)^3 ],
128+
> [ Z(5)^2, Z(5)^3, 0*Z(5), Z(5)^2, Z(5) ],
129+
> [ Z(5)^2, Z(5)^2, Z(5)^0, Z(5), Z(5)^3 ],
130+
> [ Z(5)^0, Z(5)^3, Z(5), Z(5)^0, Z(5)^3 ],
131+
> [ Z(5)^3, 0*Z(5), Z(5)^0, 0*Z(5), Z(5) ]
132+
> ];;
133+
gap> go2 := go^x;
134+
<matrix group of size 18720000 with 2 generators>
135+
gap> forms := PreservedSesquilinearForms( go2 );
136+
[ < bilinear form > ]
137+
gap> Display( forms[1] );
138+
Bilinear form
139+
Gram Matrix:
140+
4 2 4 3 3
141+
2 2 2 3 3
142+
4 2 3 1 4
143+
3 3 1 2 4
144+
3 3 4 4 3
145+
146+
#
147+
gap> STOP_TEST("forms01.tst", 1 );

0 commit comments

Comments
 (0)