# $Id$ # #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: simple test r = WordPolyRing(QQ(), "x,y") print "WordPolyRing: " + str(r) print [one, x, y] = r.gens() print "one = " + str(one) print "x = " + str(x) print "y = " + str(y) print f1 = x * y - (1, 10) f2 = y * x + x + y print "f1 = " + str(f1) print "f2 = " + str(f2) print c1 = f1 * f2 c2 = f2 * f1 s = c1 - c2
# #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: solvable polynomials example #r = WordPolyRing(QQ(),"a,b,e1,e2,e3"); r = WordPolyRing(QQ(), "a,b,e,f,g") print "WordPolyRing: " + str(r) print [one, a, b, e, f, g] = r.gens() print "one = " + str(one) print "a = " + str(a) print "b = " + str(b) print "e = " + str(e) print "f = " + str(f) print "g = " + str(g) print r1 = g * e - (e * g - e) r2 = g * f - (f * g - f) r3 = e * a - a * e r4 = e * b - b * e r5 = f * a - a * f r6 = f * b - b * f r7 = g * a - a * g
# $Id$ # #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: simple test r = WordPolyRing(QQ(),"x,y"); print "WordPolyRing: " + str(r); print; [one,x,y] = r.gens(); print "one = " + str(one); print "x = " + str(x); print "y = " + str(y); print; f1 = x*y - (1,10); f2 = y*x + x + y; print "f1 = " + str(f1); print "f2 = " + str(f2); print; c1 = f1 * f2; c2 = f2 * f1; s = c1 - c2;
## \end{PossoExample} #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing, RingElem from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM, WRC # Hawes & Gibson example 2 # rational function coefficients r = WordPolyRing(PolyRing(ZZ(), "a, c, b", PolyRing.lex), "y2, y1, z1, z2, x") print "Ring: " + str(r) print one, a, c, b, y2, y1, z1, z2, x = r.gens() p1 = x + 2 * y1 * z1 + 3 * a * y1**2 + 5 * y1**4 + 2 * c * y1 p2 = x + 2 * y2 * z2 + 3 * a * y2**2 + 5 * y2**4 + 2 * c * y2 p3 = 2 * z2 + 6 * a * y2 + 20 * y2**3 + 2 * c p4 = 3 * z1**2 + y1**2 + b p5 = 3 * z2**2 + y2**2 + b F = [p1, p2, p3, p4, p5] # make all variables commute cm = [RingElem(q) for q in r.ring.commute()] print "commute: " + str([str(q) for q in cm]) print g = r.ideal("", F + cm)
from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # exterior calculus example # Hartley and Tuckey, 1993, # GB in Clifford and Grassmann algebras r = WordPolyRing(QQ(), "a,b,c,f,g,h,u,v,w,x,y,z"); #r = WordPolyRing(ZZ(), "a,b,c,f,g,h,u,v,w,x,y,z"); print "WordPolyRing: " + str(r); print; one,a,b,c,f,g,h,u,v,w,x,y,z = r.gens(); print "a = %s" % a; print "z = %s" % z; print; # exterior algebra relations rs = [ b * a - a * b , c * a - a * c , f * a - a * f , g * a - a * g , h * a - a * h , u * a - a * u , v * a - a * v , w * a - a * w , x * a - a * x ,
# $Id$ # # from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: evans example r = WordPolyRing(QQ(), "x,y,z") print "WordPolyRing: " + str(r) print [one, x, y, z] = r.gens() print "one = " + str(one) print "x = " + str(x) print "y = " + str(y) print "z = " + str(z) print f1 = x * y - z f2 = y * z + 2 * x + z f3 = y * z + x print "f1 = " + str(f1) print "f2 = " + str(f2) print "f3 = " + str(f3) print
# $Id$ # #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: solvable polynomials example r = WordPolyRing(QQ(), "a,b,e1,e2,e3") print "WordPolyRing: " + str(r) print [one, a, b, e1, e2, e3] = r.gens() print "one = " + str(one) print "a = " + str(a) print "b = " + str(b) print "e1 = " + str(e1) print "e2 = " + str(e2) print "e3 = " + str(e3) print r1 = e3 * e1 - (e1 * e3 - e1) r2 = e3 * e2 - (e2 * e3 - e2) r3 = e1 * a - a * e1 r4 = e1 * b - b * e1 r5 = e2 * a - a * e2 r6 = e2 * b - b * e2 r7 = e3 * a - a * e3
#from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM, WRC # exterior calculus example # Hartley and Tuckey, 1993, # GB in Clifford and Grassmann algebras r = WordPolyRing(QQ(), "a,b,c,f,g,h,u,v,w,x,y,z"); print "WordPolyRing: " + str(r); print; one,a,b,c,f,g,h,u,v,w,x,y,z = r.gens(); print "a = %s" % a; print "z = %s" % z; print; # exterior algebra relations rs = [ b * a - a * b , c * a - a * c , f * a - a * f , g * a - a * g , h * a - a * h , u * a - a * u , v * a - a * v , w * a - a * w , x * a - a * x ,
## \end{PossoExample} #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing, RingElem from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM, WRC # Hawes & Gibson example 2 # rational function coefficients r = WordPolyRing( PolyRing(ZZ(),"a, c, b",PolyRing.lex), "y2, y1, z1, z2, x" ); print "Ring: " + str(r); print; one,a,c,b,y2,y1,z1,z2,x = r.gens(); p1 = x + 2 * y1 * z1 + 3 * a * y1**2 + 5 * y1**4 + 2 * c * y1; p2 = x + 2 * y2 * z2 + 3 * a * y2**2 + 5 * y2**4 + 2 * c * y2; p3 = 2 * z2 + 6 * a * y2 + 20 * y2**3 + 2 * c; p4 = 3 * z1**2 + y1**2 + b; p5 = 3 * z2**2 + y2**2 + b; F = [p1,p2,p3,p4,p5]; # make all variables commute cm = [ RingElem(q) for q in r.ring.commute() ]; print "commute: " + str( [ str(q) for q in cm] ); print; g = r.ideal( "", F + cm );
# $Id$ # #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: solvable polynomials example r = WordPolyRing(QQ(),"a,b,e1,e2,e3"); print "WordPolyRing: " + str(r); print; [one,a,b,e1,e2,e3] = r.gens(); print "one = " + str(one); print "a = " + str(a); print "b = " + str(b); print "e1 = " + str(e1); print "e2 = " + str(e2); print "e3 = " + str(e3); print; r1 = e3 * e1 - (e1 * e3 - e1); r2 = e3 * e2 - (e2 * e3 - e2); r3 = e1 * a - a * e1; r4 = e1 * b - b * e1; r5 = e2 * a - a * e2; r6 = e2 * b - b * e2; r7 = e3 * a - a * e3;
# $Id$ # #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: evans example r = WordPolyRing(QQ(), "x,y,z") print "WordPolyRing: " + str(r) print [one, x, y, z] = r.gens() print "one = " + str(one) print "x = " + str(x) print "y = " + str(y) print "z = " + str(z) print f1 = x * y - z f2 = y * z + 2 * x + z f3 = y * z + x print "f1 = " + str(f1) print "f2 = " + str(f2) print "f3 = " + str(f3) print
# #from java.lang import System from jas import WordRing, WordPolyRing, WordPolyIdeal, PolyRing, SolvPolyRing from jas import terminate, startLog from jas import QQ, ZZ, GF, ZM # non-commutative polynomial examples: solvable polynomials example #r = WordPolyRing(QQ(),"a,b,e1,e2,e3"); r = WordPolyRing(QQ(),"a,b,e,f,g"); print "WordPolyRing: " + str(r); print; [one,a,b,e,f,g] = r.gens(); print "one = " + str(one); print "a = " + str(a); print "b = " + str(b); print "e = " + str(e); print "f = " + str(f); print "g = " + str(g); print; r1 = g * e - (e*g - e); r2 = g * f - (f*g - f); r3 = e * a - a * e; r4 = e * b - b * e; r5 = f * a - a * f; r6 = f * b - b * f; r7 = g * a - a * g;
#r = WordPolyRing(GF(19),"x4,x3,x2,x1"); #r = WordPolyRing(QQ(),"x1,x2,x3,x4"); #r = WordPolyRing(ZZ(),"x1,x2,x3,x4"); #r = WordPolyRing(GF(19),"x1,x2,x3,x4"); #r = WordPolyRing(GF(32003),"x1,x2,x3,x4"); r = WordPolyRing(GF(2**29-3),"x1,x2,x3,x4"); #r = WordPolyRing(GF(2**63-25),"x1,x2,x3,x4"); #r = WordPolyRing(GF(170141183460469231731687303715884105727),"x1,x2,x3,x4"); #r = WordPolyRing(GF(259117086013202627776246767922441530941818887553125427303974923161874019266586362086201209516800483406550695241733194177441689509238807017410377709597512042313066624082916353517952311186154862265604547691127595848775610568757931191017711408826252153849035830401185072116424747461823031471398340229288074545677907941037288235820705892351068433882986888616658650280927692080339605869308790500409503709875902119018371991620994002568935113136548829739112656797303241986517250116412703509705427773477972349821676443446668383119322540099648994051790241624056519054483690809616061625743042361721863339415852426431208737266591962061753535748892894599629195183082621860853400937932839420261866586142503251450773096274235376822938649407127700846077124211823080804139298087057504713825264571448379371125032081826126566649084251699453951887789613650248405739378594599444335231188280123660406262468609212150349937584782292237144339628858485938215738821232393687046160677362909315071),"x1,x2,x3,x4"); print "WordPolyRing: " + str(r); print; #one,x4,x3,x2,x1 = r.gens(); one,x1,x2,x3,x4 = r.gens(); print "one = " + str(one); print "x4 = " + str(x4); print "x3 = " + str(x3); print "x2 = " + str(x2); print "x1 = " + str(x1); print; f1 = x4*x4 - 25*x4*x2 - x1*x4 - 6*x1*x3 - 9*x1*x2 + x1*x1; f2 = x4*x4 - 4*x4*x3 + 13*x4*x2 + 12*x4*x1 - 9*x3*x4 + 4*x3*x2 + 41*x3*x1 - 7*x1*x4 - x1*x2; f3 = x4*x4 + 12*x4*x3 - 4*x3*x3 - 9*x3*x2 + 9*x1*x4 + x1*x1; f4 = x4*x4 - 14*x4*x3 - 17*x4*x2 - 5*x2*x2 - 42*x1*x4; f5 = x4*x4 - 2*x4*x3 + 2*x4*x2 - 7*x4*x1 - x2*x2 - 13*x2*x1 - 4*x1*x3 + 2*x1*x2 - x1*x1; f6 = x4*x4 + 7*x4*x2 - 15*x4*x1 - 9*x3*x4 + 4*x2*x2 + 15*x2*x1 + x1*x2; print "f1 = " + str(f1);
#r = WordPolyRing(QQ,"x4,x3,x2,x1"); #r = WordPolyRing(GF(19),"x4,x3,x2,x1"); #r = WordPolyRing(QQ(),"x1,x2,x3,x4"); #r = WordPolyRing(ZZ(),"x1,x2,x3,x4"); #r = WordPolyRing(GF(19),"x1,x2,x3,x4"); #r = WordPolyRing(GF(32003),"x1,x2,x3,x4"); r = WordPolyRing(GF(2**29 - 3), "x1,x2,x3,x4") #r = WordPolyRing(GF(2**63-25),"x1,x2,x3,x4"); #r = WordPolyRing(GF(170141183460469231731687303715884105727),"x1,x2,x3,x4"); #r = WordPolyRing(GF(259117086013202627776246767922441530941818887553125427303974923161874019266586362086201209516800483406550695241733194177441689509238807017410377709597512042313066624082916353517952311186154862265604547691127595848775610568757931191017711408826252153849035830401185072116424747461823031471398340229288074545677907941037288235820705892351068433882986888616658650280927692080339605869308790500409503709875902119018371991620994002568935113136548829739112656797303241986517250116412703509705427773477972349821676443446668383119322540099648994051790241624056519054483690809616061625743042361721863339415852426431208737266591962061753535748892894599629195183082621860853400937932839420261866586142503251450773096274235376822938649407127700846077124211823080804139298087057504713825264571448379371125032081826126566649084251699453951887789613650248405739378594599444335231188280123660406262468609212150349937584782292237144339628858485938215738821232393687046160677362909315071),"x1,x2,x3,x4"); print "WordPolyRing: " + str(r) print #one,x4,x3,x2,x1 = r.gens(); one, x1, x2, x3, x4 = r.gens() print "one = " + str(one) print "x4 = " + str(x4) print "x3 = " + str(x3) print "x2 = " + str(x2) print "x1 = " + str(x1) print f1 = x4 * x4 - 25 * x4 * x2 - x1 * x4 - 6 * x1 * x3 - 9 * x1 * x2 + x1 * x1 f2 = x4 * x4 - 4 * x4 * x3 + 13 * x4 * x2 + 12 * x4 * x1 - 9 * x3 * x4 + 4 * x3 * x2 + 41 * x3 * x1 - 7 * x1 * x4 - x1 * x2 f3 = x4 * x4 + 12 * x4 * x3 - 4 * x3 * x3 - 9 * x3 * x2 + 9 * x1 * x4 + x1 * x1 f4 = x4 * x4 - 14 * x4 * x3 - 17 * x4 * x2 - 5 * x2 * x2 - 42 * x1 * x4 f5 = x4 * x4 - 2 * x4 * x3 + 2 * x4 * x2 - 7 * x4 * x1 - x2 * x2 - 13 * x2 * x1 - 4 * x1 * x3 + 2 * x1 * x2 - x1 * x1 f6 = x4 * x4 + 7 * x4 * x2 - 15 * x4 * x1 - 9 * x3 * x4 + 4 * x2 * x2 + 15 * x2 * x1 + x1 * x2 print "f1 = " + str(f1)