当前位置: 首页>>代码示例>>Python>>正文


Python PolyRing.ideal方法代码示例

本文整理汇总了Python中jas.PolyRing.ideal方法的典型用法代码示例。如果您正苦于以下问题:Python PolyRing.ideal方法的具体用法?Python PolyRing.ideal怎么用?Python PolyRing.ideal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jas.PolyRing的用法示例。


在下文中一共展示了PolyRing.ideal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
     - (u0+u1+u2+u12)*l2*(l1+l2+2)*(l2+1)  ;

print f1;
print f2;
print

#h = l1*l2*(l1+1)*(l2+1)*(l1+l2+1)*(l1+l2+2);
h = l1*l2*(l1+1);
hp = (l2+1);
hpp = (l1+l2+1)*(l1+l2+2);
print h;
print hp;
print hpp;
print

F = r.ideal(list=[f1,f2]);
print F;
print

H = r.ideal(list=[h]);
print H;
print

Hp = r.ideal(list=[hp]);
print Hp;
print

Hpp = r.ideal(list=[hpp]);
print Hpp;
print
开发者ID:rjolly,项目名称:jas,代码行数:32,代码来源:alg_stat_1p.py

示例2: Ideal

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
 ( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ), 
 ( - 9 W + 15 T P + 20 S Z ), 
 ( P W + 2 T Z - 11 B**3 ), 
 ( 99 W - 11 B S + 3 B**2 ),
 ( 10000 B**2 + 6600 B + 2673 )
) 
""";

# ( 10000 B**2 + 6600 B + 2673 )
# ( B**2 + 33/50 B + 2673/10000 )

#f = Ideal( r, ps );
#print "Ideal: " + str(f);
#print;

f = r.ideal( ps );
print "Ideal: " + str(f);
print;

#startLog();

rg = f.GB();
#print "seq Output:", rg;
#print;

rg = f.parGB(2);
#print "par Output:", rg;
#print;

f.distClient(); # starts in background
rg = f.distGB(2);
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:trinks_str.py

示例3: PolyRing

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
#                      {x, y, z})", 
#       "{12-28*z+27*z^2-12*z^3+3*z^4, -6+4*y+11*z-6*z^2+3*z^3, 2+x-z}");

Scripting.setCAS(Scripting.CAS.Math);
#Scripting.setCAS(Scripting.CAS.Sage);
#Scripting.setCAS(Scripting.CAS.Singular);

r = PolyRing(ZZ(),"x,y,z",Order.Lexicographic);
print "Ring: " + str(r);
print;

ff = [ x**2 + y**2 + z**2 - 1, 
      x - z + 2, 
      z**2 - x*y]

F = r.ideal( "", ff );
print "F = " + str(F);
print;

#startLog();

G = F.GB();
print "G = " + str(G);
print;
print "Ma: " + str( r.ideal("",[12-28*z+27*z**2-12*z**3+3*z**4,-6+4*y+11*z-6*z**2+3*z**3,2+x-z] ));
print;

# check("GroebnerBasis({x^2 + y^2 + z^2 - 1, x - z + 2, z^2 - x*y},
#                      {x, y, z}, MonomialOrder -> DegreeReverseLexicographic)",
#       "{16+23*x+12*x^2+3*x^3+4*y,3+4*x+2*x^2+y^2,-4-4*x-x^2+x*y,-2-x+z}"); 
开发者ID:rjolly,项目名称:jas,代码行数:32,代码来源:orderexam.py

示例4: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
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;

#startLog();

rg = f.GB();
rg = f.GB();
if not rg.isGB():
    print "seq Output:", rg;
    print;

#-------------------

sbgb = sigbased_gb();
arri = arris_algorithm();
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:trinks_sigbased_gb.py

示例5: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
h1 = 2 * x1 - u1;
h2 = 2 * x2 - u2;
h3 = 2 * x3 - u1;
h4 = 2 * x4 - u2;
h5 = u2 * x5 + u1 * x6 - u1 * u2;
h6 = u1 * x5 - u2 * x6;
h7 = x1**2 - x2**2 - 2 * x1 * x7 + 2 * x2 * x8;
h8 = x1**2 - 2 * x1 * x7 - x3**2 + 2 * x3 * x7 - x4**2 + 2 * x4 * x8;

g = ( ( x5 - x7 )**2 + ( x6 - x8 )**2 - ( x1 - x7 )**2 - x8**2 );

L = [h1,h2,h3,h4,h5,h6,h7,h8];
#print "L = ", str(L);

f = r.ideal( list=L );
print "Ideal: " + str(f);
print;

#sys.exit();
startLog();

c = f.CS();
print "seq char set:", c;
print "is char set:", c.isCS();
print;

print "g:", g;
print;
h = c.csReduction(g);
print "h:", h;
开发者ID:rjolly,项目名称:jas,代码行数:32,代码来源:charset.py

示例6: EF

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
# EF(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2", "[1,2]").polynomial("x").build();

f1 = q**3 - 3;
f2 = w**2 - q;
#f3 = s**5 - 2;
f3 = s**3 - 2;
f4 = x**2 - w * s;

print "f1 = ", f1;
print "f2 = ", f2;
print "f3 = ", f3;
print "f4 = ", f4;
print;

F = r.ideal( list=[f1,f2,f3,f4] );
print "F = ", F;
print;

startLog();

t = System.currentTimeMillis();
R = F.realRoots();
t = System.currentTimeMillis() - t;
print "R = ", R;
print;
print "real roots = ";
F.realRootsPrint()
print "real roots time =", t, "milliseconds";
print;
开发者ID:rjolly,项目名称:jas,代码行数:31,代码来源:real_roots_ideal.py

示例7: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
print "Ring: " + str(r);
print;

#unused:
ps = """
( 
 ( 3 x1^2 x3^4 + 7 x2^5 - 61 )
) 
""";

f = 3 * x1**2 * x3**4 + 7 * x2**5 - 61;
print "f = " + str(f);
print;

#id = r.ideal( ps );
id = r.ideal( "", [f] );
print "Ideal: " + str(id);
print;

#startLog();

pps = """
 3 x1^2 x3^4 + 7 x2^5 - 61
