Ticket #3883: sage_trac_3883c.patch

File sage_trac_3883c.patch, 4.9 kB (added by wuthrich, 4 months ago)

small changes to be applied after the previous two patches.

  • a/sage/schemes/elliptic_curves/ell_generic.py

    old new  
    18291829#         self.__divpoly2[m] = f 
    18301830#         return f 
    18311831 
    1832     def multiple_x_numerator(self, n, x=None, cache=None): 
     1832    def _multiple_x_numerator(self, n, x=None, cache=None): 
    18331833         r""" 
    18341834         Returns the numerator of the x-coordinate of the nth multiple of 
    18351835         a point, using torsion polynomials (division polynomials). 
     
    18391839         The result is adjusted to be correct for both even and odd n. 
    18401840 
    18411841         WARNING: -- There may of course be cancellation between the 
    1842          numerator and the denominator (multiple_x_denominator()). Be 
    1843          careful. For more information on how to avoid cancellation, 
    1844          see Chris Wuthrich's thesis
     1842         numerator and the denominator (_multiple_x_denominator()). Be 
     1843         careful. E.g. if a point on an elliptic curve with coefficients in 
     1844         ZZ reduces to a singular point modulo a prime, then there will be cancellation, otherwise not, see Chris Wuthrich ``p-adic heights in families of elliptic curves''
    18451845 
    18461846         SEE ALSO: 
    1847            -- multiple_x_denominator() 
     1847           -- _multiple_x_denominator() 
    18481848 
    18491849         AUTHORS: 
    18501850            -- David Harvey (2006-09-24) 
     
    18561856 
    18571857           sage: (35*P)[0] 
    18581858           -804287518035141565236193151/1063198259901027900600665796 
    1859            sage: E.multiple_x_numerator(35, x) 
     1859           sage: E._multiple_x_numerator(35, x) 
    18601860           -804287518035141565236193151 
    1861            sage: E.multiple_x_denominator(35, x) 
     1861           sage: E._multiple_x_denominator(35, x) 
    18621862           1063198259901027900600665796 
    18631863 
    18641864           sage: (36*P)[0] 
    18651865           54202648602164057575419038802/15402543997324146892198790401 
    1866            sage: E.multiple_x_numerator(36, x) 
     1866           sage: E._multiple_x_numerator(36, x) 
    18671867           54202648602164057575419038802 
    1868            sage: E.multiple_x_denominator(36, x) 
     1868           sage: E._multiple_x_denominator(36, x) 
    18691869           15402543997324146892198790401 
    18701870 
    18711871         An example where cancellation occurs: 
    18721872           sage: E = EllipticCurve("88a1") 
    18731873           sage: P = E([2,2])   # fixed choice of generator 
    1874            sage: n = E.multiple_x_numerator(11, P[0]); n 
     1874           sage: n = E._multiple_x_numerator(11, P[0]); n 
    18751875           442446784738847563128068650529343492278651453440 
    1876            sage: d = E.multiple_x_denominator(11, P[0]); d 
     1876           sage: d = E._multiple_x_denominator(11, P[0]); d 
    18771877           1427247692705959881058285969449495136382746624 
    18781878           sage: n/d 
    18791879           310 
     
    19021902             return x * cache[n]**2 - cache[-1] * cache[n-1] * cache[n+1] 
    19031903 
    19041904 
    1905     def multiple_x_denominator(self, n, x=None, cache=None): 
     1905    def _multiple_x_denominator(self, n, x=None, cache=None): 
    19061906         r""" 
    19071907         Returns the denominator of the x-coordinate of the nth multiple of 
    19081908         a point, using torsion polynomials (division polynomials). 
     
    19121912         The result is adjusted to be correct for both even and odd n. 
    19131913 
    19141914         SEE ALSO: 
    1915            -- multiple_x_numerator() 
     1915           -- _multiple_x_numerator() 
    19161916 
    19171917         TODO: the numerator and denominator versions share a calculation, 
    19181918         namely squaring $\psi_n$. Maybe would be good to offer a combined 
    19191919         version to make this more efficient. 
    19201920 
    19211921         EXAMPLES: 
    1922             -- see multiple_x_numerator() 
     1922            -- see _multiple_x_numerator() 
    19231923 
    19241924         AUTHORS: 
    19251925            -- David Harvey (2006-09-24) 
     
    20362036        # the x-coordonate does not depend on the sign of m.  The work 
    20372037        # here is done by functions defined earlier: 
    20382038 
    2039         mx = self.multiple_x_numerator(m.abs(),x) / self.multiple_x_denominator(m.abs(),x) 
     2039        mx = self._multiple_x_numerator(m.abs(),x) / self._multiple_x_denominator(m.abs(),x) 
    20402040 
    20412041        if x_only: 
    20422042            # Return it if the optional parameter x_only is set. 
  • a/sage/schemes/elliptic_curves/ell_point.py

    old new  
    592592            g = E.division_polynomial(m) 
    593593        else: 
    594594            # The poly g here is 0 at x(Q) iff x(m*Q) = x(P). 
    595             g = E.multiple_x_numerator(m) - P[0]*E.multiple_x_denominator(m) 
     595            g = E._multiple_x_numerator(m) - P[0]*E._multiple_x_denominator(m) 
    596596 
    597597            # When 2*P=0, then -Q is a solution iff Q is.  For even m, 
    598598            # no 2-torsion point is a solution, so that g is the