Example #1
0
print "Qwx   = " + str(Qwx);
[ewx,ax,wx] = Qwx.gens();
#print "ewx   = " + str(ewx);
print "ax    = " + str(ax);
print "wx    = " + str(wx);
print;

#rootx = wx**5 - 2; # not working
#rootx = wx**5 - 1/ax;
#rootx = wx**5 - ax;
#rootx = wx**5 - ( ax**2 + 3 * ax );
rootx = wx**5 - ( ax**2 + 3 / ax );
print "rootx = " + str(rootx);
Q2x = AN(rootx,field=True);
print "Q2x   = " + str(Q2x.factory());
[ex2,ax2,wx] = Q2x.gens();
#print "ex2   = " + str(ex2);
#print "w2x2  = " + str(w2x2);
#print "ax2   = " + str(ax2);
#print "wx    = " + str(wx);
print;

#Yr = PolyRing(Q2x,"y,z,c0,c1,c2",PolyRing.lex)
Yr = PolyRing(Q2x,"y,z",PolyRing.lex)
print "Yr    = " + str(Yr);

#[e,x,wx,y,z,c0,c1,c2] = Yr.gens();
[e,x,wx,y,z] = Yr.gens();
print "e     = " + str(e);
print "x     = " + str(x);
print "wx    = " + str(wx);
from jas import QQ, AN, RF, Ring, PolyRing
from jas import terminate, startLog

# polynomial examples: factorization over Q(sqrt(2))(x)(sqrt(x))[y]

Q = PolyRing(QQ(),"w2",PolyRing.lex);
print "Q     = " + str(Q);
[e,a] = Q.gens();
print "e     = " + str(e);
print "a     = " + str(a);

root = a**2 - 2;
print "root  = " + str(root);
Q2 = AN(root,field=True);
print "Q2    = " + str(Q2.factory());
[one,w2] = Q2.gens();
#print "one   = " + str(one);
#print "w2    = " + str(w2);
print;

Qp = PolyRing(Q2,"x",PolyRing.lex);
print "Qp    = " + str(Qp);
[ep,wp,ap] = Qp.gens();
#print "ep    = " + str(ep);
#print "wp    = " + str(wp);
#print "ap    = " + str(ap);
print;

Qr = RF(Qp);
print "Qr    = " + str(Qr.factory());
[er,wr,ar] = Qr.gens();
from jas import terminate, startLog

# polynomial examples: absolute factorization over Q(i)

Qr = PolyRing(QQ(), "i", PolyRing.lex)
print "Qr    = " + str(Qr)
[e, a] = Qr.gens()
print "e     = " + str(e)
print "a     = " + str(a)
print

imag = a ** 2 + 1
print "imag  = " + str(imag)
Qi = AN(imag, field=True)
print "Qi    = " + str(Qi.factory())
[one, i] = Qi.gens()
print "one   = " + str(one)
print "i     = " + str(i)
print

r = PolyRing(Qi, "x", PolyRing.lex)
print "r    = " + str(r)
# is automatic: [one,i,x] = r.gens();
print "one   = " + str(one)
print "i     = " + str(i)
print "x     = " + str(x)
print


# f = x**7 - 1;
# f = x**6 + x**5 + x**4 + x**3 + x**2 + x + 1;
Example #4
0
print "s4  = " + str(s4);
print "s4.factory() = " + str(s4.factory());
print;


print "------- AN(alpha**2 - 2) ---------";
r = PolyRing(QQ(),"alpha",PolyRing.lex);
print "r = " + str(r);
[e,a] = r.gens();
print "e     = " + str(e);
print "a     = " + str(a);
sqrt2 = a**2 - 2;
print "sqrt2 = " + str(sqrt2);
Qs2 = AN(sqrt2);
print "Qs2   = " + str(Qs2.factory());
[one,alpha] = Qs2.gens();
print "one   = " + str(one);
print "alpha = " + str(alpha);
b = alpha**2 - 2;
print "b     = " + str(b);
c = 1 / alpha;
print "c     = " + str(c);
Qs2x = AN(alpha**2 - 2);
print "Qs2x  = " + str(Qs2x.factory());
print;


