• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python parent_gens.ParentWithGens类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sage.structure.parent_gens.ParentWithGens的典型用法代码示例。如果您正苦于以下问题:Python ParentWithGens类的具体用法?Python ParentWithGens怎么用?Python ParentWithGens使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ParentWithGens类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, group, base_ring = IntegerRing()):
        r""" Create the given group algebra.
        INPUT:
            -- (Group) group: a generic group.
            -- (Ring) base_ring: a commutative ring.
        OUTPUT:
            -- a GroupAlgebra instance.

        EXAMPLES::

            sage: from sage.algebras.group_algebra import GroupAlgebra
            doctest:1: DeprecationWarning:...
            sage: GroupAlgebra(GL(3, GF(7)))
            Group algebra of group "General Linear Group of degree 3 over Finite
            Field of size 7" over base ring Integer Ring
            sage: GroupAlgebra(1)
            Traceback (most recent call last):
            ...
            TypeError: "1" is not a group

            sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category()
            Category of group algebras over Ring of integers modulo 12

        """
        if not base_ring.is_commutative():
            raise NotImplementedError("Base ring must be commutative")

        if not is_Group(group):
            raise TypeError('"%s" is not a group' % group)

        ParentWithGens.__init__(self, base_ring, category = GroupAlgebras(base_ring))

        self._formal_sum_module = FormalSums(base_ring)
        self._group = group
开发者ID:CETHop,项目名称:sage,代码行数:34,代码来源:group_algebra.py


示例2: __init__

    def __init__(self, coordinate_patch = None):
        """
        Construct the algebra of differential forms on a given coordinate patch.
        See ``DifferentialForms`` for details.

        INPUT::

        - ``coordinate_patch`` -- Coordinate patch where the algebra lives.
        If no coordinate patch is given, a default coordinate patch with
        coordinates (x, y, z) is used.

        EXAMPLES::

            sage: p, q = var('p, q')
            sage: U = CoordinatePatch((p, q)); U
            Open subset of R^2 with coordinates p, q
            sage: F = DifferentialForms(U); F
            Algebra of differential forms in the variables p, q

        """

        from sage.categories.graded_algebras_with_basis \
            import GradedAlgebrasWithBasis
        from sage.structure.parent_gens import ParentWithGens

        if not coordinate_patch:
            x, y, z = var('x, y, z')
            coordinate_patch = CoordinatePatch((x, y, z))

        if not isinstance(coordinate_patch, CoordinatePatch):
            raise TypeError("%s not a valid Coordinate Patch" % coordinate_patch)
        self._patch = coordinate_patch

        ParentWithGens.__init__(self, SR, \
                                category = GradedAlgebrasWithBasis(SR))
开发者ID:DrXyzzy,项目名称:sage,代码行数:35,代码来源:differential_forms.py


示例3: __init__

    def __init__(self):
        """
        TEST::

            sage: sage.rings.infinity.InfinityRing_class() is sage.rings.infinity.InfinityRing_class() is InfinityRing
            True
        """
        ParentWithGens.__init__(self, self, names=('oo',), normalize=False)
开发者ID:pombredanne,项目名称:sage-1,代码行数:8,代码来源:infinity.py


示例4: __init__

    def __init__(self):
        """
        TESTS::

            sage: sage.rings.infinity.UnsignedInfinityRing_class() is sage.rings.infinity.UnsignedInfinityRing_class() is UnsignedInfinityRing
            True
        """
        ParentWithGens.__init__(self, self, names=("oo",), normalize=False)
开发者ID:jwbober,项目名称:sagelib,代码行数:8,代码来源:infinity.py


示例5: __init__

    def __init__(self, prec=53):
        """
        Initialize ``self``.

        EXAMPLES::
            sage: ComplexIntervalField()
            Complex Interval Field with 53 bits of precision
            sage: ComplexIntervalField(200)
            Complex Interval Field with 200 bits of precision
        """
        self._prec = int(prec)
        from sage.categories.fields import Fields
        ParentWithGens.__init__(self, self._real_field(), ('I',), False, category = Fields())
