Ticket #383: 383-more-fixes.patch

File 383-more-fixes.patch, 4.1 KB (added by robertwb, 11 years ago)
  • sage/crypto/classical.py

    More fixes for #383 changes.
    
    diff -r fd747610d1b9 sage/crypto/classical.py
    a b  
    14681468        N = Integer(self.cipher_domain().ngens())
    14691469        while True:
    14701470            A = M([ randint(0, N-1) for i in range(m**2) ])
    1471             if N.gcd(A.det()) == 1:
     1471            if N.gcd(A.det().lift()) == 1:
    14721472                break
    14731473        return A
    14741474
  • sage/modular/arithgroup/congroup_gamma0.py

    diff -r fd747610d1b9 sage/modular/arithgroup/congroup_gamma0.py
    a b  
    485485        s = []
    486486       
    487487        for d in arith.divisors(N):
    488             w = arith.gcd(d, N/d)
     488            w = arith.gcd(d, N//d)
    489489            if w == 1:
    490490                if d == 1:
    491491                    s.append(Cusp(1,0))
     
    496496            else:
    497497                for a in xrange(1, w):
    498498                    if arith.gcd(a, w) == 1:
    499                         while arith.gcd(a, d/w) != 1:
     499                        while arith.gcd(a, d//w) != 1:
    500500                            a += w
    501501                        s.append(Cusp(a,d))
    502502        return sorted(s)
  • sage/modular/etaproducts.py

    diff -r fd747610d1b9 sage/modular/etaproducts.py
    a b  
    575575            raise TypeError, "Argument (=%s) should be a CuspFamily" % cusp
    576576        if cusp.level() != self.level():
    577577            raise ValueError, "Cusp not on right curve!"
    578         return 1/ZZ(24)/gcd(cusp.width(), self.level()/cusp.width()) * sum( [ell*self.r(ell)/cusp.width() * (gcd(cusp.width(), self.level()/ell))**2  for ell in self._keys] )
     578        return 1/ZZ(24)/gcd(cusp.width(), self.level()//cusp.width()) * sum( [ell*self.r(ell)/cusp.width() * (gcd(cusp.width(), self.level()//ell))**2  for ell in self._keys] )
    579579
    580580    def divisor(self):
    581581        r"""
     
    634634#        else:
    635635#            s = ZZ(1)
    636636#            for ell in divisors(self.level()):
    637 #                s *= 1/ZZ(cusp.width())*gcd(cusp.width(), self.level() / ell)**(self.r(ell) / ZZ(2))
     637#                s *= 1/ZZ(cusp.width())*gcd(cusp.width(), self.level() // ell)**(self.r(ell) / ZZ(2))
    638638#            return s
    639639   
    640640def num_cusps_of_width(N, d):
     
    666666    except AssertionError:
    667667        raise AssertionError, "N and d must be positive integers with d|N"
    668668       
    669     return euler_phi(gcd(d, N/d))
     669    return euler_phi(gcd(d, N//d))
    670670
    671671def AllCusps(N):
    672672    r"""
  • sage/quadratic_forms/quadratic_form__split_local_covering.py

    diff -r fd747610d1b9 sage/quadratic_forms/quadratic_form__split_local_covering.py
    a b  
    326326        ## Check if the (i,0)-entry is divisible by d,
    327327        ## and stretch its row/column if not.
    328328        if Q1[i,0] % d != 0:
    329             Q1 = Q1.multiply_variable(d / GCD(d, Q1[i, 0]/2), i)
     329            Q1 = Q1.multiply_variable(d / GCD(d, Q1[i, 0]//2), i)
    330330
    331331        #print "After scaling at i =", i
    332332        #print Q1
    333333
    334334        ## Now perform the (symmetric) elementary operations to cancel out the (i,0) entries/
    335         Q1 = Q1.add_symmetric(-(Q1[i,0]/2) / (GCD(d, Q1[i,0]/2)), i, 0)
     335        Q1 = Q1.add_symmetric(-(Q1[i,0]/2) / (GCD(d, Q1[i,0]//2)), i, 0)
    336336
    337337        #print "After cancelling at i =", i
    338338        #print Q1
  • sage/structure/element.pyx

    diff -r fd747610d1b9 sage/structure/element.pyx
    a b  
    30183018       
    30193019            sage: from sage.structure.element import NamedBinopMethod
    30203020            sage: g = NamedBinopMethod(gcd)
    3021             sage: g._sage_doc_() == gcd.__doc__
     3021            sage: from sage.misc.sageinspect import sage_getdoc
     3022            sage: sage_getdoc(g) == sage_getdoc(gcd)
    30223023            True
    30233024        """
    30243025        return sageinspect.sage_getdoc(self._func)