print "------- GF_17(alpha**2 - 2) ---------";
r = PolyRing(GF(17),"alpha",PolyRing.lex);
print "r = " + str(r);
[e,a] = r.gens();
Example #5
0
print "s4  = " + str(s4);
print "s4.factory() = " + str(s4.factory());
print;


print "------- AN(alpha**2 - 2) ---------";
r = PolyRing(QQ(),"alpha",PolyRing.lex);
print "r = " + str(r);
[e,a] = r.gens();
print "e     = " + str(e);
print "a     = " + str(a);
sqrt2 = a**2 - 2;
print "sqrt2 = " + str(sqrt2);
Qs2 = AN(sqrt2);
print "Qs2   = " + str(Qs2.factory());
[one,alpha] = Qs2.gens();
print "one   = " + str(one);
print "alpha = " + str(alpha);
b = alpha**2 - 2;
print "b     = " + str(b);
c = 1 / alpha;
print "c     = " + str(c);
Qs2x = AN(alpha**2 - 2);
print "Qs2x  = " + str(Qs2x.factory());
print;


print "------- GF_17(alpha**2 - 2) ---------";
r = PolyRing(GF(17),"alpha",PolyRing.lex);
print "r = " + str(r);
[e,a] = r.gens();
Example #6
0
#print "ca = " + str(ca);
[ea,aa] = ca.gens();
print "ea   = " + str(ea);
print "aa   = " + str(aa);
print;

#!#roota = aa**prime + 2;
roota = aa**2 + 2;
print "roota = " + str(roota);
Q3a = AN(roota,field=True);
print "Q3a   = " + str(Q3a.factory());

## Q3a = RF(ca);
#print Q3a.gens();

[ea2,aa2] = Q3a.gens();
print "ea2  = " + str(ea2);
print "aa2  = " + str(aa2);
print;

#cr = PolyRing(QQ(),"t",PolyRing.lex);
cr = PolyRing(Q3a,"t",PolyRing.lex);
print "coefficient Ring: " + str(cr);
rf = RF(cr);
print "coefficient quotient Ring: " + str(rf.ring.toScript());

r = PolyRing(rf,"x,y",PolyRing.lex);
print "Ring: " + str(r);
#print;

[one,a,t,x,y] = r.gens();
#print "ca = " + str(ca);
[ea, aa] = ca.gens()
print "ea   = " + str(ea)
print "aa   = " + str(aa)
print

#!#roota = aa**prime + 2;
roota = aa**2 + 2
print "roota = " + str(roota)
Q3a = AN(roota, field=True)
print "Q3a   = " + str(Q3a.factory())

## Q3a = RF(ca);
#print Q3a.gens();

[ea2, aa2] = Q3a.gens()
print "ea2  = " + str(ea2)
print "aa2  = " + str(aa2)
print

#cr = PolyRing(QQ(),"t",PolyRing.lex);
cr = PolyRing(Q3a, "t", PolyRing.lex)
print "coefficient Ring: " + str(cr)
rf = RF(cr)
print "coefficient quotient Ring: " + str(rf.ring.toScript())

r = PolyRing(rf, "x,y", PolyRing.lex)
print "Ring: " + str(r)
#print;

#automatic: [one,a,t,x,y] = r.gens();
print "Qwx   = " + str(Qwx)
[ewx, ax, wx] = Qwx.gens()
#print "ewx   = " + str(ewx);
print "ax    = " + str(ax)
print "wx    = " + str(wx)
print

#rootx = wx**5 - 2; # not working
#rootx = wx**5 - 1/ax;
#rootx = wx**5 - ax;
#rootx = wx**5 - ( ax**2 + 3 * ax );
rootx = wx**5 - (ax**2 + 3 / ax)
print "rootx = " + str(rootx)
Q2x = AN(rootx, field=True)
print "Q2x   = " + str(Q2x.factory())
[ex2, ax2, wx] = Q2x.gens()
#print "ex2   = " + str(ex2);
#print "w2x2  = " + str(w2x2);
#print "ax2   = " + str(ax2);
#print "wx    = " + str(wx);
print

#Yr = PolyRing(Q2x,"y,z,c0,c1,c2",PolyRing.lex)
Yr = PolyRing(Q2x, "y,z", PolyRing.lex)
print "Yr    = " + str(Yr)

