# Ticket #12415: 12415_doctest_fixes.patch

File 12415_doctest_fixes.patch, 116.2 KB (added by jdemeyer, 9 years ago)

Doctest changes that are needed to account for differences in the new framework

• ## doc/de/tutorial/interfaces.rst

# HG changeset patch
# User David Roe <roed.math@gmail.com>
# Date 1340304029 14400
# Node ID 6f6ae25e6100024053d477fbaa189f415422c1cf
# Parent  2f84f74b73289ac2bc694898450a49c3695a2409
Chang various doctests to account for differences between the new framework and the old.

diff --git a/doc/de/tutorial/interfaces.rst b/doc/de/tutorial/interfaces.rst
 a //                  : names    x y //        block   2 : ordering C sage: f = singular('9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + \ ...  9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - \ ...  9*x^12*y^3 - 18*x^13*y^2 + 9*x^16') ....: 9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - \ ....: 9*x^12*y^3 - 18*x^13*y^2 + 9*x^16') Wir haben also das Polynom :math:f definiert, nun geben wir es aus und faktorisieren es. :: sage: x, y = QQ['x, y'].gens() sage: f = 9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + 9*x^6*y^4\ ...   + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3\ ...  - 18*x^13*y^2 + 9*x^16 sage: f = 9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + 9*x^6*y^4 \ ....: + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3 \ ....: - 18*x^13*y^2 + 9*x^16 sage: factor(f) (9) * (-x^5 + y^2)^2 * (x^6 - 2*x^3*y^2 - x^2*y^3 + y^4) :: sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ ...   '[plot_format,openmath]') # not tested sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested ....: '[plot_format,openmath]') Ein "live" 3D-Plot, den man mit der Maus bewegen kann: :: sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested ....: '[plot_format, openmath]') sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested ....: "[grid, 50, 50]",'[plot_format, openmath]') Der nächste Plot ist das berühmte Möbiusband: :: sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested ....: "[x, -4, 4]", "[y, -4, 4]", ....: '[plot_format, openmath]') Und der letzte ist die berühmte Kleinsche Flasche: :: sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\ ...   - 10.0") sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0") 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested ....: "[y, -%pi, %pi]", "['grid, 40, 40]", ....: '[plot_format, openmath]')
• ## doc/de/tutorial/programming.rst

diff --git a/doc/de/tutorial/programming.rst b/doc/de/tutorial/programming.rst
 a :: >>> for i in range(5): print(i) ...     print(i) ... 0 1 2 :: sage: for i in range(5): ...       print(i)  # now hit enter twice ....:     print(i)  # now hit enter twice ....: 0 1 2
• ## doc/en/bordeaux_2008/elliptic_curves.rst

diff --git a/doc/en/bordeaux_2008/elliptic_curves.rst b/doc/en/bordeaux_2008/elliptic_curves.rst
 a :: sage: L.zeros(10) ***   Warning: new stack size = ... [0.000000000, 0.000000000, 2.87609907, 4.41689608, 5.79340263, 6.98596665, 7.47490750, 8.63320525, 9.63307880, 10.3514333]
• ## doc/en/constructions/plotting.rst

diff --git a/doc/en/constructions/plotting.rst b/doc/en/constructions/plotting.rst
 a :: sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]',\ ...   '[plot_format,openmath]')  # optional -- pops up a window. sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]', # optional -- pops up a window. ....: '[plot_format,openmath]') (Mac OS X users: Note that these openmath commands were run in a session of started in an xterm shell, not using the standard Mac :: sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]",\ ...   '[plot_format, openmath]') #optional sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]", # optional ....: '[plot_format, openmath]') By rotating this suitably, you can view the contour plot.
• ## doc/en/developer/coding_in_other.rst

diff --git a/doc/en/developer/coding_in_other.rst b/doc/en/developer/coding_in_other.rst
 a parsed and converted if possible to a corresponding Sage/Python object. .. skip :: def cartan_matrix(type, rank): -2   # 64-bit [2]: 0    # 32-bit -1   # 64-bit 1    # 64-bit [3]: 1 ... L. Python has some very useful string manipulation commands to do just that. .. skip :: def points_parser(string_points,F): Singular and Sage unless d=1. So, for this reason, we restrict ourselves to points of degree one. .. skip :: def places_on_curve(f,F): EXAMPLES: sage: F=GF(5) sage: R=MPolynomialRing(F,2,names=["x","y"]) sage: R=PolynomialRing(F,2,names=["x","y"]) sage: x,y=R.gens() sage: f=y^2-x^9-x sage: places_on_curve(f,F) sage: singular.set_ring(R) sage: L = singular.new('POINTS') Note that these elements of L are defined modulo 5 in Singular, and they compare differently than you would expect from their print representation: .. link :: sage: [(L[i][1], L[i][2], L[i][3]) for i in range(1,7)] [(0, 1, 0), (2, 2, 1), (0, 0, 1), (-2, -1, 1), (-2, 1, 1), (2, -2, 1)]  # 32-bit [(0, 1, 0), (-2, 1, 1), (-2, -1, 1), (2, 2, 1), (0, 0, 1), (2, -2, 1)]  # 64-bit sage: sorted([(L[i][1], L[i][2], L[i][3]) for i in range(1,7)]) [(0, 0, 1), (0, 1, 0), (2, 2, 1), (2, -2, 1), (-2, 1, 1), (-2, -1, 1)] Next, we implement the general function (for brevity we omit the docstring, which is the same as above). Note that the point_parser
• ## doc/en/developer/coding_in_python.rst

diff --git a/doc/en/developer/coding_in_python.rst b/doc/en/developer/coding_in_python.rst
 a An example template for a _latex_ method follows: .. skip :: class X: sage: pi pi sage: float(pi) sage: float(pi) # rel tol 1e-10 3.1415926535897931 """ ...
• ## doc/en/developer/conventions.rst

diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
 a therefore whom to contact if they have questions). Use the following template when documenting functions. Note the indentation:: indentation: .. skip :: def point(self, x=1, y=2): r""" sage: U, S, V = A.SVD() sage: (U.transpose()*U-identity_matrix(8)).norm(p=2)    # abs tol 1e-10 0.0 The 8-th cyclotomic field is generated by the complex number e^\frac{i\pi}{4}.  Here we compute a numerical approximation:: sage: K. = CyclotomicField(8) sage: N(zeta8)                             # absolute tolerance 1e-10 0.7071067812 + 0.7071067812*I The "tolerance" feature checks for floating-point literals, which may occur anywhere in the doctest output, for example as polynomial coefficients:: sage: y = polygen(RDF, 'y') sage: p = (y - 10^10) * (y - 1); p y^2 - 10000000001.0*y + 10000000000.0 sage: p                           # rel tol 1e-9 y^2 - 1e10*y + 1e10 -  If a line contains todo: not implemented, it is never tested. It is good to include lines like this to make clear what we want Sage to eventually implement: A relative tolerance on a root of a polynomial.  Notice that the root should normally print as 1e+16, or something similar. However, the tolerance testing causes the doctest framework to use the output in a *computation*, so other valid text representations of the predicted value may be used.  However, they must fit the pattern defined by the regular expression float_regex in :mod:sage.doctest.parsing. :: sage: factor(x*y - x*z)    # todo: not implemented sage: y = polygen(RDF, 'y') sage: p = (y - 10^16)*(y-10^(-13))*(y-2); p y^3 - 1e+16*y^2 + 2e+16*y - 2000.0 sage: p.roots(multiplicities=False)[2]     # relative tol 1e-10 10000000000000000 -  If a line contains not implemented, it is never tested. It is good to include lines like this to make clear what we want Sage to eventually implement:: sage: factor(x*y - x*z)    # todo: not implemented It is also immediately clear to the user that the indicated example does not currently work.
• ## doc/en/developer/doctesting.rst

diff --git a/doc/en/developer/doctesting.rst b/doc/en/developer/doctesting.rst
 a .. nodoctest .. _chapter-doctesting: ===========================
• ## doc/en/developer/sagenb/development_workflow.rst

diff --git a/doc/en/developer/sagenb/development_workflow.rst b/doc/en/developer/sagenb/development_workflow.rst
 a #   (use "git add ..." to update what will be committed) #   (use "git checkout -- ..." to discard changes in working directory) # #  modified:   README #  modified:   README # # Untracked files: #   (use "git add ..." to include in what will be committed) # #  INSTALL #  INSTALL no changes added to commit (use "git add" and/or "git commit -a") #. Check what the actual changes are with git diff (git diff_).
• ## doc/en/developer/sagenb/set_up_fork.rst

diff --git a/doc/en/developer/sagenb/set_up_fork.rst b/doc/en/developer/sagenb/set_up_fork.rst
 a Just for your own satisfaction, show yourself that you now have a new 'remote', with git remote -v show, giving you something like:: upstream     git://github.com/sagemath/sagenb.git (fetch) upstream     git://github.com/sagemath/sagenb.git (push) origin       git@github.com:your-user-name/sagenb.git (fetch) origin       git@github.com:your-user-name/sagenb.git (push) upstream     git://github.com/sagemath/sagenb.git (fetch) upstream     git://github.com/sagemath/sagenb.git (push) origin       git@github.com:your-user-name/sagenb.git (fetch) origin       git@github.com:your-user-name/sagenb.git (push) .. include:: links.inc
• ## doc/en/thematic_tutorials/lie/branching_rules.rst

diff --git a/doc/en/thematic_tutorials/lie/branching_rules.rst b/doc/en/thematic_tutorials/lie/branching_rules.rst
 a D4(0,0,0,1) By contrast, rule="automorphic" simply interchanges the two spin representations, as it always does in Type D:: spin representations, as it always does in Type D: .. link:
• ## doc/en/thematic_tutorials/lie/weyl_character_ring.rst

diff --git a/doc/en/thematic_tutorials/lie/weyl_character_ring.rst b/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
 a irreducibles, each with multiplicity one. The highest weights that appear here are available (with their coefficients) through the usual free module accessors:: coefficients) through the usual free module accessors: .. link So far we have been working with n=3. For general n:: sage: def f(n,k): ...      R = WeylCharacterRing(['A',n-1]) ...      tr = R(R.fundamental_weights()[1]) ...      return sum(d^2 for d in (tr^k).coefficients()) ... sage: [f(n,5) for n in [2..7]] ....:     R = WeylCharacterRing(['A',n-1]) ....:     tr = R(R.fundamental_weights()[1]) ....:     return sum(d^2 for d in (tr^k).coefficients()) ....: sage: [f(n,5) for n in [2..7]] # long time [42, 103, 119, 120, 120, 120] We see that the 10-th moment of tr(g) is just 5! when n is sufficiently sage: [f(2,k) for k in [1..10]] [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] sage: [catalan_number(k) for k in [1..k]] sage: [catalan_number(k) for k in [1..10]] [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] sage: [f(2,k) for k in [1..10]] [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] sage: [catalan_number(k) for k in [1..k]] sage: [catalan_number(k) for k in [1..10]] [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] [1, 0, 0, 1, 0, 1, 0] If we want the multiplicity of some other representation, we may obtain that using the method multiplicity:: obtain that using the method multiplicity: .. link
• ## doc/en/tutorial/interfaces.rst

diff --git a/doc/en/tutorial/interfaces.rst b/doc/en/tutorial/interfaces.rst
 a Finally, we give an example of using Sage to plot using openmath. Many of these were modified from the Maxima reference manual. A 2D plot of several functions (do not type the ...): A 2D plot of several functions (do not type the ...):: :: sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ ...   '[plot_format,openmath]') # not tested sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',  # not tested ....:     '[plot_format,openmath]') A "live" 3D plot which you can move with your mouse (do not type the ...): the ...):: :: sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",  # not tested ....:     '[plot_format, openmath]') sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",  # not tested ....:     "[grid, 50, 50]",'[plot_format, openmath]') sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested The next plot is the famous Möbius strip (do not type the ...):: The next plot is the famous Möbius strip (do not type the ...): sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]",  # not tested ....:     "[x, -4, 4]", "[y, -4, 4]", '[plot_format, openmath]') :: The next plot is the famous Klein bottle (do not type the ...):: sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ ...   '[plot_format, openmath]') # not tested The next plot is the famous Klein bottle (do not type the ...): :: sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\ ...   - 10.0") sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0") 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",  # not tested ....:     "[y, -%pi, %pi]", "['grid, 40, 40]", '[plot_format, openmath]')
• ## doc/en/tutorial/programming.rst

diff --git a/doc/en/tutorial/programming.rst b/doc/en/tutorial/programming.rst
 a :: >>> for i in range(5): print(i) ...     print(i) ... 0 1 2 :: sage: for i in range(5): ...       print(i)  # now hit enter twice ....:     print(i)  # now hit enter twice ....: 0 1 2 :: sage: for i in range(15): ...       if gcd(i,15) == 1: ...           print(i) ....:     if gcd(i,15) == 1: ....:         print(i) ....: 1 2 4
• ## doc/fr/tutorial/interfaces.rst

diff --git a/doc/fr/tutorial/interfaces.rst b/doc/fr/tutorial/interfaces.rst
 a :: sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ ...   '[plot_format,openmath]') # not tested sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested ....: '[plot_format,openmath]') Un graphique 3D interactif, que vous pouvez déplacer à la souris (n'entrez pas les ...) : :: sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested ....: '[plot_format, openmath]') sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested ....: "[grid, 50, 50]",'[plot_format, openmath]') Le célèbre ruban de Möbius (n'entrez pas les ...) : :: sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested ....: "[x, -4, 4]", "[y, -4, 4]", ....: '[plot_format, openmath]') Et la fameuse bouteille de Klein (n'entrez pas les ...): -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested ....: "[y, -%pi, %pi]", "['grid, 40, 40]", ....: '[plot_format, openmath]')
• ## doc/fr/tutorial/programming.rst

diff --git a/doc/fr/tutorial/programming.rst b/doc/fr/tutorial/programming.rst
 a :: >>> for i in range(5): print(i) ...     print(i) ... 0 1 2 :: sage: for i in range(5): ...       print(i)  # appuyez deux fois sur entrée ici ....:     print(i)  # appuyez deux fois sur entrée ici 0 1 2
• ## doc/ru/tutorial/interfaces.rst

diff --git a/doc/ru/tutorial/interfaces.rst b/doc/ru/tutorial/interfaces.rst
 a :: sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ ...   '[plot_format,openmath]') # not tested sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested ...   '[plot_format,openmath]') "Живой" трехмерный график, который вы можете вращать мышкой (не вводите ...): :: sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested ...   '[plot_format, openmath]') sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested ...   "[grid, 50, 50]",'[plot_format, openmath]') Следующий график — это знаменитая Лента Мёбиуса (не вводите ...): :: sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested ....: "[x, -4, 4]", "[y, -4, 4]", ....: '[plot_format, openmath]') Следующий график — это знаменитая Бутылка Клейна (не вводите ...): -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\ ...   '[plot_format, openmath]') # not tested sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested ...   "[y, -%pi, %pi]", "['grid, 40, 40]", ...   '[plot_format, openmath]')
• ## doc/ru/tutorial/programming.rst

diff --git a/doc/ru/tutorial/programming.rst b/doc/ru/tutorial/programming.rst
 a :: >>> for i in range(5): print(i) ...     print(i) ... 0 1 2 :: sage: for i in range(5): ...       print(i)  # нажмите Enter дважды ....:     print(i)  # нажмите Enter дважды ....: 0 1 2
• ## sage/all.py

diff --git a/sage/all.py b/sage/all.py
 a sage: import inspect sage: from sage import * sage: frames=[x for x in gc.get_objects() if inspect.isframe(x)] sage: len(frames) 11 We exclude the known files and check to see that there are no others:: sage: import os sage: allowed = [os.path.join("lib","python","threading.py")] sage: allowed.append(os.path.join("lib","python","multiprocessing")) sage: allowed.append(os.path.join("sage","doctest")) sage: allowed.append(os.path.join("local","bin","sage-runtests")) sage: allowed.append(os.path.join("site-packages","IPython")) sage: allowed.append(os.path.join("local","bin","sage-ipython")) sage: allowed.append("") sage: allowed.append("") sage: allowed.append(os.path.join("sage","combinat","species","generating_series.py")) sage: for i in frames: ....:     filename, lineno, funcname, linelist, indx = inspect.getframeinfo(i) ....:     for nm in allowed: ....:         if nm in filename: ....:             break ....:     else: ....:         print filename ....: """ ###############################################################################
• ## sage/calculus/calculus.py

diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
 a sage: sefms("x # 3") == SR(x != 3) True sage: solve([x != 5], x) #0: solve_rat_ineq(ineq=x # 5) [[x - 5 != 0]] sage: solve([2*x==3, x != 5], x) [[x == (3/2), (-7/2) != 0]]
• ## sage/calculus/test_sympy.py

diff --git a/sage/calculus/test_sympy.py b/sage/calculus/test_sympy.py
 a # -*- coding: utf-8 -*- r""" A Sample Session using SymPy sage: f = e.series(x, 0, 10); f 1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10) And the pretty-printer:: And the pretty-printer.  Since unicode characters aren't working on some archictures, we disable it:: sage: from sympy.printing import pprint_use_unicode sage: prev_use = pprint_use_unicode(False) sage: pprint(e) 1 ------- 3 cos (x) 1 ------- 3 cos (x) sage: pprint(f) 2       4        6         8 3*x    11*x    241*x    8651*x 1 + ---- + ----- + ------ + ------- + O(x**10) 2       8      240      13440 2       4        6         8 3*x    11*x    241*x    8651*x 1 + ---- + ----- + ------ + ------- + O(x**10) 2       8      240      13440 sage: pprint_use_unicode(prev_use) False And the functionality to convert from sympy format to Sage format::
• ## sage/categories/groups.py

diff --git a/sage/categories/groups.py b/sage/categories/groups.py
 a return [Monoids()] def example(self): from sage.rings.rational_field import QQ from sage.groups.matrix_gps.general_linear import GL """ EXAMPLES:: sage: Groups().example() General Linear Group of degree 4 over Rational Field """ from sage.rings.rational_field import QQ from sage.groups.matrix_gps.general_linear import GL return GL(4,QQ) class ParentMethods: def group_generators(self): from sage.sets.family import Family """ Returns group generators for self. sage: A.group_generators() Family ((2,3,4), (1,2,3)) """ from sage.sets.family import Family return Family(self.gens()) def _test_inverse(self, **options):
• ## sage/categories/semigroups.py

diff --git a/sage/categories/semigroups.py b/sage/categories/semigroups.py
 a @cached_method def algebra_generators(self): from sage.sets.family import Family r""" The generators of this algebra, as per :meth:Algebras.ParentMethods.algebra_generators() sage: A.algebra_generators() Finite family {0: B['a'], 1: B['b'], 2: B['c'], 3: B['d']} """ from sage.sets.family import Family return self.basis().keys().semigroup_generators().map(self.monomial) def product_on_basis(self, g1, g2):
• ## sage/categories/sets_cat.py

