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


Python PowerSeriesRing.set_default_prec方法代码示例

本文整理汇总了Python中sage.rings.power_series_ring.PowerSeriesRing.set_default_prec方法的典型用法代码示例。如果您正苦于以下问题:Python PowerSeriesRing.set_default_prec方法的具体用法?Python PowerSeriesRing.set_default_prec怎么用?Python PowerSeriesRing.set_default_prec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sage.rings.power_series_ring.PowerSeriesRing的用法示例。


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

示例1: series

# 需要导入模块: from sage.rings.power_series_ring import PowerSeriesRing [as 别名]
# 或者: from sage.rings.power_series_ring.PowerSeriesRing import set_default_prec [as 别名]
    def series(self, n, prec):
        r"""
        Returns the `n`-th approximation to the `p`-adic `L`-series
        associated to self, as a power series in `T` (corresponding to
        `\gamma-1` with `\gamma= 1 + p` as a generator of `1+p\ZZ_p`).

        EXAMPLES::
        
            sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
            sage: E = EllipticCurve('57a')
            sage: p = 5
            sage: prec = 4
            sage: phi = ps_modsym_from_elliptic_curve(E)
            sage: phi_stabilized = phi.p_stabilize(p,M = prec+3)
            sage: Phi = phi_stabilized.lift(p,prec,None,algorithm='stevens',eigensymbol=True)
            sage: L = pAdicLseries(Phi)
            sage: L.series(3,4)
            O(5^3) + (3*5 + 5^2 + O(5^3))*T + (5 + O(5^2))*T^2
            
            sage: L1 = E.padic_lseries(5)
            sage: L1.series(4)
            O(5^6) + (3*5 + 5^2 + O(5^3))*T + (5 + 4*5^2 + O(5^3))*T^2 + (4*5^2 + O(5^3))*T^3 + (2*5 + 4*5^2 + O(5^3))*T^4 + O(T^5)
        
        """
        p = self.prime()
        M = self.symb().precision_absolute()
        K = pAdicField(p, M)
        R = PowerSeriesRing(K, names = 'T')
        T = R.gens()[0]
        R.set_default_prec(prec)
        return sum(self[i] * T**i for i in range(n))
开发者ID:Habli,项目名称:OMS,代码行数:33,代码来源:padic_lseries.py

示例2: local_coordinates_at_nonweierstrass

# 需要导入模块: from sage.rings.power_series_ring import PowerSeriesRing [as 别名]
# 或者: from sage.rings.power_series_ring.PowerSeriesRing import set_default_prec [as 别名]
    def local_coordinates_at_nonweierstrass(self, P, prec=20, name='t'):
        """
        For a non-Weierstrass point `P = (a,b)` on the hyperelliptic
        curve `y^2 = f(x)`, return `(x(t), y(t))` such that `(y(t))^2 = f(x(t))`,
        where `t = x - a` is the local parameter.

        INPUT:

        - ``P = (a, b)`` -- a non-Weierstrass point on self
        - ``prec`` --  desired precision of the local coordinates
        - ``name`` -- gen of the power series ring (default: ``t``)

        OUTPUT:

        `(x(t),y(t))` such that `y(t)^2 = f(x(t))` and `t = x - a`
        is the local parameter at `P`

        EXAMPLES::

            sage: R.<x> = QQ['x']
            sage: H = HyperellipticCurve(x^5-23*x^3+18*x^2+40*x)
            sage: P = H(1,6)
            sage: x,y = H.local_coordinates_at_nonweierstrass(P,prec=5)
            sage: x
            1 + t + O(t^5)
            sage: y
            6 + t - 7/2*t^2 - 1/2*t^3 - 25/48*t^4 + O(t^5)
            sage: Q = H(-2,12)
            sage: x,y = H.local_coordinates_at_nonweierstrass(Q,prec=5)
            sage: x
            -2 + t + O(t^5)
            sage: y
            12 - 19/2*t - 19/32*t^2 + 61/256*t^3 - 5965/24576*t^4 + O(t^5)

        AUTHOR:

            - Jennifer Balakrishnan (2007-12)
        """
        d = P[1]
        if d == 0:
            raise TypeError("P = %s is a Weierstrass point. Use local_coordinates_at_weierstrass instead!"%P)
        pol = self.hyperelliptic_polynomials()[0]
        L = PowerSeriesRing(self.base_ring(), name)
        t = L.gen()
        L.set_default_prec(prec)
        K = PowerSeriesRing(L, 'x')
        pol = K(pol)
        x = K.gen()
        b = P[0]
        f = pol(t+b)
        for i in range((RR(log(prec)/log(2))).ceil()):
            d = (d + f/d)/2
        return t+b+O(t**(prec)), d + O(t**(prec))
开发者ID:saraedum,项目名称:sage-renamed,代码行数:55,代码来源:hyperelliptic_generic.py

示例3: series

# 需要导入模块: from sage.rings.power_series_ring import PowerSeriesRing [as 别名]
# 或者: from sage.rings.power_series_ring.PowerSeriesRing import set_default_prec [as 别名]
    def series(self, n, prec=5):
        r"""
        Return the `n`-th approximation to the `p`-adic `L`-series
        associated to self, as a power series in `T` (corresponding to
        `\gamma-1` with `\gamma` the chosen generator of `1+p\ZZ_p`).

        INPUT:

        - ``n`` -- ## mm TODO

        - ``prec`` -- (default 5) is the precision of the power series

        EXAMPLES::

            sage: E = EllipticCurve('14a2')
            sage: p = 3
            sage: prec = 6
            sage: L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) # long time
            sage: L.series(prec, 4)          # long time
            2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 + O(3^2))*T^3 + O(T^4)

            sage: E = EllipticCurve("15a3")
            sage: L = E.padic_lseries(5,implementation="pollackstevens",precision=15)  # long time
            sage: L.series(10, 3)            # long time
            O(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 + 3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 + 5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)

            sage: E = EllipticCurve("79a1")
            sage: L = E.padic_lseries(2,implementation="pollackstevens",precision=10) # not tested
            sage: L.series(10, 4)  # not tested
            O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)
        """
        p = self.prime()
        M = self.symbol().precision_relative()
        K = pAdicField(p, M)
        R = PowerSeriesRing(K, names='T')
        T = R.gens()[0]
        R.set_default_prec(n)
        return (sum(self[i] * T ** i for i in range(prec))).add_bigoh(prec)
开发者ID:drupel,项目名称:sage,代码行数:40,代码来源:padic_lseries.py


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