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

Python abelian_group_element.AbelianGroupElement类代码示例

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

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



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

示例1: __init__

    def __init__(self, parent, ideal, element=None):
        """
        Returns the ideal class of this fractional ideal.

        EXAMPLE::

            sage: K.<a> = NumberField(x^2 + 23,'a'); G = K.class_group()
            sage: G(K.ideal(13, a + 4))
            Fractional ideal class (13, 1/2*a + 17/2)
        """
        self.__ideal = ideal
        if element is None:
            element = map(int, ideal.ideal_class_log(proof=parent._proof_flag))
        AbelianGroupElement.__init__(self, parent, element)
开发者ID:dagss,项目名称:sage,代码行数:14,代码来源:class_group.py


示例2: __init__

    def __init__(self, exponents, parent, value=None):
        """
        Create an element

        EXAMPLES::

            sage: F = AbelianGroupWithValues([1,-1], [2,4])
            sage: a,b = F.gens()
            sage: a*b^-1 in F
            True
            sage: (a*b^-1).value()
            -1
        """
        self._value = value
        AbelianGroupElement.__init__(self, exponents, parent)
开发者ID:biasse,项目名称:sage,代码行数:15,代码来源:values.py


示例3: _mul_

    def _mul_(self, other):
        r"""
        Multiplication of two (S-)ideal classes.

        EXAMPLE::

            sage: G = NumberField(x^2 + 23,'a').class_group(); G
            Class group of order 3 with structure C3 of Number Field in a with defining polynomial x^2 + 23
            sage: I = G.0; I
            Fractional ideal class (2, 1/2*a - 1/2)
            sage: I*I # indirect doctest
            Fractional ideal class (2, 1/2*a + 1/2)
            sage: I*I*I # indirect doctest
            Trivial principal fractional ideal class

            sage: K.<a> = QuadraticField(-14)
            sage: I = K.ideal(2,a)
            sage: S = (I,)
            sage: CS = K.S_class_group(S)
            sage: G = K.ideal(3,a+1)
            sage: CS(G)*CS(G)
            Trivial S-ideal class
        """
        m = AbelianGroupElement._mul_(self, other)
        m._value = (self.ideal() * other.ideal()).reduce_equiv()
        return m
开发者ID:BlairArchibald,项目名称:sage,代码行数:26,代码来源:class_group.py


示例4: inverse

 def inverse(self):
     r"""
     Return the multiplicative inverse of this ideal class.
     
     EXAMPLE::
     
         sage: K.<a> = NumberField(x^3 - 3*x + 8); G = K.class_group()
         sage: G(2, a).inverse()
         Fractional ideal class (2, a^2 + 2*a - 1)
     """
     m = AbelianGroupElement.inverse(self)
     return FractionalIdealClass(self.parent(), (~self.__ideal).reduce_equiv(), m.list())
开发者ID:dagss,项目名称:sage,代码行数:12,代码来源:class_group.py


示例5: inverse

    def inverse(self):
        r"""
        Return the multiplicative inverse of this ideal class.

        EXAMPLE::

            sage: K.<a> = NumberField(x^3 - 3*x + 8); G = K.class_group()
            sage: G(2, a).inverse()
            Fractional ideal class (2, a^2 + 2*a - 1)
            sage: ~G(2, a)
            Fractional ideal class (2, a^2 + 2*a - 1)
        """
        m = AbelianGroupElement.inverse(self)
        m._value = (~self.ideal()).reduce_equiv()
        return m
开发者ID:BlairArchibald,项目名称:sage,代码行数:15,代码来源:class_group.py


示例6: _mul_

    def _mul_(left, right):
        """
        Multiply ``left`` and ``right``

        TESTS::

            sage: G.<a,b> = AbelianGroupWithValues([5,2], 2)
            sage: a._mul_(b)
            a*b
            sage: a*b
            a*b
            sage: (a*b).value()
            10
        """
        m = AbelianGroupElement._mul_(left, right)
        m._value = left.value() * right.value()
        return m
开发者ID:biasse,项目名称:sage,代码行数:17,代码来源:values.py