diff --git a/sage/categories/sets_cat.py b/sage/categories/sets_cat.py
 a """ return self._realizations facade_for = realizations """ Returns the parents self is a facade for, that is the realizations of self def facade_for(self): """ Returns the parents self is a facade for, that is the realizations of self EXAMPLES:: EXAMPLES:: sage: A = Sets().WithRealizations().example(); A The subset algebra of {1, 2, 3} over Rational Field sage: A.facade_for() [The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis, The subset algebra of {1, 2, 3} over Rational Field in the In basis, The subset algebra of {1, 2, 3} over Rational Field in the Out basis] sage: A = Sets().WithRealizations().example(); A The subset algebra of {1, 2, 3} over Rational Field sage: A.facade_for() [The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis, The subset algebra of {1, 2, 3} over Rational Field in the In basis, The subset algebra of {1, 2, 3} over Rational Field in the Out basis] sage: A = Sets().WithRealizations().example(); A The subset algebra of {1, 2, 3} over Rational Field sage: f = A.F().an_element(); f F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}] sage: i = A.In().an_element(); i In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}] sage: o = A.Out().an_element(); o Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}] sage: f in A, i in A, o in A (True, True, True) """ sage: A = Sets().WithRealizations().example(); A The subset algebra of {1, 2, 3} over Rational Field sage: f = A.F().an_element(); f F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}] sage: i = A.In().an_element(); i In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}] sage: o = A.Out().an_element(); o Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}] sage: f in A, i in A, o in A (True, True, True) """ return self.realizations() # Do we really want this feature? class Realizations(Category_realization_of_parent):
• ## sage/combinat/crystals/direct_sum.py

diff --git a/sage/combinat/crystals/direct_sum.py b/sage/combinat/crystals/direct_sum.py
 a (0, 1) sage: b.weight() (1, 0, 0) """ r""" The following is required, because :class:DirectSumOfCrystals takes the same arguments as :class:DisjointUnionEnumeratedSets (which see for details).
• ## sage/combinat/free_module.py

diff --git a/sage/combinat/free_module.py b/sage/combinat/free_module.py
 a sage: F.print_options(monomial_cmp = lambda x,y: -cmp(x,y)) sage: f._sorted_items_for_printing() [('c', 2), ('b', 3), ('a', 1)] sage: F.print_options(monomial_cmp=cmp) #reset to original state .. seealso:: :meth:_repr_, :meth:_latex_, :meth:print_options """ sage: F4.prefix() 'F' sage: F2.print_options(prefix='F') #reset for following doctests The default category is the category of modules with basis over the base ring:: Customizing print and LaTeX representations of elements:: sage: F = CombinatorialFreeModule(QQ, ['a','b'], prefix='x') sage: original_print_options = F.print_options() sage: e = F.basis() sage: e['a'] - 3 * e['b'] x['a'] - 3*x['b'] sage: tensor([f, g]) 2*x[1] # y[3] + x[1] # y[4] + 4*x[2] # y[3] + 2*x[2] # y[4] sage: F.print_options(**original_print_options) # reset print options """ @staticmethod sage: sorted(F.print_options().items()) [('bracket', '('), ('latex_bracket', False), ('latex_prefix', None), ('latex_scalar_mult', None), ('monomial_cmp', ), ('prefix', 'x'), ('scalar_mult', '*'), ('tensor_symbol', None)] sage: F.print_options(bracket='[') # reset """ # don't just use kwds.get(...) because I want to distinguish # between an argument like "option=None" and the option not F['a'] + 2*F['b'] sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="") sage: original_print_options = QS3.print_options() sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1]) sage: a                      # indirect doctest 2*[[1, 2, 3]] + 4*[[3, 2, 1]] sage: a              # indirect doctest 2 *@* |[1, 2, 3]| + 4 *@* |[3, 2, 1]| sage: QS3.print_options(**original_print_options) # reset TESTS:: sage: F = CombinatorialFreeModule(QQ, [('a', 'b'), ('c','d')]) C_{a} + 2C_{b} sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="", scalar_mult="*") sage: original_print_options = QS3.print_options() sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1]) sage: latex(a)                     # indirect doctest 2[1, 2, 3] + 4[3, 2, 1] sage: QS3.print_options(latex_bracket=('\\myleftbracket', '\\myrightbracket')) sage: latex(a)                     # indirect doctest 2\myleftbracket[1, 2, 3]\myrightbracket + 4\myleftbracket[3, 2, 1]\myrightbracket sage: QS3.print_options(**original_print_options) # reset TESTS::
• ## sage/combinat/partition_algebra.py

diff --git a/sage/combinat/partition_algebra.py b/sage/combinat/partition_algebra.py
 a #A_k# ##### SetPartitionsAk = functools.partial(create_set_partition_function,"A") SetPartitionsAk.__doc__ = """ Returns the combinatorial class of set partitions of type A_k. SetPartitionsAk.__doc__ = ( """ Returns the combinatorial class of set partitions of type A_k. EXAMPLES:: EXAMPLES:: sage: A3 = SetPartitionsAk(3); A3 Set partitions of {1, ..., 3, -1, ..., -3} sage: A3 = SetPartitionsAk(3); A3 Set partitions of {1, ..., 3, -1, ..., -3} sage: A3.first() #random {{1, 2, 3, -1, -3, -2}} sage: A3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: A3.random_element()  #random {{1, 3, -3, -1}, {2, -2}} sage: A3.first() #random {{1, 2, 3, -1, -3, -2}} sage: A3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: A3.random_element()  #random {{1, 3, -3, -1}, {2, -2}} sage: A3.cardinality() 203 sage: A3.cardinality() 203 sage: A2p5 = SetPartitionsAk(2.5); A2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block sage: A2p5.cardinality() 52 sage: A2p5 = SetPartitionsAk(2.5); A2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block sage: A2p5.cardinality() 52 sage: A2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: A2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: A2p5.random_element() #random {{-1}, {-2}, {3, -3}, {1, 2}} """ sage: A2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: A2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: A2p5.random_element() #random {{-1}, {-2}, {3, -3}, {1, 2}} """) class SetPartitionsAk_k(set_partition.SetPartitions_set): def __init__(self, k): #S_k# ##### SetPartitionsSk = functools.partial(create_set_partition_function,"S") SetPartitionsSk.__doc__ = """ Returns the combinatorial class of set partitions of type S_k.  There is a bijection between these set partitions and the permutations of 1, ..., k. SetPartitionsSk.__doc__ = ( """ Returns the combinatorial class of set partitions of type S_k.  There is a bijection between these set partitions and the permutations of 1, ..., k. EXAMPLES:: EXAMPLES:: sage: S3 = SetPartitionsSk(3); S3 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3 sage: S3.cardinality() 6 sage: S3 = SetPartitionsSk(3); S3 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3 sage: S3.cardinality() 6 sage: S3.list()  #random [{{2, -2}, {3, -3}, {1, -1}}, {{1, -1}, {2, -3}, {3, -2}}, {{2, -1}, {3, -3}, {1, -2}}, {{1, -2}, {2, -3}, {3, -1}}, {{1, -3}, {2, -1}, {3, -2}}, {{1, -3}, {2, -2}, {3, -1}}] sage: S3.first() #random {{2, -2}, {3, -3}, {1, -1}} sage: S3.last() #random {{1, -3}, {2, -2}, {3, -1}} sage: S3.random_element() #random {{1, -3}, {2, -1}, {3, -2}} sage: S3.list()  #random [{{2, -2}, {3, -3}, {1, -1}}, {{1, -1}, {2, -3}, {3, -2}}, {{2, -1}, {3, -3}, {1, -2}}, {{1, -2}, {2, -3}, {3, -1}}, {{1, -3}, {2, -1}, {3, -2}}, {{1, -3}, {2, -2}, {3, -1}}] sage: S3.first() #random {{2, -2}, {3, -3}, {1, -1}} sage: S3.last() #random {{1, -3}, {2, -2}, {3, -1}} sage: S3.random_element() #random {{1, -3}, {2, -1}, {3, -2}} sage: S3p5 = SetPartitionsSk(3.5); S3p5 Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4 sage: S3p5.cardinality() 6 sage: S3p5 = SetPartitionsSk(3.5); S3p5 Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4 sage: S3p5.cardinality() 6 sage: S3p5.list() #random [{{2, -2}, {3, -3}, {1, -1}, {4, -4}}, {{2, -3}, {1, -1}, {4, -4}, {3, -2}}, {{2, -1}, {3, -3}, {1, -2}, {4, -4}}, {{2, -3}, {1, -2}, {4, -4}, {3, -1}}, {{1, -3}, {2, -1}, {4, -4}, {3, -2}}, {{1, -3}, {2, -2}, {4, -4}, {3, -1}}] sage: S3p5.first() #random {{2, -2}, {3, -3}, {1, -1}, {4, -4}} sage: S3p5.last() #random {{1, -3}, {2, -2}, {4, -4}, {3, -1}} sage: S3p5.random_element() #random {{1, -3}, {2, -2}, {4, -4}, {3, -1}} """ sage: S3p5.list() #random [{{2, -2}, {3, -3}, {1, -1}, {4, -4}}, {{2, -3}, {1, -1}, {4, -4}, {3, -2}}, {{2, -1}, {3, -3}, {1, -2}, {4, -4}}, {{2, -3}, {1, -2}, {4, -4}, {3, -1}}, {{1, -3}, {2, -1}, {4, -4}, {3, -2}}, {{1, -3}, {2, -2}, {4, -4}, {3, -1}}] sage: S3p5.first() #random {{2, -2}, {3, -3}, {1, -1}, {4, -4}} sage: S3p5.last() #random {{1, -3}, {2, -2}, {4, -4}, {3, -1}} sage: S3p5.random_element() #random {{1, -3}, {2, -2}, {4, -4}, {3, -1}} """) class SetPartitionsSk_k(SetPartitionsAk_k): def __repr__(self): """ #I_k# ##### SetPartitionsIk = functools.partial(create_set_partition_function,"I") SetPartitionsIk.__doc__ = """ Returns the combinatorial class of set partitions of type I_k.  These are set partitions with a propagating number of less than k.  Note that the identity set partition {{1, -1}, ..., {k, -k}} is not in I_k. SetPartitionsIk.__doc__ = ( """ Returns the combinatorial class of set partitions of type I_k.  These are set partitions with a propagating number of less than k.  Note that the identity set partition {{1, -1}, ..., {k, -k}} is not in I_k. EXAMPLES:: EXAMPLES:: sage: I3 = SetPartitionsIk(3); I3 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3 sage: I3.cardinality() 197 sage: I3 = SetPartitionsIk(3); I3 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3 sage: I3.cardinality() 197 sage: I3.first() #random {{1, 2, 3, -1, -3, -2}} sage: I3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: I3.random_element() #random {{-1}, {-3, -2}, {2, 3}, {1}} sage: I3.first() #random {{1, 2, 3, -1, -3, -2}} sage: I3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: I3.random_element() #random {{-1}, {-3, -2}, {2, 3}, {1}} sage: I2p5 = SetPartitionsIk(2.5); I2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3 sage: I2p5.cardinality() 50 sage: I2p5 = SetPartitionsIk(2.5); I2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3 sage: I2p5.cardinality() 50 sage: I2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: I2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: I2p5.random_element() #random {{-1}, {-2}, {1, 3, -3}, {2}} sage: I2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: I2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: I2p5.random_element() #random {{-1}, {-2}, {1, 3, -3}, {2}} """ """) class SetPartitionsIk_k(SetPartitionsAk_k): def __repr__(self): """ #B_k# ##### SetPartitionsBk = functools.partial(create_set_partition_function,"B") SetPartitionsBk.__doc__ = """ Returns the combinatorial class of set partitions of type B_k. These are the set partitions where every block has size 2. SetPartitionsBk.__doc__ = ( """ Returns the combinatorial class of set partitions of type B_k. These are the set partitions where every block has size 2. EXAMPLES:: EXAMPLES:: sage: B3 = SetPartitionsBk(3); B3 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 sage: B3 = SetPartitionsBk(3); B3 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 sage: B3.first() #random {{2, -2}, {1, -3}, {3, -1}} sage: B3.last() #random {{1, 2}, {3, -2}, {-3, -1}} sage: B3.random_element() #random {{2, -1}, {1, -3}, {3, -2}} sage: B3.first() #random {{2, -2}, {1, -3}, {3, -1}} sage: B3.last() #random {{1, 2}, {3, -2}, {-3, -1}} sage: B3.random_element() #random {{2, -1}, {1, -3}, {3, -2}} sage: B3.cardinality() 15 sage: B3.cardinality() 15 sage: B2p5 = SetPartitionsBk(2.5); B2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 sage: B2p5 = SetPartitionsBk(2.5); B2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 sage: B2p5.first() #random {{2, -1}, {3, -3}, {1, -2}} sage: B2p5.last() #random {{1, 2}, {3, -3}, {-1, -2}} sage: B2p5.random_element() #random {{2, -2}, {3, -3}, {1, -1}} sage: B2p5.first() #random {{2, -1}, {3, -3}, {1, -2}} sage: B2p5.last() #random {{1, 2}, {3, -3}, {-1, -2}} sage: B2p5.random_element() #random {{2, -2}, {3, -3}, {1, -1}} sage: B2p5.cardinality() 3 """ sage: B2p5.cardinality() 3 """) class SetPartitionsBk_k(SetPartitionsAk_k): def __repr__(self): #P_k# ##### SetPartitionsPk = functools.partial(create_set_partition_function,"P") SetPartitionsPk.__doc__ = """ Returns the combinatorial class of set partitions of type P_k. These are the planar set partitions. SetPartitionsPk.__doc__ = ( """ Returns the combinatorial class of set partitions of type P_k. These are the planar set partitions. EXAMPLES:: EXAMPLES:: sage: P3 = SetPartitionsPk(3); P3 Set partitions of {1, ..., 3, -1, ..., -3} that are planar sage: P3.cardinality() 132 sage: P3 = SetPartitionsPk(3); P3 Set partitions of {1, ..., 3, -1, ..., -3} that are planar sage: P3.cardinality() 132 sage: P3.first() #random {{1, 2, 3, -1, -3, -2}} sage: P3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: P3.random_element() #random {{1, 2, -1}, {-3}, {3, -2}} sage: P3.first() #random {{1, 2, 3, -1, -3, -2}} sage: P3.last() #random {{-1}, {-2}, {3}, {1}, {-3}, {2}} sage: P3.random_element() #random {{1, 2, -1}, {-3}, {3, -2}} sage: P2p5 = SetPartitionsPk(2.5); P2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar sage: P2p5.cardinality() 42 sage: P2p5 = SetPartitionsPk(2.5); P2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar sage: P2p5.cardinality() 42 sage: P2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: P2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: P2p5.random_element() #random {{1, 2, 3, -3}, {-1, -2}} sage: P2p5.first() #random {{1, 2, 3, -1, -3, -2}} sage: P2p5.last() #random {{-1}, {-2}, {2}, {3, -3}, {1}} sage: P2p5.random_element() #random {{1, 2, 3, -3}, {-1, -2}} """ """) class SetPartitionsPk_k(SetPartitionsAk_k): def __repr__(self): """ #T_k# ##### SetPartitionsTk = functools.partial(create_set_partition_function,"T") SetPartitionsTk.__doc__ = """ Returns the combinatorial class of set partitions of type T_k. These are planar set partitions where every block is of size 2. SetPartitionsTk.__doc__ = ( """ Returns the combinatorial class of set partitions of type T_k. These are planar set partitions where every block is of size 2. EXAMPLES:: EXAMPLES:: sage: T3 = SetPartitionsTk(3); T3 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar sage: T3.cardinality() 5 sage: T3 = SetPartitionsTk(3); T3 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar sage: T3.cardinality() 5 sage: T3.first() #random {{1, -3}, {2, 3}, {-1, -2}} sage: T3.last() #random {{1, 2}, {3, -1}, {-3, -2}} sage: T3.random_element() #random {{1, -3}, {2, 3}, {-1, -2}} sage: T3.first() #random {{1, -3}, {2, 3}, {-1, -2}} sage: T3.last() #random {{1, 2}, {3, -1}, {-3, -2}} sage: T3.random_element() #random {{1, -3}, {2, 3}, {-1, -2}} sage: T2p5 = SetPartitionsTk(2.5); T2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar sage: T2p5.cardinality() 2 sage: T2p5 = SetPartitionsTk(2.5); T2p5 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar sage: T2p5.cardinality() 2 sage: T2p5.first() #random {{2, -2}, {3, -3}, {1, -1}} sage: T2p5.last() #random {{1, 2}, {3, -3}, {-1, -2}} sage: T2p5.first() #random {{2, -2}, {3, -3}, {1, -1}} sage: T2p5.last() #random {{1, 2}, {3, -3}, {-1, -2}} """ """) class SetPartitionsTk_k(SetPartitionsBk_k): def __repr__(self): """ SetPartitionsRk = functools.partial(create_set_partition_function,"R") SetPartitionsRk.__doc__ = """ """ SetPartitionsRk.__doc__ = ( """ """) class SetPartitionsRk_k(SetPartitionsAk_k): def __init__(self, k): """ SetPartitionsPRk = functools.partial(create_set_partition_function,"PR") SetPartitionsPRk.__doc__ = """ """ SetPartitionsPRk.__doc__ = ( """ """) class SetPartitionsPRk_k(SetPartitionsRk_k): def __init__(self, k): """
