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


Python LaurentPolynomialRing.parent方法代码示例

本文整理汇总了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())
开发者ID:sagemath,项目名称:sage,代码行数:31,代码来源:moebius_algebra.py

示例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)
开发者ID:sagemath,项目名称:sage,代码行数:29,代码来源:quantum_matrix_coordinate_algebra.py

示例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)
开发者ID:mcognetta,项目名称:sage,代码行数:23,代码来源:yokonuma_hecke_algebra.py

示例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())
开发者ID:sensen1,项目名称:sage,代码行数:24,代码来源:moebius_algebra.py


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