""";

ri = r.ring;
print "ri = " + str(ri);
print

pol = id.pset;
print "pol = " + str(pol);
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:pppj2006.py

示例8:

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
#automatic: [one,c,x,y,z] = r.gens();
print one,c,x,y,z;

#sys.exit();

f1 = (x**2 - 2); #**2;
f2 = (y**2 - c)**5;
f3 = (z**2 - 2 * c); #**5;

print "f1 = ", f1;
print "f2 = ", f2;
print "f3 = ", f3;
#print "f4 = ", f4;
print;

F = r.ideal( list=[f1,f2,f3] );
#F = r.ideal( list=[f1,f3] );
#F = r.ideal( list=[f2,f3] );

print "F = ", F;
print;

startLog();

t = System.currentTimeMillis();
P = F.primeDecomp();
t = System.currentTimeMillis() - t;
print "P = ", P;
print;
print "decomp time =", t, "milliseconds";
print;
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:prime-decomp-charp.py

示例9: PolyRing

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
# trinks 7 example

r = PolyRing(QQ(), "B,S,T,Z,P,W", PolyRing.lex );
print "Ring: " + str(r);
print;
#one,B,S,T,Z,P,W = r.gens(); # capital letter variables automaticaly included in Python

f1 = 45 * P + 35 * S - 165 * B - 36;
f2 = 35 * P + 40 * Z + 25 * T - 27 * S;
f3 = 15 * W + 25 * S * P + 30 * Z - 18 * T - 165 * B**2;
f4 = - 9 * W + 15 * T * P + 20 * S * Z;
f5 = P * W + 2 * T * Z - 11 * B**3;
f6 = 99 * W - 11 *B * S + 3 * B**2;
f7 = 10000 * B**2 + 6600 * B + 2673;

f = r.ideal( "", [f1,f2,f3,f4,f5,f6,f7] );
print "Ideal: " + str(f);
print;

#exit()

rg = f.GB();
print "GB: " + str(rg);
print;

#startLog();

s = rg.syzygy();
print "syzygy: " + str(s);
print;
开发者ID:rjolly,项目名称:jas,代码行数:32,代码来源:syz_script.py

示例10: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
(
 ( x - 1 ),
 ( y - 1 ),
 ( z - 1 )
)
""";

ps2 = """
(
 ( x - 2 ),
 ( y - 3 ),
 ( z - 3 )
)
""";

F1 = r.ideal( ps1 );
#print "Ideal: " + str(F1);
#print;

F2 = r.ideal( ps2 );
#print "Ideal: " + str(F2);
#print;