• ## sage/functions/hyperbolic.py

diff --git a/sage/functions/hyperbolic.py b/sage/functions/hyperbolic.py
 a sage: import numpy sage: a = numpy.linspace(0,1,3) sage: arcsech(a) Warning: divide by zero encountered in divide array([       inf,  1.3169579,  0.       ]) """ return arccosh(1.0 / x) sage: import numpy sage: a = numpy.linspace(0,1,3) sage: arccsch(a) Warning: divide by zero encountered in divide array([        inf,  1.44363548,  0.88137359]) """ return arcsinh(1.0 / x)
• ## sage/interfaces/tachyon.py

diff --git a/sage/interfaces/tachyon.py b/sage/interfaces/tachyon.py
 a - John E. Stone """ #***************************************************************************** #       Copyright (C) 2006 John E. Stone # #  Distributed under the terms of the GNU General Public License (GPL) #  as published by the Free Software Foundation; either version 2 of #  the License, or (at your option) any later version. #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.misc.pager import pager from sage.misc.misc import tmp_filename from sage.misc.sagedoc import format import os import sys class TachyonRT: """ sage: import os sage: t(tgen.str(), outfile = os.devnull) tachyon ... Tachyon Parallel/Multiprocessor Ray Tracer... """ modelfile = tmp_filename(ext='.dat') open(modelfile,'w').write(model) if verbose: print cmd # One should always flush before system() sys.stdout.flush() sys.stderr.flush() os.system(cmd) def usage(self, use_pager=True):
• ## sage/lfunctions/lcalc.py

diff --git a/sage/lfunctions/lcalc.py b/sage/lfunctions/lcalc.py
 a sage: lcalc.zeros(5, L='--tau')                # long time [9.22237940, 13.9075499, 17.4427770, 19.6565131, 22.3361036] sage: lcalc.zeros(3, EllipticCurve('37a'))     # long time ***   Warning: new stack size = ... [0.000000000, 5.00317001, 6.87039122] """ L = self._compute_L(L) sage: E = EllipticCurve('389a') sage: E.lseries().values_along_line(0.5, 3, 5) ***   Warning: new stack size = ... [(0.000000000, 0.209951303), (0.500000000, -...e-16), (1.00000000, 0.133768433), sage: E = EllipticCurve('37a') sage: lcalc.analytic_rank(E) ***   Warning: new stack size = ... 1 """ L = self._compute_L(L)
• ## sage/libs/lcalc/lcalc_Lfunction.pyx

diff --git a/sage/libs/lcalc/lcalc_Lfunction.pyx b/sage/libs/lcalc/lcalc_Lfunction.pyx
 a sage: from sage.libs.lcalc.lcalc_Lfunction import * sage: chi=DirichletGroup(5)[2] #This is a quadratic character sage: L=Lfunction_from_character(chi, type="int") sage: L._print_data_to_standard_output() sage: L._print_data_to_standard_output() # tol 1e-15 ----------------------------------------------- Name of L_function: number of dirichlet coefficients = 5 coefficients are periodic b[1] = 1 b[2] = -1 b[3] = -1 b[4] = 1 b[5] = 0 Q = 1.26156626101 OMEGA = (1,0) a = 1 (the quasi degree) gamma[1] =0.5    lambda[1] =(0,0) number of poles (of the completed L function) = 0 ----------------------------------------------- """ (self.thisptr).print_data_L() sage: from sage.libs.lcalc.lcalc_Lfunction import * sage: chi=DirichletGroup(5)[2] #This is a quadratic character sage: L=Lfunction_from_character(chi, type="double") sage: L._print_data_to_standard_output() sage: L._print_data_to_standard_output() # tol 1e-15 ----------------------------------------------- Name of L_function: number of dirichlet coefficients = 5 coefficients are periodic b[1] = 1 b[2] = -1 b[3] = -1 b[4] = 1 b[5] = 0 Q = 1.26156626101 OMEGA = (1,0) a = 1 (the quasi degree) gamma[1] =0.5    lambda[1] =(0,0) number of poles (of the completed L function) = 0 ----------------------------------------------- """ (self.thisptr).print_data_L() sage: from sage.libs.lcalc.lcalc_Lfunction import * sage: chi=DirichletGroup(5)[1] sage: L=Lfunction_from_character(chi, type="complex") sage: L._print_data_to_standard_output() sage: L._print_data_to_standard_output() # tol 1e-15 ----------------------------------------------- Name of L_function: number of dirichlet coefficients = 5 coefficients are periodic b[1] = (1,0) b[2] = (0,1) b[3] = (0,-1) b[4] = (-1,0) b[5] = (0,0) Q = 1.26156626101 OMEGA = (0.850650808352,0.525731112119) a = 1 (the quasi degree) gamma[1] =0.5    lambda[1] =(0.5,0) number of poles (of the completed L function) = 0 ----------------------------------------------- """ (self.thisptr).print_data_L()
• ## sage/libs/mpmath/ext_main.pyx

diff --git a/sage/libs/mpmath/ext_main.pyx b/sage/libs/mpmath/ext_main.pyx
 a Creates an mpc from tuple data :: sage: import mpmath >>> complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1)))) sage: complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1)))) (0.5-0.25j) """ cdef mpc x
• ## sage/libs/mwrank/interface.py

diff --git a/sage/libs/mwrank/interface.py b/sage/libs/mwrank/interface.py
 a sage: E = mwrank_EllipticCurve([0, 0, 1, -1, 0]) sage: E.set_verbose(1) sage: E.saturate() # produces the following output :: sage: E.saturate() # tol 1e-14 Basic pair: I=48, J=-432 disc=255744 2-adic index bound = 2 Looking for quartics with I = 48, J = -432 Looking for Type 2 quartics: Trying positive a from 1 up to 1 (square a first...) (1,0,-6,4,1)        --trivial (1,0,-6,4,1)        --trivial Trying positive a from 1 up to 1 (...then non-square a) Finished looking for Type 2 quartics. Looking for Type 1 quartics: Trying positive a from 1 up to 2 (square a first...) (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0) (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0) Point = [0:0:1] height = 0.051111408239968840235886099756942021609538202280854 height = 0.0511114082399688402358 Rank of B=im(eps) increases to 1 (The previous point is on the egg) Exiting search for Type 1 quartics after finding one which is globally soluble. Mordell rank contribution from B=im(eps) = 1 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 Searching for points (bound = 8)...done: found points of rank 1 and regulator 0.051111408239968840235886099756942021609538202280854 found points which generate a subgroup of rank 1 and regulator 0.0511114082399688402358 Processing points found during 2-descent...done: now regulator = 0.051111408239968840235886099756942021609538202280854 Saturating (bound = -1)...done: points were already saturated. now regulator = 0.0511114082399688402358 Saturating (with bound = -1)...done: points were already saturated. """ self.__verbose = verbose TESTS (see #7992):: sage: EllipticCurve([0, prod(prime_range(10))]).mwrank_curve().two_descent() Basic pair: I=0, J=-5670 disc=-32148900 2-adic index bound = 2 2-adic index = 2 Two (I,J) pairs Looking for quartics with I = 0, J = -5670 Looking for Type 3 quartics: Trying positive a from 1 up to 5 (square a first...) Trying positive a from 1 up to 5 (...then non-square a) (2,0,-12,19,-6)     --nontrivial...(x:y:z) = (2 : 4 : 1) Point = [-2488:-4997:512] height = 6.46767239... Rank of B=im(eps) increases to 1 Trying negative a from -1 down to -3 Finished looking for Type 3 quartics. Looking for quartics with I = 0, J = -362880 Looking for Type 3 quartics: Trying positive a from 1 up to 20 (square a first...) Trying positive a from 1 up to 20 (...then non-square a) Trying negative a from -1 down to -13 Finished looking for Type 3 quartics. Mordell rank contribution from B=im(eps) = 1 Selmer  rank contribution from B=im(eps) = 1 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: EllipticCurve([0, prod(prime_range(100))]).mwrank_curve().two_descent() Traceback (most recent call last): ... sage: EQ = mwrank_MordellWeil(E) sage: EQ Subgroup of Mordell-Weil group: [] sage: EQ.search(2) # output below The previous command produces the following output:: sage: EQ.search(2) P1 = [0:1:0]     is torsion point, order 1 P1 = [1:-1:1]    is torsion point, order 2 P1 = [2:2:1]     is torsion point, order 3 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.search(2) P1 = [0:1:0]     is torsion point, order 1 P1 = [-3:0:1]     is generator number 1 ... P4 = [-91:804:343]       = -2*P1 + 2*P2 + 1*P3 (mod torsion) sage: EQ Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E, verbose=False) sage: EQ.search(1) # no output sage: EQ.search(1) sage: EQ Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] sage: EQ = mwrank_MordellWeil(E, verbose=True) sage: EQ.search(1) # output below The previous command produces the following output:: sage: EQ.search(1) P1 = [0:1:0]     is torsion point, order 1 P1 = [-3:0:1]     is generator number 1 saturating up to 20...Checking 2-saturation [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] sage: EQ = mwrank_MordellWeil(E) sage: EQ.process([[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]) Output of previous command:: P1 = [1:-1:1]         is generator number 1 P2 = [-2:3:1]         is generator number 2 P3 = [-14:25:8]       is generator number 3 :: sage: EQ.points() [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=20) P1 = [1547:-2967:343]         is generator number 1 ... Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ] sage: EQ.points() [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]] sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0) P1 = [1547:-2967:343]         is generator number 1 P2 = [2707496766203306:864581029138191:2969715140223272]      is generator number 2 P3 = [-13422227300:-49322830557:12167000000]          is generator number 3 sage: EQ.points() [[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]] sage: EQ.regulator() 375.42919921875 sage: EQ.saturate(2)  # points were not 2-saturated saturating basis...Saturation index bound = 93 WARNING: saturation at primes p > 2 will not be done; ... Gained index 2 New regulator =  93.857300720636393209 (False, 2, '[ ]') sage: EQ.points() [[-2, 3, 1], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]] sage: EQ.regulator() 93.8572998046875 sage: EQ.saturate(3)  # points were not 3-saturated saturating basis...Saturation index bound = 46 WARNING: saturation at primes p > 3 will not be done; ... Gained index 3 New regulator =  10.4285889689595992455 (False, 3, '[ ]') sage: EQ.points() [[-2, 3, 1], [-14, 25, 8], [-13422227300, -49322830557, 12167000000]] sage: EQ.regulator() 10.4285888671875 sage: EQ.saturate(5)  # points were not 5-saturated saturating basis...Saturation index bound = 15 WARNING: saturation at primes p > 5 will not be done; ... Gained index 5 New regulator =  0.417143558758383969818 (False, 5, '[ ]') sage: EQ.points() [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]] sage: EQ.regulator() 0.4171435534954071 sage: EQ.saturate()   # points are now saturated saturating basis...Saturation index bound = 3 Checking saturation at [ 2 3 ] Checking 2-saturation Points were proved 2-saturated (max q used = 11) Checking 3-saturation Points were proved 3-saturated (max q used = 13) done (True, 1, '[ ]') """ if not isinstance(v, list): Now we do a very small search:: sage: EQ.search(1) P1 = [0:1:0]         is torsion point, order 1 P1 = [-3:0:1]         is generator number 1 saturating up to 20...Checking 2-saturation ... P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion) sage: EQ Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] sage: EQ.rank() sat to 0 (which is in fact the default):: sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0) P1 = [1547:-2967:343]         is generator number 1 P2 = [2707496766203306:864581029138191:2969715140223272]      is generator number 2 P3 = [-13422227300:-49322830557:12167000000]          is generator number 3 sage: EQ Subgroup of Mordell-Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] sage: EQ.regulator() Now we saturate at p=2, and gain index 2:: sage: EQ.saturate(2)  # points were not 2-saturated saturating basis...Saturation index bound = 93 WARNING: saturation at primes p > 2 will not be done; ... Gained index 2 New regulator =  93.857300720636393209 (False, 2, '[ ]') sage: EQ Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] Now we saturate at p=3, and gain index 3:: sage: EQ.saturate(3)  # points were not 3-saturated saturating basis...Saturation index bound = 46 WARNING: saturation at primes p > 3 will not be done; ... Gained index 3 New regulator =  10.4285889689595992455 (False, 3, '[ ]') sage: EQ Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] Now we saturate at p=5, and gain index 5:: sage: EQ.saturate(5)  # points were not 5-saturated saturating basis...Saturation index bound = 15 WARNING: saturation at primes p > 5 will not be done; ... Gained index 5 New regulator =  0.417143558758383969818 (False, 5, '[ ]') sage: EQ Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] the points are now provably saturated at all primes:: sage: EQ.saturate()   # points are now saturated saturating basis...Saturation index bound = 3 Checking saturation at [ 2 3 ] Checking 2-saturation Points were proved 2-saturated (max q used = 11) Checking 3-saturation Points were proved 3-saturated (max q used = 13) done (True, 1, '[ ]') Of course, the :meth:process() function would have done all this sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=5) P1 = [1547:-2967:343]         is generator number 1 ... Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ] sage: EQ Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] sage: EQ.regulator() verify that full saturation has been done:: sage: EQ.saturate() saturating basis...Saturation index bound = 3 Checking saturation at [ 2 3 ] Checking 2-saturation Points were proved 2-saturated (max q used = 11) Checking 3-saturation Points were proved 3-saturated (max q used = 13) done (True, 1, '[ ]') The preceding command produces the following output as a side-effect.  It proves that the index of the points in their saturation is at most 3, then proves saturation at 2 and at 3, by reducing the points modulo all primes of good reduction up to 11, respectively 13:: saturating basis...Saturation index bound = 3 Checking saturation at [ 2 3 ] Checking 2-saturation Points were proved 2-saturated (max q used = 11) Checking 3-saturation Points were proved 3-saturated (max q used = 13) done Note the output of the preceding command: it proves that the index of the points in their saturation is at most 3, then proves saturation at 2 and at 3, by reducing the points modulo all primes of good reduction up to 11, respectively 13. """ ok, index, unsat = self.__mw.saturate(int(max_prime), odd_primes_only) return bool(ok), int(str(index)), unsat sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.search(1) P1 = [0:1:0]         is torsion point, order 1 P1 = [-3:0:1]         is generator number 1 ... P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion) sage: EQ Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] sage: E = mwrank_EllipticCurve([0, -1, 0, -18392, -1186248]) #1056g4 sage: EQ = mwrank_MordellWeil(E) sage: EQ.search(11); EQ P1 = [0:1:0]         is torsion point, order 1 P1 = [161:0:1]       is torsion point, order 2 Subgroup of Mordell-Weil group: [] sage: EQ.search(12); EQ P1 = [0:1:0]         is torsion point, order 1 P1 = [161:0:1]       is torsion point, order 2 P1 = [4413270:10381877:27000]         is generator number 1 ... Subgroup of Mordell-Weil group: [[4413270:10381877:27000]] """ height_limit = float(height_limit) sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) sage: EQ = mwrank_MordellWeil(E) sage: EQ.search(1) P1 = [0:1:0]         is torsion point, order 1 P1 = [-3:0:1]         is generator number 1 ... P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion) sage: EQ.points() [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]
• ## sage/libs/mwrank/mwrank.pyx

diff --git a/sage/libs/mwrank/mwrank.pyx b/sage/libs/mwrank/mwrank.pyx
 a sage: file = os.path.join(SAGE_TMP, 'PRIMES') sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^7,10^7+20)])) sage: mwrank_initprimes(file, verb=True) The previous command does produce the following output when run from the command line, but not during a doctest:: Computed 78519 primes, largest is 1000253 reading primes from file ... read extra prime 10000019 sage: EQ.search(1) sage: EQ = _mw(E, verb=True) sage: EQ.search(1) P1 = [0:1:0]         is torsion point, order 1 P1 = [-3:0:1]         is generator number 1 ... P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion) The previous command produces the following output:: sage: EQ = _mw(E) sage: EQ.process([494, -5720, 6859]) # 3 times another point sage: EQ.saturate(sat_bd=2) Saturation index bound = 10 WARNING: saturation at primes p > 2 will not be done; points may be unsaturated at primes between 2 and index bound Failed to saturate MW basis at primes [ ] (0, 1, '[ ]') sage: EQ [[494:-5720:6859]] sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.getrank() 3 sage: D2.getcertain() sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.getrank() 3 """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.getrankbound() 3 """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.getselmer() 3 """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.ok() 1 """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.getcertain() 1 """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.saturate() Searching for points (bound = 8)...done: found points which generate a subgroup of rank 3 and regulator 0.417143558758383969817119544618093396749810106098479 Processing points found during 2-descent...done: now regulator = 0.417143558758383969817119544618093396749810106098479 No saturation being done sage: D2.getbasis() '[[1:-1:1], [-2:3:1], [-14:25:8]]' """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 sage: D2.saturate() Searching for points (bound = 8)...done: found points which generate a subgroup of rank 3 and regulator 0.417143558758383969817119544618093396749810106098479 Processing points found during 2-descent...done: now regulator = 0.417143558758383969817119544618093396749810106098479 No saturation being done sage: D2.getbasis() '[[1:-1:1], [-2:3:1], [-14:25:8]]' """ sage: from sage.libs.mwrank.mwrank import _two_descent sage: D2 = _two_descent() sage: D2.do_descent(CD) Basic pair: I=336, J=-10800 disc=35092224 ... Mordell rank contribution from B=im(eps) = 3 Selmer  rank contribution from B=im(eps) = 3 Sha     rank contribution from B=im(eps) = 0 Mordell rank contribution from A=ker(eps) = 0 Selmer  rank contribution from A=ker(eps) = 0 Sha     rank contribution from A=ker(eps) = 0 If called before calling saturate(), a bogus value of 1.0 is returned:: 2-descent:: sage: D2.saturate() Searching for points (bound = 8)...done: found points which generate a subgroup of rank 3 and regulator 0.417143558758383969817119544618093396749810106098479 Processing points found during 2-descent...done: now regulator = 0.417143558758383969817119544618093396749810106098479 No saturation being done sage: D2.getbasis() '[[1:-1:1], [-2:3:1], [-14:25:8]]' sage: D2.regulator()
