Ticket #9467: 14329.patch

File 14329.patch, 8.5 KB (added by jen, 12 years ago)
  • sage/modular/abvar/abvar.py

    # HG changeset patch
    # User Jen Balakrishnan <jen@math.mit.edu>
    # Date 1278706571 25200
    # Node ID 9e6c9dd499ff08c036f04a17639e166084c04c6b
    # Parent  12b029c403261077dca4fae35c5f3291b1be1fdd
    Trac #9467: p-adic l-series associated to modular Jacobians
    
    A first attempt at merging the p-adic L-series code from Sage Days 22
    
    diff -r 12b029c40326 -r 9e6c9dd499ff sage/modular/abvar/abvar.py
    a b  
    4949
    5050import homology
    5151import homspace
    52 import lseries
     52#import lseries
     53import padics
    5354
    5455def is_ModularAbelianVariety(x):
    5556    """
     
    21272128        self.__lseries = lseries.Lseries_complex(self)
    21282129        return self.__lseries
    21292130
    2130     def padic_lseries(self, p):
    2131         """
    2132         Return the `p`-adic `L`-series of this modular
    2133         abelian variety.
    2134        
    2135         EXAMPLES::
    2136        
    2137             sage: A = J0(37)
    2138             sage: A.padic_lseries(7)
    2139             7-adic L-series attached to Abelian variety J0(37) of dimension 2
    2140         """
    2141         p = int(p)
    2142         try:
    2143             return self.__lseries_padic[p]
    2144         except AttributeError:
    2145             self.__lseries_padic = {}
    2146         except KeyError:
    2147             pass
    2148         self.__lseries_padic[p] = lseries.Lseries_padic(self, p)
    2149         return self.__lseries_padic[p]
     2131    padic_lseries = padics.padic_lseries
     2132
     2133#    def padic_lseries(self, p):
     2134#        """
     2135#        Return the `p`-adic `L`-series of this modular
     2136#        abelian variety.
     2137#       
     2138#        EXAMPLES::
     2139#       
     2140#            sage: A = J0(37)
     2141#            sage: A.padic_lseries(7)
     2142#            7-adic L-series attached to Abelian variety J0(37) of dimension 2
     2143#        """
     2144#        p = int(p)
     2145#        try:
     2146#            return self.__lseries_padic[p]
     2147#        except AttributeError:
     2148#            self.__lseries_padic = {}
     2149#        except KeyError:
     2150#            pass
     2151#        self.__lseries_padic[p] = lseries.Lseries_padic(self, p)
     2152#        self.__lseries_padic[p] = lseries.pAdicLseries(self,p)
     2153#        return self.__lseries_padic[p]
    21502154
    21512155    ###############################################################################
    21522156    # Hecke Operators
     
    29732977            else:
    29742978                # The hard case -- now we have to pull back the
    29752979                # factorization
    2976 
     2980               
    29772981                # Suppose $B$ is an abelian variety and there is a
    29782982                # finite degree map $B\to J$, where $J$ is an ambient
    29792983                # Jacobian.  Suppose further that we find abelian
  • sage/modular/abvar/lseries.py

    diff -r 12b029c40326 -r 9e6c9dd499ff sage/modular/abvar/lseries.py
    a b  
    152152        raise NotImplementedError       
    153153
    154154
    155 class Lseries_padic(Lseries):
    156     """
    157     A `p`-adic `L`-series attached to a modular abelian variety.
    158     """
    159     def __init__(self, abvar, p):
    160         """
    161         Create a `p`-adic `L`-series.
     155#class pAdicLseries(SageObject):
     156#    """
     157#    A `p`-adic `L`-series attached to a modular abelian variety.
     158#    """
     159#    def __init__(self, abvar, p):
     160#        """
     161#        Create a `p`-adic `L`-series.
     162#
     163#        EXAMPLES::
     164#
     165#            sage: J0(37)[0].padic_lseries(389)
     166#            389-adic L-series attached to Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37)
     167#        """
     168#        Lseries.__init__(self, abvar)
     169#        p = Integer(p)
     170#        if not p.is_prime():
     171#            raise ValueError, "p (=%s) must be prime"%p
     172#        self.__p = p
     173#
     174#    def __cmp__(self, other):
     175#        """
     176#        Compare this `p`-adic `L`-series to another one.
     177#
     178#        First the abelian varieties are compared; if they are the same,
     179#        then the primes are compared.
     180#
     181#        INPUT:
     182#            other -- object
     183#
     184#        OUTPUT:
     185#            -1, 0, or 1
     186#
     187#        EXAMPLES::
     188#
     189#            sage: L = J0(37)[0].padic_lseries(5); M = J0(37)[1].padic_lseries(5)
     190#            sage: K = J0(37)[0].padic_lseries(3)
     191#            sage: cmp(L,K)
     192#            1
     193#            sage: cmp(K,L)
     194#            -1
     195#            sage: K < L
     196#            True
     197#            sage: cmp(L,M)
     198#            -1
     199#            sage: cmp(M,L)
     200#            1
     201#            sage: cmp(L,L)
     202#            0
     203#        """
     204#        if not isinstance(other, pAdicLseries):
     205#            return cmp(type(self), type(other))
     206#        return cmp((self.abelian_variety(), self.__p),
     207#                   (other.abelian_variety(), other.__p))
    162208
    163         EXAMPLES::
     209#    def prime(self):
     210#        """
     211#        Return the prime `p` of this `p`-adic `L`-series.
     212#
     213#        EXAMPLES::
     214#
     215#            sage: J0(11).padic_lseries(7).prime()
     216#            7
     217#        """
     218#        return self.__p
     219   
     220#    def _repr_(self):
     221#        """
     222#        String representation of this `p`-adic `L`-series.
     223#
     224#        EXAMPLES::
     225#
     226#            sage: L = J0(37)[0].padic_lseries(5)
     227#            sage: L._repr_()
     228#            '5-adic L-series attached to Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37)'
     229#        """
     230#        return "%s-adic L-series attached to %s"%(self.__p, self.abelian_variety())
    164231
    165             sage: J0(37)[0].padic_lseries(389)
    166             389-adic L-series attached to Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37)
    167         """
    168         Lseries.__init__(self, abvar)
    169         p = Integer(p)
    170         if not p.is_prime():
    171             raise ValueError, "p (=%s) must be prime"%p
    172         self.__p = p
    173 
    174     def __cmp__(self, other):
    175         """
    176         Compare this `p`-adic `L`-series to another one.
    177 
    178         First the abelian varieties are compared; if they are the same,
    179         then the primes are compared.
    180 
    181         INPUT:
    182             other -- object
    183 
    184         OUTPUT:
    185             -1, 0, or 1
    186 
    187         EXAMPLES::
    188 
    189             sage: L = J0(37)[0].padic_lseries(5); M = J0(37)[1].padic_lseries(5)
    190             sage: K = J0(37)[0].padic_lseries(3)
    191             sage: cmp(L,K)
    192             1
    193             sage: cmp(K,L)
    194             -1
    195             sage: K < L
    196             True
    197             sage: cmp(L,M)
    198             -1
    199             sage: cmp(M,L)
    200             1
    201             sage: cmp(L,L)
    202             0
    203         """
    204         if not isinstance(other, Lseries_padic):
    205             return cmp(type(self), type(other))
    206         return cmp((self.abelian_variety(), self.__p),
    207                    (other.abelian_variety(), other.__p))
    208 
    209     def prime(self):
    210         """
    211         Return the prime `p` of this `p`-adic `L`-series.
    212 
    213         EXAMPLES::
    214 
    215             sage: J0(11).padic_lseries(7).prime()
    216             7
    217         """
    218         return self.__p
    219    
    220     def power_series(self, n=2, prec=5):
    221         """
    222         Return the `n`-th approximation to this `p`-adic `L`-series as
    223         a power series in `T`.  Each coefficient is a `p`-adic number
    224         whose precision is provably correct.
    225 
    226         NOTE: This is not yet implemented.
    227 
    228         EXAMPLES::
    229 
    230             sage: L = J0(37)[0].padic_lseries(5)
    231             sage: L.power_series()
    232             Traceback (most recent call last):
    233             ...
    234             NotImplementedError
    235             sage: L.power_series(3,7)
    236             Traceback (most recent call last):
    237             ...
    238             NotImplementedError
    239         """
    240         raise NotImplementedError
    241 
    242     def _repr_(self):
    243         """
    244         String representation of this `p`-adic `L`-series.
    245 
    246         EXAMPLES::
    247 
    248             sage: L = J0(37)[0].padic_lseries(5)
    249             sage: L._repr_()
    250             '5-adic L-series attached to Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37)'
    251         """
    252         return "%s-adic L-series attached to %s"%(self.__p, self.abelian_variety())
    253 
  • sage/schemes/elliptic_curves/ell_rational_field.py

    diff -r 12b029c40326 -r 9e6c9dd499ff sage/schemes/elliptic_curves/ell_rational_field.py
    a b  
    12751275        return M
    12761276
    12771277    padic_lseries = padics.padic_lseries
    1278 
     1278   
    12791279    def newform(self):
    12801280        r"""
    12811281        Same as ``self.modular_form()``.
     
    49954995    #################################################################################       
    49964996    # p-adic functions
    49974997    #################################################################################
    4998 
     4998   
    49994999    padic_regulator = padics.padic_regulator
    50005000
    50015001    padic_height_pairing_matrix = padics.padic_height_pairing_matrix