开发者ID:sageb0t,项目名称:testsage,代码行数:13,代码来源:complex_interval_field.py


示例6: __init__

    def __init__(self, prec=53):
        """
        TESTS::

            sage: C = ComplexField(200)
            sage: C.category()
            Category of fields
            sage: TestSuite(C).run()
        """
        self._prec = int(prec)
        from sage.categories.fields import Fields
        ParentWithGens.__init__(self, self._real_field(), ('I',), False, category = Fields())
#        self._populate_coercion_lists_()
        self._populate_coercion_lists_(coerce_list=[complex_number.RRtoCC(self._real_field(), self)])
开发者ID:jwbober,项目名称:sagelib,代码行数:14,代码来源:complex_field.py


示例7: __init__

    def __init__(self, polynomial, names, category=CAT):
        """
        Create a function field defined as an extension of another
        function field by adjoining a root of a univariate polynomial.

        INPUT:

            - ``polynomial`` -- a univariate polynomial over a function field
            - ``names`` -- variable names (as a tuple of length 1 or string)
            - ``category`` -- a category (defaults to category of function fields)
        
        EXAMPLES::

        We create an extension of function fields::
        
            sage: K.<x> = FunctionField(QQ); R.<y> = K[]
            sage: L = K.extension(y^5 - x^3 - 3*x + x*y); L
            Function field in y defined by y^5 + x*y - x^3 - 3*x

        Note the type::
        
            sage: type(L)
            <class 'sage.rings.function_field.function_field.FunctionField_polymod_with_category'>

        We can set the variable name, which doesn't have to be y::
        
            sage: L.<w> = K.extension(y^5 - x^3 - 3*x + x*y); L
            Function field in w defined by y^5 + x*y - x^3 - 3*x
        """
        from sage.rings.polynomial.all import is_Polynomial
        if names is None:
            names = (polynomial.variable_name(), )
        if not is_Polynomial(polynomial):
            raise TypeError, "polynomial must be a polynomial"
        if polynomial.degree() <= 0:
            raise ValueError, "polynomial must have positive degree"
        base_field = polynomial.base_ring()
        if not isinstance(base_field, FunctionField):
            raise TypeError, "polynomial must be over a function"
        self._base_field = base_field
        self._polynomial = polynomial
        
        ParentWithGens.__init__(self, base_field,
                                names=names, category = category)

        self._hash = hash(polynomial)
        self._ring = self._polynomial.parent()
        self._populate_coercion_lists_(coerce_list=[base_field, self._ring])
        self._gen = self(self._ring.gen())
开发者ID:fredstro,项目名称:psage,代码行数:49,代码来源:function_field.py


示例8: __init__

    def __init__(self, prec=53):
        """
        Initialize ``self``.

        TESTS::

            sage: C = ComplexField(200)
            sage: C.category()
            Join of Category of fields and Category of complete metric spaces
            sage: TestSuite(C).run()
        """
        self._prec = int(prec)
        from sage.categories.fields import Fields
        ParentWithGens.__init__(self, self._real_field(), ('I',), False, category=Fields().Metric().Complete())
#        self._populate_coercion_lists_()
        self._populate_coercion_lists_(coerce_list=[RRtoCC(self._real_field(), self)])
开发者ID:mcognetta,项目名称:sage,代码行数:16,代码来源:complex_field.py


示例9: __init__

    def __init__(self):
        """
        Initialize ``self``.

        TESTS::

            sage: sage.rings.infinity.UnsignedInfinityRing_class() is sage.rings.infinity.UnsignedInfinityRing_class() is UnsignedInfinityRing
            True
        
        Sage can understand SymPy's complex infinity (:trac:`17493`)::
        
            sage: import sympy
            sage: SR(sympy.zoo)
            Infinity
        """
        ParentWithGens.__init__(self, self, names=('oo',), normalize=False)
开发者ID:ProgVal,项目名称:sage,代码行数:16,代码来源:infinity.py