• ## sage/libs/singular/function.pyx

diff --git a/sage/libs/singular/function.pyx b/sage/libs/singular/function.pyx
 a sage: l = ringlist(P) sage: ring = singular_function("ring") sage: ring(l, ring=P)._output() //   characteristic : 0 //   number of vars : 3 //        block   1 : ordering dp //                  : names    x y z //        block   2 : ordering C """ rPrint(self._ring) sage: I = Ideal(I.groebner_basis()) sage: hilb = sage.libs.singular.ff.hilb sage: hilb(I) # Singular will print // ** _ is no standard basis // ** _ is no standard basis //         1 t^0 //        -1 t^5 //         1 t^0 //         1 t^1 //         1 t^2 //         1 t^3 //         1 t^4 // dimension (proj.)  = 1 // degree (proj.)   = 5 So we tell Singular that I is indeed a Groebner basis:: sage: hilb(I,attributes={I:{'isSB':1}}) # no complaint from Singular //         1 t^0 //        -1 t^5 //         1 t^0 //         1 t^1 //         1 t^2 //         1 t^3 //         1 t^4 // dimension (proj.)  = 1 // degree (proj.)   = 5 TESTS:
• ## sage/libs/singular/option.pyx

diff --git a/sage/libs/singular/option.pyx b/sage/libs/singular/option.pyx
 a The option mult_bound is only relevant in the local case:: sage: from sage.libs.singular.option import opt sage: Rlocal. = PolynomialRing(QQ, order='ds') sage: x^2
