Skip to content

Commit 4d6cab1

Browse files
committed
Import manual examples into tst/
1 parent c1637f4 commit 4d6cab1

File tree

5 files changed

+262
-11
lines changed

5 files changed

+262
-11
lines changed

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ Dependencies := rec(
8888
ExternalConditions := []
8989
),
9090
AvailabilityTest := ReturnTrue,
91-
Autoload := false,
9291

9392
# the banner
9493
BannerString := "LieRing\n a package for working with Lie rings \n by Serena Cicalò and Willem de Graaf\n",
94+
TestFile := "tst/testall.g",
9595
Keywords := ["Lie rings","Lazard correspondence"],
9696

9797
AutoDoc := rec(

doc/manual.xml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,8 @@ gap> x:= L.1;; y:= L.2;;
273273
gap> R:= [((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];
274274
[ (-1)*(x,(x,(x,y)))+(-6)*(y,(x,y)),
275275
(-3)*(x,(x,(x,(x,(x,y)))))+(-20)*(y,(x,(x,(x,y)))) ]
276-
gap> K:= FpLieRing( L, R : maxdeg:= 15 ); time;
276+
gap> K:= FpLieRing( L, R : maxdeg:= 15 );
277277
<Lie ring with 75 generators>
278-
944
279278
gap> f:=CanonicalProjection(K);
280279
function( elm ) ... end
281280
gap> f(R[1]);
@@ -488,7 +487,7 @@ gap> rr:=[((y*x)*x)*x-7*(y*x)*y, 7*((((y*x)*x)*x)*x)*x-49*(((y*x)*x)*x)*y,
488487
gap> K:= FpLieRing( L, rr : maxdeg:= 5 );;
489488
gap> LieLowerPCentralSeries(K,7);
490489
[ <Lie ring with 11 generators>, <Lie ring with 10 generators>,
491-
<Lie ring with 8 generators>, <Lie ring with 6 generators>,
490+
<Lie ring with 8 generators>, <Lie ring with 6 generators>,
492491
<Lie ring with 4 generators>, <Lie ring with 0 generators> ]
493492
</Example>
494493
</Description>
@@ -528,7 +527,7 @@ gap> TensorWithField( K, GF(3) );
528527
gap> TensorWithField( K, GF(2) );
529528
&lt;Lie algebra of dimension 1 over GF(2)>
530529
gap> TensorWithField( K, GF(5) );
531-
&lt;Lie algebra over GF(5), with 0 generators>
530+
&lt;Lie algebra of dimension 0 over GF(5)>
532531
</Example>
533532
</Description>
534533
</ManSection>
@@ -570,9 +569,9 @@ gap> rels := [ a^13, b^13/g, c^13, d^13, e^13, f^13, g^13,
570569
gap> G := PcGroupFpGroup( F/rels );
571570
&lt;pc group of size 62748517 with 7 generators>
572571
gap> r:= PGroupToLieRing(G);
573-
rec( pgroup := &lt;pc group of size 62748517 with 7 generators>,
574-
liering := &lt;Lie ring with 6 generators>,
575-
GtoL := function( g0 ) ... end, LtoG := function( x0 ) ... end )
572+
rec( GtoL := function( g0 ) ... end, LtoG := function( x0 ) ... end,
573+
liering := &lt;Lie ring with 6 generators>,
574+
pgroup := &lt;pc group of size 62748517 with 7 generators> )
576575
gap> f:= r.GtoL; h:= r.LtoG;
577576
function( g0 ) ... end
578577
function( x0 ) ... end
@@ -609,9 +608,9 @@ gap> rels:= [ (b*a)*b, c*a, c*b-(b*a)*a, 7^2*a, 7*b-((b*a)*a)*a,
609608
gap> K:= FpLieRing( L, rels );
610609
&lt;Lie ring with 5 generators>
611610
gap> r:= LieRingToPGroup(K);
612-
rec( pgroup := &lt;pc group of size 823543 with 7 generators>,
613-
liering := &lt;Lie ring with 5 generators>,
614-
LtoG := function( x0 ) ... end, GtoL := function( g0 ) ... end )
611+
rec( GtoL := function( g0 ) ... end, LtoG := function( x0 ) ... end,
612+
liering := &lt;Lie ring with 5 generators>,
613+
pgroup := &lt;pc group of size 823543 with 7 generators> )
615614
gap> G:= r.pgroup;; f:= r.LtoG;; h:= r.GtoL;;
616615
gap> u:= 5*Basis(K)[2]+9*Basis(K)[5];
617616
5*v_2+9*v_5

tst/liering01.tst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# LieRing, chapter 1
2+
#
3+
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
4+
#
5+
# This file has been autogenerated with GAP. It contains examples
6+
# extracted from the documentation. Each example is preceded by the
7+
# comment which points to the location of its source.
8+
#
9+
gap> START_TEST( "liering01.tst");
10+
11+
# doc/manual.xml:50-66
12+
gap> L:= FreeLieRing( Integers, ["a","b"] );
13+
<Free algebra over Integers generators: a, b >
14+
gap> a:= L.1; b:= L.2;
15+
a
16+
b
17+
gap> S:= [ 5*a-(b*a)*a-((b*a)*b)*b,5*b];
18+
[ (5)*a+(-1)*(a,(a,b))+(b,(b,(a,b))), (5)*b ]
19+
gap> K:= FpLieRing( L, S : maxdeg:= 4 );
20+
<Lie ring with 5 generators>
21+
gap> v:=BasisVectors( Basis(K) );
22+
[ v_1, v_2, v_3, v_4, v_5 ]
23+
gap> v[1]*v[4];
24+
4*v_2+5*v_5
25+
gap> Torsion( Basis(K) );
26+
[ 5, 5, 5, 5, 25 ]
27+
gap> STOP_TEST("liering01.tst", 1 );

tst/liering02.tst

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
# LieRing, chapter 2
2+
#
3+
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
4+
#
5+
# This file has been autogenerated with GAP. It contains examples
6+
# extracted from the documentation. Each example is preceded by the
7+
# comment which points to the location of its source.
8+
#
9+
gap> START_TEST( "liering02.tst");
10+
11+
# doc/manual.xml:174-182
12+
gap> L:= FreeLieRing( Integers, ["a","b"] );
13+
<Free algebra over Integers generators: a, b >
14+
gap> a:= L.1; b:= L.2;
15+
a
16+
b
17+
gap> (a*b)*b+2*a*b;
18+
(2)*(a,b)+(-1)*(b,(a,b))
19+
20+
# doc/manual.xml:193-200
21+
gap> L:= FreeLieRing( Integers, ["a","b"] );;
22+
gap> a:= L.1;; b:= L.2;;
23+
gap> f:=(a*b)*b+2*a*b;
24+
(2)*(a,b)+(-1)*(b,(a,b))
25+
gap> Degree(f);
26+
3
27+
28+
# doc/manual.xml:239-244
29+
gap> T:= EmptySCTable( 3, 0, "antisymmetric" );;
30+
gap> SetEntrySCTable( T, 1, 2, [1,3] );
31+
gap> LieRingByStructureConstants( [3,6,3], T );
32+
<Lie ring with 3 generators>
33+
34+
# doc/manual.xml:269-284
35+
gap> L:= FreeLieRing( Integers, ["x","y"], [1,2] );
36+
<Free algebra over Integers generators: x, y >
37+
gap> x:= L.1;; y:= L.2;;
38+
gap> R:= [((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];
39+
[ (-1)*(x,(x,(x,y)))+(-6)*(y,(x,y)),
40+
(-3)*(x,(x,(x,(x,(x,y)))))+(-20)*(y,(x,(x,(x,y)))) ]
41+
gap> K:= FpLieRing( L, R : maxdeg:= 15 );
42+
<Lie ring with 75 generators>
43+
gap> f:=CanonicalProjection(K);
44+
function( elm ) ... end
45+
gap> f(R[1]);
46+
0
47+
gap> f(x);
48+
v_1
49+
50+
# doc/manual.xml:314-323
51+
gap> T:= EmptySCTable( 3, 0, "antisymmetric" );;
52+
gap> SetEntrySCTable( T, 1, 2, [1,3] );
53+
gap> K:= LieRingByStructureConstants( [3,6,3], T );
54+
<Lie ring with 3 generators>
55+
gap> Basis(K);
56+
Basis( <Lie ring with 3 generators>, [ v_1, v_2, v_3 ] )
57+
gap> BasisVectors( Basis(K) );
58+
[ v_1, v_2, v_3 ]
59+
60+
# doc/manual.xml:332-341
61+
gap> T:= EmptySCTable( 3, 0, "antisymmetric" );;
62+
gap> SetEntrySCTable( T, 1, 2, [1,3] );
63+
gap> K:= LieRingByStructureConstants( [3,6,3], T );
64+
<Lie ring with 3 generators>
65+
gap> StructureConstantsTable( Basis(K) );
66+
[ [ [ [ ], [ ] ], [ [ 3 ], [ 1 ] ], [ [ ], [ ] ] ],
67+
[ [ [ 3 ], [ -1 ] ], [ [ ], [ ] ], [ [ ], [ ] ] ],
68+
[ [ [ ], [ ] ], [ [ ], [ ] ], [ [ ], [ ] ] ], -1, 0 ]
69+
70+
# doc/manual.xml:350-357
71+
gap> T:= EmptySCTable( 3, 0, "antisymmetric" );;
72+
gap> SetEntrySCTable( T, 1, 2, [1,3] );
73+
gap> K:= LieRingByStructureConstants( [3,6,3], T );
74+
<Lie ring with 3 generators>
75+
gap> Torsion( Basis(K) );
76+
[ 3, 6, 3 ]
77+
78+
# doc/manual.xml:367-377
79+
gap> L:= FreeLieRing( Integers, ["x","y"] );; x:= L.1;; y:= L.2;;
80+
gap> rr:=[((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];;
81+
gap> K:= FpLieRing( L, rr : maxdeg:= 6 );;
82+
gap> C:=LieCentre(K);
83+
<Lie ring with 9 generators>
84+
gap> Coefficients( Basis(K), Basis(C)[6] );
85+
[ 5, 5, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
86+
gap> Coefficients( Basis(C), Basis(C)[6] );
87+
[ 0, 0, 0, 0, 0, 1, 0, 0, 0 ]
88+
89+
# doc/manual.xml:391-405
90+
gap> L:= FreeLieRing( Integers, ["x","y"] );;
91+
gap> x:= L.1;; y:= L.2;;
92+
gap> rr:=[((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];;
93+
gap> K:= FpLieRing( L, rr : maxdeg:= 8 );
94+
<Lie ring with 41 generators>
95+
gap> b:= Basis(K);;
96+
gap> M:= SubLieRing( K, [ b[30], b[40] ] );
97+
<Lie ring with 6 generators>
98+
gap> Torsion(Basis(M));
99+
[ 3, 6, 6, 12, 360, 0 ]
100+
gap> Basis(M)[2];
101+
3*v_2+2*v_3+2*v_10+4*v_12+4*v_13+5*v_14+v_15+3*v_17+3*v_18+6*v_20+10*v_22+6*v_
102+
24+6*v_25+10*v_26+4*v_27+18*v_28+30*v_29+60*v_30+360*v_31+5040*v_32
103+
104+
# doc/manual.xml:429-448
105+
gap> L:= FreeLieRing( Integers, ["x","y"] );;
106+
gap> x:= L.1;; y:= L.2;;
107+
gap> rr:=[((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];;
108+
gap> K:= FpLieRing( L, rr : maxdeg:= 8 );;
109+
gap> b:= Basis(K);;
110+
gap> I:= LieRingIdeal( K, [ b[29] ] );
111+
<Lie ring with 23 generators>
112+
gap> f:= NaturalHomomorphismByIdeal( K, I );;
113+
gap> M:= Range(f);
114+
<Lie ring with 27 generators>
115+
gap> Torsion(Basis(M));
116+
[ 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 12, 12, 12, 120, 720, 10080, 0, 0, 0,
117+
0, 0, 0, 0, 0, 0 ]
118+
gap> Image( f, b[30] );
119+
v_16+716*v_17
120+
gap> PreImagesRepresentative( f, Basis(M)[10] );
121+
4*v_2+4*v_3+4*v_4+4*v_5+5*v_6+v_7+5*v_8+v_9+5*v_10+v_11+5*v_12+v_13+5*v_14+v_
122+
24+v_25+11*v_26+v_29+10*v_30+100*v_31
123+
124+
# doc/manual.xml:459-468
125+
gap> L:= FreeLieRing( Integers, ["x","y"] );; x:= L.1;; y:= L.2;;
126+
gap> rr:=[((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];;
127+
gap> K:= FpLieRing( L, rr : maxdeg:= 7 );;
128+
gap> LieLowerCentralSeries(K);
129+
[ <Lie ring with 26 generators>, <Lie ring with 24 generators>,
130+
<Lie ring with 23 generators>, <Lie ring with 22 generators>,
131+
<Lie ring with 21 generators>, <Lie ring with 19 generators>,
132+
<Lie ring with 16 generators>, <Lie ring with 0 generators> ]
133+
134+
# doc/manual.xml:483-492
135+
gap> L:= FreeLieRing( Integers, ["x","y"] );; x:= L.1;; y:= L.2;;
136+
gap> rr:=[((y*x)*x)*x-7*(y*x)*y, 7*((((y*x)*x)*x)*x)*x-49*(((y*x)*x)*x)*y,
137+
> 7*x, 49*y ];;
138+
gap> K:= FpLieRing( L, rr : maxdeg:= 5 );;
139+
gap> LieLowerPCentralSeries(K,7);
140+
[ <Lie ring with 11 generators>, <Lie ring with 10 generators>,
141+
<Lie ring with 8 generators>, <Lie ring with 6 generators>,
142+
<Lie ring with 4 generators>, <Lie ring with 0 generators> ]
143+
144+
# doc/manual.xml:502-511
145+
gap> L:= FreeLieRing( Integers, ["x","y"] );; x:= L.1;; y:= L.2;;
146+
gap> rr:=[((y*x)*x)*x-6*(y*x)*y, 3*((((y*x)*x)*x)*x)*x-20*(((y*x)*x)*x)*y ];;
147+
gap> K:= FpLieRing( L, rr : maxdeg:= 7 );;
148+
gap> LieCentre(K);
149+
<Lie ring with 16 generators>
150+
gap> Torsion( Basis(K) );
151+
[ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 360, 5040, 0, 0, 0, 0,
152+
0, 0, 0, 0 ]
153+
154+
# doc/manual.xml:521-531
155+
gap> T:= EmptySCTable( 3, 0, "antisymmetric" );;
156+
gap> SetEntrySCTable( T, 1, 2, [1,3] );
157+
gap> K:= LieRingByStructureConstants( [3,6,3], T );;
158+
gap> TensorWithField( K, GF(3) );
159+
<Lie algebra of dimension 3 over GF(3)>
160+
gap> TensorWithField( K, GF(2) );
161+
<Lie algebra of dimension 1 over GF(2)>
162+
gap> TensorWithField( K, GF(5) );
163+
<Lie algebra of dimension 0 over GF(5)>
164+
165+
# doc/manual.xml:561-586
166+
gap> F := FreeGroup(IsSyllableWordsFamily,"a","b","c","d", "e", "f", "g");;
167+
gap> a := F.1;; b := F.2;; c := F.3;; d := F.4;; e := F.5;; f := F.6;; g:=F.7;;
168+
gap> rels := [ a^13, b^13/g, c^13, d^13, e^13, f^13, g^13,
169+
> Comm(b,a)/c, Comm(c,a)/d, Comm(d,a)/e, Comm(e,a)/f, Comm(f,a), Comm(g,a),
170+
> Comm(c,b)/(g^11), Comm(d,b)/g, Comm(e,b)/g, Comm(g,b), Comm(d,c)/(g^12),
171+
> Comm(e,c), Comm(f,c), Comm(g,c), Comm(e,d), Comm(f,d), Comm(g,d), Comm(f,e),
172+
> Comm(g,e), Comm(g,f)];;
173+
gap> G := PcGroupFpGroup( F/rels );
174+
<pc group of size 62748517 with 7 generators>
175+
gap> r:= PGroupToLieRing(G);
176+
rec( GtoL := function( g0 ) ... end, LtoG := function( x0 ) ... end,
177+
liering := <Lie ring with 6 generators>,
178+
pgroup := <pc group of size 62748517 with 7 generators> )
179+
gap> f:= r.GtoL; h:= r.LtoG;
180+
function( g0 ) ... end
181+
function( x0 ) ... end
182+
gap> L:= r.liering;
183+
<Lie ring with 6 generators>
184+
gap> b:= Basis(L);
185+
Basis( <Lie ring with 6 generators>, [ v_1, v_2, v_3, v_4, v_5, v_6 ] )
186+
gap> h(b[1]);
187+
a^12*c*d^5*e^3*f^8*g^7
188+
gap> f(h(b[1]));
189+
v_1
190+
191+
# doc/manual.xml:603-621
192+
gap> L:= FreeLieRing( Integers, ["a","b","c"] );;
193+
gap> a:= L.1;; b:= L.2;; c:= L.3;;
194+
gap> rels:= [ (b*a)*b, c*a, c*b-(b*a)*a, 7^2*a, 7*b-((b*a)*a)*a,
195+
> 7*c-((b*a)*a)*a];;
196+
gap> K:= FpLieRing( L, rels );
197+
<Lie ring with 5 generators>
198+
gap> r:= LieRingToPGroup(K);
199+
rec( GtoL := function( g0 ) ... end, LtoG := function( x0 ) ... end,
200+
liering := <Lie ring with 5 generators>,
201+
pgroup := <pc group of size 823543 with 7 generators> )
202+
gap> G:= r.pgroup;; f:= r.LtoG;; h:= r.GtoL;;
203+
gap> u:= 5*Basis(K)[2]+9*Basis(K)[5];
204+
5*v_2+9*v_5
205+
gap> f(u);
206+
f3^2*f4^2*f5^6*f7^3
207+
gap> h(f(u));
208+
5*v_2+9*v_5
209+
210+
# doc/manual.xml:646-658
211+
gap> L:= SmallNEngelLieRing( 4, 3 );
212+
<Lie ring with 133 generators>
213+
gap> x:= 10*Basis(L)[1]+7*Basis(L)[10]+19*Basis(L)[89];
214+
7*v_10+19*v_89
215+
gap> ForAll( Basis(L), y -> IsZero( x*(x*(x*(x*y))) ) );
216+
true
217+
gap> K:= TensorWithField( L, GF(3) );
218+
<Lie algebra of dimension 83 over GF(3)>
219+
gap> x:= Random(K);;
220+
gap> ForAll( Basis(K), y -> IsZero( x*(x*(x*(x*y))) ) );
221+
true
222+
gap> STOP_TEST("liering02.tst", 1 );

tst/testall.g

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LoadPackage("liering");
2+
TestDirectory(DirectoriesPackageLibrary("liering", "tst"), rec(exitGAP := true));
3+
FORCE_QUIT_GAP(1);

0 commit comments

Comments
 (0)