本文整理汇总了Python中jas.PolyRing.gens方法的典型用法代码示例。如果您正苦于以下问题:Python PolyRing.gens方法的具体用法?Python PolyRing.gens怎么用?Python PolyRing.gens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jas.PolyRing
的用法示例。
在下文中一共展示了PolyRing.gens方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRingQQ
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
def testRingQQ(self):
r = PolyRing( QQ(), "(t,x)", Order.INVLEX );
self.assertEqual(str(r),'PolyRing(QQ(),"t,x",Order.INVLEX)');
[one,x,t] = r.gens();
self.assertTrue(one.isONE());
self.assertTrue(len(x)==1);
self.assertTrue(len(t)==1);
#
f = 11 * x**4 - 13 * t * x**2 - 11 * x**2 + 2 * t**2 + 11 * t;
f = f**2 + f + 3;
#print "f = " + str(f);
self.assertEqual(str(f),'( 4 * x**4 - 52 * t**2 * x**3 + 44 * x**3 + 213 * t**4 * x**2 - 330 * t**2 * x**2 + 123 * x**2 - 286 * t**6 * x + 528 * t**4 * x - 255 * t**2 * x + 11 * x + 121 * t**8 - 242 * t**6 + 132 * t**4 - 11 * t**2 + 3 )');
示例2: testRingZM
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
def testRingZM(self):
r = PolyRing( GF(17), "(t,x)", Order.INVLEX );
self.assertEqual(str(r),'PolyRing(GFI(17),"t,x",Order.INVLEX)');
[one,x,t] = r.gens();
self.assertTrue(one.isONE());
self.assertTrue(len(x)==1);
self.assertTrue(len(t)==1);
#
f = 11 * x**4 - 13 * t * x**2 - 11 * x**2 + 2 * t**2 + 11 * t;
f = f**2 + f + 3;
#print "f = " + str(f);
self.assertEqual(str(f),'( 4 * x**4 + 16 * t**2 * x**3 + 10 * x**3 + 9 * t**4 * x**2 + 10 * t**2 * x**2 + 4 * x**2 + 3 * t**6 * x + t**4 * x + 11 * x + 2 * t**8 + 13 * t**6 + 13 * t**4 + 6 * t**2 + 3 )');
示例3: PolyRing
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
#
import sys;
from jas import Ring, PolyRing, ParamIdeal, QQ
from jas import startLog, terminate
# Raksanyi & Walter example
# integral/rational function coefficients
r = PolyRing(PolyRing(QQ(),"a1,a2,a3,a4",PolyRing.grad),"x1,x2,x3,x4",PolyRing.lex);
#print "r = " + str(r);
[one,a1,a2,a3,a4,x1,x2,x3,x4] = r.gens();
pl = [ ( x4 - ( a4 - a2 ) ),
( x1 + x2 + x3 + x4 - ( a1 + a3 + a4 ) ),
( x1 * x3 + x1 * x4 + x2 * x3 + x3 * x4 - ( a1 * a4 + a1 * a3 + a3 * a4 ) ),
( x1 * x3 * x4 - ( a1 * a3 * a4 ) )
];
f = ParamIdeal(r,list=pl);
print "ParamIdeal: " + str(f);
gs = f.CGBsystem();
#print "CGBsystem: " + str(gs);
#print;
print f.CGB();
示例4: Z_p
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from java.lang import System
from java.lang import Integer
from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import ZM, QQ, AN, RF
from jas import terminate
from jas import startLog
# polynomial examples: factorization over Z_p(x)(sqrt3(x))[y]
Q = PolyRing(ZM(5),"x",PolyRing.lex);
print "Q = " + str(Q);
[e,a] = Q.gens();
#print "e = " + str(e);
print "a = " + str(a);
Qr = RF(Q);
print "Qr = " + str(Qr.factory());
[er,ar] = Qr.gens();
#print "er = " + str(er);
#print "ar = " + str(ar);
print;
Qwx = PolyRing(Qr,"wx",PolyRing.lex);
print "Qwx = " + str(Qwx);
[ewx,ax,wx] = Qwx.gens();
#print "ewx = " + str(ewx);
print "ax = " + str(ax);
示例5: PolyRing
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
#
import sys
from java.lang import System
from jas import PolyRing, Ideal
from jas import QQ, AN, RF
from jas import terminate, startLog
# polynomial examples: prime/primary decomposition in Q[w2,x,wx,y,z]
Q = PolyRing(QQ(), "w2,x,wx,y,z", PolyRing.lex)
print "Q = " + str(Q)
[e, w2, x, wx, y, z] = Q.gens()
print "e = " + str(e)
print "w2 = " + str(w2)
print "x = " + str(x)
print "wx = " + str(wx)
print "y = " + str(y)
print "z = " + str(z)
print
w1 = w2 ** 2 - 2
w2 = wx ** 2 - x
f1 = (y ** 2 - x) * (y ** 2 - 2)
# f1 = ( y**2 - x )**3 * ( y**2 - 2 )**2;
f2 = z ** 2 - y ** 2
print "w1 = ", w1
示例6: str
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
print "o1 = " + str(o1);
o2 = (1/o1)**2;
print "o2 = " + str(o2);
o3 = o2 * o1 * o1;
print "o3 = " + str(o3);
o4 = (-69,20164)*oneOR + (-3,20164)*IOR + (-1,5041)*JOR + (-5,20164)*KOR + (-3,10082)*oneOI + (-7,20164)*IOI + (-2,5041)*JOI + (-9,20164)*KOI;
print "o4 = " + str(o4);
o5 = o2 - o4;
print "o5 = " + str(o5);
print;
print "------- PolyRing(ZZ(),\"x,y,z\") ---------";
r = PolyRing(ZZ(),"x,y,z",PolyRing.grad);
print "r = " + str(r);
[one,x,y,z] = r.gens();
print "one = " + str(one);
print "x = " + str(x);
print "y = " + str(y);
print "z = " + str(z);
p1 = 2 + 3 * x + 4 * y + 5 * z + ( x + y + z )**2;
print "p1 = " + str(p1);
p2 = z**2 + 2 * y * z + 2 * x * z + y**2 + 2 * x * y + x**2 + 5 * z + 4 * y + 3 * x + 2;
print "p2 = " + str(p2);
p3 = p1 - p2;
print "p3 = " + str(p3);
print "p3.factory() = " + str(p3.factory());
print;
print "------- PolyRing(QQ(),\"x,y,z\") ---------";
示例7: str
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
print "zrelations: = " + str( [ str(r) for r in zrelations ] );
print;
pz = SolvPolyRing(QQ(), "x,y,z,t", PolyRing.lex, zrelations);
print "SolvPolyRing: " + str(pz);
print;
pzq = SRF(pz);
print "SolvableQuotientRing: " + str(pzq.ring.toScript); # + ", assoz: " + str(pzq::ring.isAssociative);
#print "gens =" + str( [ str(r) for r in pzq.gens() ] );
print;
pct = PolyRing(pzq,"u,v,w", PolyRing.lex);
#is automatic: [one,x,y,z,t,u,v,w] = p.gens();
print "tgens = " + str( [ str(r) for r in pct.gens() ] );
print;
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);
示例8: noThreads
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from jas import Ring, PolyRing
from jas import terminate, startLog, noThreads
from jas import QQ, ZM, RF, AN
# polynomial examples: ideal radical decomposition, modified from example 8.16 in GB book
# noThreads(); # must be called very early
prime = 5;
cf = ZM(prime);
#cf = QQ();
ca = PolyRing(cf,"a",PolyRing.lex);
#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);
示例9: noThreads
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from java.lang import System
from jas import Ring, PolyRing, QQ, ZM, RF, AN, GF
from jas import terminate, startLog, noThreads
# polynomial examples: ideal radical decomposition, example 8.16 in GB book, base field with p-th root
# noThreads(); # must be called very early
prime = 5;
cf = GF(prime);
#cf = QQ();
ca = PolyRing(cf,"t",PolyRing.lex);
print "ca = " + str(ca);
[ea,ta] = ca.gens();
print "ea = " + str(ea);
print "ta = " + str(ta);
print;
Qpt = RF(ca);
#print Qpt.gens();
[ea2,ta2] = Qpt.gens();
print "ea2 = " + str(ea2);
print "ta2 = " + str(ta2);
print;
cr = PolyRing(Qpt,"wpt",PolyRing.lex);
print "polynomial quotient ring: " + str(cr);
示例10: PolyRing
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from basic_sigbased_gb import ggv, ggv_first_implementation
from basic_sigbased_gb import coeff_free_sigbased_gb
from basic_sigbased_gb import arris_algorithm, min_size_mons
from basic_sigbased_gb import f5, f5z
from staggered_linear_basis import staglinbasis
#r = PolyRing( QQ(), "(B,S,T,Z,P,W)", PolyRing.lex );
#r = PolyRing( ZZ(), "(B,S,T,Z,P,W)", PolyRing.lex );
r = PolyRing( ZM(32003), "(B,S,T,Z,P,W)", PolyRing.lex );
#r = PolyRing( ZM(19), "(B,S,T,Z,P,W)", PolyRing.lex );
print "Ring: " + str(r);
print;
[one,B,S,T,Z,P,W] = r.gens();
p1 = 45 * P + 35 * S - 165 * B - 36;
p2 = 35 * P + 40 * Z + 25 * T - 27 * S;
p3 = 15 * W + 25 * S * P + 30 * Z - 18 * T - 165 * B**2;
p4 = -9 * W + 15 * T * P + 20 * S * Z;
p5 = P * W + 2 * T * Z - 11 * B**3;
p6 = 99 * W - 11 * B * S + 3 * B**2;
p7 = 10000 * B**2 + 6600 * B + 2673;
F = [p1,p2,p3,p4,p5,p6,p7];
#F = [p1,p2,p3,p4,p5,p6];
f = r.ideal( list=F );
print "Ideal: " + str(f);
print;
示例11: Z_p
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from java.lang import System
from java.lang import Integer
from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import ZM, QQ, AN, RF
from jas import terminate
from jas import startLog
# polynomial examples: factorization over Z_p(sqrt(2))(x)(sqrt(x))[y]
Q = PolyRing(ZM(5), "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()
示例12: str
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
#print "Ring: " + str(r);
#print;
#r = PolyRing(ZZ(),"B,S,T,Z,P,W",PolyRing.lex);
#r = PolyRing(QQ(),"B,S,T,Z,P,W",PolyRing.lex);
#r = PolyRing(CC(),"B,S,T,Z,P,W",PolyRing.lex);
#r = PolyRing(DD(),"B,S,T,Z,P,W",PolyRing.lex);
#r = PolyRing(ZM(19),"B,S,T,Z,P,W",PolyRing.lex);
#r = PolyRing(ZM(1152921504606846883),"B,S,T,Z,P,W",PolyRing.lex); # 2^60-93
#rc = PolyRing(ZZ(),"e,f",PolyRing.lex);
#rc = PolyRing(QQ(),"e,f",PolyRing.lex);
#r = PolyRing(rc,"B,S,T,Z,P,W",PolyRing.lex);
rqc = PolyRing(ZZ(),"e,f",PolyRing.lex);
print "Q-Ring: " + str(rqc);
print "rqc.gens() = ", [ str(f) for f in rqc.gens() ];
print;
[pone,pe,pf] = rqc.gens();
r = PolyRing(RF(rqc),"B,S,T,Z,P,W",PolyRing.lex);
print "Ring: " + str(r);
print;
# sage like: with generators for the polynomial ring
print "r.gens() = ", [ str(f) for f in r.gens() ];
print;
[one,e,f,B,S,T,Z,P,W] = r.gens();
#[one,B,S,T,Z,P,W] = r.gens();
#[one,I,B,S,T,Z,P,W] = r.gens();
f1 = 45 * P + 35 * S - 165 * B - 36;
示例13: Ring
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
from jas import Ring, PolyRing
from jas import terminate
from jas import startLog
from jas import QQ, DD
# polynomial examples: real roots over Q for zero dimensional ideal `cyclic5'
# r = Ring( "Q(x) L" );
r = PolyRing(QQ(), "a,b,c,d,e", PolyRing.lex)
print "Ring: " + str(r)
print
[one, a, b, c, d, e] = r.gens()
f1 = a + b + c + d + e
f2 = a * b + b * c + c * d + d * e + e * a
f3 = a * b * c + b * c * d + c * d * e + d * e * a + e * a * b
f4 = a * b * c * d + b * c * d * e + c * d * e * a + d * e * a * b + e * a * b * c
f5 = a * b * c * d * e - 1
print "f1 = ", f1
print "f2 = ", f2
print "f3 = ", f3
print "f4 = ", f4
print "f5 = ", f5
print
F = r.ideal(list=[f1, f2, f3, f4, f5])
示例14: Q
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
# $Id$
#
import sys
from java.lang import System
from jas import Ring, PolyRing
from jas import QQ, AN
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)
示例15: PolyRing
# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import gens [as 别名]
import sys;
from jas import PolyRing, QQ, RF
from jas import startLog
from jas import terminate
# Montes JSC 2002, 33, 183-208, example 11.1
# integral function coefficients
r = PolyRing( PolyRing(QQ(),"c, b, a",PolyRing.lex), "z,y,x", PolyRing.lex );
print "Ring: " + str(r);
print;
#automatic: [one,c,b,a,z,y,x] = r.gens();
print "gens: ", [ str(f) for f in r.gens() ];
print;
f1 = x + c * y + b * z + a;
f2 = c * x + y + a * z + b;
f3 = b * x + a * y + z + c;
F = [f1,f2,f3];
print "F: ", [ str(f) for f in F ];
print;
#startLog();
If = r.paramideal( "", list = F );
print "ParamIdeal: " + str(If);