• ## sage/matrix/benchmark.py

diff --git a/sage/matrix/benchmark.py b/sage/matrix/benchmark.py
 a The basic command syntax is as follows:: sage: import sage.matrix.benchmark as b sage: b.report([b.det_ZZ], 'Test', systems=['sage']) sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage']) starting... ====================================================================== Test ====================================================================== EXAMPLES:: sage: import sage.matrix.benchmark as b sage: b.report([b.det_ZZ], 'Test', systems=['sage']) sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage']) starting... ====================================================================== Test ====================================================================== EXAMPLES:: sage: import sage.matrix.benchmark as b sage: b.report_ZZ(systems=['sage'])  # long time (15s on sage.math, 2012) sage: print "starting"; import sys; sys.stdout.flush(); b.report_ZZ(systems=['sage'])  # long time (15s on sage.math, 2012) starting... ====================================================================== Dense benchmarks over ZZ ====================================================================== EXAMPLES:: sage: import sage.matrix.benchmark as b sage: b.report_GF(systems=['sage']) sage: print "starting"; import sys; sys.stdout.flush(); b.report_GF(systems=['sage']) starting... ====================================================================== Dense benchmarks over GF with prime 16411 ======================================================================
• ## sage/misc/constant_function.pyx

diff --git a/sage/misc/constant_function.pyx b/sage/misc/constant_function.pyx
 a from sage.structure.sage_object cimport SageObject cdef class ConstantFunction(SageObject): cdef object _value """ A class for function objects implementing constant functions. sage: { 1: 'a', True: 'b' } {1: 'b'} """ cdef object _value def __init__(self, value): """ EXAMPLES::
• ## sage/misc/cython.py

diff --git a/sage/misc/cython.py b/sage/misc/cython.py
 a sage: f.write(s) sage: f.close() sage: cython_create_local_so('hello.spyx') Compiling hello.spyx... sage: sys.path.append('.') sage: import hello sage: hello.hello()
• ## sage/misc/hg.py

diff --git a/sage/misc/hg.py b/sage/misc/hg.py
 a #                  http://www.gnu.org/licenses/ ######################################################################## import os, shutil import os, shutil, sys from   viewer import browser from   misc   import tmp_filename, branch_current_hg, embedded s = 'cd "%s" && sage --hg %s'%(self.__dir, cmd) if debug: print s sys.stdout.flush() if interactive: e = os.system(s) return e EXAMPLES:: sage: hg_sage.qseries() cd ... && sage --hg qseries cd ... && sage --hg qseries... """ options = "--summary" if verbose else "" self('qseries %s %s' % (options, color(),), debug=debug) EXAMPLES:: sage: hg_sage.qapplied() cd ... && sage --hg qapplied cd ... && sage --hg qapplied... """ options = "--summary" if verbose else "" self('qapplied %s %s' % (options, color(),), debug=debug) EXAMPLES:: sage: hg_sage.qunapplied() cd ... && sage --hg qunapplied cd ... && sage --hg qunapplied... """ options = "--summary" if verbose else "" self('qunapplied %s %s' % (options, color(),), debug=debug)
• ## sage/misc/interpreter.py

diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
 a sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0 True sage: shell.system_raw('R --version') R version ... sage: status = shell.user_ns['_exit_code'] sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0 True
• ## sage/misc/preparser.py

diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
 a EXAMPLES: Note that .py files are *not* preparsed:: sage: t=tmp_filename(ext='.py'); open(t,'w').write("print 'hi',2/3; z=-2/9") sage: sage.misc.preparser.load(t,globals()) Note that .py files are *not* preparsed:: sage: t = tmp_filename(ext='.py') sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") sage: z = 1 sage: sage.misc.preparser.load(t, globals()) hi 0 sage: z -1 A .sage file *is* preparsed:: sage: t=tmp_filename(ext='.sage'); open(t,'w').write("print 'hi',2/3; s=-2/7") sage: sage.misc.preparser.load(t,globals()) A .sage file *is* preparsed:: sage: t = tmp_filename(ext='.sage') sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") sage: z = 1 sage: sage.misc.preparser.load(t, globals()) hi 2/3 sage: s sage: z -2/7 Cython files are *not* preparsed:: sage: t=tmp_filename(ext='.pyx'); open(t,'w').write("print 'hi',2/3; z=-2/9") sage: z=0; sage.misc.preparser.load(t,globals()) sage: t = tmp_filename(ext='.pyx') sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") sage: z = 1 sage: sage.misc.preparser.load(t, globals()) Compiling ... hi 0 sage: z -1
• ## sage/misc/session.pyx

diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
 a - creates a file EXAMPLES: For testing, we use a temporary file, that will be removed as soon as Sage is left. Of course, for permanently saving your session, you should choose a permanent file.:: you should choose a permanent file. :: sage: a = 5 sage: tmp_f = tmp_filename() 5 We illustrate what happens when one of the variables is a function.:: sage: f = lambda x : x^2 sage: save_session(tmp_f) sage: save_session(tmp_f, verbose=True) sage: g = cython_lambda('double x', 'x*x + 1.5') sage: save_session(tmp_f, verbose=True) Saving... Not saving g: g is a function, method, class or type ... """
• ## sage/misc/sh.py

diff --git a/sage/misc/sh.py b/sage/misc/sh.py
 a the following really only tests that the command doesn't bomb, not that it gives the right output:: sage: sh.eval('''echo "Hello there"\nif [ $? -eq 0 ]; then\necho "good"\nfi''') /... '' sage: sh.eval('''echo "Hello there"\nif [$? -eq 0 ]; then\necho "good"\nfi''') # random output """ # Print out the current absolute path, which is where the code # will be evaluated.    Evidently, users find this comforting,
• ## sage/modular/modform/cuspidal_submodule.py

