#is automatic: [one,y,z,t] = p.gens(); # no x #exit(0); trelations = [t, y, y * t + y, t, z, z * t - z ]; print "trelations: = " + str([ str(f) for f in trelations ]); print; #startLog(); pt = SolvPolyRing(pzc, "t,u", PolyRing.lex, trelations); print "SolvPolyRing: " + str(pt); print "sp.gens =" + str([ str(f) for f in pt.gens() ]); #is automatic: one,y,z,t = rp.gens(); # no x print; #exit(0); a = t**2 + y; b = t + y + 1; c = z*t**2 - y * t - z; print "a = " + str(a); print "b = " + str(b); print "c = " + str(c); #c = c.monic(); #print "c = " + str(c); print
# Weyl coefficient field example r = PolyRing(QQ(),"p1,q1"); #is automatic: [one,p1,q1] = p.gens(); relations = [q1, p1, p1 * q1 + 1 ]; print "relations: = " + str([ str(f) for f in relations ]); print; rp = SolvPolyRing(QQ(), "p1,q1", PolyRing.lex, relations); print "SolvPolyRing: " + str(rp); print; print "gens =" + str([ str(f) for f in rp.gens() ]); #is automatic: one,p1,q1 = rp.gens(); scp = SRF(rp); print "scp = " + str(scp); r2 = PolyRing(scp,"p2,q2"); #is automatic: [one,p1,q1,p2,q2] = r2.gens(); relations2 = [q2, p2, p2 * q2 + 1 ]; print "relations: = " + str([ str(f) for f in relations2 ]); print;
# now as solvable polynomials p = PolyRing(QQ(), "a,b,e1,e2,e3") #is automatic: [one,a,b,e1,e2,e3] = p.gens(); relations = [e3, e1, e1 * e3 - e1, e3, e2, e2 * e3 - e2] print "relations: =", [str(f) for f in relations] print #rp = SolvPolyRing(QQ(), "a,b,e1,e2,e3", rel=relations); rp = SolvPolyRing(QQ(), "a,b,e1,e2,e3", PolyRing.lex, relations) print "SolvPolyRing: " + str(rp) print print "gens =", [str(f) for f in rp.gens()] #[one,a,b,e1,e2,e3] = rp.gens(); #[one,I,J,K,a,b,e1,e2,e3] = rp.gens(); f1 = e1 * e3**3 + e2**10 - a f2 = e1**3 * e2**2 + e3 f3 = e3**3 + e3**2 - b F = [f1, f2, f3] print "F =", [str(f) for f in F] print I = rp.ideal(list=F) print "SolvableIdeal: " + str(I) print
# + ", assoz: " + str(pzq.ring.isAssociative()); #print "gens =" + str([ str(f) for f in pzq.ring.generators() ]); print pct = PolyRing(pzq, "t") #is automatic: [one,x,y,z,t] = p.gens(); trelations = [t, y, y * t + y, t, z, z * t - z] print "relations: = " + str([str(f) for f in trelations]) print pt = SolvPolyRing(pzq, "t", PolyRing.lex, trelations) print "SolvPolyRing: " + str(pt) print print "gens =", [str(f) for f in pt.gens()] #print "t = " + str(t); #print "z = " + str(z); zi = 1 / z yi = 1 / y xi = 1 / x #startLog(); a = (t * zi) * y b = t * (zi * y) c = a - b print "t * 1/z * y: " print "a = " + str(a) print "b = " + str(b)
print; print "------- SolvPolyRing(QQ(),\"x,y,z\") ---------"; r = PolyRing(QQ(),"x,y,z",PolyRing.lex); print "r = " + str(r); [pone,px,py,pz] = r.gens(); print "pone = " + str(pone); print "px = " + str(px); print "py = " + str(py); print "pz = " + str(pz); rel = ( py, px, px * py - 1 , pz, py, py * pz - 1 ); #print "rel = " + str(rel); sr = SolvPolyRing(QQ(),"x,y,z",PolyRing.lex,rel); print "sr = " + str(sr); [one,x,y,z] = sr.gens(); print "one = " + str(one); print "x = " + str(x); print "y = " + str(y); print "z = " + str(z); print "one.factory() = " + str(one.factory()); s1 = QQ(1,2) + QQ(2,3) * x + QQ(2,5) * y + ( x + y + z )**2; print "s1 = " + str(s1); s2 = (1,2) + (2,3) * x + (2,5) * y + ( x + y + z )**2; print "s2 = " + str(s2); s3 = z**2 + 2 * y * z + 2 * x * z + y**2 + 2 * x * y + x**2 + (2,5) * y + (2,3) * x + (1,2); print "s3 = " + str(s3); s4 = s1 - s3; print "s4 = " + str(s4); print "s4.factory() = " + str(s4.factory()); sr1 = SolvPolyRing(QQ(),"x, y, z",PolyRing.lex,(( z ), ( y ), ( y * z - 1 ),( y ), ( x ), ( x * y - 1 )));
#exit(0); trelations = [t, y, y * t + y, t, z, z * t - z ]; print "trelations: = " + str([ str(f) for f in trelations ]); print; startLog(); pt = SolvPolyRing(pzc, "t", PolyRing.lex, trelations); print "SolvPolyRing: " + str(pt); print; print "sp.gens =" + str([ str(f) for f in pt.gens() ]); #is automatic: one,y,z,t = rp.gens(); # no x #exit(0); #yi = 1 / y; # not invertible #print "yi = " + str(yi); a = t**2 + y; b = t + y + 1; c = t**2 - y * t - z; print "a = " + str(a); print "b = " + str(b); print "c = " + str(c); print
print; print "------- SolvPolyRing(QQ(),\"x,y,z\") ---------"; r = PolyRing(QQ(),"x,y,z",PolyRing.lex); print "r = " + str(r); [pone,px,py,pz] = r.gens(); print "pone = " + str(pone); print "px = " + str(px); print "py = " + str(py); print "pz = " + str(pz); rel = ( py, px, px * py - 1 , pz, py, py * pz - 1 ); #print "rel = " + str(rel); sr = SolvPolyRing(QQ(),"x,y,z",PolyRing.lex,rel); print "sr = " + str(sr); [one,x,y,z] = sr.gens(); print "one = " + str(one); print "x = " + str(x); print "y = " + str(y); print "z = " + str(z); print "one.factory() = " + str(one.factory()); s1 = QQ(1,2) + QQ(2,3) * x + QQ(2,5) * y + ( x + y + z )**2; print "s1 = " + str(s1); s2 = (1,2) + (2,3) * x + (2,5) * y + ( x + y + z )**2; print "s2 = " + str(s2); s3 = z**2 + 2 * y * z + 2 * x * z + y**2 + 2 * x * y + x**2 + (2,5) * y + (2,3) * x + (1,2); print "s3 = " + str(s3); s4 = s1 - s3; print "s4 = " + str(s4); print "s4.factory() = " + str(s4.factory()); sr1 = SolvPolyRing(QQ(),"x, y, z",PolyRing.lex,(( z ), ( y ), ( y * z - 1 ),( y ), ( x ), ( x * y - 1 )));
p = PolyRing(QQ(),"a,b,e1,e2,e3"); #is automatic: [one,a,b,e1,e2,e3] = p.gens(); relations = [e3, e1, e1*e3 - e1, e3, e2, e2*e3 - e2]; print "relations: =", [ str(f) for f in relations ]; print; #rp = SolvPolyRing(QQ(), "a,b,e1,e2,e3", rel=relations); rp = SolvPolyRing(QQ(), "a,b,e1,e2,e3", PolyRing.lex, relations); print "SolvPolyRing: " + str(rp); print; print "gens =", [ str(f) for f in rp.gens() ]; #[one,a,b,e1,e2,e3] = rp.gens(); #[one,I,J,K,a,b,e1,e2,e3] = rp.gens(); f1 = e1 * e3**3 + e2**10 - a; f2 = e1**3 * e2**2 + e3; f3 = e3**3 + e3**2 - b; f4 = ( e3**2 * e2**3 + e1 )**3; #print "f1 = ", f1; #print "f2 = ", f2; #print "f3 = ", f3; #print "f4 = ", f4; F = [ f1, f2, f3 ];
relations = [#w, v, v * w - u, v, u, v * u + x, w, y, y * w + y, w, z, z * w - z ]; print "relations: = " + str( [ str(r) for r in relations ] ); print; #startLog(); pt = SolvPolyRing(pzq, "u,v,w", PolyRing.lex, relations); print "SolvPolyRing: " + str(pt); # + ", is assoz: " + str(pt.ring.isAssociative); print; print "gens = " + str( [ str(r) for r in pt.gens() ] ); #is automatic: one,x,y,z,r,s,t = rp.gens(); #exit(0); #f1 = u**2 + v**2 + w**2; #f1 = v; f1 = w**2 - t; #print "f1 = " + str(f1); #f2 = t + u - x**2; #f2 = f1 * (t - x**2); #f2 = v**2 - v; #f2 = v**2 - y; #f2 = v**2 - z; f2 = v**2 - t;
relations = [ ( D3 ), ( D1 ), ( D1 * D3 - c1 * E + b1 * E ), ( D3 ), ( D2 ), ( D2 * D3 - E + E ), ( D2 ), ( D1 ), ( D1 * D2 - c1 * E + b1 * E ) ]; print "relations: = " + str([ str(f) for f in relations ]); print; rp = SolvPolyRing( RF(PolyRing(coeff,"b1,c1",PolyRing.lex)), "E,D1,D2,D3",PolyRing.grad,relations); print "SolvPolyRing: rp = " + str(rp); print; print "gens = " + str([ str(f) for f in rp.gens() ]); print; F = [ ( D1 - D2 * D3 ), ( D2 * D3 + D1 ), ( - D1 * D3 + D2 ) ]; print "F =" + str([ str(f) for f in F ]); print f = rp.ideal( list=F ); print "SolvableIdeal: " + str(f); print; #startLog();
# + ", assoz: " + str(pzq.ring.isAssociative()); # print "gens =" + str([ str(f) for f in pzq.ring.generators() ]); print pct = PolyRing(pzq, "t") # is automatic: [one,x,y,z,t] = p.gens(); trelations = [t, y, y * t + y, t, z, z * t - z] print "relations: = " + str([str(f) for f in trelations]) print pt = SolvPolyRing(pzq, "t", PolyRing.lex, trelations) print "SolvPolyRing: " + str(pt) print print "gens =", [str(f) for f in pt.gens()] # print "t = " + str(t); # print "z = " + str(z); zi = 1 / z yi = 1 / y xi = 1 / x # startLog(); a = (t * zi) * y b = t * (zi * y) c = a - b print "t * 1/z * y: " print "a = " + str(a) print "b = " + str(b)
## \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 = SolvPolyRing( PolyRing(ZZ(),"a, c, b",PolyRing.lex), "y2, y1, z1, z2, x",PolyRing.grad); 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]; g = r.ideal( "", F ); print "Ideal: " + str(g); print; #startLog();
print "g = " + str(g) print print "------- SolvPolyRing(QQ(),\"x,y,z\") ---------" r = PolyRing(QQ(), "x,y,z", PolyRing.lex) print "r = " + str(r) [pone, px, py, pz] = r.gens() print "pone = " + str(pone) print "px = " + str(px) print "py = " + str(py) print "pz = " + str(pz) rel = (py, px, px * py - 1, pz, py, py * pz - 1) #print "rel = " + str(rel); sr = SolvPolyRing(QQ(), "x,y,z", PolyRing.lex, rel) print "sr = " + str(sr) [one, x, y, z] = sr.gens() print "one = " + str(one) print "x = " + str(x) print "y = " + str(y) print "z = " + str(z) print "one.factory() = " + str(one.factory()) s1 = QQ(1, 2) + QQ(2, 3) * x + QQ(2, 5) * y + (x + y + z)**2 print "s1 = " + str(s1) s2 = (1, 2) + (2, 3) * x + (2, 5) * y + (x + y + z)**2 print "s2 = " + str(s2) s3 = z**2 + 2 * y * z + 2 * x * z + y**2 + 2 * x * y + x**2 + (2, 5) * y + ( 2, 3) * x + (1, 2) print "s3 = " + str(s3) s4 = s1 - s3 print "s4 = " + str(s4) print "s4.factory() = " + str(s4.factory())