示例7: _div_

    def _div_(left, right):
        """
        Divide ``left`` by ``right``

        TESTS::

            sage: G.<a,b> = AbelianGroupWithValues([5,2], 2)
            sage: a._div_(b)
            a*b^-1
            sage: a/b
            a*b^-1
            sage: (a/b).value()
            5/2
        """
        m = AbelianGroupElement._div_(left, right)
        m._value = left.value() / right.value()
        return m
开发者ID:biasse,项目名称:sage,代码行数:17,代码来源:values.py


示例8: _mul_

    def _mul_(self, other):
        r"""
        Multiplies together two S-ideal classes.
        
        EXAMPLES::
        
            sage: K.<a> = QuadraticField(-14)
            sage: I = K.ideal(2,a)                  
            sage: S = (I,)
            sage: CS = K.S_class_group(S)
            sage: G = K.ideal(3,a+1)
            sage: CS(G)*CS(G)
            Trivial S-ideal class
        """

        m = AbelianGroupElement._mul_(self, other)
        return SFractionalIdealClass(self.parent(), (self.ideal() * other.ideal()).reduce_equiv(), m.list())
开发者ID:dagss,项目名称:sage,代码行数:17,代码来源:class_group.py


示例9: _div_

    def _div_(self, other):
        r"""
        Division of two ideal classes.

        EXAMPLE::

            sage: G = NumberField(x^2 + 23,'a').class_group(); G
            Class group of order 3 with structure C3 of Number Field in a with defining polynomial x^2 + 23
            sage: I = G.0; I
            Fractional ideal class (2, 1/2*a - 1/2)
            sage: I*I # indirect doctest
            Fractional ideal class (2, 1/2*a + 1/2)
            sage: I*I*I # indirect doctest
            Trivial principal fractional ideal class
        """
        m = AbelianGroupElement._div_(self, other)
        m._value = (self.ideal() / other.ideal()).reduce_equiv()
        return m
开发者ID:BlairArchibald,项目名称:sage,代码行数:18,代码来源:class_group.py


示例10: order

    def order(self):
        r"""
        Return the order of this ideal class in the class group.

        EXAMPLE::

            sage: K.<w>=QuadraticField(-23)
            sage: OK=K.ring_of_integers()
            sage: C=OK.class_group()
            sage: [c.order() for c in C]
            [1, 3, 3]

            sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G
            Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072
            sage: [c.order() for c in G.gens()]
            [38, 2]

        """
        # an old method with a new docstring
        return AbelianGroupElement.order(self)
开发者ID:dagss,项目名称:sage,代码行数:20,代码来源:class_group.py


示例11: __pow__

    def __pow__(self, n):
        """
        Exponentiate ``self``

        INPUT:

        - ``n`` -- integer. The exponent.

        TESTS::

            sage: G.<a,b> = AbelianGroupWithValues([5,2], 2)
            sage: a^3
            a^3
            sage: (a^3).value()
            125
        """
        m = Integer(n)
        if n != m:
            raise TypeError('argument n (= '+str(n)+') must be an integer.')
        pow_self = AbelianGroupElement.__pow__(self, m)
        pow_self._value = pow(self.value(), m)
        return pow_self
开发者ID:biasse,项目名称:sage,代码行数:22,代码来源:values.py


示例12: inverse

    def inverse(self):
        """
        Return the inverse element.

        EXAMPLE::

            sage: G.<a,b> = AbelianGroupWithValues([2,-1], [0,4])
            sage: a.inverse()
            a^-1
            sage: a.inverse().value()
            1/2
            sage: a.__invert__().value()
            1/2
            sage: (~a).value()
            1/2
            sage: (a*b).value()
            -2
            sage: (a*b).inverse().value()
            -1/2
        """
        m = AbelianGroupElement.inverse(self)
        m._value = ~self.value()
        return m
开发者ID:biasse,项目名称:sage,代码行数:23,代码来源:values.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python group_element.MatrixGroupElement_gap类代码示例发布时间:2022-05-27
下一篇:
Python graph.Graph类代码示例发布时间: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