diff --git a/sage/modular/modform/cuspidal_submodule.py b/sage/modular/modform/cuspidal_submodule.py
 a sage: f.qexp(1) O(q^1) """ pass #def _repr_(self): #    A = self.ambient_module() #    return "Cuspidal subspace of dimension %s of Modular Forms space with character %s and weight %s over %s"%(self.dimension(), self.character(), self.weight(), self.base_ring()) def _convert_matrix_from_modsyms(symbs, T):
• ## sage/modules/vector_double_dense.pyx

diff --git a/sage/modules/vector_double_dense.pyx b/sage/modules/vector_double_dense.pyx
 a 0.953760808... sage: w = vector(CDF, [-1,0,1]) sage: w.norm(p=-1.6) Warning: divide by zero encountered in power 0.0 Return values are in RDF, or an integer when p = 0.  ::
• ## sage/numerical/backends/glpk_backend.pyx

diff --git a/sage/numerical/backends/glpk_backend.pyx b/sage/numerical/backends/glpk_backend.pyx
 a sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3) sage: p.set_objective([2, 5]) sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) Writing problem data to ... 9 lines were written """ glp_write_lp(self.lp, NULL, filename) sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3) sage: p.set_objective([2, 5]) sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps"), 2) Writing problem data to... 17 records were written """ glp_write_mps(self.lp, modern, NULL,  filename) sage: import sage.numerical.backends.glpk_backend as backend sage: p.solver_parameter(backend.glp_simplex_or_intopt, backend.glp_simplex_only) sage: p.print_ranges() ... glp_print_ranges: optimal basic solution required 1 sage: p.solve() 0 sage: p.print_ranges() Write sensitivity analysis report to... GLPK ... - SENSITIVITY ANALYSIS REPORT                                                                         Page   1 Problem: Problem: Objective:  7.5 (MAXimum) No. Row name     St      Activity         Slack   Lower bound       Activity      Obj coef  Obj value at Limiting Marginal   Upper bound          range         range   break point variable ------ ------------ -- ------------- ------------- -------------  ------------- ------------- ------------- ------------ 1              NU       3.00000        .               -Inf         .           -2.50000        . 1              NU       3.00000        .               -Inf         .           -2.50000        . 2.50000       3.00000           +Inf          +Inf          +Inf GLPK ... - SENSITIVITY ANALYSIS REPORT                                                                         Page   2 Problem: Problem: Objective:  7.5 (MAXimum) No. Column name  St      Activity      Obj coef   Lower bound       Activity      Obj coef  Obj value at Limiting End of report 0 """ from sage.misc.all import SAGE_TMP
• ## sage/numerical/mip.pyx

diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
 a sage: p.set_objective(x[1] + x[2]) sage: p.add_constraint(-3*x[1] + 2*x[2], max=2,name="OneConstraint") sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps")) Writing problem data to ... 17 records were written For information about the MPS file format : http://en.wikipedia.org/wiki/MPS_%28format%29 sage: p.set_objective(x[1] + x[2]) sage: p.add_constraint(-3*x[1] + 2*x[2], max=2) sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) Writing problem data to ... 9 lines were written For more information about the LP file format : http://lpsolve.sourceforge.net/5.5/lp-format.htm sage: b = p.get_backend() sage: b.solver_parameter("simplex_or_intopt", "simplex_only") sage: b.solver_parameter("verbosity_simplex", "GLP_MSG_ALL") sage: p.solve() # tol 0.00001 sage: p.solve()  # tol 0.00001 GLPK Simplex Optimizer, v4.44 2 rows, 2 columns, 4 non-zeros *     0: obj =   7.000000000e+00  infeas =  0.000e+00 (0) *     2: obj =   9.400000000e+00  infeas =  0.000e+00 (0) OPTIMAL SOLUTION FOUND 9.4 """ return self._backend
• ## sage/numerical/optimize.py

diff --git a/sage/numerical/optimize.py b/sage/numerical/optimize.py
 a sage: sol['x'] (45.000000..., 6.2499999...3, 1.00000000...) sage: sol=linear_program(v,m,h,solver='glpk') GLPK Simplex Optimizer... OPTIMAL SOLUTION FOUND sage: sol['x'] (45.0..., 6.25, 1.0...) """
• ## sage/parallel/decorate.py

diff --git a/sage/parallel/decorate.py b/sage/parallel/decorate.py
 a sage: cython('def f(): print 0') sage: @fork ... def g(): f() sage: g() sage: print "this works"; g() this works... ------------------------------------------------------------------------ Unhandled SIG... ------------------------------------------------------------------------ 'NO DATA' """ F = Fork(timeout=timeout, verbose=verbose)
• ## sage/plot/line.py

diff --git a/sage/plot/line.py b/sage/plot/line.py
 a sage: E = EllipticCurve('37a') sage: vals = E.lseries().values_along_line(1-I, 1+10*I, 100) # critical line ***   Warning: new stack size = ... sage: L = [(z[1].real(), z[1].imag()) for z in vals] sage: line(L, rgbcolor=(3/4,1/2,5/8))
• ## sage/rings/fraction_field_FpT.pyx

diff --git a/sage/rings/fraction_field_FpT.pyx b/sage/rings/fraction_field_FpT.pyx
 a return self.cur cdef class Polyring_FpT_coerce(RingHomomorphism_coercion): cdef long p """ This class represents the coercion map from GF(p)[t] to GF(p)(t) sage: type(f) """ cdef long p def __init__(self, R): """ INPUTS: return FpT_Polyring_section(self) cdef class FpT_Polyring_section(Section): cdef long p """ This class represents the section from GF(p)(t) back to GF(p)[t] sage: type(f) """ cdef long p def __init__(self, Polyring_FpT_coerce f): """ INPUTS: return ans cdef class Fp_FpT_coerce(RingHomomorphism_coercion): cdef long p """ This class represents the coercion map from GF(p) to GF(p)(t) sage: type(f) """ cdef long p def __init__(self, R): """ INPUTS: return FpT_Fp_section(self) cdef class FpT_Fp_section(Section): cdef long p """ This class represents the section from GF(p)(t) back to GF(p)[t] sage: type(f) """ cdef long p def __init__(self, Fp_FpT_coerce f): """ INPUTS: return ans cdef class ZZ_FpT_coerce(RingHomomorphism_coercion): cdef long p """ This class represents the coercion map from ZZ to GF(p)(t) sage: type(f) """ cdef long p def __init__(self, R): """ INPUTS:
• ## sage/rings/number_field/number_field_ideal.py

diff --git a/sage/rings/number_field/number_field_ideal.py b/sage/rings/number_field/number_field_ideal.py
 a sage: P = EllipticCurve(L, '57a1').lift_x(z_x) * 3 sage: ideal = L.fractional_ideal(P[0], P[1]) sage: ideal.is_principal(proof=False) ***   Warning: precision too low for generators, not given. True sage: len(ideal.gens_reduced(proof=False)) 1
• ## sage/rings/number_field/order.py

diff --git a/sage/rings/number_field/order.py b/sage/rings/number_field/order.py
 a sage: k. = NumberField(x^2 + 5077); G = k.class_group(); G Class group of order 22 with structure C22 of Number Field in a with defining polynomial x^2 + 5077 sage: G.0 Fractional ideal class (11, a + 7)   # 32-bit Fractional ideal class (23, a + 12)  # 64-bit Fractional ideal class (11, a + 7) sage: Ok = k.maximal_order(); Ok Maximal Order in Number Field in a with defining polynomial x^2 + 5077 sage: Ok * (11, a + 7)

diff --git a/sage/rings/padics/padic_capped_relative_element.pyx b/sage/rings/padics/padic_capped_relative_element.pyx
 a sage: hash(R(17)) #indirect doctest 17 sage: hash(R(-1)) # 32-bit 1977822444 sage: hash(R(-1)) # 64-bit 95367431640624 sage: hash(R(-1)) 1977822444 # 32-bit 95367431640624 # 64-bit """ return hash(self.lift_c())
• ## sage/rings/polynomial/multi_polynomial_ideal.py

diff --git a/sage/rings/polynomial/multi_polynomial_ideal.py b/sage/rings/polynomial/multi_polynomial_ideal.py
 a product criterion:1 chain criterion:0 [x^3 + y^2, x^2*y + 1, y^3 - x] sage: I.groebner_basis(prot=False) std in (0),(x,y),(dp(2),C) [4294967295:2]3ss4s6 (S:2)-- product criterion:1 chain criterion:0 [x^3 + y^2, x^2*y + 1, y^3 - x] sage: set_verbose(0) sage: I.groebner_basis(prot=True)  # not tested
• ## sage/rings/polynomial/polynomial_element.pyx

diff --git a/sage/rings/polynomial/polynomial_element.pyx b/sage/rings/polynomial/polynomial_element.pyx
 a sage: pari.default("debug", 3) sage: F = pol.factor() Entering nffactor: ... sage: pari.default("debug", 0) (... + 1.25992104989*I, 1), (1.09112363597 - 0.629960524947*I, 1)] sage: f.roots(multiplicities=False) [-1.09112363597 - 0.629960524947*I, ... + 1.25992104989r*I, 1.09112363597 - 0.629960524947*I] [-1.09112363597 - 0.629960524947*I, ... + 1.25992104989*I, 1.09112363597 - 0.629960524947*I] sage: [f(z) for z in f.roots(multiplicities=False)] # random, too close to 0 [-2.56337823492e-15 - 6.66133814775e-15*I, 3.96533069372e-16 + 1.99840144433e-15*I,
• ## sage/rings/polynomial/polynomial_integer_dense_ntl.pyx

diff --git a/sage/rings/polynomial/polynomial_integer_dense_ntl.pyx b/sage/rings/polynomial/polynomial_integer_dense_ntl.pyx
 a sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^3: 1}) x^8 sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^30: 1}) # 32-bit sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^62: 1}) # 64-bit sage: import sys sage: PolynomialRing(ZZ, 'x', implementation='NTL')({sys.maxint>>1: 1}) Traceback (most recent call last): ... OverflowError: Dense NTL integer polynomials have a maximum degree of 268435455    # 32-bit
• ## sage/rings/polynomial/symmetric_ideal.py

