本文整理汇总了Python中sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing.quotient方法的典型用法代码示例。如果您正苦于以下问题:Python PolynomialRing.quotient方法的具体用法?Python PolynomialRing.quotient怎么用?Python PolynomialRing.quotient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing
的用法示例。
在下文中一共展示了PolynomialRing.quotient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: canonical_scheme
# 需要导入模块: from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing [as 别名]
# 或者: from sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing import quotient [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))
示例2: expand
# 需要导入模块: from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing [as 别名]
# 或者: from sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing import quotient [as 别名]
def expand(self, n, letter='x'):
r"""
Expand ``self`` written in the `\mathbf{w}` basis in `n^2`
commuting variables which satisfy the relation
`x_{ij} x_{ik} = 0` for all `i`, `j`, and `k`.
The expansion of an element of the `\mathbf{w}` basis is
given by equations (26) and (55) in [HNT06]_.
INPUT:
- ``n`` -- an integer
- ``letter`` -- (default: ``'x'``) a string
OUTPUT:
- The symmetric function of ``self`` expressed in the ``n*n``
non-commuting variables described by ``letter``.
REFERENCES:
.. [HNT06] \F. Hivert, J.-C. Novelli, J.-Y. Thibon.
*Commutative combinatorial Hopf algebras*. (2006).
:arxiv:`0605262v1`.
EXAMPLES::
sage: w = SymmetricFunctionsNonCommutingVariables(QQ).dual().w()
sage: w[[1,3],[2]].expand(4)
x02*x11*x20 + x03*x11*x30 + x03*x22*x30 + x13*x22*x31
One can use a different set of variable by using the
optional argument ``letter``::
sage: w[[1,3],[2]].expand(3, letter='y')
y02*y11*y20
"""
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.combinat.permutation import Permutations
m = self.parent()
names = ['{}{}{}'.format(letter, i, j) for i in range(n) for j in range(n)]
R = PolynomialRing(m.base_ring(), n*n, names)
x = [[R.gens()[i*n+j] for j in range(n)] for i in range(n)]
I = R.ideal([x[i][j]*x[i][k] for j in range(n) for k in range(n) for i in range(n)])
Q = R.quotient(I, names)
x = [[Q.gens()[i*n+j] for j in range(n)] for i in range(n)]
P = SetPartitions()
def on_basis(A):
k = A.size()
ret = R.zero()
if n < k:
return ret
for p in Permutations(k):
if P(p.to_cycles()) == A:
# -1 for indexing
ret += R.sum(prod(x[I[i]][I[p[i]-1]] for i in range(k))
for I in Subsets(range(n), k))
return ret
return m._apply_module_morphism(self, on_basis, codomain=R)