本文整理汇总了Python中sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing.prod方法的典型用法代码示例。如果您正苦于以下问题:Python PolynomialRing.prod方法的具体用法?Python PolynomialRing.prod怎么用?Python PolynomialRing.prod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing
的用法示例。
在下文中一共展示了PolynomialRing.prod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: canonical_scheme
# 需要导入模块: from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing [as 别名]
# 或者: from sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing import prod [as 别名]
def canonical_scheme(self, t=None):
"""
Return the canonical scheme.
This is a scheme that contains this hypergeometric motive in its cohomology.
EXAMPLES::
sage: from sage.modular.hypergeometric_motive import HypergeometricData as Hyp
sage: H = Hyp(cyclotomic=([3],[4]))
sage: H.gamma_list()
[-1, 2, 3, -4]
sage: H.canonical_scheme()
Spectrum of Quotient of Multivariate Polynomial Ring
in X0, X1, Y0, Y1 over Fraction Field of Univariate Polynomial Ring
in t over Rational Field by the ideal
(X0 + X1 - 1, Y0 + Y1 - 1, (-t)*X0^2*X1^3 + 27/64*Y0*Y1^4)
sage: H = Hyp(gamma_list=[-2, 3, 4, -5])
sage: H.canonical_scheme()
Spectrum of Quotient of Multivariate Polynomial Ring
in X0, X1, Y0, Y1 over Fraction Field of Univariate Polynomial Ring
in t over Rational Field by the ideal
(X0 + X1 - 1, Y0 + Y1 - 1, (-t)*X0^3*X1^4 + 1728/3125*Y0^2*Y1^5)
REFERENCES:
[Kat1991]_, section 5.4
"""
if t is None:
t = FractionField(QQ['t']).gen()
basering = t.parent()
gamma_pos = [u for u in self.gamma_list() if u > 0]
gamma_neg = [u for u in self.gamma_list() if u < 0]
N_pos = len(gamma_pos)
N_neg = len(gamma_neg)
varX = ['X{}'.format(i) for i in range(N_pos)]
varY = ['Y{}'.format(i) for i in range(N_neg)]
ring = PolynomialRing(basering, varX + varY)
gens = ring.gens()
X = gens[:N_pos]
Y = gens[N_pos:]
eq0 = ring.sum(X) - 1
eq1 = ring.sum(Y) - 1
eq2_pos = ring.prod(X[i] ** gamma_pos[i] for i in range(N_pos))
eq2_neg = ring.prod(Y[j] ** -gamma_neg[j] for j in range(N_neg))
ideal = ring.ideal([eq0, eq1, self.M_value() * eq2_neg - t * eq2_pos])
return Spec(ring.quotient(ideal))