#[e,x,wx,y,z,c0,c1,c2] = Yr.gens();
[e, x, wx, y, z] = Yr.gens()
print "e     = " + str(e)
print "x     = " + str(x)
print "wx    = " + str(wx)
print "polynomial quotient ring: " + str(cr);

[et2,t,wpt] = cr.gens();
print "et2  = " + str(et2);
print "t    = " + str(t);
print "wpt  = " + str(wpt);
print;

root = wpt**prime - ta2;
af = AN(root,field=True);
print "coefficient algebraic quotient ring: " + str(af.ring.toScript());
#print af.gens();
##xx = AN(( wpt**5 + 4 * t ),True,PolyRing(RF(PolyRing(ZM(5),"t",PolyRing.lex)),"wpt",PolyRing.lex))
##print "xx: " + str(xx.ring.toScript());

[one,t,wpt] = af.gens();
print "one  = " + str(one);
print "t    = " + str(t);
print "wpt  = " + str(wpt);
#print one,t,wpt;
print;

#sys.exit();

r = PolyRing(af,"x,y",PolyRing.lex);
print "polynomial ring: " + str(r);
#print;

#automatic: [one,t,wpt,x,y] = r.gens();
#print one,t,wpt,x,y;
print "one  = " + str(one);
from jas import terminate, startLog

# polynomial examples: absolute factorization over Q(i)

Qr = PolyRing(QQ(), "i", PolyRing.lex)
print "Qr    = " + str(Qr)
[e, a] = Qr.gens()
print "e     = " + str(e)
print "a     = " + str(a)
print

imag = a**2 + 1
print "imag  = " + str(imag)
Qi = AN(imag, field=True)
print "Qi    = " + str(Qi.factory())
[one, i] = Qi.gens()
print "one   = " + str(one)
print "i     = " + str(i)
print

r = PolyRing(Qi, "x", PolyRing.lex)
print "r    = " + str(r)
#is automatic: [one,i,x] = r.gens();
print "one   = " + str(one)
print "i     = " + str(i)
print "x     = " + str(x)
print

#f = x**7 - 1;
#f = x**6 + x**5 + x**4 + x**3 + x**2 + x + 1;
#f = x**2 - i;
print "polynomial quotient ring: " + str(cr)

[et2, t, wpt] = cr.gens()
print "et2  = " + str(et2)
print "t    = " + str(t)
print "wpt  = " + str(wpt)
print

root = wpt**prime - ta2
af = AN(root, field=True)
print "coefficient algebraic quotient ring: " + str(af.ring.toScript())
#print af.gens();
##xx = AN(( wpt**5 + 4 * t ),True,PolyRing(RF(PolyRing(ZM(5),"t",PolyRing.lex)),"wpt",PolyRing.lex))
##print "xx: " + str(xx.ring.toScript());

[one, t, wpt] = af.gens()
print "one  = " + str(one)
print "t    = " + str(t)
print "wpt  = " + str(wpt)
#print one,t,wpt;
print

#sys.exit();

r = PolyRing(af, "x,y", PolyRing.lex)
print "polynomial ring: " + str(r)
#print;

#automatic: [one,t,wpt,x,y] = r.gens();
#print one,t,wpt,x,y;
print "one  = " + str(one)
Example #12
0
# multiple algebraic field extensions

print "------- multiple algebraic field extensions QQ(alpha)(beta)(gamma)(delta) ---------";
r = PolyRing(QQ(),"alpha",PolyRing.lex);
print "r     = " + str(r);
e,a = r.gens();
print "e     = " + str(e);
print "a     = " + str(a);

ap = a**5 - a + 1;
print "ap    = " + str(ap);
x = r.factors(ap); 
print "x     = " + str( [ str(p)+"**"+str(e)+"," for (p,e) in x.iteritems() ] );
qs2 = AN(ap,0,len(x)==1); # and e==1
print "qs2   = " + str(qs2.factory());
one,alpha = qs2.gens();
print "one   = " + str(one);
print "alpha = " + str(alpha);

b = alpha**2 - 1;
print "b     = " + str(b);
c = 1 / b;
print "c     = " + str(c);
print "b*c   = " + str(b*c);
print

ar = PolyRing(qs2,"beta",PolyRing.lex);
print "ar    = " + str(ar);
e,a,b = ar.gens();
print "e     = " + str(e);
print "a     = " + str(a);