diff --git a/sage/rings/polynomial/symmetric_ideal.py b/sage/rings/polynomial/symmetric_ideal.py
 a sage: I.interreduction(report=True) Symmetric interreduction [1/2]  > [2/2] : > [2/2] :> [1/2]  > [2/2] T[1] > [2/2] T[1]> > Symmetric Ideal (-x_1^2, x_2 + x_1) of Infinite polynomial ring in x over Rational Field sage: I1.groebner_basis(report=True, reduced=True) Symmetric interreduction [1/2]  > [2/2] : > [2/2] :> [1/2]  > [2/2]  > Symmetrise 2 polynomials at level 2 Symmetric interreduction [1/3]  > [2/3]  > [3/3] : > [3/3] :> -> 0 [1/2]  > [2/2]  > ::> Symmetric interreduction [1/4]  > [2/4] : > [2/4] :> -> 0 [3/4] :: > [3/4] ::> -> 0 [4/4] : > [4/4] :> -> 0 [1/1]  > Apply permutations :> Symmetric interreduction [1/2]  > [2/2] : > [2/2] :> -> 0 [1/1]  > Symmetric interreduction
• ## sage/schemes/elliptic_curves/ell_rational_field.py

diff --git a/sage/schemes/elliptic_curves/ell_rational_field.py b/sage/schemes/elliptic_curves/ell_rational_field.py
 a sage: E.analytic_rank(algorithm='pari') 2 sage: E.analytic_rank(algorithm='rubinstein') ***   Warning: new stack size = ... 2 sage: E.analytic_rank(algorithm='sympow') 2 sage: E.analytic_rank(algorithm='magma')    # optional - magma 2 sage: E.analytic_rank(algorithm='all') ***   Warning: new stack size = ... 2 With the optional parameter leading_coefficient set to True, a sage: E.saturation([P]) ([(-192128125858676194585718821667542660822323528626273/336995568430319276695106602174283479617040716649 : 70208213492933395764907328787228427430477177498927549075405076353624188436/195630373799784831667835900062564586429333568841391304129067339731164107 : 1)], 1, 113.302910926080) sage: E.saturation([2*P]) ## needs higher precision After 10 attempts at enlargement, giving up! ... ([(1755450733726721618440965414535034458701302721700399/970334851896750960577261378321772998240802013604 : -59636173615502879504846810677646864329901430096139563516090202443694810309127/955833935771565601591243078845907133814963790187832340692216425242529192 : 1)], 2, 113.302910926080)
• ## sage/schemes/elliptic_curves/lseries_ell.py

diff --git a/sage/schemes/elliptic_curves/lseries_ell.py b/sage/schemes/elliptic_curves/lseries_ell.py
 a EXAMPLES: sage: E = EllipticCurve('37a') sage: E.lseries().zeros(2) ***   Warning: new stack size = ... [0.000000000, 5.00317001] sage: a = E.lseries().zeros(20)             # long time ***   Warning: new stack size = ... sage: point([(1,x) for x in a])             # graph  (long time) AUTHOR: EXAMPLES: sage: E = EllipticCurve('37a') sage: E.lseries().zeros_in_interval(6, 10, 0.1)      # long time ***   Warning: new stack size = ... [(6.87039122, 0.248922780), (8.01433081, -0.140168533), (9.93309835, -0.129943029)] """ from sage.lfunctions.lcalc import lcalc EXAMPLES: sage: E = EllipticCurve('37a') sage: E.lseries().twist_zeros(3, -4, -3)         # long time ***   Warning: new stack size = ... {-4: [1.60813783, 2.96144840, 3.89751747], -3: [2.06170900, 3.48216881, 4.45853219]} """ from sage.lfunctions.lcalc import lcalc
• ## sage/schemes/generic/morphism.py

diff --git a/sage/schemes/generic/morphism.py b/sage/schemes/generic/morphism.py
 a #******************************************************************* # Abelian varieties #******************************************************************* class SchemeMorphism_point_abelian_variety_field\ (AdditiveGroupElement, SchemeMorphism_point_projective_field): class SchemeMorphism_point_abelian_variety_field( AdditiveGroupElement, SchemeMorphism_point_projective_field): """ A rational point of an abelian variety over a field.
• ## sage/schemes/toric/variety.py

diff --git a/sage/schemes/toric/variety.py b/sage/schemes/toric/variety.py
 a ﻿r""" # -*- coding: utf-8 -*- r""" Toric varieties This module provides support for (normal) toric varieties, corresponding to
• ## sage/structure/parent_old.pyx

diff --git a/sage/structure/parent_old.pyx b/sage/structure/parent_old.pyx
 a """ Parents are the SAGE/mathematical analogues of container objects in computer science. TESTS:: sage: V = VectorSpace(GF(2,'a'),2) sage: V.list() [(0, 0), (1, 0), (0, 1), (1, 1)] sage: MatrixSpace(GF(3), 1, 1).list() [[0], [1], [2]] sage: DirichletGroup(3).list() [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1] sage: K = GF(7^6,'a') sage: K.list()[:10] # long time [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2] sage: K. = GF(4) sage: K.list() [0, a, a + 1, 1] """ def __init__(self, coerce_from=[], actions=[], embeddings=[], category=None): # This is just a convenient spot to cover the relevant cython parents, # without bothering the new parents list = parent.Parent._list_from_iterator_cached """ TESTS:: sage: V = VectorSpace(GF(2,'a'),2) sage: V.list() [(0, 0), (1, 0), (0, 1), (1, 1)] sage: MatrixSpace(GF(3), 1, 1).list() [[0], [1], [2]] sage: DirichletGroup(3).list() [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1] sage: K = GF(7^6,'a') sage: K.list()[:10] # long time [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2] sage: K. = GF(4) sage: K.list() [0, a, a + 1, 1] """ ################################################
• ## sage/symbolic/expression.pyx

diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
 a EXAMPLES:: sage: var('x,y,z,a,b,c,d,e,f') (x, y, z, a, b, c, d, e, f) sage: var('x,y,z,a,b,c,d,f,g') (x, y, z, a, b, c, d, f, g) sage: w0 = SR.wild(0); w1 = SR.wild(1); w2 = SR.wild(2) sage: ((x+y)^a).match((x+y)^a)  # no wildcards, so empty dict {} sage: t = (a*(x+y)+a*z+b).match(a*w0+w1) sage: t[w0], t[w1] (x + y, a*z + b) sage: print (a+b+c+d+e+f).match(c) sage: print (a+b+c+d+f+g).match(c) None sage: (a+b+c+d+e+f).has(c) sage: (a+b+c+d+f+g).has(c) True sage: (a+b+c+d+e+f).match(c+w0) {$0: a + b + d + e + f} sage: (a+b+c+d+e+f).match(c+e+w0) sage: (a+b+c+d+f+g).match(c+w0) {$0: a + b + d + f + g} sage: (a+b+c+d+f+g).match(c+g+w0) {$0: a + b + d + f} sage: (a+b).match(a+b+w0) {$0: 0} """ EXAMPLES:: sage: var('x,y,z,a,b,c,d,e,f') (x, y, z, a, b, c, d, e, f) sage: var('x,y,z,a,b,c,d,f,g') (x, y, z, a, b, c, d, f, g) sage: w0 = SR.wild(0); w1 = SR.wild(1) sage: t = a^2 + b^2 + (x+y)^3 """ EXAMPLES:: sage: var('x,y,z,a,b,c,d,e,f') (x, y, z, a, b, c, d, e, f) sage: var('x,y,z,a,b,c,d,f') (x, y, z, a, b, c, d, f) sage: w0 = SR.wild(0); w1 = SR.wild(1) sage: (a^2 + b^2 + (x+y)^2)._subs_expr(w0^2 == w0^3) (x + y)^3 + a^3 + b^3 :: sage: gp('gamma(1+I)') # 32-bit 0.4980156681183560427136911175 - 0.1549498283018106851249551305*I :: sage: gp('gamma(1+I)') # 64-bit 0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I sage: gp('gamma(1+I)') 0.4980156681183560427136911175 - 0.1549498283018106851249551305*I # 32-bit 0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I # 64-bit We plot the familiar plot of this log-convex function:: assumed to be an integer, a real if with r, and so on:: sage: solve( sin(x)==cos(x), x, to_poly_solve=True) [x == 1/4*pi + pi*z74] [x == 1/4*pi + pi*z...] An effort is made to only return solutions that satisfy the current assumptions:: sage: from sage.calculus.calculus import maxima sage: sol = maxima(cos(x)==0).to_poly_solve(x) sage: sol.sage() [[x == -1/2*pi + 2*pi*z86], [x == 1/2*pi + 2*pi*z88]] [[x == -1/2*pi + 2*pi*z...], [x == 1/2*pi + 2*pi*z...]] If a returned unsolved expression has a denominator, but the original one did not, this may also be true:: sage: from sage.calculus.calculus import maxima sage: sol = maxima(cos(x) * sin(x) == 1/2).to_poly_solve(x) sage: sol.sage() [[x == 1/4*pi + pi*z102]] [[x == 1/4*pi + pi*z...]] Some basic inequalities can be also solved:: :: sage: solve(sin(x)==1/2,x,to_poly_solve='force') [x == 5/6*pi + 2*pi*z116, x == 1/6*pi + 2*pi*z114] [x == 5/6*pi + 2*pi*z..., x == 1/6*pi + 2*pi*z...] :trac:11618 fixed:: sage: b.solve(t) [] sage: b.solve(t, to_poly_solve=True) [t == 1/450*I*pi*z128 + 1/900*log(3/4*sqrt(41) + 25/4), t == 1/450*I*pi*z126 + 1/900*log(-3/4*sqrt(41) + 25/4)] [t == 1/450*I*pi*z... + 1/900*log(3/4*sqrt(41) + 25/4), t == 1/450*I*pi*z... + 1/900*log(-3/4*sqrt(41) + 25/4)] sage: n(1/900*log(-3/4*sqrt(41) + 25/4)) 0.000411051404934985
• ## sage/symbolic/function.pyx

diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx
 a sage: import numpy sage: a = numpy.arange(5) sage: csc(a) Warning: divide by zero encountered in divide array([        inf,  1.18839511,  1.09975017,  7.0861674 , -1.32134871]) sage: factorial(a)
• ## sage/tests/cmdline.py

diff --git a/sage/tests/cmdline.py b/sage/tests/cmdline.py`
 a sage: (out, err, ret) = test_executable(["sage", "-t", script]) sage: ret 128 sage: out.find("1 items had failures:") >= 0 sage: out.find("1 item had failures:") >= 0 True sage: os.environ['SAGE_TESTDIR'] = OLD_TESTDIR  # just in case