# 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 sage: q_bernoulli(0) 1 sage: q_bernoulli(1) 1/(-q - 1) -1/(q + 1) sage: q_bernoulli(2) q/(q^3 + 2*q^2 + 2*q + 1) 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 sage: s = Sym.schur() sage: JJ(s([3])) # indirect doctest ((-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] ((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] sage: JJ(s([2,1])) ((t-1)/(3*t+6))*JackJ[1, 1, 1] + (1/(t+2))*JackJ[2, 1] sage: JJ(s([1,1,1])) sage: a.scalar(JP([1,1])) 0 sage: JP(JQp([2]))                        # todo: missing auto normalization ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2] ((t-1)/(t+1))*JackP[1, 1] + JackP[2] sage: JP._normalize(JP(JQp([2]))) ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2] ((t-1)/(t+1))*JackP[1, 1] + JackP[2] """ return JackPolynomials_qp(self) 0 sage: s = P.realization_of().s() sage: P(Qp([2]))                        # todo: missing auto normalization ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2] ((t-1)/(t+1))*JackP[1, 1] + JackP[2] sage: P._normalize(P(Qp([2]))) ((-t+1)/(-t-1))*JackP[1, 1] + JackP[2] ((t-1)/(t+1))*JackP[1, 1] + JackP[2] """ (R, t) = NoneConvention(R, t) sage.misc.superseded.deprecation(5457, "Deprecation warning: In the future use SymmetricFunctions(R).jack(t=%s).Qp()"%(t)) sage: JJ = SymmetricFunctions(FractionField(QQ['t'])).jack().J() sage: JJ([1])^2              # indirect doctest (-t/(-t-1))*JackJ[1, 1] + (1/(t+1))*JackJ[2] (t/(t+1))*JackJ[1, 1] + (1/(t+1))*JackJ[2] sage: JJ([2])^2 (-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] (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] sage: JQ = SymmetricFunctions(FractionField(QQ['t'])).jack().Q() sage: JQ([1])^2              # indirect doctest JackQ[1, 1] + (2/(t+1))*JackQ[2] sage: Sym = SymmetricFunctions(QQ['t'].fraction_field()) sage: Sym.jack().P()[2,2].coproduct() #indirect doctest 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[] 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[] """ from sage.categories.tensor import tensor s = self.realization_of().schur() sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: JP._m_cache(2) sage: l(JP._self_to_m_cache[2]) [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], -2/(-t - 1)), ([2], 1)])] [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], 2/(t + 1)), ([2], 1)])] sage: l(JP._m_to_self_cache[2]) [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], 2/(-t - 1)), ([2], 1)])] [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], -2/(t + 1)), ([2], 1)])] sage: JP._m_cache(3) sage: l(JP._m_to_self_cache[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], -6/(t + 2)), ([2, 1], 1)]), ([3], [([1, 1, 1], -6/(-t^2 - 3*t - 2)), ([2, 1], -3/(2*t + 1)), ([3], 1)])] ([3], [([1, 1, 1], 6/(t^2 + 3*t + 2)), ([2, 1], -3/(2*t + 1)), ([3], 1)])] sage: l(JP._self_to_m_cache[3]) [([1, 1, 1], [([1, 1, 1], 1)]), ([2, 1], [([1, 1, 1], 6/(t + 2)), ([2, 1], 1)]), ([3], [([1, 1, 1], -6/(-2*t^2 - 3*t - 1)), ([2, 1], 3/(2*t + 1)), ([3], 1)])] ([3], [([1, 1, 1], 6/(2*t^2 + 3*t + 1)), ([2, 1], 3/(2*t + 1)), ([3], 1)])] """ if n in self._self_to_m_cache: return sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P() sage: m = JP.symmetric_function_ring().m() sage: JP([1])^2 # indirect doctest (-2*t/(-t-1))*JackP[1, 1] + JackP[2] (2*t/(t+1))*JackP[1, 1] + JackP[2] sage: m(_) 2*m[1, 1] + m[2] sage: JP = SymmetricFunctions(QQ).jack(t=2).P() sage: JQp = SymmetricFunctions(FractionField(QQ['t'])).jack().Qp() sage: h = JQp.symmetric_function_ring().h() sage: JQp([1])^2 # indirect doctest JackQp[1, 1] + (-2/(-t-1))*JackQp[2] JackQp[1, 1] + (2/(t+1))*JackQp[2] sage: h(_) h[1, 1] sage: JQp = SymmetricFunctions(QQ).jack(t=2).Qp() sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())] sage: JQp._h_cache(2) sage: l(JQp._self_to_h_cache[2]) [([1, 1], [([1, 1], 1), ([2], 2/(-t - 1))]), ([2], [([2], 1)])] [([1, 1], [([1, 1], 1), ([2], -2/(t + 1))]), ([2], [([2], 1)])] sage: l(JQp._h_to_self_cache[2]) [([1, 1], [([1, 1], 1), ([2], -2/(-t - 1))]), ([2], [([2], 1)])] [([1, 1], [([1, 1], 1), ([2], 2/(t + 1))]), ([2], [([2], 1)])] sage: JQp._h_cache(3) sage: l(JQp._h_to_self_cache[3]) [([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)])] [([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)])] sage: l(JQp._self_to_h_cache[3]) [([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)])] [([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)])] """ if n in self._self_to_h_cache: return sage: Sym = SymmetricFunctions(QQ['t'].fraction_field()) sage: JQp = Sym.jack().Qp() sage: JQp[2,2].coproduct()   #indirect doctest 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[] 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[] """ h = elt.parent().realization_of().h() parent = elt.parent()
`diff --git a/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py b/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py`
`diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pyx b/sage/rings/polynomial/polynomial_zmod_flint.pyx`
`diff --git a/sage/schemes/elliptic_curves/ell_padic_field.py b/sage/schemes/elliptic_curves/ell_padic_field.py`