本文整理匯總了Python中sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing.parent方法的典型用法代碼示例。如果您正苦於以下問題:Python LaurentPolynomialRing.parent方法的具體用法?Python LaurentPolynomialRing.parent怎麽用?Python LaurentPolynomialRing.parent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing
的用法示例。
在下文中一共展示了LaurentPolynomialRing.parent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing [as 別名]
# 或者: from sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing import parent [as 別名]
def __init__(self, L, q=None):
"""
Initialize ``self``.
TESTS::
sage: L = posets.BooleanLattice(4)
sage: M = L.quantum_moebius_algebra()
sage: TestSuite(M).run() # long time
sage: from sage.combinat.posets.moebius_algebra import QuantumMoebiusAlgebra
sage: L = posets.Crown(2)
sage: QuantumMoebiusAlgebra(L)
Traceback (most recent call last):
...
ValueError: L must be a lattice
"""
if not L.is_lattice():
raise ValueError("L must be a lattice")
if q is None:
q = LaurentPolynomialRing(ZZ, 'q').gen()
self._q = q
R = q.parent()
cat = Algebras(R).WithBasis()
if L in FiniteEnumeratedSets():
cat = cat.Commutative().FiniteDimensional()
self._lattice = L
self._category = cat
Parent.__init__(self, base=R, category=self._category.WithRealizations())
示例2: __classcall__
# 需要導入模塊: from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing [as 別名]
# 或者: from sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing import parent [as 別名]
def __classcall__(cls, q=None, bar=None, R=None, **kwds):
"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: R.<q> = LaurentPolynomialRing(ZZ)
sage: O1 = algebras.QuantumMatrixCoordinate(4)
sage: O2 = algebras.QuantumMatrixCoordinate(4, 4, q=q)
sage: O3 = algebras.QuantumMatrixCoordinate(4, R=ZZ)
sage: O4 = algebras.QuantumMatrixCoordinate(4, R=R, q=q)
sage: O1 is O2 and O2 is O3 and O3 is O4
True
sage: O5 = algebras.QuantumMatrixCoordinate(4, R=QQ)
sage: O1 is O5
False
"""
if R is None:
R = ZZ
else:
if q is not None:
q = R(q)
if q is None:
q = LaurentPolynomialRing(R, 'q').gen()
return super(QuantumMatrixCoordinateAlgebra_abstract,
cls).__classcall__(cls,
q=q, bar=bar, R=q.parent(), **kwds)
示例3: __classcall_private__
# 需要導入模塊: from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing [as 別名]
# 或者: from sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing import parent [as 別名]
def __classcall_private__(cls, d, n, q=None, R=None):
"""
Standardize input to ensure a unique representation.
TESTS::
sage: Y1 = algebras.YokonumaHecke(5, 3)
sage: q = LaurentPolynomialRing(QQ, 'q').gen()
sage: Y2 = algebras.YokonumaHecke(5, 3, q)
sage: Y3 = algebras.YokonumaHecke(5, 3, q, q.parent())
sage: Y1 is Y2 and Y2 is Y3
True
"""
if q is None:
q = LaurentPolynomialRing(QQ, 'q').gen()
if R is None:
R = q.parent()
q = R(q)
if R not in Rings().Commutative():
raise TypeError("base ring must be a commutative ring")
return super(YokonumaHeckeAlgebra, cls).__classcall__(cls, d, n, q, R)
示例4: __init__
# 需要導入模塊: from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing [as 別名]
# 或者: from sage.rings.polynomial.laurent_polynomial_ring.LaurentPolynomialRing import parent [as 別名]
def __init__(self, L, q=None):
"""
Initialize ``self``.
TESTS::
sage: L = posets.BooleanLattice(4)
sage: M = L.quantum_moebius_algebra()
sage: TestSuite(M).run() # long time
"""
if not L.is_lattice():
raise ValueError("L must be a lattice")
if q is None:
q = LaurentPolynomialRing(ZZ, "q").gen()
self._q = q
R = q.parent()
cat = Algebras(R).WithBasis()
if L in FiniteEnumeratedSets():
cat = cat.Commutative().FiniteDimensional()
self._lattice = L
self._category = cat
Parent.__init__(self, base=R, category=self._category.WithRealizations())