#startLog();

rg1 = F1.GB();
print "rg1 = ", rg1;
print;

rg2 = F2.GB();
print "rg2 = ", rg2;
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:intersect.py

示例11: QQ

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
h = 2;
n = 5;
delta = QQ(2,10); # 0.2

f1 = R - 1/(1+A**n);
f2 = M * L - delta * A - ( v * M * A ) / ( h + A ); 
f3 = c0 + c * ( 1 - 1 / ( 1 + A**n ) - gamma * M);


F = [f1,f2,f3];
print "f1 = " + str(f1);
print "f2 = " + str(f2);
print "f3 = " + str(f3);
print;

I = r.ideal( "", list=F );
print "Ideal: " + str(I);
print;

#sys.exit();

G = I.GB();
print "GB: " + str(G);
print;


# ------------ GB and CGB --------------------

r2 = PolyRing(PolyRing(QQ(),"L",PolyRing.lex),"A, M, R",PolyRing.lex);
#r2 = PolyRing(RF(PolyRing(QQ(),"L",PolyRing.lex)),"A, M, R",PolyRing.lex);
print "PolyRing: " + str(r2);
开发者ID:rjolly,项目名称:jas,代码行数:33,代码来源:sys-bio2.py

示例12: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
 ( a^2 - a ),
 ( f^2 - f ),
 ( p^2 - p ),
 ( u^2 - u )
)
""";

ps = """
(
 ( p f + p ),
 ( p u + p + u + 1 ),
 ( a + u + 1 ),
 ( a + p + 1 )
)
""";


k = r.ideal( ks );
p = r.ideal( ps );

f = k.sum( p );

print "Ideal: " + str(f);
print;

rg = f.GB();
print "Output:", rg;
print;


开发者ID:rjolly,项目名称:jas,代码行数:30,代码来源:logic.py

示例13: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
    + x1 * x2 * x3 * x6
    + x1 * x2 * x5 * x6
    + x1 * x4 * x5 * x6
    + x2 * x3 * x4 * x5
    + x3 * x4 * x5 * x6,
    x1 * x2 * x3 * x4 * x5
    + x1 * x2 * x3 * x4 * x6
    + x1 * x2 * x3 * x5 * x6
    + x1 * x2 * x4 * x5 * x6
    + x1 * x3 * x4 * x5 * x6
    + x2 * x3 * x4 * x5 * x6,
    x1 * x2 * x3 * x4 * x5 * x6 - 1,
]

# f = r.ideal( ps );
f = r.ideal("", F)
print "Ideal: " + str(f)
print

startLog()

o = f.optimize()
print "optimized Ideal: " + str(o)
print

rg = f.GB()
print "Output:", rg
print

# org = o.GB();
# print "opt Output:", org;
开发者ID:siwiwit,项目名称:java-algebra-system,代码行数:33,代码来源:cyclic6_opt.py

示例14: str

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
## t4 = L;
## t5 = P;
#
## t1 = M;
## t2 = B;
## t3 = A;
## t4 = L - 1;
## t5 = P;
#
t1 = M;
t2 = B;
t3 = A - 1;
t4 = L - 1;
t5 = P;


F = [f1,f2,f3,f4,f5];
#F = [f1,f2,f3,f4,f5,t1,t2,t3,t4,t5];

I = r.ideal( "", list=F );
print "Ideal: " + str(I);
print;

G = I.GB();
print "GB: " + str(G);
print;


#startLog();
terminate();
开发者ID:,项目名称:,代码行数:32,代码来源:

示例15:

# 需要导入模块: from jas import PolyRing [as 别名]
# 或者: from jas.PolyRing import ideal [as 别名]
##f1 = x**4 + t;
##f2 = y**4 + t;
f1 = x**3 + t;
f2 = y**3 + t;

#f2 = f2**2;

f3 = (y-x);
f3 = f3**prime;

print "f1 = ", f1;
print "f2 = ", f2;
#print "f3 = ", f3;
print;

F = r.ideal( list=[f1,f2] );

print "F = ", F;
print;

startLog();

t = System.currentTimeMillis();
R = F.radicalDecomp();
#R = F.primeDecomp();
t = System.currentTimeMillis() - t;
print "R = ", R;
print;
print "decomp time =", t, "milliseconds";
print;
开发者ID:,项目名称:,代码行数:32,代码来源:


注:本文中的jas.PolyRing.ideal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。