Skip to content

Commit

Permalink
Resolve issue 15 (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdwensley authored Jul 4, 2024
1 parent 2480973 commit 4785663
Show file tree
Hide file tree
Showing 9 changed files with 997 additions and 976 deletions.
22 changes: 11 additions & 11 deletions doc/examples/nmo/example03.g
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# left-lexicographic ordering implicitly assumed in {\GBNP}:

LoadPackage("gbnp", false);
A := FreeAssociativeAlgebraWithOne(Rationals,"x","y","z");;
x := A.x;; y := A.y;; z := A.z;; id := One(A);;
polys := [ x^2 + y^2 + z^2 - id, x^2 + z^2 - y, x-z,
x*y-y*x, x*z-z*x, y*z-z*y];;
reps := GP2NPList(polys);;
gb := Grobner(reps);;
NP2GPList(gb,A);
A3 := FreeAssociativeAlgebraWithOne(Rationals,"x","y","z");;
x := A3.x;; y := A3.y;; z := A3.z;; id := One(A3);;
polys3 := [ x^2 + y^2 + z^2 - id, x^2 + z^2 - y, x-z,
x*y-y*x, x*z-z*x, y*z-z*y];;
reps3 := GP2NPList(polys3);;
gb3 := Grobner(reps3);;
NP2GPList(gb3,A3);

ml := NCMonomialLeftLexicographicOrdering(A,[3,2,1]);
PatchGBNP(ml);
gb := Grobner(reps);;
NP2GPList(gb,A);
ml3 := NCMonomialLeftLexicographicOrdering(A3,[3,2,1]);
PatchGBNP(ml3);
gb3 := Grobner(reps3);;
NP2GPList(gb3,A3);

24 changes: 12 additions & 12 deletions doc/examples/nmo/example03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ left-lexicographic ordering implicitly assumed in {\GBNP}:

gap> LoadPackage("gbnp", false);
true
gap> A := FreeAssociativeAlgebraWithOne(Rationals,"x","y","z");;
gap> x := A.x;; y := A.y;; z := A.z;; id := One(A);;
gap> polys := [ x^2 + y^2 + z^2 - id, x^2 + z^2 - y, x-z,
> x*y-y*x, x*z-z*x, y*z-z*y];;
gap> reps := GP2NPList(polys);;
gap> gb := Grobner(reps);;
gap> NP2GPList(gb,A);
gap> A3 := FreeAssociativeAlgebraWithOne(Rationals,"x","y","z");;
gap> x := A3.x;; y := A3.y;; z := A3.z;; id := One(A3);;
gap> polys3 := [ x^2 + y^2 + z^2 - id, x^2 + z^2 - y, x-z,
> x*y-y*x, x*z-z*x, y*z-z*y];;
gap> reps3 := GP2NPList(polys3);;
gap> gb3 := Grobner(reps3);;
gap> NP2GPList(gb3,A3);
[ (1)*z+(-1)*x, (1)*x^2+(-1/2)*y, (1)*y*x+(-1)*x*y,
(1)*y^2+(2)*x^2+(-1)*<identity ...> ]
(1)*y^2+(1)*y+(-1)*<identity ...> ]

gap> ml := NCMonomialLeftLexicographicOrdering(A,[3,2,1]);
gap> ml3 := NCMonomialLeftLexicographicOrdering(A3,[3,2,1]);
NCMonomialLeftLexicographicOrdering([ (1)*z, (1)*y, (1)*x ])
gap> PatchGBNP(ml);
gap> PatchGBNP(ml3);
LtNP patched.
GtNP patched.
gap> gb := Grobner(reps);;
gap> NP2GPList(gb,A);
gap> gb3 := Grobner(reps3);;
gap> NP2GPList(gb3,A3);
[ (1)*z^4+(1/2)*z^2+(-1/4)*<identity ...>, (1)*y+(-2)*z^2, (1)*x+(-1)*z ]

28 changes: 14 additions & 14 deletions doc/examples/nmo/example04.g
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

LoadPackage("gbnp", false);

A := FreeAssociativeAlgebraWithOne(Rationals,"a","b","c","d","e","f");;
a := A.a;; b := A.b;; c := A.c;; d := A.d;; e := A.e;; f := A.f;;
A4 := FreeAssociativeAlgebraWithOne(Rationals,"a","b","c","d","e","f");;
a := A4.a;; b := A4.b;; c := A4.c;; d := A4.d;; e := A4.e;; f := A4.f;;

