Ticket #11372: trac_11372.patch

File trac_11372.patch, 1.8 KB (added by was, 10 years ago)
  • sage/schemes/elliptic_curves/ell_rational_field.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1332186971 25200
    # Node ID 4b2e3bbb3d50908012cbe0387c03d2339a722a6d
    # Parent  9d29db850bbe5eb0c2dde55877b6d32203d6c116
    Trac #11372: nasty side effect of a failed simon_two_descent search
    
    diff --git a/sage/schemes/elliptic_curves/ell_rational_field.py b/sage/schemes/elliptic_curves/ell_rational_field.py
    a b  
    14881488            sage: E.gens()
    14891489            [(-73 : -394 : 1), (323/4 : 1891/8 : 1)]
    14901490
    1491         """
     1491        Example from Trac #11372::
     1492
     1493            sage: E = EllipticCurve([1, 1, 0, -23611790086, 1396491910863060])
     1494            sage: E.simon_two_descent()
     1495            (1, 2, [(88716 : -44358 : 1)])
     1496            sage: E.rank()
     1497            1
     1498            sage: E.gens()
     1499            [(4311692542083/48594841 : -13035144436525227/338754636611 : 1)]           
     1500        """
     1501        verbose = int(verbose)
    14921502        t = simon_two_descent(self, verbose=verbose, lim1=lim1, lim3=lim3, limtriv=limtriv,
    14931503                              maxprob=maxprob, limbigprime=limbigprime)
    14941504        if t=='fail':
     
    15031513                print "Rank determined successfully, saturating..."
    15041514            gens = [P for P in gens_mod_two if P.has_infinite_order()]
    15051515            gens = self.saturation(gens)[0]
    1506             self.__gens[True] = gens
    1507             self.__gens[True].sort()
    1508             self.__rank[True] = len(self.__gens[True])
     1516            if len(gens) == rank_low_bd:
     1517                self.__gens[True] = gens
     1518                self.__gens[True].sort()
     1519            self.__rank[True] = rank_low_bd
    15091520        return rank_low_bd, two_selmer_rank, gens_mod_two
    15101521
    15111522    two_descent_simon = simon_two_descent