示例10: __init__

    def __init__(self, coordinate_patch = None):
        """
        Construct the algebra of differential forms on a given coordinate patch.

        See ``DifferentialForms`` for details.

        INPUT:

        - ``coordinate_patch`` -- Coordinate patch where the algebra lives.

        If no coordinate patch is given, a default coordinate patch with
        coordinates (x, y, z) is used.

        EXAMPLES::

            sage: p, q = var('p, q')
            sage: U = CoordinatePatch((p, q)); U
            doctest:...: DeprecationWarning: Use Manifold instead.
            See http://trac.sagemath.org/24444 for details.
            Open subset of R^2 with coordinates p, q
            sage: F = DifferentialForms(U); F
            doctest:...:  DeprecationWarning: For the set of differential forms of
             degree p, use U.diff_form_module(p), where U is the base manifold
             (type U.diff_form_module? for details).
            See http://trac.sagemath.org/24444 for details.
            Algebra of differential forms in the variables p, q
        """
        from sage.categories.graded_algebras_with_basis \
            import GradedAlgebrasWithBasis
        from sage.structure.parent_gens import ParentWithGens
        from sage.misc.superseded import deprecation
        deprecation(24444, 'For the set of differential forms of degree p, ' +
                    'use U.diff_form_module(p), where U is the base ' +
                    'manifold (type U.diff_form_module? for details).')

        if not coordinate_patch:
            x, y, z = var('x, y, z')
            coordinate_patch = CoordinatePatch((x, y, z))

        if not isinstance(coordinate_patch, CoordinatePatch):
            raise TypeError("%s not a valid Coordinate Patch" % coordinate_patch)
        self._patch = coordinate_patch

        ParentWithGens.__init__(self, SR, \
                                category = GradedAlgebrasWithBasis(SR))
开发者ID:saraedum,项目名称:sage-renamed,代码行数:45,代码来源:differential_forms.py


示例11: __init__

    def __init__(self):
        r"""
        We create the rational numbers `\QQ`, and call a few functions::

            sage: Q = RationalField(); Q
            Rational Field
            sage: Q.characteristic()
            0
            sage: Q.is_field()
            True
            sage: Q.category()
            Category of quotient fields
            sage: Q.zeta()
            -1

        We next illustrate arithmetic in `\QQ`.

        ::

            sage: Q('49/7')
            7
            sage: type(Q('49/7'))
            <type 'sage.rings.rational.Rational'>
            sage: a = Q('19/374'); b = Q('17/371'); print a, b
            19/374 17/371
            sage: a + b
            13407/138754
            sage: b + a
            13407/138754
            sage: a * b
            19/8162
            sage: b * a
            19/8162
            sage: a - b
            691/138754
            sage: b - a
            -691/138754
            sage: a / b
            7049/6358
            sage: b / a
            6358/7049
            sage: b < a
            True
            sage: a < b
            False

        Next finally illustrate arithmetic with automatic coercion. The
        types that coerce into the rational field include ``str, int,
        long, Integer``.

        ::

            sage: a + Q('17/371')
            13407/138754
            sage: a * 374
            19
            sage: 374 * a
            19
            sage: a/19
            1/374
            sage: a + 1
            393/374

        TESTS::

            sage: TestSuite(QQ).run()
            sage: QQ.variable_name()
            'x'
            sage: QQ.variable_names()
            ('x',)
        """
        from sage.categories.basic import QuotientFields
        ParentWithGens.__init__(self, self, category = QuotientFields())
        self._assign_names(('x',),normalize=False) # ???
        self._populate_coercion_lists_(element_constructor=rational.Rational, init_no_parent=True)
开发者ID:Findstat,项目名称:sage,代码行数:75,代码来源:rational_field.py


示例12: __init__

 def __init__(self, prec=53):
     self._prec = int(prec)
     from sage.categories.fields import Fields
     ParentWithGens.__init__(self, self._real_field(), ('I',), False, category = Fields())
开发者ID:dagss,项目名称:sage,代码行数:4,代码来源:complex_interval_field.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python richcmp.richcmp函数代码示例发布时间:2022-05-27
下一篇:
Python parent_gens.normalize_names函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap