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


Python PowerSeriesRing.base_ring方法代码示例

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


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

示例1: JFSeriesConstructor

# 需要导入模块: from sage.rings.all import PowerSeriesRing [as 别名]
# 或者: from sage.rings.all.PowerSeriesRing import base_ring [as 别名]

#.........这里部分代码省略.........
        #returns coefficient c(d,r) p^r q^d of i q^(-1/8) theta1; s = shift = i q^{-1/8}
        k = r - QQ(1/2)
        if k in ZZ and 2*d == (k**2+k):
            return (-1)**k
        else:
            return 0
    @cached_method
    def _cseta(self, m):
        #returns coefficient q^m of q^{1/24} eta^{-1}
        if m < 0: return 0
        return Partitions(m).cardinality()
    @cached_method
    def _cseta3(self, m):
        #returns coeffcient q^m of q^{1/8} eta^{-3}
        if m < 0: return 0
        return PartitionTuples(3,m).cardinality()
    @cached_method
    def _cK(self, d, r):
        #K = i theta_1 / \eta^3 = stheta*seta3
        #return coefficient c(d,r) p^r q^d
        ## Since Jacobi form coffs satisfy r^2 < 4mn. theta1 coffs satisfy r^2 < 2 n. Here n = d + 1/8 so zero except for r^2 <= 2d + 1/4.
        if d < 0: return 0
        return sum( self._cseta3(d - a)*self._cstheta(a,r) for a in range(0,d+1) )
    @cached_method
    def _cK2(self, d, r):
        ## theta1^2 satisfy 4^2 < 4 n. n = d + 1/4, we get c(d,r) non-zero for r^2 <= 4d + 1.
        if d < 0: return 0
        coff = 0
        for a in range(0,d+1):
            L = sqrt(2*a + QQ(1/4)).round()
            #print "a,L", a, L
            coff += sum( self._cK(d - a,r-QQ(b/2))*self._cK(a,QQ(b/2))  for b in range(-2*L,2*L+1) if is_odd(b) )
        return coff
    @cached_method
    def _cWP(self, d, r):
        #\wp(z) & = \frac{1}{12} + \frac{p}{(1-p)^2} + \sum_{k,r \geq 1} k (p^k - 2 + p^{-k}) q^{kr}
        if d < 0: return 0
        if d == 0:
            if r < 0: return 0
            elif r == 0: return QQ(1/12)
            else: return r
        if d > 0:
            if r == 0: return -2*sigma(d,1)
            elif d % r == 0:
              return abs(r)
            else:
              return 0
    @cached_method
    def _cZ(self, d, r):
        #elliptic genus 24*K**2*wp
        if d < 0: return 0
        coff = 0
        for a in range(0,d + 1):
            L = sqrt(4*a + 1).round()
            coff += sum( 24*self._cWP(d - a,r-b)*self._cK2(a,b)  for b in range(-L,L+1) )
        return coff


    @cached_method
    def K(self):
        q = self._series_ring.gen()
        p = self._series_ring.base_ring().gen()

        def min_rcoeff(d):
            #TODO
            return -10
        def max_rcoeff(d):
            #TODO
            return 10

        return sum([sum([self._cK(d,r)*p**r for r in range(min_rcoeff(d), max_rcoeff(d) + 1)])*q**d for d in range(self.prec())])

    @cached_method
    def wp(self):
        q = self._series_ring.gen()
        p = self._series_ring.base_ring().gen()

        def min_rcoeff(d):
            #TODO
            return -10
        def max_rcoeff(d):
            #TODO
            return 10

        return sum([sum([self._cWP(d,r)*p**r for r in range(min_rcoeff(d), max_rcoeff(d) + 1)])*q**d for d in range(self.prec())])

    #TODO
    @cached_method
    def J1(self):
        q = self._series_ring.gen()
        p = self._series_ring.base_ring().gen()

        def min_rcoeff(d):
            #TODO
            return -10
        def max_rcoeff(d):
            #TODO
            return 10

        return sum([sum([self._cK(d,r)*p**r for r in range(min_rcoeff(d), max_rcoeff(d) + 1)])*q**d for d in range(self.prec())])
开发者ID:jjermann,项目名称:jacobi_forms,代码行数:104,代码来源:series_constructor.py


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