本文整理汇总了Python中jas.Ring.one方法的典型用法代码示例。如果您正苦于以下问题:Python Ring.one方法的具体用法?Python Ring.one怎么用?Python Ring.one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jas.Ring
的用法示例。
在下文中一共展示了Ring.one方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: H
# 需要导入模块: from jas import Ring [as 别名]
# 或者: from jas.Ring import one [as 别名]
from jas import startLog
from jas import terminate
# hermite polynomial example
# H(0) = 1
# H(1) = 2 * x
# H(n) = 2 * x * H(n-1) - 2 * (n-1) * H(n-2)
r = Ring( "Z(x) L" );
print "Ring: " + str(r);
print;
# sage like: with generators for the polynomial ring
[x] = r.gens();
one = r.one();
x2 = 2 * x;
N = 10;
H = [one,x2];
for n in range(2,N):
h = x2 * H[n-1] - 2 * (n-1) * H[n-2];
H.append( h );
for n in range(0,N):
print "H[%s] = %s" % (n,H[n]);
print;
#sys.exit();
示例2: Ring
# 需要导入模块: from jas import Ring [as 别名]
# 或者: from jas.Ring import one [as 别名]
print;
ps9 = ps8 - c;
print "ps9:", ps9;
print;
# conversion from polynomials
pr = Ring("Q(y) L");
print "pr:", pr;
print;
[yp] = pr.gens();
one = pr.one();
p1 = one;
p2 = one - yp;
ps1 = psr.from(p1);
ps2 = psr.from(p2);
# rational function as power series:
ps3 = ps1 / ps2;
print "p1:", p1;
print "p2:", p2;
print "ps1:", ps1;
print "ps2:", ps2;
print "ps3:", ps3;
print;