Ticket #12173: trac_12173-doctests-v2.patch

File trac_12173-doctests-v2.patch, 10.8 KB (added by jdemeyer, 9 years ago)
  • sage/combinat/q_bernoulli.pyx

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1366200020 -7200
    # Node ID 06a3f2c98282375d37b3816bcd7d65d2afe14af6
    # Parent  c7e8ce34f41d2b4bf38426ac746c587e203c7380
    Doctest fixes
    
    diff --git a/sage/combinat/q_bernoulli.pyx b/sage/combinat/q_bernoulli.pyx
    a b  
    2929        sage: q_bernoulli(0)
    3030        1
    3131        sage: q_bernoulli(1)
    32         1/(-q - 1)
     32        -1/(q + 1)
    3333        sage: q_bernoulli(2)
    3434        q/(q^3 + 2*q^2 + 2*q + 1)
    3535        sage: all(q_bernoulli(i)(q=1)==bernoulli(i) for i in range(12))
  • sage/combinat/sf/jack.py

    diff --git a/sage/combinat/sf/jack.py b/sage/combinat/sf/jack.py
    a b  
    334334
    335335            sage: s = Sym.schur()
    336336            sage: JJ(s([3])) # indirect doctest
    337             ((-t^2+3*t-2)/(-6*t^2-18*t-12))*JackJ[1, 1, 1] + ((2*t-2)/(2*t^2+5*t+2))*JackJ[2, 1] + (1/(2*t^2+3*t+1))*JackJ[3]
     337            ((t^2-3*t+2)/(6*t^2+18*t+12))*JackJ[1, 1, 1] + ((2*t-2)/(2*t^2+5*t+2))*JackJ[2, 1] + (1/(2*t^2+3*t+1))*JackJ[3]
    338338            sage: JJ(s([2,1]))
    339339            ((t-1)/(3*t+6))*JackJ[1, 1, 1] + (1/(t+2))*JackJ[2, 1]
    340340            sage: JJ(s([1,1,1]))
     
    367367            sage: a.scalar(JP([1,1]))
    368368            0
    369369            sage: JP(JQp([2]))                        # todo: missing auto normalization
    370             ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2]
     370            ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
    371371            sage: JP._normalize(JP(JQp([2])))
    372             ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2]
     372            ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
    373373        """
    374374        return JackPolynomials_qp(self)
    375375
     
    572572        0
    573573        sage: s = P.realization_of().s()
    574574        sage: P(Qp([2]))                        # todo: missing auto normalization
    575         ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2]
     575        ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
    576576        sage: P._normalize(P(Qp([2])))
    577         ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2]
     577        ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
    578578    """
    579579    (R, t) = NoneConvention(R, t)
    580580    sage.misc.superseded.deprecation(5457, "Deprecation warning: In the future use SymmetricFunctions(R).jack(t=%s).Qp()"%(t))
     
    943943
    944944            sage: JJ = SymmetricFunctions(FractionField(QQ['t'])).jack().J()
    945945            sage: JJ([1])^2              # indirect doctest
    946             (-t/(-t-1))*JackJ[1, 1] + (1/(t+1))*JackJ[2]
     946            (t/(t+1))*JackJ[1, 1] + (1/(t+1))*JackJ[2]
    947947            sage: JJ([2])^2
    948             (-2*t^2/(-2*t^2-3*t-1))*JackJ[2, 2] + (-4*t/(-3*t^2-4*t-1))*JackJ[3, 1] + ((t+1)/(6*t^2+5*t+1))*JackJ[4]
     948            (2*t^2/(2*t^2+3*t+1))*JackJ[2, 2] + (4*t/(3*t^2+4*t+1))*JackJ[3, 1] + ((t+1)/(6*t^2+5*t+1))*JackJ[4]
    949949            sage: JQ = SymmetricFunctions(FractionField(QQ['t'])).jack().Q()
    950950            sage: JQ([1])^2              # indirect doctest
    951951            JackQ[1, 1] + (2/(t+1))*JackQ[2]
     
    992992
    993993            sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
    994994            sage: Sym.jack().P()[2,2].coproduct() #indirect doctest
    995             JackP[] # JackP[2, 2] + (2/(t+1))*JackP[1] # JackP[2, 1] + ((-8*t-4)/(-t^3-4*t^2-5*t-2))*JackP[1, 1] # JackP[1, 1] + JackP[2] # JackP[2] + (2/(t+1))*JackP[2, 1] # JackP[1] + JackP[2, 2] # JackP[]
     995            JackP[] # JackP[2, 2] + (2/(t+1))*JackP[1] # JackP[2, 1] + ((8*t+4)/(t^3+4*t^2+5*t+2))*JackP[1, 1] # JackP[1, 1] + JackP[2] # JackP[2] + (2/(t+1))*JackP[2, 1] # JackP[1] + JackP[2, 2] # JackP[]
    996996        """
    997997        from sage.categories.tensor import tensor
    998998        s = self.realization_of().schur()
     
    11121112            sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
    11131113            sage: JP._m_cache(2)
    11141114            sage: l(JP._self_to_m_cache[2])
    1115             [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], -2/(-t - 1)), ([2], 1)])]
     1115            [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], 2/(t + 1)), ([2], 1)])]
    11161116            sage: l(JP._m_to_self_cache[2])
    1117             [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], 2/(-t - 1)), ([2], 1)])]
     1117            [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], -2/(t + 1)), ([2], 1)])]
    11181118            sage: JP._m_cache(3)
    11191119            sage: l(JP._m_to_self_cache[3])
    11201120            [([1, 1, 1], [([1, 1, 1], 1)]),
    11211121             ([2, 1], [([1, 1, 1], -6/(t + 2)), ([2, 1], 1)]),
    1122              ([3], [([1, 1, 1], -6/(-t^2 - 3*t - 2)), ([2, 1], -3/(2*t + 1)), ([3], 1)])]
     1122             ([3], [([1, 1, 1], 6/(t^2 + 3*t + 2)), ([2, 1], -3/(2*t + 1)), ([3], 1)])]
    11231123            sage: l(JP._self_to_m_cache[3])
    11241124            [([1, 1, 1], [([1, 1, 1], 1)]),
    11251125             ([2, 1], [([1, 1, 1], 6/(t + 2)), ([2, 1], 1)]),
    1126              ([3], [([1, 1, 1], -6/(-2*t^2 - 3*t - 1)), ([2, 1], 3/(2*t + 1)), ([3], 1)])]
     1126             ([3], [([1, 1, 1], 6/(2*t^2 + 3*t + 1)), ([2, 1], 3/(2*t + 1)), ([3], 1)])]
    11271127        """
    11281128        if n in self._self_to_m_cache:
    11291129            return
     
    11901190            sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
    11911191            sage: m = JP.symmetric_function_ring().m()
    11921192            sage: JP([1])^2 # indirect doctest
    1193             (-2*t/(-t-1))*JackP[1, 1] + JackP[2]
     1193            (2*t/(t+1))*JackP[1, 1] + JackP[2]
    11941194            sage: m(_)
    11951195            2*m[1, 1] + m[2]
    11961196            sage: JP = SymmetricFunctions(QQ).jack(t=2).P()
     
    13901390            sage: JQp = SymmetricFunctions(FractionField(QQ['t'])).jack().Qp()
    13911391            sage: h = JQp.symmetric_function_ring().h()
    13921392            sage: JQp([1])^2 # indirect doctest
    1393             JackQp[1, 1] + (-2/(-t-1))*JackQp[2]
     1393            JackQp[1, 1] + (2/(t+1))*JackQp[2]
    13941394            sage: h(_)
    13951395            h[1, 1]
    13961396            sage: JQp = SymmetricFunctions(QQ).jack(t=2).Qp()
     
    14191419            sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
    14201420            sage: JQp._h_cache(2)
    14211421            sage: l(JQp._self_to_h_cache[2])
    1422             [([1, 1], [([1, 1], 1), ([2], 2/(-t - 1))]), ([2], [([2], 1)])]
     1422            [([1, 1], [([1, 1], 1), ([2], -2/(t + 1))]), ([2], [([2], 1)])]
    14231423            sage: l(JQp._h_to_self_cache[2])
    1424             [([1, 1], [([1, 1], 1), ([2], -2/(-t - 1))]), ([2], [([2], 1)])]
     1424            [([1, 1], [([1, 1], 1), ([2], 2/(t + 1))]), ([2], [([2], 1)])]
    14251425            sage: JQp._h_cache(3)
    14261426            sage: l(JQp._h_to_self_cache[3])
    1427             [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 6/(t + 2)), ([3], -6/(-2*t^2 - 3*t - 1))]), ([2, 1], [([2, 1], 1), ([3], 3/(2*t + 1))]), ([3], [([3], 1)])]
     1427            [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 6/(t + 2)), ([3], 6/(2*t^2 + 3*t + 1))]), ([2, 1], [([2, 1], 1), ([3], 3/(2*t + 1))]), ([3], [([3], 1)])]
    14281428            sage: l(JQp._self_to_h_cache[3])
    1429             [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -6/(t + 2)), ([3], -6/(-t^2 - 3*t - 2))]), ([2, 1], [([2, 1], 1), ([3], -3/(2*t + 1))]), ([3], [([3], 1)])]
     1429            [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -6/(t + 2)), ([3], 6/(t^2 + 3*t + 2))]), ([2, 1], [([2, 1], 1), ([3], -3/(2*t + 1))]), ([3], [([3], 1)])]
    14301430        """
    14311431        if n in self._self_to_h_cache:
    14321432            return
     
    15201520            sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
    15211521            sage: JQp = Sym.jack().Qp()
    15221522            sage: JQp[2,2].coproduct()   #indirect doctest
    1523             JackQp[] # JackQp[2, 2] + (2*t/(t+1))*JackQp[1] # JackQp[2, 1] + JackQp[1, 1] # JackQp[1, 1] + ((-4*t^3-8*t^2)/(-2*t^3-5*t^2-4*t-1))*JackQp[2] # JackQp[2] + (2*t/(t+1))*JackQp[2, 1] # JackQp[1] + JackQp[2, 2] # JackQp[]
     1523            JackQp[] # JackQp[2, 2] + (2*t/(t+1))*JackQp[1] # JackQp[2, 1] + JackQp[1, 1] # JackQp[1, 1] + ((4*t^3+8*t^2)/(2*t^3+5*t^2+4*t+1))*JackQp[2] # JackQp[2] + (2*t/(t+1))*JackQp[2, 1] # JackQp[1] + JackQp[2, 2] # JackQp[]
    15241524        """
    15251525        h = elt.parent().realization_of().h()
    15261526        parent = elt.parent()
  • sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py

    diff --git a/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py b/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py
    a b  
    407407
    408408        EXAMPLES::
    409409
    410         sage: K = Qp(13,7)
    411         sage: R.<t> = K[]
    412         sage: a = 13^7*t^3 + K(169,4)*t - 13^4
    413         sage: a[1]
    414         13^2 + O(13^4)
    415         sage: a[1:2]
    416         (13^2 + O(13^4))*t
     410            sage: K = Qp(13,7)
     411            sage: R.<t> = K[]
     412            sage: a = 13^7*t^3 + K(169,4)*t - 13^4
     413            sage: a[1]
     414            13^2 + O(13^4)
     415            sage: a[1:2]
     416            (13^2 + O(13^4))*t
    417417        """
    418418        if isinstance(n, slice):
    419419            start, stop = n.start, n.stop
  • sage/rings/polynomial/polynomial_zmod_flint.pyx

    diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pyx b/sage/rings/polynomial/polynomial_zmod_flint.pyx
    a b  
    497497        EXAMPLES::
    498498
    499499            sage: P.<a>=GF(7)[]
    500             sage: a = P(range(10)); b = P(range(5, 15))
    501             sage: a._mul_trunc_opposite(b, 10)
     500            sage: b = P(range(10)); c = P(range(5, 15))
     501            sage: (b._mul_trunc_opposite(c, 10))[10:18]
    502502            5*a^17 + 2*a^16 + 6*a^15 + 4*a^14 + 4*a^13 + 5*a^10
    503             sage: a._mul_trunc_opposite(b, 18)
     503            sage: (b._mul_trunc_opposite(c, 18))[18:]
    504504            0
    505505
    506506        TESTS::
  • sage/schemes/elliptic_curves/ell_padic_field.py

    diff --git a/sage/schemes/elliptic_curves/ell_padic_field.py b/sage/schemes/elliptic_curves/ell_padic_field.py
    a b  
    3939    def __init__(self, x, y=None):
    4040        """
    4141        Constructor from [a1,a2,a3,a4,a6] or [a4,a6].
     42
    4243        EXAMPLES::
    4344
    4445            sage: Qp=pAdicField(17)
     
    7273        Returns the Frobenius as a function on the group of points of
    7374        this elliptic curve.
    7475
    75         EXAMPLE:
     76        EXAMPLE::
     77
    7678            sage: Qp=pAdicField(13)
    7779            sage: E=EllipticCurve(Qp,[1,1])
    7880            sage: type(E.frobenius())
     
    8789            K = self.base_field()
    8890            p = K.prime()
    8991            x = PolynomialRing(K, 'x').gen(0)
    90            
     92
    9193            a1, a2, a3, a4, a6 = self.a_invariants()
    9294            if a1 != 0 or a2 != 0:
    9395                raise NotImplementedError, "Curve must be in weierstrass normal form."
    94            
     96
    9597            f = x*x*x + a2*x*x + a4*x + a6
    9698            h = (f(x**p) - f**p)
    9799
     
    105107                if (yres-y0).valuation() == 0:
    106108                    yres=-yres
    107109                return self.point([xres,yres, K(1)])
    108                
     110
    109111            self._frob = _frob
    110            
     112
    111113        if P is None:
    112114            return _frob
    113115        else:
    114             return _frob(P)       
     116            return _frob(P)