Ticket #10710: trac_10710.patch

File trac_10710.patch, 5.4 KB (added by AlexGhitza, 10 years ago)
  • sage/modular/modform/ambient.py

    # HG changeset patch
    # User Alexandru Ghitza <aghitza@alum.mit.edu>
    # Date 1296277062 28800
    # Node ID fd6b46847c592b816d0ddb42013783d951dfded3
    # Parent  063ffd2a1aa7c0aaf2f7548513dc8ee546a0a108
    #10710: doc fixes for modular symbols
    
    diff -r 063ffd2a1aa7 -r fd6b46847c59 sage/modular/modform/ambient.py
    a b  
    397397        self.__module = free_module.VectorSpace(self.base_ring(), d)
    398398        return self.__module
    399399
    400     def free_module(self): return self.module()
    401     # stupid thing: there are functions in classes ModularFormsSpace and
    402     # HeckeModule that both do much the same thing, and one has to override
    403     # both of them!
     400    # free_module -- stupid thing: there are functions in classes
     401    # ModularFormsSpace and HeckeModule that both do much the same
     402    # thing, and one has to override both of them!
     403    def free_module(self):
     404        """
     405        Return the free module underlying this space of modular forms.
     406
     407        EXAMPLES::
     408
     409            sage: ModularForms(37).free_module()
     410            Vector space of dimension 3 over Rational Field
     411        """
     412        return self.module()
    404413
    405414    def prec(self, new_prec=None):
    406415        """
  • sage/modular/modsym/ambient.py

    diff -r 063ffd2a1aa7 -r fd6b46847c59 sage/modular/modsym/ambient.py
    a b  
    9292import sage.structure.formal_sum as formal_sum
    9393import sage.categories.all as cat
    9494from sage.modular.cusps import Cusp
    95 from sage.rings.arith import binomial
    9695import sage.structure.all
    9796
    9897import boundary
  • sage/modular/modsym/apply.pyx

    diff -r 063ffd2a1aa7 -r fd6b46847c59 sage/modular/modsym/apply.pyx
    a b  
    2323
    2424cdef class Apply:
    2525    def __cinit__(self):
     26        """
     27        EXAMPLES::
     28
     29            sage: import sage.modular.modsym.apply
     30            sage: sage.modular.modsym.apply.Apply()
     31            <sage.modular.modsym.apply.Apply object at ...>
     32        """
    2633        fmpz_poly_init(self.f)
    2734        fmpz_poly_init(self.g)
    2835        fmpz_poly_init(self.ff)
     
    5764cdef Apply A = Apply()       
    5865
    5966def apply_to_monomial(int i, int j, int a, int b, int c, int d):
    60     """
     67    r"""
    6168    Returns a list of the coefficients of
    62     $$
    63              (aX + bY)^i (cX + dY)^{j-i},
    64     $$
    65     where $0 \leq i \leq j$, and $a,b,c,d$ are integers.
    6669
    67     One should think of $j$ as being $k-2$ for the application to
     70    .. math::
     71
     72        (aX + bY)^i (cX + dY)^{j-i},
     73       
     74    where `0 \leq i \leq j`, and `a`, `b`, `c`, `d` are integers.
     75
     76    One should think of `j` as being `k-2` for the application to
    6877    modular symbols.
    6978   
    7079    INPUT:
     
    7281       
    7382    OUTPUT:
    7483        list of ints, which are the coefficients
    75         of $Y^j$, $Y^{j-1}*X$, \ldots, $X^j$, respectively.
     84        of `Y^j, Y^{j-1}X, \ldots, X^j`, respectively.
    7685       
    7786    EXAMPLE:
    78     We compute that $(X+Y)^2(X-Y) = X^3 + X^2Y - XY^2 - Y^3$.
     87
     88    We compute that `(X+Y)^2(X-Y) = X^3 + X^2Y - XY^2 - Y^3`::
     89
    7990        sage: from sage.modular.modsym.manin_symbols import apply_to_monomial
    8091        sage: apply_to_monomial(2, 3, 1,1,1,-1)
    8192        [-1, -1, 1, 1]
  • sage/modular/modsym/relation_matrix.py

    diff -r 063ffd2a1aa7 -r fd6b46847c59 sage/modular/modsym/relation_matrix.py
    a b  
    510510        sage: sparse_2term_quotient(rels, n, QQ)
    511511        [(3, -1/3), (3, -1), (3, -1), (3, 1), (5, 1), (5, 1)]
    512512    """
    513    
    514513    if not isinstance(rels, set):
    515514        raise TypeError, "rels must be a set"
    516515    n = int(n)
    517     #if not isinstance(n, int):
    518     #    raise TypeError, "n must be an int"
    519516    if not isinstance(F, rings.Ring):
    520517        raise TypeError, "F must be a ring."
    521518   
    522     tm = misc.verbose()
     519    tm = misc.verbose("Starting sparse 2-term quotient...")
    523520    free = range(n)
    524521    ONE = F(1)
    525522    ZERO = F(0)
     
    528525    for v0, v1 in rels:
    529526        c0 = coef[v0[0]] * F(v0[1])
    530527        c1 = coef[v1[0]] * F(v1[1])
    531         # Mod out by the relation
    532         #    c1*x_free[t[0]] + c2*x_free[t[1]] = 0.
     528
     529        # Mod out by the following relation:
     530        #
     531        #    c0*free[v0[0]] + c1*free[v1[0]] = 0.
     532        #
    533533        die = None
    534534        if c0 == ZERO and c1 == ZERO:
    535535            pass
    536         elif c0 == ZERO and c1 != ZERO:  # free[t[1]] --> 0
     536        elif c0 == ZERO and c1 != ZERO:  # free[v1[0]] --> 0
    537537            die = free[v1[0]]
    538538        elif c1 == ZERO and c0 != ZERO:
    539539            die = free[v0[0]]
    540540        elif free[v0[0]] == free[v1[0]]:
    541             if c0+c1 != 0:
    542                 # all xi equal to free[t[0]] must now equal to zero.
     541            if c0 + c1 != 0:
     542                # all xi equal to free[v0[0]] must now equal to zero.
    543543                die = free[v0[0]]
    544544        else:  # x1 = -c1/c0 * x2.
    545545            x = free[v0[0]]
     
    550550                coef[i] *= coef[x]
    551551                related_to_me[free[v1[0]]].append(i)
    552552            related_to_me[free[v1[0]]].append(x)
    553         if die != None:
     553        if die is not None:
    554554            for i in related_to_me[die]:
    555555                free[i] = 0
    556556                coef[i] = ZERO