polys := [ e*a, a^3 + f*a, a^9 + c*a^3, a^81 + c*a^9 + d*a^3,
a^27 + d*a^81 + e*a^9 + f*a^3, b + c*a^27 + e*a^81 + f*a^9,
c*b + d*a^27 + f*a^81, a + d*b + e*a^27, c*a + e*b + f*a^27,
d*a + f*b, b^3 - b, a*b - b*a, a*c - c*a, a*d - d*a,
a*e - e*a, a*f - f*a, b*c - c*b, b*d - d*b, b*e - e*b,
b*f - f*b, c*d - d*c, c*e - e*c, c*f - f*c, d*e - e*d,
d*f - f*d, e*f - f*e
polys4 := [ e*a, a^3 + f*a, a^9 + c*a^3, a^81 + c*a^9 + d*a^3,
a^27 + d*a^81 + e*a^9 + f*a^3, b + c*a^27 + e*a^81 + f*a^9,
c*b + d*a^27 + f*a^81, a + d*b + e*a^27, c*a + e*b + f*a^27,
d*a + f*b, b^3 - b, a*b - b*a, a*c - c*a, a*d - d*a,
a*e - e*a, a*f - f*a, b*c - c*b, b*d - d*b, b*e - e*b,
b*f - f*b, c*d - d*c, c*e - e*c, c*f - f*c, d*e - e*d,
d*f - f*d, e*f - f*e
];;
reps := GP2NPList(polys);;
reps4 := GP2NPList(polys4);;

ml := NCMonomialLeftLengthLexOrdering(A);
PatchGBNP(ml);
gb := Grobner(reps);;
NP2GPList(gb,A);
ml4 := NCMonomialLeftLengthLexOrdering(A4);
PatchGBNP(ml4);
gb4 := Grobner(reps4);;
NP2GPList(gb4,A4);
28 changes: 14 additions & 14 deletions doc/examples/nmo/example04.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ the following example shows. It was taken from the book page 339 of
gap> LoadPackage("gbnp", false);
true

gap> A := FreeAssociativeAlgebraWithOne(Rationals,"a","b","c","d","e","f");;
gap> a := A.a;; b := A.b;; c := A.c;; d := A.d;; e := A.e;; f := A.f;;
gap> A4 := FreeAssociativeAlgebraWithOne(Rationals,"a","b","c","d","e","f");;
gap> a := A4.a;; b := A4.b;; c := A4.c;; d := A4.d;; e := A4.e;; f := A4.f;;

gap> polys := [ e*a, a^3 + f*a, a^9 + c*a^3, a^81 + c*a^9 + d*a^3,
> a^27 + d*a^81 + e*a^9 + f*a^3, b + c*a^27 + e*a^81 + f*a^9,
> c*b + d*a^27 + f*a^81, a + d*b + e*a^27, c*a + e*b + f*a^27,
> d*a + f*b, b^3 - b, a*b - b*a, a*c - c*a, a*d - d*a,
> a*e - e*a, a*f - f*a, b*c - c*b, b*d - d*b, b*e - e*b,
> b*f - f*b, c*d - d*c, c*e - e*c, c*f - f*c, d*e - e*d,
> d*f - f*d, e*f - f*e
gap> polys4 := [ e*a, a^3 + f*a, a^9 + c*a^3, a^81 + c*a^9 + d*a^3,
> a^27 + d*a^81 + e*a^9 + f*a^3, b + c*a^27 + e*a^81 + f*a^9,
> c*b + d*a^27 + f*a^81, a + d*b + e*a^27, c*a + e*b + f*a^27,
> d*a + f*b, b^3 - b, a*b - b*a, a*c - c*a, a*d - d*a,
> a*e - e*a, a*f - f*a, b*c - c*b, b*d - d*b, b*e - e*b,
> b*f - f*b, c*d - d*c, c*e - e*c, c*f - f*c, d*e - e*d,
> d*f - f*d, e*f - f*e
> ];;
gap> reps := GP2NPList(polys);;
gap> reps4 := GP2NPList(polys4);;

gap> ml := NCMonomialLeftLengthLexOrdering(A);
gap> ml4 := NCMonomialLeftLengthLexOrdering(A4);
NCMonomialLeftLengthLexicographicOrdering([ (1)*a, (1)*b, (1)*c, (1)*d, (1)*e,\
(1)*f ])
gap> PatchGBNP(ml);
gap> PatchGBNP(ml4);
LtNP patched.
GtNP patched.
gap> gb := Grobner(reps);;
gap> NP2GPList(gb,A);
gap> gb4 := Grobner(reps4);;
gap> NP2GPList(gb4,A4);
[ (1)*a, (1)*b, (1)*d*c+(-1)*c*d, (1)*e*c+(-1)*c*e, (1)*e*d+(-1)*d*e,
(1)*f*c+(-1)*c*f, (1)*f*d+(-1)*d*f, (1)*f*e+(-1)*e*f ]
2 changes: 1 addition & 1 deletion doc/nmo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ gap> reps3 := GP2NPList( polys3 );;
gap> gb3 := Grobner( reps3 );;
gap> NP2GPList( gb3, A3 );
[ (1)*z+(-1)*x, (1)*x^2+(-1/2)*y, (1)*y*x+(-1)*x*y,
(1)*y^2+(2)*x^2+(-1)*&lt;identity ...> ]
(1)*y^2+(1)*y+(-1)*&lt;identity ...> ]
</Example>

The example, as presented in the book, uses a left-lexicographic ordering
Expand Down
Loading

0 comments on commit 4785663

Please sign in to comment.