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


Python DirichletGroup.modulus方法代码示例

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


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

示例1: AlgebraicWeight

# 需要导入模块: from sage.modular.dirichlet import DirichletGroup [as 别名]
# 或者: from sage.modular.dirichlet.DirichletGroup import modulus [as 别名]

#.........这里部分代码省略.........
            sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)
            sage: kappa.k()
            13
        """
        return self._k

    def chi(self):
        r"""
        If this character is `x \mapsto x^k \chi(x)` for an integer `k` and a
        Dirichlet character `\chi`, return `\chi`.
        
        EXAMPLE::
        
            sage: kappa = pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0^14)
            sage: kappa.chi()
            Dirichlet character modulo 29 of conductor 29 mapping 2 |--> 28 + 28*29 + 28*29^2 + ... + O(29^20)
        """
        return self._chi

    def _repr_(self):
        r"""
        String representation of self.

        EXAMPLES::

            sage: pAdicWeightSpace(17)(2)._repr_()
            '2'
            sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0)._repr_()
            '(2, 17, [-1])'
            sage: pAdicWeightSpace(17)(2, DirichletGroup(17, QQ).0^2)._repr_()
            '2'
        """
        if self._chi.is_trivial():
            return "%s" % self._k
        else:
            return "(%s, %s, %s)" % (self._k, self._chi.modulus(), self._chi._repr_short_())

    def teichmuller_type(self):
        r"""
        Return the Teichmuller type of this weight-character `\kappa`, which is
        the unique `t \in \ZZ/(p-1)\ZZ` such that `\kappa(\mu) =
        \mu^t` for \mu a `(p-1)`-st root of 1.

        For `p = 2` this doesn't make sense, but we still want the Teichmuller
        type to correspond to the index of the component of weight space in
        which `\kappa` lies, so we return 1 if `\kappa` is odd and 0 otherwise.

        EXAMPLE::

            sage: pAdicWeightSpace(11)(2, DirichletGroup(11,QQ).0).teichmuller_type()
            7
            sage: pAdicWeightSpace(29)(13, DirichletGroup(29, Qp(29)).0).teichmuller_type()
            14
            sage: pAdicWeightSpace(2)(3, DirichletGroup(4,QQ).0).teichmuller_type()
            0
        """
        # Special case p == 2
        if self._p == 2:
            if self.is_even():
                return IntegerModRing(2)(0)
            else:
                return IntegerModRing(2)(1)
        m = IntegerModRing(self._p).multiplicative_generator()
        x = [y for y in IntegerModRing(self._chi.modulus()) if y == m and y**(self._p - 1) == 1]
        if len(x) != 1: raise ArithmeticError
        x = x[0]
        f = IntegerModRing(self._p)(self._chi(x)).log(m)
        return IntegerModRing(self._p - 1)(self._k + f)

    def Lvalue(self):
        r"""
        Return the value of the p-adic L-function of `\QQ` evaluated at
        this weight-character. If the character is `x \mapsto x^k \chi(x)`
        where `k > 0` and `\chi` has conductor a power of `p`, this is an
        element of the number field generated by the values of `\chi`, equal to
        the value of the complex L-function `L(1-k, \chi)`. If `\chi` is
        trivial, it is equal to `(1 - p^{k-1})\zeta(1-k)`.

        At present this is not implemented in any other cases, except the
        trivial character (for which the value is `\infty`).

        TODO: Implement this more generally using the Amice transform machinery
        in sage/schemes/elliptic_curves/padic_lseries.py, which should clearly
        be factored out into a separate class.

        EXAMPLES::

            sage: pAdicWeightSpace(7)(4).Lvalue() == (1 - 7^3)*zeta__exact(-3)
            True
            sage: pAdicWeightSpace(7)(5, DirichletGroup(7, Qp(7)).0^4).Lvalue()
            0
            sage: pAdicWeightSpace(7)(6, DirichletGroup(7, Qp(7)).0^4).Lvalue()
            1 + 2*7 + 7^2 + 3*7^3 + 3*7^5 + 4*7^6 + 2*7^7 + 5*7^8 + 2*7^9 + 3*7^10 + 6*7^11 + 2*7^12 + 3*7^13 + 5*7^14 + 6*7^15 + 5*7^16 + 3*7^17 + 6*7^18 + O(7^19)
        """
        if self._k > 0:
            return -self._chi.bernoulli(self._k)/self._k
        if self.is_trivial():
            return Infinity
        else:
            raise NotImplementedError, "Don't know how to compute value of this L-function"
开发者ID:bgxcpku,项目名称:sagelib,代码行数:104,代码来源:weightspace.py

示例2: dimension_of_ordinary_subspace

# 需要导入模块: from sage.modular.dirichlet import DirichletGroup [as 别名]
# 或者: from sage.modular.dirichlet.DirichletGroup import modulus [as 别名]
 def dimension_of_ordinary_subspace(self, p=None, cusp=False):
     """
     If ``cusp`` is ``True``, return dimension of cuspidal ordinary
     subspace. This does a weight 2 computation with sage's ModularSymbols.
     
     EXAMPLES::
     
         sage: M = OverconvergentModularSymbols(11, 0, sign=-1, p=3, prec_cap=4, base=ZpCA(3, 8))
         sage: M.dimension_of_ordinary_subspace()
         2
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         2
         sage: M = OverconvergentModularSymbols(11, 0, sign=1, p=3, prec_cap=4, base=ZpCA(3, 8))
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         2
         sage: M.dimension_of_ordinary_subspace()
         4
         sage: M = OverconvergentModularSymbols(11, 0, sign=0, p=3, prec_cap=4, base=ZpCA(3, 8))
         sage: M.dimension_of_ordinary_subspace()
         6
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         4
         sage: M = OverconvergentModularSymbols(11, 0, sign=1, p=11, prec_cap=4, base=ZpCA(11, 8))
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         1
         sage: M.dimension_of_ordinary_subspace()
         2
         sage: M = OverconvergentModularSymbols(11, 2, sign=1, p=11, prec_cap=4, base=ZpCA(11, 8))
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         0
         sage: M.dimension_of_ordinary_subspace()
         1
         sage: M = OverconvergentModularSymbols(11, 10, sign=1, p=11, prec_cap=4, base=ZpCA(11, 8))
         sage: M.dimension_of_ordinary_subspace(cusp=True)
         1
         sage: M.dimension_of_ordinary_subspace()
         2
     
     An example with odd weight and hence non-trivial character::
     
         sage: K = Qp(11, 6)
         sage: DG = DirichletGroup(11, K)
         sage: chi = DG([K(378703)])
         sage: MM = FamiliesOfOMS(chi, 1, p=11, prec_cap=[4, 4], base_coeffs=ZpCA(11, 4), sign=-1)
         sage: MM.dimension_of_ordinary_subspace()
         1
     """
     try:
         p = self.prime()
     except AttributeError:
         if p is None:
             raise ValueError("If self doesn't have a prime, must specify p.")
     try:
         return self._ord_dim_dict[(p, cusp)]
     except AttributeError:
         self._ord_dim_dict = {}
     except KeyError:
         pass
     from sage.modular.dirichlet import DirichletGroup
     from sage.rings.finite_rings.constructor import GF
     try:
         chi = self.character()
     except AttributeError:
         chi = DirichletGroup(self.level(), GF(p))[0]
     if chi is None:
         chi = DirichletGroup(self.level(), GF(p))[0]
     
     from sage.modular.modsym.modsym import ModularSymbols
     r = self.weight() % (p-1)
     if chi.is_trivial():
         N = chi.modulus()
         if N % p != 0:
             N *= p
         else:
             e = N.valuation(p)
             N.divide_knowing_divisible_by(p ** (e-1))
         chi = DirichletGroup(N, GF(p))[0]
     elif chi.modulus() % p != 0:
         chi = DirichletGroup(chi.modulus() * p, GF(p))(chi)
     DG = DirichletGroup(chi.modulus(), GF(p))
     if r == 0:
         from sage.modular.arithgroup.congroup_gamma0 import Gamma0_constructor as Gamma0
         verbose("in dim: %s, %s, %s"%(self.sign(), chi, p))
         M = ModularSymbols(DG(chi), 2, self.sign(), GF(p))
     else:
         psi = [GF(p)(u) ** r for u in DG.unit_gens()]    #mod p Teichmuller^r
         psi = DG(psi)
         M = ModularSymbols(DG(chi) * psi, 2, self.sign(), GF(p))
     if cusp:
         M = M.cuspidal_subspace()
     hecke_poly = M.hecke_polynomial(p)
     verbose("in dim: %s"%(hecke_poly))
     x = hecke_poly.parent().gen()
     d = hecke_poly.degree() - hecke_poly.ord(x)
     self._ord_dim_dict[(p, cusp)] = d
     return d
开发者ID:lalitkumarj,项目名称:OMSCategory,代码行数:98,代码来源:modsym_space.py


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