Ticket #12415: 12415_doctest_fixes.patch
File 12415_doctest_fixes.patch, 116.2 KB (added by , 7 years ago) |
---|
-
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 b 208 208 // : names x y 209 209 // block 2 : ordering C 210 210 sage: f = singular('9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + \ 211 ... 212 ... 211 ....: 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 - \ 212 ....: 9*x^12*y^3 - 18*x^13*y^2 + 9*x^16') 213 213 214 214 Wir haben also das Polynom :math:`f` definiert, nun geben wir es aus und faktorisieren es. 215 215 … … 239 239 :: 240 240 241 241 sage: x, y = QQ['x, y'].gens() 242 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 \243 ... + 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\244 ... 242 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 \ 243 ....: + 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 \ 244 ....: - 18*x^13*y^2 + 9*x^16 245 245 sage: factor(f) 246 246 (9) * (-x^5 + y^2)^2 * (x^6 - 2*x^3*y^2 - x^2*y^3 + y^4) 247 247 … … 312 312 313 313 :: 314 314 315 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', \316 ... '[plot_format,openmath]') # not tested315 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested 316 ....: '[plot_format,openmath]') 317 317 318 318 Ein "live" 3D-Plot, den man mit der Maus bewegen kann: 319 319 320 320 :: 321 321 322 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", \323 ... '[plot_format, openmath]') # not tested324 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", \325 ... "[grid, 50, 50]",'[plot_format, openmath]') # not tested322 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested 323 ....: '[plot_format, openmath]') 324 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested 325 ....: "[grid, 50, 50]",'[plot_format, openmath]') 326 326 327 327 Der nächste Plot ist das berühmte Möbiusband: 328 328 329 329 :: 330 330 331 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), \332 ... y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\333 ... '[plot_format, openmath]') # not tested331 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested 332 ....: "[x, -4, 4]", "[y, -4, 4]", 333 ....: '[plot_format, openmath]') 334 334 335 335 Und der letzte ist die berühmte Kleinsche Flasche: 336 336 337 337 :: 338 338 339 sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\ 340 ... - 10.0") 339 sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0") 341 340 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 342 341 sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") 343 342 -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) 344 343 sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 345 344 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) 346 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", \347 ... "[y, -%pi, %pi]", "['grid, 40, 40]",\348 ... '[plot_format, openmath]') # not tested345 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested 346 ....: "[y, -%pi, %pi]", "['grid, 40, 40]", 347 ....: '[plot_format, openmath]') 349 348 -
doc/de/tutorial/programming.rst
diff --git a/doc/de/tutorial/programming.rst b/doc/de/tutorial/programming.rst
a b 618 618 :: 619 619 620 620 >>> for i in range(5): 621 622 621 ... print(i) 622 ... 623 623 0 624 624 1 625 625 2 … … 636 636 :: 637 637 638 638 sage: for i in range(5): 639 ... print(i) # now hit enter twice 639 ....: print(i) # now hit enter twice 640 ....: 640 641 0 641 642 1 642 643 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 b 369 369 :: 370 370 371 371 sage: L.zeros(10) 372 *** Warning: new stack size = ... 372 373 [0.000000000, 0.000000000, 2.87609907, 4.41689608, 5.79340263, 373 374 6.98596665, 7.47490750, 8.63320525, 9.63307880, 10.3514333] 374 375 -
doc/en/constructions/plotting.rst
diff --git a/doc/en/constructions/plotting.rst b/doc/en/constructions/plotting.rst
a b 197 197 198 198 :: 199 199 200 sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]', \201 ... '[plot_format,openmath]') # optional -- pops up a window.200 sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]', # optional -- pops up a window. 201 ....: '[plot_format,openmath]') 202 202 203 203 (Mac OS X users: Note that these ``openmath`` commands were run in a 204 204 session of started in an xterm shell, not using the standard Mac … … 226 226 227 227 :: 228 228 229 sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]", \230 ... '[plot_format, openmath]') #optional229 sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]", # optional 230 ....: '[plot_format, openmath]') 231 231 232 232 By rotating this suitably, you can view the contour plot. 233 233 -
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 b 210 210 parsed and converted if possible to a corresponding Sage/Python 211 211 object. 212 212 213 .. skip 214 213 215 :: 214 216 215 217 def cartan_matrix(type, rank): … … 439 441 -2 # 64-bit 440 442 [2]: 441 443 0 # 32-bit 442 -1# 64-bit444 1 # 64-bit 443 445 [3]: 444 446 1 445 447 ... … … 451 453 `L`. Python has some very useful string manipulation commands to do 452 454 just that. 453 455 456 .. skip 457 454 458 :: 455 459 456 460 def points_parser(string_points,F): … … 512 516 Singular and Sage unless `d=1`. So, for this reason, we restrict 513 517 ourselves to points of degree one. 514 518 519 .. skip 520 515 521 :: 516 522 517 523 def places_on_curve(f,F): … … 525 531 526 532 EXAMPLES: 527 533 sage: F=GF(5) 528 sage: R= MPolynomialRing(F,2,names=["x","y"])534 sage: R=PolynomialRing(F,2,names=["x","y"]) 529 535 sage: x,y=R.gens() 530 536 sage: f=y^2-x^9-x 531 537 sage: places_on_curve(f,F) … … 580 586 sage: singular.set_ring(R) 581 587 sage: L = singular.new('POINTS') 582 588 589 Note that these elements of L are defined modulo 5 in Singular, and 590 they compare differently than you would expect from their print 591 representation: 592 583 593 .. link 584 594 585 595 :: 586 596 587 sage: [(L[i][1], L[i][2], L[i][3]) for i in range(1,7)] 588 [(0, 1, 0), (2, 2, 1), (0, 0, 1), (-2, -1, 1), (-2, 1, 1), (2, -2, 1)] # 32-bit 589 [(0, 1, 0), (-2, 1, 1), (-2, -1, 1), (2, 2, 1), (0, 0, 1), (2, -2, 1)] # 64-bit 597 sage: sorted([(L[i][1], L[i][2], L[i][3]) for i in range(1,7)]) 598 [(0, 0, 1), (0, 1, 0), (2, 2, 1), (2, -2, 1), (-2, 1, 1), (-2, -1, 1)] 590 599 591 600 Next, we implement the general function (for brevity we omit the 592 601 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 b 90 90 91 91 An example template for a ``_latex_`` method follows: 92 92 93 .. skip 94 93 95 :: 94 96 95 97 class X: … … 136 138 137 139 sage: pi 138 140 pi 139 sage: float(pi) 141 sage: float(pi) # rel tol 1e-10 140 142 3.1415926535897931 141 143 """ 142 144 ... -
doc/en/developer/conventions.rst
diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
a b 449 449 therefore whom to contact if they have questions). 450 450 451 451 Use the following template when documenting functions. Note the 452 indentation:: 452 indentation: 453 454 .. skip 455 456 :: 453 457 454 458 def point(self, x=1, y=2): 455 459 r""" … … 793 797 sage: U, S, V = A.SVD() 794 798 sage: (U.transpose()*U-identity_matrix(8)).norm(p=2) # abs tol 1e-10 795 799 0.0 796 800 797 801 The 8-th cyclotomic field is generated by the complex number 798 802 `e^\frac{i\pi}{4}`. Here we compute a numerical approximation:: 799 803 800 804 sage: K.<zeta8> = CyclotomicField(8) 801 805 sage: N(zeta8) # absolute tolerance 1e-10 802 806 0.7071067812 + 0.7071067812*I 803 807 804 The "tolerance" feature checks for floating-point literals, which 805 may occur anywhere in the doctest output, for example as polynomial 806 coefficients:: 807 808 sage: y = polygen(RDF, 'y') 809 sage: p = (y - 10^10) * (y - 1); p 810 y^2 - 10000000001.0*y + 10000000000.0 811 sage: p # rel tol 1e-9 812 y^2 - 1e10*y + 1e10 813 814 815 - If a line contains ``todo: not implemented``, it is never 816 tested. It is good to include lines like this to make clear what we 817 want Sage to eventually implement: 808 A relative tolerance on a root of a polynomial. Notice that the 809 root should normally print as ``1e+16``, or something similar. 810 However, the tolerance testing causes the doctest framework to use 811 the output in a *computation*, so other valid text representations 812 of the predicted value may be used. However, they must fit the 813 pattern defined by the regular expression ``float_regex`` in 814 :mod:`sage.doctest.parsing`. 818 815 819 816 :: 820 817 821 sage: factor(x*y - x*z) # todo: not implemented 818 sage: y = polygen(RDF, 'y') 819 sage: p = (y - 10^16)*(y-10^(-13))*(y-2); p 820 y^3 - 1e+16*y^2 + 2e+16*y - 2000.0 821 sage: p.roots(multiplicities=False)[2] # relative tol 1e-10 822 10000000000000000 823 824 - If a line contains ``not implemented``, it is never 825 tested. It is good to include lines like this to make clear what we 826 want Sage to eventually implement:: 827 828 sage: factor(x*y - x*z) # todo: not implemented 822 829 823 830 It is also immediately clear to the user that the indicated example 824 831 does not currently work. -
doc/en/developer/doctesting.rst
diff --git a/doc/en/developer/doctesting.rst b/doc/en/developer/doctesting.rst
a b 1 .. nodoctest 2 1 3 .. _chapter-doctesting: 2 4 3 5 =========================== -
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 b 123 123 # (use "git add <file>..." to update what will be committed) 124 124 # (use "git checkout -- <file>..." to discard changes in working directory) 125 125 # 126 # 126 # modified: README 127 127 # 128 128 # Untracked files: 129 129 # (use "git add <file>..." to include in what will be committed) 130 130 # 131 # 131 # INSTALL 132 132 no changes added to commit (use "git add" and/or "git commit -a") 133 133 134 134 #. 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 b 59 59 Just for your own satisfaction, show yourself that you now have a new 60 60 'remote', with ``git remote -v show``, giving you something like:: 61 61 62 upstream 63 upstream 64 origin 65 origin 62 upstream git://github.com/sagemath/sagenb.git (fetch) 63 upstream git://github.com/sagemath/sagenb.git (push) 64 origin git@github.com:your-user-name/sagenb.git (fetch) 65 origin git@github.com:your-user-name/sagenb.git (push) 66 66 67 67 .. include:: links.inc 68 68 -
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 b 551 551 D4(0,0,0,1) 552 552 553 553 By contrast, ``rule="automorphic"`` simply interchanges the two 554 spin representations, as it always does in Type D: :554 spin representations, as it always does in Type D: 555 555 556 556 .. link: 557 557 -
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 b 162 162 irreducibles, each with multiplicity one. 163 163 164 164 The highest weights that appear here are available (with their 165 coefficients) through the usual free module accessors: :165 coefficients) through the usual free module accessors: 166 166 167 167 .. link 168 168 … … 248 248 So far we have been working with `n=3`. For general `n`:: 249 249 250 250 sage: def f(n,k): 251 ... 252 ... 253 ... 254 ... 255 sage: [f(n,5) for n in [2..7]] 251 ....: R = WeylCharacterRing(['A',n-1]) 252 ....: tr = R(R.fundamental_weights()[1]) 253 ....: return sum(d^2 for d in (tr^k).coefficients()) 254 ....: 255 sage: [f(n,5) for n in [2..7]] # long time 256 256 [42, 103, 119, 120, 120, 120] 257 257 258 258 We see that the 10-th moment of `tr(g)` is just `5!` when `n` is sufficiently … … 264 264 265 265 sage: [f(2,k) for k in [1..10]] 266 266 [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] 267 sage: [catalan_number(k) for k in [1.. k]]267 sage: [catalan_number(k) for k in [1..10]] 268 268 [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] 269 269 270 270 … … 537 537 538 538 sage: [f(2,k) for k in [1..10]] 539 539 [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] 540 sage: [catalan_number(k) for k in [1.. k]]540 sage: [catalan_number(k) for k in [1..10]] 541 541 [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796] 542 542 543 543 … … 560 560 [1, 0, 0, 1, 0, 1, 0] 561 561 562 562 If we want the multiplicity of some other representation, we may 563 obtain that using the method ``multiplicity``: :563 obtain that using the method ``multiplicity``: 564 564 565 565 .. link 566 566 -
doc/en/tutorial/interfaces.rst
diff --git a/doc/en/tutorial/interfaces.rst b/doc/en/tutorial/interfaces.rst
a b 304 304 Finally, we give an example of using Sage to plot using ``openmath``. 305 305 Many of these were modified from the Maxima reference manual. 306 306 307 A 2D plot of several functions (do not type the ``...``): 307 A 2D plot of several functions (do not type the ``...``):: 308 308 309 :: 310 311 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ 312 ... '[plot_format,openmath]') # not tested 309 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested 310 ....: '[plot_format,openmath]') 313 311 314 312 A "live" 3D plot which you can move with your mouse (do not type 315 the ``...``): 313 the ``...``):: 316 314 317 :: 315 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested 316 ....: '[plot_format, openmath]') 317 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested 318 ....: "[grid, 50, 50]",'[plot_format, openmath]') 318 319 319 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ 320 ... '[plot_format, openmath]') # not tested 321 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ 322 ... "[grid, 50, 50]",'[plot_format, openmath]') # not tested 320 The next plot is the famous Möbius strip (do not type the ``...``):: 323 321 324 The next plot is the famous Möbius strip (do not type the ``...``): 322 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested 323 ....: "[x, -4, 4]", "[y, -4, 4]", '[plot_format, openmath]') 325 324 326 ::325 The next plot is the famous Klein bottle (do not type the ``...``):: 327 326 328 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ 329 ... y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ 330 ... '[plot_format, openmath]') # not tested 331 332 The next plot is the famous Klein bottle (do not type the ``...``): 333 334 :: 335 336 sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\ 337 ... - 10.0") 327 sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0") 338 328 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 339 329 sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") 340 330 -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) 341 331 sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 342 332 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) 343 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ 344 ... "[y, -%pi, %pi]", "['grid, 40, 40]",\ 345 ... '[plot_format, openmath]') # not tested 333 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested 334 ....: "[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 b 594 594 :: 595 595 596 596 >>> for i in range(5): 597 598 597 ... print(i) 598 ... 599 599 0 600 600 1 601 601 2 … … 611 611 :: 612 612 613 613 sage: for i in range(5): 614 ... print(i) # now hit enter twice 614 ....: print(i) # now hit enter twice 615 ....: 615 616 0 616 617 1 617 618 2 … … 625 626 :: 626 627 627 628 sage: for i in range(15): 628 ... if gcd(i,15) == 1: 629 ... print(i) 629 ....: if gcd(i,15) == 1: 630 ....: print(i) 631 ....: 630 632 1 631 633 2 632 634 4 -
doc/fr/tutorial/interfaces.rst
diff --git a/doc/fr/tutorial/interfaces.rst b/doc/fr/tutorial/interfaces.rst
a b 318 318 319 319 :: 320 320 321 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', \322 ... '[plot_format,openmath]') # not tested321 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested 322 ....: '[plot_format,openmath]') 323 323 324 324 Un graphique 3D interactif, que vous pouvez déplacer à la souris 325 325 (n'entrez pas les ``...``) : 326 326 327 327 :: 328 328 329 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", \330 ... '[plot_format, openmath]') # not tested331 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", \332 ... "[grid, 50, 50]",'[plot_format, openmath]') # not tested329 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested 330 ....: '[plot_format, openmath]') 331 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested 332 ....: "[grid, 50, 50]",'[plot_format, openmath]') 333 333 334 334 Le célèbre ruban de Möbius (n'entrez pas les ``...``) : 335 335 336 336 :: 337 337 338 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), \339 ... y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\340 ... '[plot_format, openmath]') # not tested338 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested 339 ....: "[x, -4, 4]", "[y, -4, 4]", 340 ....: '[plot_format, openmath]') 341 341 342 342 Et la fameuse bouteille de Klein (n'entrez pas les ``...``): 343 343 … … 350 350 -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) 351 351 sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 352 352 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) 353 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", \354 ... "[y, -%pi, %pi]", "['grid, 40, 40]",\355 ... '[plot_format, openmath]') # not tested353 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested 354 ....: "[y, -%pi, %pi]", "['grid, 40, 40]", 355 ....: '[plot_format, openmath]') 356 356 -
doc/fr/tutorial/programming.rst
diff --git a/doc/fr/tutorial/programming.rst b/doc/fr/tutorial/programming.rst
a b 613 613 :: 614 614 615 615 >>> for i in range(5): 616 617 616 ... print(i) 617 ... 618 618 0 619 619 1 620 620 2 … … 632 632 :: 633 633 634 634 sage: for i in range(5): 635 ... 635 ....: print(i) # appuyez deux fois sur entrée ici 636 636 0 637 637 1 638 638 2 -
doc/ru/tutorial/interfaces.rst
diff --git a/doc/ru/tutorial/interfaces.rst b/doc/ru/tutorial/interfaces.rst
a b 299 299 300 300 :: 301 301 302 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', \303 ... '[plot_format,openmath]') # not tested302 sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested 303 ... '[plot_format,openmath]') 304 304 305 305 "Живой" трехмерный график, который вы можете вращать мышкой (не вводите ``...``): 306 306 307 307 :: 308 308 309 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", \310 ... '[plot_format, openmath]') # not tested311 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", \312 ... "[grid, 50, 50]",'[plot_format, openmath]') # not tested309 sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested 310 ... '[plot_format, openmath]') 311 sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested 312 ... "[grid, 50, 50]",'[plot_format, openmath]') 313 313 314 314 Следующий график — это знаменитая Лента Мёбиуса (не вводите ``...``): 315 315 316 316 :: 317 317 318 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), \319 ... y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\320 ... '[plot_format, openmath]') # not tested318 sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested 319 ....: "[x, -4, 4]", "[y, -4, 4]", 320 ....: '[plot_format, openmath]') 321 321 322 322 Следующий график — это знаменитая Бутылка Клейна (не вводите ``...``): 323 323 … … 330 330 -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) 331 331 sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 332 332 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) 333 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", \334 ... "[y, -%pi, %pi]", "['grid, 40, 40]", \335 ... '[plot_format, openmath]') # not tested333 sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested 334 ... "[y, -%pi, %pi]", "['grid, 40, 40]", 335 ... '[plot_format, openmath]') -
doc/ru/tutorial/programming.rst
diff --git a/doc/ru/tutorial/programming.rst b/doc/ru/tutorial/programming.rst
a b 576 576 :: 577 577 578 578 >>> for i in range(5): 579 580 579 ... print(i) 580 ... 581 581 0 582 582 1 583 583 2 … … 592 592 :: 593 593 594 594 sage: for i in range(5): 595 ... print(i) # нажмите Enter дважды 595 ....: print(i) # нажмите Enter дважды 596 ....: 596 597 0 597 598 1 598 599 2 -
sage/all.py
diff --git a/sage/all.py b/sage/all.py
a b 14 14 sage: import inspect 15 15 sage: from sage import * 16 16 sage: frames=[x for x in gc.get_objects() if inspect.isframe(x)] 17 sage: len(frames) 18 11 19 17 18 We exclude the known files and check to see that there are no others:: 19 20 sage: import os 21 sage: allowed = [os.path.join("lib","python","threading.py")] 22 sage: allowed.append(os.path.join("lib","python","multiprocessing")) 23 sage: allowed.append(os.path.join("sage","doctest")) 24 sage: allowed.append(os.path.join("local","bin","sage-runtests")) 25 sage: allowed.append(os.path.join("site-packages","IPython")) 26 sage: allowed.append(os.path.join("local","bin","sage-ipython")) 27 sage: allowed.append("<ipython console>") 28 sage: allowed.append("<doctest sage.all[3]>") 29 sage: allowed.append(os.path.join("sage","combinat","species","generating_series.py")) 30 sage: for i in frames: 31 ....: filename, lineno, funcname, linelist, indx = inspect.getframeinfo(i) 32 ....: for nm in allowed: 33 ....: if nm in filename: 34 ....: break 35 ....: else: 36 ....: print filename 37 ....: 20 38 """ 21 39 22 40 ############################################################################### -
sage/calculus/calculus.py
diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
a b 1740 1740 sage: sefms("x # 3") == SR(x != 3) 1741 1741 True 1742 1742 sage: solve([x != 5], x) 1743 #0: solve_rat_ineq(ineq=x # 5) 1743 1744 [[x - 5 != 0]] 1744 1745 sage: solve([2*x==3, x != 5], x) 1745 1746 [[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 b 1 # -*- coding: utf-8 -*- 1 2 r""" 2 3 A Sample Session using SymPy 3 4 … … 111 112 sage: f = e.series(x, 0, 10); f 112 113 1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10) 113 114 114 And the pretty-printer:: 115 And the pretty-printer. Since unicode characters aren't working on 116 some archictures, we disable it:: 115 117 118 sage: from sympy.printing import pprint_use_unicode 119 sage: prev_use = pprint_use_unicode(False) 116 120 sage: pprint(e) 117 1 118 ------- 119 3 120 cos (x) 121 1 122 ------- 123 3 124 cos (x) 125 121 126 sage: pprint(f) 122 2 4 6 8 123 3*x 11*x 241*x 8651*x 124 1 + ---- + ----- + ------ + ------- + O(x**10) 125 2 8 240 13440 127 2 4 6 8 128 3*x 11*x 241*x 8651*x 129 1 + ---- + ----- + ------ + ------- + O(x**10) 130 2 8 240 13440 131 sage: pprint_use_unicode(prev_use) 132 False 126 133 127 134 And the functionality to convert from sympy format to Sage format:: 128 135 -
sage/categories/groups.py
diff --git a/sage/categories/groups.py b/sage/categories/groups.py
a b 44 44 return [Monoids()] 45 45 46 46 def example(self): 47 from sage.rings.rational_field import QQ48 from sage.groups.matrix_gps.general_linear import GL49 47 """ 50 48 EXAMPLES:: 51 49 52 50 sage: Groups().example() 53 51 General Linear Group of degree 4 over Rational Field 54 52 """ 53 from sage.rings.rational_field import QQ 54 from sage.groups.matrix_gps.general_linear import GL 55 55 return GL(4,QQ) 56 56 57 57 class ParentMethods: 58 58 59 59 def group_generators(self): 60 from sage.sets.family import Family61 60 """ 62 61 Returns group generators for self. 63 62 … … 70 69 sage: A.group_generators() 71 70 Family ((2,3,4), (1,2,3)) 72 71 """ 72 from sage.sets.family import Family 73 73 return Family(self.gens()) 74 74 75 75 def _test_inverse(self, **options): -
sage/categories/semigroups.py
diff --git a/sage/categories/semigroups.py b/sage/categories/semigroups.py
a b 441 441 442 442 @cached_method 443 443 def algebra_generators(self): 444 from sage.sets.family import Family445 444 r""" 446 445 The generators of this algebra, as per 447 446 :meth:`Algebras.ParentMethods.algebra_generators() … … 455 454 sage: A.algebra_generators() 456 455 Finite family {0: B['a'], 1: B['b'], 2: B['c'], 3: B['d']} 457 456 """ 457 from sage.sets.family import Family 458 458 return self.basis().keys().semigroup_generators().map(self.monomial) 459 459 460 460 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 b 1246 1246 """ 1247 1247 return self._realizations 1248 1248 1249 facade_for = realizations1250 """1251 Returns the parents ``self`` is a facade for, that is1252 the realizations of ``self``1249 def facade_for(self): 1250 """ 1251 Returns the parents ``self`` is a facade for, that is 1252 the realizations of ``self`` 1253 1253 1254 EXAMPLES::1254 EXAMPLES:: 1255 1255 1256 sage: A = Sets().WithRealizations().example(); A1257 The subset algebra of {1, 2, 3} over Rational Field1258 sage: A.facade_for()1259 [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]1256 sage: A = Sets().WithRealizations().example(); A 1257 The subset algebra of {1, 2, 3} over Rational Field 1258 sage: A.facade_for() 1259 [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] 1260 1260 1261 sage: A = Sets().WithRealizations().example(); A 1262 The subset algebra of {1, 2, 3} over Rational Field 1263 sage: f = A.F().an_element(); f 1264 F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}] 1265 sage: i = A.In().an_element(); i 1266 In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}] 1267 sage: o = A.Out().an_element(); o 1268 Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}] 1269 sage: f in A, i in A, o in A 1270 (True, True, True) 1271 """ 1261 sage: A = Sets().WithRealizations().example(); A 1262 The subset algebra of {1, 2, 3} over Rational Field 1263 sage: f = A.F().an_element(); f 1264 F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}] 1265 sage: i = A.In().an_element(); i 1266 In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}] 1267 sage: o = A.Out().an_element(); o 1268 Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}] 1269 sage: f in A, i in A, o in A 1270 (True, True, True) 1271 """ 1272 return self.realizations() 1272 1273 1273 1274 # Do we really want this feature? 1274 1275 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 b 65 65 (0, 1) 66 66 sage: b.weight() 67 67 (1, 0, 0) 68 """69 68 70 r"""71 69 The following is required, because :class:`DirectSumOfCrystals` 72 70 takes the same arguments as :class:`DisjointUnionEnumeratedSets` 73 71 (which see for details). -
sage/combinat/free_module.py
diff --git a/sage/combinat/free_module.py b/sage/combinat/free_module.py
a b 147 147 sage: F.print_options(monomial_cmp = lambda x,y: -cmp(x,y)) 148 148 sage: f._sorted_items_for_printing() 149 149 [('c', 2), ('b', 3), ('a', 1)] 150 sage: F.print_options(monomial_cmp=cmp) #reset to original state 150 151 151 152 .. seealso:: :meth:`_repr_`, :meth:`_latex_`, :meth:`print_options` 152 153 """ … … 1048 1049 sage: F4.prefix() 1049 1050 'F' 1050 1051 1052 sage: F2.print_options(prefix='F') #reset for following doctests 1053 1051 1054 The default category is the category of modules with basis over 1052 1055 the base ring:: 1053 1056 … … 1063 1066 Customizing print and LaTeX representations of elements:: 1064 1067 1065 1068 sage: F = CombinatorialFreeModule(QQ, ['a','b'], prefix='x') 1069 sage: original_print_options = F.print_options() 1066 1070 sage: e = F.basis() 1067 1071 sage: e['a'] - 3 * e['b'] 1068 1072 x['a'] - 3*x['b'] … … 1117 1121 sage: tensor([f, g]) 1118 1122 2*x[1] # y[3] + x[1] # y[4] + 4*x[2] # y[3] + 2*x[2] # y[4] 1119 1123 1124 sage: F.print_options(**original_print_options) # reset print options 1120 1125 """ 1121 1126 1122 1127 @staticmethod … … 1673 1678 1674 1679 sage: sorted(F.print_options().items()) 1675 1680 [('bracket', '('), ('latex_bracket', False), ('latex_prefix', None), ('latex_scalar_mult', None), ('monomial_cmp', <built-in function cmp>), ('prefix', 'x'), ('scalar_mult', '*'), ('tensor_symbol', None)] 1676 1681 sage: F.print_options(bracket='[') # reset 1677 1682 """ 1678 1683 # don't just use kwds.get(...) because I want to distinguish 1679 1684 # between an argument like "option=None" and the option not … … 1728 1733 F['a'] + 2*F['b'] 1729 1734 1730 1735 sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="") 1736 sage: original_print_options = QS3.print_options() 1731 1737 sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1]) 1732 1738 sage: a # indirect doctest 1733 1739 2*[[1, 2, 3]] + 4*[[3, 2, 1]] … … 1744 1750 sage: a # indirect doctest 1745 1751 2 *@* |[1, 2, 3]| + 4 *@* |[3, 2, 1]| 1746 1752 1753 sage: QS3.print_options(**original_print_options) # reset 1754 1747 1755 TESTS:: 1748 1756 1749 1757 sage: F = CombinatorialFreeModule(QQ, [('a', 'b'), ('c','d')]) … … 1805 1813 C_{a} + 2C_{b} 1806 1814 1807 1815 sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="", scalar_mult="*") 1816 sage: original_print_options = QS3.print_options() 1808 1817 sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1]) 1809 1818 sage: latex(a) # indirect doctest 1810 1819 2[1, 2, 3] + 4[3, 2, 1] … … 1817 1826 sage: QS3.print_options(latex_bracket=('\\myleftbracket', '\\myrightbracket')) 1818 1827 sage: latex(a) # indirect doctest 1819 1828 2\myleftbracket[1, 2, 3]\myrightbracket + 4\myleftbracket[3, 2, 1]\myrightbracket 1829 sage: QS3.print_options(**original_print_options) # reset 1820 1830 1821 1831 TESTS:: 1822 1832 -
sage/combinat/partition_algebra.py
diff --git a/sage/combinat/partition_algebra.py b/sage/combinat/partition_algebra.py
a b 51 51 #A_k# 52 52 ##### 53 53 SetPartitionsAk = functools.partial(create_set_partition_function,"A") 54 SetPartitionsAk.__doc__ = """ 55 Returns the combinatorial class of set partitions of type A_k. 54 SetPartitionsAk.__doc__ = ( 55 """ 56 Returns the combinatorial class of set partitions of type A_k. 56 57 57 EXAMPLES::58 EXAMPLES:: 58 59 59 sage: A3 = SetPartitionsAk(3); A360 Set partitions of {1, ..., 3, -1, ..., -3}60 sage: A3 = SetPartitionsAk(3); A3 61 Set partitions of {1, ..., 3, -1, ..., -3} 61 62 62 sage: A3.first() #random63 {{1, 2, 3, -1, -3, -2}}64 sage: A3.last() #random65 {{-1}, {-2}, {3}, {1}, {-3}, {2}}66 sage: A3.random_element() #random67 {{1, 3, -3, -1}, {2, -2}}63 sage: A3.first() #random 64 {{1, 2, 3, -1, -3, -2}} 65 sage: A3.last() #random 66 {{-1}, {-2}, {3}, {1}, {-3}, {2}} 67 sage: A3.random_element() #random 68 {{1, 3, -3, -1}, {2, -2}} 68 69 69 sage: A3.cardinality()70 20370 sage: A3.cardinality() 71 203 71 72 72 sage: A2p5 = SetPartitionsAk(2.5); A2p573 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block74 sage: A2p5.cardinality()75 5273 sage: A2p5 = SetPartitionsAk(2.5); A2p5 74 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block 75 sage: A2p5.cardinality() 76 52 76 77 77 sage: A2p5.first() #random78 {{1, 2, 3, -1, -3, -2}}79 sage: A2p5.last() #random80 {{-1}, {-2}, {2}, {3, -3}, {1}}81 sage: A2p5.random_element() #random82 {{-1}, {-2}, {3, -3}, {1, 2}}83 84 """ 78 sage: A2p5.first() #random 79 {{1, 2, 3, -1, -3, -2}} 80 sage: A2p5.last() #random 81 {{-1}, {-2}, {2}, {3, -3}, {1}} 82 sage: A2p5.random_element() #random 83 {{-1}, {-2}, {3, -3}, {1, 2}} 84 85 """) 85 86 86 87 class SetPartitionsAk_k(set_partition.SetPartitions_set): 87 88 def __init__(self, k): … … 195 196 #S_k# 196 197 ##### 197 198 SetPartitionsSk = functools.partial(create_set_partition_function,"S") 198 SetPartitionsSk.__doc__ = """ 199 Returns the combinatorial class of set partitions of type S_k. There 200 is a bijection between these set partitions and the permutations 201 of 1, ..., k. 199 SetPartitionsSk.__doc__ = ( 200 """ 201 Returns the combinatorial class of set partitions of type S_k. There 202 is a bijection between these set partitions and the permutations 203 of 1, ..., k. 202 204 203 EXAMPLES::205 EXAMPLES:: 204 206 205 sage: S3 = SetPartitionsSk(3); S3206 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3207 sage: S3.cardinality()208 6207 sage: S3 = SetPartitionsSk(3); S3 208 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3 209 sage: S3.cardinality() 210 6 209 211 210 sage: S3.list() #random211 [{{2, -2}, {3, -3}, {1, -1}},212 {{1, -1}, {2, -3}, {3, -2}},213 {{2, -1}, {3, -3}, {1, -2}},214 {{1, -2}, {2, -3}, {3, -1}},215 {{1, -3}, {2, -1}, {3, -2}},216 {{1, -3}, {2, -2}, {3, -1}}]217 sage: S3.first() #random218 {{2, -2}, {3, -3}, {1, -1}}219 sage: S3.last() #random220 {{1, -3}, {2, -2}, {3, -1}}221 sage: S3.random_element() #random222 {{1, -3}, {2, -1}, {3, -2}}212 sage: S3.list() #random 213 [{{2, -2}, {3, -3}, {1, -1}}, 214 {{1, -1}, {2, -3}, {3, -2}}, 215 {{2, -1}, {3, -3}, {1, -2}}, 216 {{1, -2}, {2, -3}, {3, -1}}, 217 {{1, -3}, {2, -1}, {3, -2}}, 218 {{1, -3}, {2, -2}, {3, -1}}] 219 sage: S3.first() #random 220 {{2, -2}, {3, -3}, {1, -1}} 221 sage: S3.last() #random 222 {{1, -3}, {2, -2}, {3, -1}} 223 sage: S3.random_element() #random 224 {{1, -3}, {2, -1}, {3, -2}} 223 225 224 sage: S3p5 = SetPartitionsSk(3.5); S3p5225 Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4226 sage: S3p5.cardinality()227 6226 sage: S3p5 = SetPartitionsSk(3.5); S3p5 227 Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4 228 sage: S3p5.cardinality() 229 6 228 230 229 sage: S3p5.list() #random230 [{{2, -2}, {3, -3}, {1, -1}, {4, -4}},231 {{2, -3}, {1, -1}, {4, -4}, {3, -2}},232 {{2, -1}, {3, -3}, {1, -2}, {4, -4}},233 {{2, -3}, {1, -2}, {4, -4}, {3, -1}},234 {{1, -3}, {2, -1}, {4, -4}, {3, -2}},235 {{1, -3}, {2, -2}, {4, -4}, {3, -1}}]236 sage: S3p5.first() #random237 {{2, -2}, {3, -3}, {1, -1}, {4, -4}}238 sage: S3p5.last() #random239 {{1, -3}, {2, -2}, {4, -4}, {3, -1}}240 sage: S3p5.random_element() #random241 {{1, -3}, {2, -2}, {4, -4}, {3, -1}}242 """ 231 sage: S3p5.list() #random 232 [{{2, -2}, {3, -3}, {1, -1}, {4, -4}}, 233 {{2, -3}, {1, -1}, {4, -4}, {3, -2}}, 234 {{2, -1}, {3, -3}, {1, -2}, {4, -4}}, 235 {{2, -3}, {1, -2}, {4, -4}, {3, -1}}, 236 {{1, -3}, {2, -1}, {4, -4}, {3, -2}}, 237 {{1, -3}, {2, -2}, {4, -4}, {3, -1}}] 238 sage: S3p5.first() #random 239 {{2, -2}, {3, -3}, {1, -1}, {4, -4}} 240 sage: S3p5.last() #random 241 {{1, -3}, {2, -2}, {4, -4}, {3, -1}} 242 sage: S3p5.random_element() #random 243 {{1, -3}, {2, -2}, {4, -4}, {3, -1}} 244 """) 243 245 class SetPartitionsSk_k(SetPartitionsAk_k): 244 246 def __repr__(self): 245 247 """ … … 384 386 #I_k# 385 387 ##### 386 388 SetPartitionsIk = functools.partial(create_set_partition_function,"I") 387 SetPartitionsIk.__doc__ = """ 388 Returns the combinatorial class of set partitions of type I_k. These 389 are set partitions with a propagating number of less than k. Note 390 that the identity set partition {{1, -1}, ..., {k, -k}} is not 391 in I_k. 389 SetPartitionsIk.__doc__ = ( 390 """ 391 Returns the combinatorial class of set partitions of type I_k. These 392 are set partitions with a propagating number of less than k. Note 393 that the identity set partition {{1, -1}, ..., {k, -k}} is not 394 in I_k. 392 395 393 EXAMPLES::396 EXAMPLES:: 394 397 395 sage: I3 = SetPartitionsIk(3); I3396 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3397 sage: I3.cardinality()398 197398 sage: I3 = SetPartitionsIk(3); I3 399 Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3 400 sage: I3.cardinality() 401 197 399 402 400 sage: I3.first() #random401 {{1, 2, 3, -1, -3, -2}}402 sage: I3.last() #random403 {{-1}, {-2}, {3}, {1}, {-3}, {2}}404 sage: I3.random_element() #random405 {{-1}, {-3, -2}, {2, 3}, {1}}403 sage: I3.first() #random 404 {{1, 2, 3, -1, -3, -2}} 405 sage: I3.last() #random 406 {{-1}, {-2}, {3}, {1}, {-3}, {2}} 407 sage: I3.random_element() #random 408 {{-1}, {-3, -2}, {2, 3}, {1}} 406 409 407 sage: I2p5 = SetPartitionsIk(2.5); I2p5408 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3409 sage: I2p5.cardinality()410 50410 sage: I2p5 = SetPartitionsIk(2.5); I2p5 411 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3 412 sage: I2p5.cardinality() 413 50 411 414 412 sage: I2p5.first() #random413 {{1, 2, 3, -1, -3, -2}}414 sage: I2p5.last() #random415 {{-1}, {-2}, {2}, {3, -3}, {1}}416 sage: I2p5.random_element() #random417 {{-1}, {-2}, {1, 3, -3}, {2}}415 sage: I2p5.first() #random 416 {{1, 2, 3, -1, -3, -2}} 417 sage: I2p5.last() #random 418 {{-1}, {-2}, {2}, {3, -3}, {1}} 419 sage: I2p5.random_element() #random 420 {{-1}, {-2}, {1, 3, -3}, {2}} 418 421 419 """ 422 """) 420 423 class SetPartitionsIk_k(SetPartitionsAk_k): 421 424 def __repr__(self): 422 425 """ … … 538 541 #B_k# 539 542 ##### 540 543 SetPartitionsBk = functools.partial(create_set_partition_function,"B") 541 SetPartitionsBk.__doc__ = """ 542 Returns the combinatorial class of set partitions of type B_k. 543 These are the set partitions where every block has size 2. 544 SetPartitionsBk.__doc__ = ( 545 """ 546 Returns the combinatorial class of set partitions of type B_k. 547 These are the set partitions where every block has size 2. 544 548 545 EXAMPLES::549 EXAMPLES:: 546 550 547 sage: B3 = SetPartitionsBk(3); B3548 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2551 sage: B3 = SetPartitionsBk(3); B3 552 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 549 553 550 sage: B3.first() #random551 {{2, -2}, {1, -3}, {3, -1}}552 sage: B3.last() #random553 {{1, 2}, {3, -2}, {-3, -1}}554 sage: B3.random_element() #random555 {{2, -1}, {1, -3}, {3, -2}}554 sage: B3.first() #random 555 {{2, -2}, {1, -3}, {3, -1}} 556 sage: B3.last() #random 557 {{1, 2}, {3, -2}, {-3, -1}} 558 sage: B3.random_element() #random 559 {{2, -1}, {1, -3}, {3, -2}} 556 560 557 sage: B3.cardinality()558 15561 sage: B3.cardinality() 562 15 559 563 560 sage: B2p5 = SetPartitionsBk(2.5); B2p5561 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2564 sage: B2p5 = SetPartitionsBk(2.5); B2p5 565 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 562 566 563 sage: B2p5.first() #random564 {{2, -1}, {3, -3}, {1, -2}}565 sage: B2p5.last() #random566 {{1, 2}, {3, -3}, {-1, -2}}567 sage: B2p5.random_element() #random568 {{2, -2}, {3, -3}, {1, -1}}567 sage: B2p5.first() #random 568 {{2, -1}, {3, -3}, {1, -2}} 569 sage: B2p5.last() #random 570 {{1, 2}, {3, -3}, {-1, -2}} 571 sage: B2p5.random_element() #random 572 {{2, -2}, {3, -3}, {1, -1}} 569 573 570 sage: B2p5.cardinality()571 3572 """ 574 sage: B2p5.cardinality() 575 3 576 """) 573 577 574 578 class SetPartitionsBk_k(SetPartitionsAk_k): 575 579 def __repr__(self): … … 740 744 #P_k# 741 745 ##### 742 746 SetPartitionsPk = functools.partial(create_set_partition_function,"P") 743 SetPartitionsPk.__doc__ = """ 744 Returns the combinatorial class of set partitions of type P_k. 745 These are the planar set partitions. 747 SetPartitionsPk.__doc__ = ( 748 """ 749 Returns the combinatorial class of set partitions of type P_k. 750 These are the planar set partitions. 746 751 747 EXAMPLES::752 EXAMPLES:: 748 753 749 sage: P3 = SetPartitionsPk(3); P3750 Set partitions of {1, ..., 3, -1, ..., -3} that are planar751 sage: P3.cardinality()752 132754 sage: P3 = SetPartitionsPk(3); P3 755 Set partitions of {1, ..., 3, -1, ..., -3} that are planar 756 sage: P3.cardinality() 757 132 753 758 754 sage: P3.first() #random755 {{1, 2, 3, -1, -3, -2}}756 sage: P3.last() #random757 {{-1}, {-2}, {3}, {1}, {-3}, {2}}758 sage: P3.random_element() #random759 {{1, 2, -1}, {-3}, {3, -2}}759 sage: P3.first() #random 760 {{1, 2, 3, -1, -3, -2}} 761 sage: P3.last() #random 762 {{-1}, {-2}, {3}, {1}, {-3}, {2}} 763 sage: P3.random_element() #random 764 {{1, 2, -1}, {-3}, {3, -2}} 760 765 761 sage: P2p5 = SetPartitionsPk(2.5); P2p5762 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar763 sage: P2p5.cardinality()764 42766 sage: P2p5 = SetPartitionsPk(2.5); P2p5 767 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar 768 sage: P2p5.cardinality() 769 42 765 770 766 sage: P2p5.first() #random767 {{1, 2, 3, -1, -3, -2}}768 sage: P2p5.last() #random769 {{-1}, {-2}, {2}, {3, -3}, {1}}770 sage: P2p5.random_element() #random771 {{1, 2, 3, -3}, {-1, -2}}771 sage: P2p5.first() #random 772 {{1, 2, 3, -1, -3, -2}} 773 sage: P2p5.last() #random 774 {{-1}, {-2}, {2}, {3, -3}, {1}} 775 sage: P2p5.random_element() #random 776 {{1, 2, 3, -3}, {-1, -2}} 772 777 773 """ 778 """) 774 779 class SetPartitionsPk_k(SetPartitionsAk_k): 775 780 def __repr__(self): 776 781 """ … … 900 905 #T_k# 901 906 ##### 902 907 SetPartitionsTk = functools.partial(create_set_partition_function,"T") 903 SetPartitionsTk.__doc__ = """ 904 Returns the combinatorial class of set partitions of type T_k. 905 These are planar set partitions where every block is of size 2. 908 SetPartitionsTk.__doc__ = ( 909 """ 910 Returns the combinatorial class of set partitions of type T_k. 911 These are planar set partitions where every block is of size 2. 906 912 907 EXAMPLES::913 EXAMPLES:: 908 914 909 sage: T3 = SetPartitionsTk(3); T3910 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar911 sage: T3.cardinality()912 5915 sage: T3 = SetPartitionsTk(3); T3 916 Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar 917 sage: T3.cardinality() 918 5 913 919 914 sage: T3.first() #random915 {{1, -3}, {2, 3}, {-1, -2}}916 sage: T3.last() #random917 {{1, 2}, {3, -1}, {-3, -2}}918 sage: T3.random_element() #random919 {{1, -3}, {2, 3}, {-1, -2}}920 sage: T3.first() #random 921 {{1, -3}, {2, 3}, {-1, -2}} 922 sage: T3.last() #random 923 {{1, 2}, {3, -1}, {-3, -2}} 924 sage: T3.random_element() #random 925 {{1, -3}, {2, 3}, {-1, -2}} 920 926 921 sage: T2p5 = SetPartitionsTk(2.5); T2p5922 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar923 sage: T2p5.cardinality()924 2927 sage: T2p5 = SetPartitionsTk(2.5); T2p5 928 Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar 929 sage: T2p5.cardinality() 930 2 925 931 926 sage: T2p5.first() #random927 {{2, -2}, {3, -3}, {1, -1}}928 sage: T2p5.last() #random929 {{1, 2}, {3, -3}, {-1, -2}}932 sage: T2p5.first() #random 933 {{2, -2}, {3, -3}, {1, -1}} 934 sage: T2p5.last() #random 935 {{1, 2}, {3, -3}, {-1, -2}} 930 936 931 """ 937 """) 932 938 class SetPartitionsTk_k(SetPartitionsBk_k): 933 939 def __repr__(self): 934 940 """ … … 1051 1057 1052 1058 1053 1059 SetPartitionsRk = functools.partial(create_set_partition_function,"R") 1054 SetPartitionsRk.__doc__ = """ 1055 """ 1060 SetPartitionsRk.__doc__ = ( 1061 """ 1062 """) 1056 1063 class SetPartitionsRk_k(SetPartitionsAk_k): 1057 1064 def __init__(self, k): 1058 1065 """ … … 1232 1239 1233 1240 1234 1241 SetPartitionsPRk = functools.partial(create_set_partition_function,"PR") 1235 SetPartitionsPRk.__doc__ = """ 1236 """ 1242 SetPartitionsPRk.__doc__ = ( 1243 """ 1244 """) 1237 1245 class SetPartitionsPRk_k(SetPartitionsRk_k): 1238 1246 def __init__(self, k): 1239 1247 """ -
sage/functions/hyperbolic.py
diff --git a/sage/functions/hyperbolic.py b/sage/functions/hyperbolic.py
a b 608 608 sage: import numpy 609 609 sage: a = numpy.linspace(0,1,3) 610 610 sage: arcsech(a) 611 Warning: divide by zero encountered in divide 611 612 array([ inf, 1.3169579, 0. ]) 612 613 """ 613 614 return arccosh(1.0 / x) … … 657 658 sage: import numpy 658 659 sage: a = numpy.linspace(0,1,3) 659 660 sage: arccsch(a) 661 Warning: divide by zero encountered in divide 660 662 array([ inf, 1.44363548, 0.88137359]) 661 663 """ 662 664 return arcsinh(1.0 / x) -
sage/interfaces/tachyon.py
diff --git a/sage/interfaces/tachyon.py b/sage/interfaces/tachyon.py
a b 6 6 - John E. Stone 7 7 """ 8 8 9 #***************************************************************************** 10 # Copyright (C) 2006 John E. Stone 11 # 12 # Distributed under the terms of the GNU General Public License (GPL) 13 # as published by the Free Software Foundation; either version 2 of 14 # the License, or (at your option) any later version. 15 # http://www.gnu.org/licenses/ 16 #***************************************************************************** 9 17 10 18 from sage.misc.pager import pager 11 19 from sage.misc.misc import tmp_filename 12 20 from sage.misc.sagedoc import format 13 21 import os 22 import sys 14 23 15 24 class TachyonRT: 16 25 """ … … 98 107 sage: import os 99 108 sage: t(tgen.str(), outfile = os.devnull) 100 109 tachyon ... 110 Tachyon Parallel/Multiprocessor Ray Tracer... 101 111 """ 102 112 modelfile = tmp_filename(ext='.dat') 103 113 open(modelfile,'w').write(model) … … 130 140 131 141 if verbose: 132 142 print cmd 143 # One should always flush before system() 144 sys.stdout.flush() 145 sys.stderr.flush() 133 146 os.system(cmd) 134 147 135 148 def usage(self, use_pager=True): -
sage/lfunctions/lcalc.py
diff --git a/sage/lfunctions/lcalc.py b/sage/lfunctions/lcalc.py
a b 119 119 sage: lcalc.zeros(5, L='--tau') # long time 120 120 [9.22237940, 13.9075499, 17.4427770, 19.6565131, 22.3361036] 121 121 sage: lcalc.zeros(3, EllipticCurve('37a')) # long time 122 *** Warning: new stack size = ... 122 123 [0.000000000, 5.00317001, 6.87039122] 123 124 """ 124 125 L = self._compute_L(L) … … 228 229 229 230 sage: E = EllipticCurve('389a') 230 231 sage: E.lseries().values_along_line(0.5, 3, 5) 232 *** Warning: new stack size = ... 231 233 [(0.000000000, 0.209951303), 232 234 (0.500000000, -...e-16), 233 235 (1.00000000, 0.133768433), … … 373 375 374 376 sage: E = EllipticCurve('37a') 375 377 sage: lcalc.analytic_rank(E) 378 *** Warning: new stack size = ... 376 379 1 377 380 """ 378 381 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 b 401 401 sage: from sage.libs.lcalc.lcalc_Lfunction import * 402 402 sage: chi=DirichletGroup(5)[2] #This is a quadratic character 403 403 sage: L=Lfunction_from_character(chi, type="int") 404 sage: L._print_data_to_standard_output() 404 sage: L._print_data_to_standard_output() # tol 1e-15 405 ----------------------------------------------- 406 <BLANKLINE> 407 Name of L_function: 408 number of dirichlet coefficients = 5 409 coefficients are periodic 410 b[1] = 1 411 b[2] = -1 412 b[3] = -1 413 b[4] = 1 414 b[5] = 0 415 <BLANKLINE> 416 Q = 1.26156626101 417 OMEGA = (1,0) 418 a = 1 (the quasi degree) 419 gamma[1] =0.5 lambda[1] =(0,0) 420 <BLANKLINE> 421 <BLANKLINE> 422 number of poles (of the completed L function) = 0 423 ----------------------------------------------- 424 <BLANKLINE> 405 425 """ 406 426 (<c_Lfunction_I *>self.thisptr).print_data_L() 407 427 … … 509 529 sage: from sage.libs.lcalc.lcalc_Lfunction import * 510 530 sage: chi=DirichletGroup(5)[2] #This is a quadratic character 511 531 sage: L=Lfunction_from_character(chi, type="double") 512 sage: L._print_data_to_standard_output() 532 sage: L._print_data_to_standard_output() # tol 1e-15 533 ----------------------------------------------- 534 <BLANKLINE> 535 Name of L_function: 536 number of dirichlet coefficients = 5 537 coefficients are periodic 538 b[1] = 1 539 b[2] = -1 540 b[3] = -1 541 b[4] = 1 542 b[5] = 0 543 <BLANKLINE> 544 Q = 1.26156626101 545 OMEGA = (1,0) 546 a = 1 (the quasi degree) 547 gamma[1] =0.5 lambda[1] =(0,0) 548 <BLANKLINE> 549 <BLANKLINE> 550 number of poles (of the completed L function) = 0 551 ----------------------------------------------- 552 <BLANKLINE> 553 513 554 """ 514 555 (<c_Lfunction_D *>self.thisptr).print_data_L() 515 556 … … 622 663 sage: from sage.libs.lcalc.lcalc_Lfunction import * 623 664 sage: chi=DirichletGroup(5)[1] 624 665 sage: L=Lfunction_from_character(chi, type="complex") 625 sage: L._print_data_to_standard_output() 666 sage: L._print_data_to_standard_output() # tol 1e-15 667 ----------------------------------------------- 668 <BLANKLINE> 669 Name of L_function: 670 number of dirichlet coefficients = 5 671 coefficients are periodic 672 b[1] = (1,0) 673 b[2] = (0,1) 674 b[3] = (0,-1) 675 b[4] = (-1,0) 676 b[5] = (0,0) 677 <BLANKLINE> 678 Q = 1.26156626101 679 OMEGA = (0.850650808352,0.525731112119) 680 a = 1 (the quasi degree) 681 gamma[1] =0.5 lambda[1] =(0.5,0) 682 <BLANKLINE> 683 <BLANKLINE> 684 number of poles (of the completed L function) = 0 685 ----------------------------------------------- 686 <BLANKLINE> 687 626 688 627 689 """ 628 690 (<c_Lfunction_C *>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 b 508 508 Creates an mpc from tuple data :: 509 509 510 510 sage: import mpmath 511 >>>complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1))))511 sage: complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1)))) 512 512 (0.5-0.25j) 513 513 """ 514 514 cdef mpc x -
sage/libs/mwrank/interface.py
diff --git a/sage/libs/mwrank/interface.py b/sage/libs/mwrank/interface.py
a b 208 208 209 209 sage: E = mwrank_EllipticCurve([0, 0, 1, -1, 0]) 210 210 sage: E.set_verbose(1) 211 sage: E.saturate() # produces the following output 212 213 :: 214 211 sage: E.saturate() # tol 1e-14 215 212 Basic pair: I=48, J=-432 216 213 disc=255744 217 214 2-adic index bound = 2 … … 221 218 Looking for quartics with I = 48, J = -432 222 219 Looking for Type 2 quartics: 223 220 Trying positive a from 1 up to 1 (square a first...) 224 (1,0,-6,4,1) 221 (1,0,-6,4,1) --trivial 225 222 Trying positive a from 1 up to 1 (...then non-square a) 226 223 Finished looking for Type 2 quartics. 227 224 Looking for Type 1 quartics: 228 225 Trying positive a from 1 up to 2 (square a first...) 229 (1,0,0,4,4) 226 (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0) 230 227 Point = [0:0:1] 231 height = 0.051111408239968840235886099756942021609538202280854228 height = 0.0511114082399688402358 232 229 Rank of B=im(eps) increases to 1 (The previous point is on the egg) 233 230 Exiting search for Type 1 quartics after finding one which is globally soluble. 234 231 Mordell rank contribution from B=im(eps) = 1 … … 238 235 Selmer rank contribution from A=ker(eps) = 0 239 236 Sha rank contribution from A=ker(eps) = 0 240 237 Searching for points (bound = 8)...done: 241 found pointsof rank 1242 and regulator 0.051111408239968840235886099756942021609538202280854238 found points which generate a subgroup of rank 1 239 and regulator 0.0511114082399688402358 243 240 Processing points found during 2-descent...done: 244 now regulator = 0.051111408239968840235886099756942021609538202280854245 Saturating ( bound = -1)...done:246 points were already saturated.241 now regulator = 0.0511114082399688402358 242 Saturating (with bound = -1)...done: 243 points were already saturated. 247 244 """ 248 245 self.__verbose = verbose 249 246 … … 376 373 TESTS (see #7992):: 377 374 378 375 sage: EllipticCurve([0, prod(prime_range(10))]).mwrank_curve().two_descent() 376 Basic pair: I=0, J=-5670 377 disc=-32148900 378 2-adic index bound = 2 379 2-adic index = 2 380 Two (I,J) pairs 381 Looking for quartics with I = 0, J = -5670 382 Looking for Type 3 quartics: 383 Trying positive a from 1 up to 5 (square a first...) 384 Trying positive a from 1 up to 5 (...then non-square a) 385 (2,0,-12,19,-6) --nontrivial...(x:y:z) = (2 : 4 : 1) 386 Point = [-2488:-4997:512] 387 height = 6.46767239... 388 Rank of B=im(eps) increases to 1 389 Trying negative a from -1 down to -3 390 Finished looking for Type 3 quartics. 391 Looking for quartics with I = 0, J = -362880 392 Looking for Type 3 quartics: 393 Trying positive a from 1 up to 20 (square a first...) 394 Trying positive a from 1 up to 20 (...then non-square a) 395 Trying negative a from -1 down to -13 396 Finished looking for Type 3 quartics. 397 Mordell rank contribution from B=im(eps) = 1 398 Selmer rank contribution from B=im(eps) = 1 399 Sha rank contribution from B=im(eps) = 0 400 Mordell rank contribution from A=ker(eps) = 0 401 Selmer rank contribution from A=ker(eps) = 0 402 Sha rank contribution from A=ker(eps) = 0 379 403 sage: EllipticCurve([0, prod(prime_range(100))]).mwrank_curve().two_descent() 380 404 Traceback (most recent call last): 381 405 ... … … 739 763 sage: EQ = mwrank_MordellWeil(E) 740 764 sage: EQ 741 765 Subgroup of Mordell-Weil group: [] 742 sage: EQ.search(2) # output below 743 744 The previous command produces the following output:: 745 766 sage: EQ.search(2) 746 767 P1 = [0:1:0] is torsion point, order 1 747 768 P1 = [1:-1:1] is torsion point, order 2 748 769 P1 = [2:2:1] is torsion point, order 3 … … 751 772 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 752 773 sage: EQ = mwrank_MordellWeil(E) 753 774 sage: EQ.search(2) 775 P1 = [0:1:0] is torsion point, order 1 776 P1 = [-3:0:1] is generator number 1 777 ... 778 P4 = [-91:804:343] = -2*P1 + 2*P2 + 1*P3 (mod torsion) 754 779 sage: EQ 755 780 Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] 756 781 … … 758 783 759 784 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 760 785 sage: EQ = mwrank_MordellWeil(E, verbose=False) 761 sage: EQ.search(1) # no output786 sage: EQ.search(1) 762 787 sage: EQ 763 788 Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] 764 789 765 790 sage: EQ = mwrank_MordellWeil(E, verbose=True) 766 sage: EQ.search(1) # output below 767 768 The previous command produces the following output:: 769 791 sage: EQ.search(1) 770 792 P1 = [0:1:0] is torsion point, order 1 771 793 P1 = [-3:0:1] is generator number 1 772 794 saturating up to 20...Checking 2-saturation … … 941 963 [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] 942 964 sage: EQ = mwrank_MordellWeil(E) 943 965 sage: EQ.process([[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]) 944 945 Output of previous command::946 947 966 P1 = [1:-1:1] is generator number 1 948 967 P2 = [-2:3:1] is generator number 2 949 968 P3 = [-14:25:8] is generator number 3 950 969 951 970 :: 952 971 953 972 sage: EQ.points() 954 973 [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] 955 974 … … 958 977 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 959 978 sage: EQ = mwrank_MordellWeil(E) 960 979 sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=20) 980 P1 = [1547:-2967:343] is generator number 1 981 ... 982 Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ] 983 961 984 sage: EQ.points() 962 985 [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]] 963 986 … … 967 990 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 968 991 sage: EQ = mwrank_MordellWeil(E) 969 992 sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0) 993 P1 = [1547:-2967:343] is generator number 1 994 P2 = [2707496766203306:864581029138191:2969715140223272] is generator number 2 995 P3 = [-13422227300:-49322830557:12167000000] is generator number 3 970 996 sage: EQ.points() 971 997 [[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]] 972 998 sage: EQ.regulator() 973 999 375.42919921875 974 1000 sage: EQ.saturate(2) # points were not 2-saturated 1001 saturating basis...Saturation index bound = 93 1002 WARNING: saturation at primes p > 2 will not be done; 1003 ... 1004 Gained index 2 1005 New regulator = 93.857300720636393209 975 1006 (False, 2, '[ ]') 976 1007 sage: EQ.points() 977 1008 [[-2, 3, 1], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]] 978 1009 sage: EQ.regulator() 979 1010 93.8572998046875 980 1011 sage: EQ.saturate(3) # points were not 3-saturated 1012 saturating basis...Saturation index bound = 46 1013 WARNING: saturation at primes p > 3 will not be done; 1014 ... 1015 Gained index 3 1016 New regulator = 10.4285889689595992455 981 1017 (False, 3, '[ ]') 982 1018 sage: EQ.points() 983 1019 [[-2, 3, 1], [-14, 25, 8], [-13422227300, -49322830557, 12167000000]] 984 1020 sage: EQ.regulator() 985 1021 10.4285888671875 986 1022 sage: EQ.saturate(5) # points were not 5-saturated 1023 saturating basis...Saturation index bound = 15 1024 WARNING: saturation at primes p > 5 will not be done; 1025 ... 1026 Gained index 5 1027 New regulator = 0.417143558758383969818 987 1028 (False, 5, '[ ]') 988 1029 sage: EQ.points() 989 1030 [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]] 990 1031 sage: EQ.regulator() 991 1032 0.4171435534954071 992 1033 sage: EQ.saturate() # points are now saturated 1034 saturating basis...Saturation index bound = 3 1035 Checking saturation at [ 2 3 ] 1036 Checking 2-saturation 1037 Points were proved 2-saturated (max q used = 11) 1038 Checking 3-saturation 1039 Points were proved 3-saturated (max q used = 13) 1040 done 993 1041 (True, 1, '[ ]') 994 1042 """ 995 1043 if not isinstance(v, list): … … 1059 1107 Now we do a very small search:: 1060 1108 1061 1109 sage: EQ.search(1) 1110 P1 = [0:1:0] is torsion point, order 1 1111 P1 = [-3:0:1] is generator number 1 1112 saturating up to 20...Checking 2-saturation 1113 ... 1114 P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) 1062 1115 sage: EQ 1063 1116 Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] 1064 1117 sage: EQ.rank() … … 1141 1194 ``sat`` to 0 (which is in fact the default):: 1142 1195 1143 1196 sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0) 1197 P1 = [1547:-2967:343] is generator number 1 1198 P2 = [2707496766203306:864581029138191:2969715140223272] is generator number 2 1199 P3 = [-13422227300:-49322830557:12167000000] is generator number 3 1144 1200 sage: EQ 1145 1201 Subgroup of Mordell-Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] 1146 1202 sage: EQ.regulator() … … 1149 1205 Now we saturate at `p=2`, and gain index 2:: 1150 1206 1151 1207 sage: EQ.saturate(2) # points were not 2-saturated 1208 saturating basis...Saturation index bound = 93 1209 WARNING: saturation at primes p > 2 will not be done; 1210 ... 1211 Gained index 2 1212 New regulator = 93.857300720636393209 1152 1213 (False, 2, '[ ]') 1153 1214 sage: EQ 1154 1215 Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] … … 1158 1219 Now we saturate at `p=3`, and gain index 3:: 1159 1220 1160 1221 sage: EQ.saturate(3) # points were not 3-saturated 1222 saturating basis...Saturation index bound = 46 1223 WARNING: saturation at primes p > 3 will not be done; 1224 ... 1225 Gained index 3 1226 New regulator = 10.4285889689595992455 1161 1227 (False, 3, '[ ]') 1162 1228 sage: EQ 1163 1229 Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] … … 1167 1233 Now we saturate at `p=5`, and gain index 5:: 1168 1234 1169 1235 sage: EQ.saturate(5) # points were not 5-saturated 1236 saturating basis...Saturation index bound = 15 1237 WARNING: saturation at primes p > 5 will not be done; 1238 ... 1239 Gained index 5 1240 New regulator = 0.417143558758383969818 1170 1241 (False, 5, '[ ]') 1171 1242 sage: EQ 1172 1243 Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] … … 1177 1248 the points are now provably saturated at all primes:: 1178 1249 1179 1250 sage: EQ.saturate() # points are now saturated 1251 saturating basis...Saturation index bound = 3 1252 Checking saturation at [ 2 3 ] 1253 Checking 2-saturation 1254 Points were proved 2-saturated (max q used = 11) 1255 Checking 3-saturation 1256 Points were proved 3-saturated (max q used = 13) 1257 done 1180 1258 (True, 1, '[ ]') 1181 1259 1182 1260 Of course, the :meth:`process()` function would have done all this … … 1185 1263 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 1186 1264 sage: EQ = mwrank_MordellWeil(E) 1187 1265 sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=5) 1266 P1 = [1547:-2967:343] is generator number 1 1267 ... 1268 Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ] 1188 1269 sage: EQ 1189 1270 Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] 1190 1271 sage: EQ.regulator() … … 1194 1275 verify that full saturation has been done:: 1195 1276 1196 1277 sage: EQ.saturate() 1278 saturating basis...Saturation index bound = 3 1279 Checking saturation at [ 2 3 ] 1280 Checking 2-saturation 1281 Points were proved 2-saturated (max q used = 11) 1282 Checking 3-saturation 1283 Points were proved 3-saturated (max q used = 13) 1284 done 1197 1285 (True, 1, '[ ]') 1198 1286 1199 The preceding command produces the following output as a 1200 side-effect. It proves that the index of the points in their 1201 saturation is at most 3, then proves saturation at 2 and at 3, 1202 by reducing the points modulo all primes of good reduction up 1203 to 11, respectively 13:: 1204 1205 saturating basis...Saturation index bound = 3 1206 Checking saturation at [ 2 3 ] 1207 Checking 2-saturation 1208 Points were proved 2-saturated (max q used = 11) 1209 Checking 3-saturation 1210 Points were proved 3-saturated (max q used = 13) 1211 done 1287 Note the output of the preceding command: it proves that the 1288 index of the points in their saturation is at most 3, then 1289 proves saturation at 2 and at 3, by reducing the points modulo 1290 all primes of good reduction up to 11, respectively 13. 1212 1291 """ 1213 1292 ok, index, unsat = self.__mw.saturate(int(max_prime), odd_primes_only) 1214 1293 return bool(ok), int(str(index)), unsat … … 1250 1329 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 1251 1330 sage: EQ = mwrank_MordellWeil(E) 1252 1331 sage: EQ.search(1) 1332 P1 = [0:1:0] is torsion point, order 1 1333 P1 = [-3:0:1] is generator number 1 1334 ... 1335 P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) 1253 1336 sage: EQ 1254 1337 Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] 1255 1338 … … 1259 1342 sage: E = mwrank_EllipticCurve([0, -1, 0, -18392, -1186248]) #1056g4 1260 1343 sage: EQ = mwrank_MordellWeil(E) 1261 1344 sage: EQ.search(11); EQ 1345 P1 = [0:1:0] is torsion point, order 1 1346 P1 = [161:0:1] is torsion point, order 2 1262 1347 Subgroup of Mordell-Weil group: [] 1263 1348 sage: EQ.search(12); EQ 1349 P1 = [0:1:0] is torsion point, order 1 1350 P1 = [161:0:1] is torsion point, order 2 1351 P1 = [4413270:10381877:27000] is generator number 1 1352 ... 1264 1353 Subgroup of Mordell-Weil group: [[4413270:10381877:27000]] 1265 1354 """ 1266 1355 height_limit = float(height_limit) … … 1299 1388 sage: E = mwrank_EllipticCurve([0,0,1,-7,6]) 1300 1389 sage: EQ = mwrank_MordellWeil(E) 1301 1390 sage: EQ.search(1) 1391 P1 = [0:1:0] is torsion point, order 1 1392 P1 = [-3:0:1] is generator number 1 1393 ... 1394 P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) 1302 1395 sage: EQ.points() 1303 1396 [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]] 1304 1397 -
sage/libs/mwrank/mwrank.pyx
diff --git a/sage/libs/mwrank/mwrank.pyx b/sage/libs/mwrank/mwrank.pyx
a b 156 156 sage: file = os.path.join(SAGE_TMP, 'PRIMES') 157 157 sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^7,10^7+20)])) 158 158 sage: mwrank_initprimes(file, verb=True) 159 160 The previous command does produce the following output when run161 from the command line, but not during a doctest::162 163 159 Computed 78519 primes, largest is 1000253 164 160 reading primes from file ... 165 161 read extra prime 10000019 … … 567 563 sage: EQ.search(1) 568 564 sage: EQ = _mw(E, verb=True) 569 565 sage: EQ.search(1) 566 P1 = [0:1:0] is torsion point, order 1 567 P1 = [-3:0:1] is generator number 1 568 ... 569 P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) 570 570 571 571 The previous command produces the following output:: 572 572 … … 882 882 sage: EQ = _mw(E) 883 883 sage: EQ.process([494, -5720, 6859]) # 3 times another point 884 884 sage: EQ.saturate(sat_bd=2) 885 Saturation index bound = 10 886 WARNING: saturation at primes p > 2 will not be done; 887 points may be unsaturated at primes between 2 and index bound 888 Failed to saturate MW basis at primes [ ] 885 889 (0, 1, '[ ]') 886 890 sage: EQ 887 891 [[494:-5720:6859]] … … 1049 1053 sage: from sage.libs.mwrank.mwrank import _two_descent 1050 1054 sage: D2 = _two_descent() 1051 1055 sage: D2.do_descent(CD) 1056 Basic pair: I=336, J=-10800 1057 disc=35092224 1058 ... 1059 Mordell rank contribution from B=im(eps) = 3 1060 Selmer rank contribution from B=im(eps) = 3 1061 Sha rank contribution from B=im(eps) = 0 1062 Mordell rank contribution from A=ker(eps) = 0 1063 Selmer rank contribution from A=ker(eps) = 0 1064 Sha rank contribution from A=ker(eps) = 0 1052 1065 sage: D2.getrank() 1053 1066 3 1054 1067 sage: D2.getcertain() … … 1078 1091 sage: from sage.libs.mwrank.mwrank import _two_descent 1079 1092 sage: D2 = _two_descent() 1080 1093 sage: D2.do_descent(CD) 1094 Basic pair: I=336, J=-10800 1095 disc=35092224 1096 ... 1097 Mordell rank contribution from B=im(eps) = 3 1098 Selmer rank contribution from B=im(eps) = 3 1099 Sha rank contribution from B=im(eps) = 0 1100 Mordell rank contribution from A=ker(eps) = 0 1101 Selmer rank contribution from A=ker(eps) = 0 1102 Sha rank contribution from A=ker(eps) = 0 1081 1103 sage: D2.getrank() 1082 1104 3 1083 1105 """ … … 1103 1125 sage: from sage.libs.mwrank.mwrank import _two_descent 1104 1126 sage: D2 = _two_descent() 1105 1127 sage: D2.do_descent(CD) 1128 Basic pair: I=336, J=-10800 1129 disc=35092224 1130 ... 1131 Mordell rank contribution from B=im(eps) = 3 1132 Selmer rank contribution from B=im(eps) = 3 1133 Sha rank contribution from B=im(eps) = 0 1134 Mordell rank contribution from A=ker(eps) = 0 1135 Selmer rank contribution from A=ker(eps) = 0 1136 Sha rank contribution from A=ker(eps) = 0 1106 1137 sage: D2.getrankbound() 1107 1138 3 1108 1139 """ … … 1128 1159 sage: from sage.libs.mwrank.mwrank import _two_descent 1129 1160 sage: D2 = _two_descent() 1130 1161 sage: D2.do_descent(CD) 1162 Basic pair: I=336, J=-10800 1163 disc=35092224 1164 ... 1165 Mordell rank contribution from B=im(eps) = 3 1166 Selmer rank contribution from B=im(eps) = 3 1167 Sha rank contribution from B=im(eps) = 0 1168 Mordell rank contribution from A=ker(eps) = 0 1169 Selmer rank contribution from A=ker(eps) = 0 1170 Sha rank contribution from A=ker(eps) = 0 1131 1171 sage: D2.getselmer() 1132 1172 3 1133 1173 """ … … 1152 1192 sage: from sage.libs.mwrank.mwrank import _two_descent 1153 1193 sage: D2 = _two_descent() 1154 1194 sage: D2.do_descent(CD) 1195 Basic pair: I=336, J=-10800 1196 disc=35092224 1197 ... 1198 Mordell rank contribution from B=im(eps) = 3 1199 Selmer rank contribution from B=im(eps) = 3 1200 Sha rank contribution from B=im(eps) = 0 1201 Mordell rank contribution from A=ker(eps) = 0 1202 Selmer rank contribution from A=ker(eps) = 0 1203 Sha rank contribution from A=ker(eps) = 0 1155 1204 sage: D2.ok() 1156 1205 1 1157 1206 """ … … 1172 1221 sage: from sage.libs.mwrank.mwrank import _two_descent 1173 1222 sage: D2 = _two_descent() 1174 1223 sage: D2.do_descent(CD) 1224 Basic pair: I=336, J=-10800 1225 disc=35092224 1226 ... 1227 Mordell rank contribution from B=im(eps) = 3 1228 Selmer rank contribution from B=im(eps) = 3 1229 Sha rank contribution from B=im(eps) = 0 1230 Mordell rank contribution from A=ker(eps) = 0 1231 Selmer rank contribution from A=ker(eps) = 0 1232 Sha rank contribution from A=ker(eps) = 0 1175 1233 sage: D2.getcertain() 1176 1234 1 1177 1235 """ … … 1192 1250 sage: from sage.libs.mwrank.mwrank import _two_descent 1193 1251 sage: D2 = _two_descent() 1194 1252 sage: D2.do_descent(CD) 1253 Basic pair: I=336, J=-10800 1254 disc=35092224 1255 ... 1256 Mordell rank contribution from B=im(eps) = 3 1257 Selmer rank contribution from B=im(eps) = 3 1258 Sha rank contribution from B=im(eps) = 0 1259 Mordell rank contribution from A=ker(eps) = 0 1260 Selmer rank contribution from A=ker(eps) = 0 1261 Sha rank contribution from A=ker(eps) = 0 1195 1262 sage: D2.saturate() 1263 Searching for points (bound = 8)...done: 1264 found points which generate a subgroup of rank 3 1265 and regulator 0.417143558758383969817119544618093396749810106098479 1266 Processing points found during 2-descent...done: 1267 now regulator = 0.417143558758383969817119544618093396749810106098479 1268 No saturation being done 1196 1269 sage: D2.getbasis() 1197 1270 '[[1:-1:1], [-2:3:1], [-14:25:8]]' 1198 1271 """ … … 1224 1297 sage: from sage.libs.mwrank.mwrank import _two_descent 1225 1298 sage: D2 = _two_descent() 1226 1299 sage: D2.do_descent(CD) 1300 Basic pair: I=336, J=-10800 1301 disc=35092224 1302 ... 1303 Mordell rank contribution from B=im(eps) = 3 1304 Selmer rank contribution from B=im(eps) = 3 1305 Sha rank contribution from B=im(eps) = 0 1306 Mordell rank contribution from A=ker(eps) = 0 1307 Selmer rank contribution from A=ker(eps) = 0 1308 Sha rank contribution from A=ker(eps) = 0 1227 1309 sage: D2.saturate() 1310 Searching for points (bound = 8)...done: 1311 found points which generate a subgroup of rank 3 1312 and regulator 0.417143558758383969817119544618093396749810106098479 1313 Processing points found during 2-descent...done: 1314 now regulator = 0.417143558758383969817119544618093396749810106098479 1315 No saturation being done 1228 1316 sage: D2.getbasis() 1229 1317 '[[1:-1:1], [-2:3:1], [-14:25:8]]' 1230 1318 """ … … 1246 1334 sage: from sage.libs.mwrank.mwrank import _two_descent 1247 1335 sage: D2 = _two_descent() 1248 1336 sage: D2.do_descent(CD) 1337 Basic pair: I=336, J=-10800 1338 disc=35092224 1339 ... 1340 Mordell rank contribution from B=im(eps) = 3 1341 Selmer rank contribution from B=im(eps) = 3 1342 Sha rank contribution from B=im(eps) = 0 1343 Mordell rank contribution from A=ker(eps) = 0 1344 Selmer rank contribution from A=ker(eps) = 0 1345 Sha rank contribution from A=ker(eps) = 0 1249 1346 1250 1347 If called before calling ``saturate()``, a bogus value of 1.0 1251 1348 is returned:: … … 1258 1355 2-descent:: 1259 1356 1260 1357 sage: D2.saturate() 1358 Searching for points (bound = 8)...done: 1359 found points which generate a subgroup of rank 3 1360 and regulator 0.417143558758383969817119544618093396749810106098479 1361 Processing points found during 2-descent...done: 1362 now regulator = 0.417143558758383969817119544618093396749810106098479 1363 No saturation being done 1261 1364 sage: D2.getbasis() 1262 1365 '[[1:-1:1], [-2:3:1], [-14:25:8]]' 1263 1366 sage: D2.regulator() -
sage/libs/singular/function.pyx
diff --git a/sage/libs/singular/function.pyx b/sage/libs/singular/function.pyx
a b 277 277 sage: l = ringlist(P) 278 278 sage: ring = singular_function("ring") 279 279 sage: ring(l, ring=P)._output() 280 // characteristic : 0 281 // number of vars : 3 282 // block 1 : ordering dp 283 // : names x y z 284 // block 2 : ordering C 280 285 """ 281 286 rPrint(self._ring) 282 287 … … 1219 1224 sage: I = Ideal(I.groebner_basis()) 1220 1225 sage: hilb = sage.libs.singular.ff.hilb 1221 1226 sage: hilb(I) # Singular will print // ** _ is no standard basis 1227 // ** _ is no standard basis 1228 // 1 t^0 1229 // -1 t^5 1230 <BLANKLINE> 1231 // 1 t^0 1232 // 1 t^1 1233 // 1 t^2 1234 // 1 t^3 1235 // 1 t^4 1236 // dimension (proj.) = 1 1237 // degree (proj.) = 5 1222 1238 1223 1239 So we tell Singular that ``I`` is indeed a Groebner basis:: 1224 1240 1225 1241 sage: hilb(I,attributes={I:{'isSB':1}}) # no complaint from Singular 1242 // 1 t^0 1243 // -1 t^5 1244 <BLANKLINE> 1245 // 1 t^0 1246 // 1 t^1 1247 // 1 t^2 1248 // 1 t^3 1249 // 1 t^4 1250 // dimension (proj.) = 1 1251 // degree (proj.) = 5 1226 1252 1227 1253 1228 1254 TESTS: -
sage/libs/singular/option.pyx
diff --git a/sage/libs/singular/option.pyx b/sage/libs/singular/option.pyx
a b 398 398 399 399 The option ``mult_bound`` is only relevant in the local case:: 400 400 401 sage: from sage.libs.singular.option import opt 401 402 sage: Rlocal.<x,y,z> = PolynomialRing(QQ, order='ds') 402 403 sage: x^2<x 403 404 True 404 405 sage: J = [x^7+y^7+z^6,x^6+y^8+z^7,x^7+y^5+z^8, x^2*y^3+y^2*z^3+x^3*z^2,x^3*y^2+y^3*z^2+x^2*z^3]*Rlocal 405 406 sage: J.groebner_basis(mult_bound=100) 406 407 [x^3*y^2 + y^3*z^2 + x^2*z^3, x^2*y^3 + x^3*z^2 + y^2*z^3, y^5, x^6 + x*y^4*z^5, x^4*z^2 - y^4*z^2 - x^2*y*z^3 + x*y^2*z^3, z^6 - x*y^4*z^4 - x^3*y*z^5] 408 sage: opt['red_tail'] = True # the previous commands reset opt['red_tail'] to False 407 409 sage: J.groebner_basis() 408 410 [x^3*y^2 + y^3*z^2 + x^2*z^3, x^2*y^3 + x^3*z^2 + y^2*z^3, y^5, x^6, x^4*z^2 - y^4*z^2 - x^2*y*z^3 + x*y^2*z^3, z^6, y^4*z^3 - y^3*z^4 - x^2*z^5, x^3*y*z^4 - x^2*y^2*z^4 + x*y^3*z^4, x^3*z^5, x^2*y*z^5 + y^3*z^5, x*y^3*z^5] 409 411 … … 417 419 sage: from sage.libs.singular.option import LibSingularOptions 418 420 sage: libsingular_options = LibSingularOptions() 419 421 sage: libsingular_options 420 general options for libSingular (current value 0x 06000082)422 general options for libSingular (current value 0x...) 421 423 """ 422 424 self.global_options = &singular_options 423 425 self.name = "general" -
sage/matrix/benchmark.py
diff --git a/sage/matrix/benchmark.py b/sage/matrix/benchmark.py
a b 8 8 The basic command syntax is as follows:: 9 9 10 10 sage: import sage.matrix.benchmark as b 11 sage: b.report([b.det_ZZ], 'Test', systems=['sage']) 11 sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage']) 12 starting... 12 13 ====================================================================== 13 14 Test 14 15 ====================================================================== … … 37 38 EXAMPLES:: 38 39 39 40 sage: import sage.matrix.benchmark as b 40 sage: b.report([b.det_ZZ], 'Test', systems=['sage']) 41 sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage']) 42 starting... 41 43 ====================================================================== 42 44 Test 43 45 ====================================================================== … … 92 94 EXAMPLES:: 93 95 94 96 sage: import sage.matrix.benchmark as b 95 sage: b.report_ZZ(systems=['sage']) # long time (15s on sage.math, 2012) 97 sage: print "starting"; import sys; sys.stdout.flush(); b.report_ZZ(systems=['sage']) # long time (15s on sage.math, 2012) 98 starting... 96 99 ====================================================================== 97 100 Dense benchmarks over ZZ 98 101 ====================================================================== … … 566 569 EXAMPLES:: 567 570 568 571 sage: import sage.matrix.benchmark as b 569 sage: b.report_GF(systems=['sage']) 572 sage: print "starting"; import sys; sys.stdout.flush(); b.report_GF(systems=['sage']) 573 starting... 570 574 ====================================================================== 571 575 Dense benchmarks over GF with prime 16411 572 576 ====================================================================== -
sage/misc/constant_function.pyx
diff --git a/sage/misc/constant_function.pyx b/sage/misc/constant_function.pyx
a b 10 10 11 11 from sage.structure.sage_object cimport SageObject 12 12 cdef class ConstantFunction(SageObject): 13 cdef object _value14 13 """ 15 14 A class for function objects implementing constant functions. 16 15 … … 60 59 sage: { 1: 'a', True: 'b' } 61 60 {1: 'b'} 62 61 """ 62 cdef object _value 63 63 64 def __init__(self, value): 64 65 """ 65 66 EXAMPLES:: -
sage/misc/cython.py
diff --git a/sage/misc/cython.py b/sage/misc/cython.py
a b 693 693 sage: f.write(s) 694 694 sage: f.close() 695 695 sage: cython_create_local_so('hello.spyx') 696 Compiling hello.spyx... 696 697 sage: sys.path.append('.') 697 698 sage: import hello 698 699 sage: hello.hello() -
sage/misc/hg.py
diff --git a/sage/misc/hg.py b/sage/misc/hg.py
a b 70 70 # http://www.gnu.org/licenses/ 71 71 ######################################################################## 72 72 73 import os, shutil 73 import os, shutil, sys 74 74 75 75 from viewer import browser 76 76 from misc import tmp_filename, branch_current_hg, embedded … … 395 395 s = 'cd "%s" && sage --hg %s'%(self.__dir, cmd) 396 396 if debug: 397 397 print s 398 sys.stdout.flush() 398 399 if interactive: 399 400 e = os.system(s) 400 401 return e … … 1624 1625 EXAMPLES:: 1625 1626 1626 1627 sage: hg_sage.qseries() 1627 cd ... && sage --hg qseries 1628 cd ... && sage --hg qseries... 1628 1629 """ 1629 1630 options = "--summary" if verbose else "" 1630 1631 self('qseries %s %s' % (options, color(),), debug=debug) … … 1643 1644 EXAMPLES:: 1644 1645 1645 1646 sage: hg_sage.qapplied() 1646 cd ... && sage --hg qapplied 1647 cd ... && sage --hg qapplied... 1647 1648 """ 1648 1649 options = "--summary" if verbose else "" 1649 1650 self('qapplied %s %s' % (options, color(),), debug=debug) … … 1662 1663 EXAMPLES:: 1663 1664 1664 1665 sage: hg_sage.qunapplied() 1665 cd ... && sage --hg qunapplied 1666 cd ... && sage --hg qunapplied... 1666 1667 """ 1667 1668 options = "--summary" if verbose else "" 1668 1669 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 b 185 185 sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0 186 186 True 187 187 sage: shell.system_raw('R --version') 188 R version ... 188 189 sage: status = shell.user_ns['_exit_code'] 189 190 sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0 190 191 True -
sage/misc/preparser.py
diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
a b 1671 1671 1672 1672 EXAMPLES: 1673 1673 1674 Note that .py files are *not* preparsed:: 1675 1676 sage: t=tmp_filename(ext='.py'); open(t,'w').write("print 'hi',2/3; z=-2/9") 1677 sage: sage.misc.preparser.load(t,globals()) 1674 Note that ``.py`` files are *not* preparsed:: 1675 1676 sage: t = tmp_filename(ext='.py') 1677 sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") 1678 sage: z = 1 1679 sage: sage.misc.preparser.load(t, globals()) 1678 1680 hi 0 1679 1681 sage: z 1680 1682 -1 1681 1683 1682 A .sage file *is* preparsed:: 1683 1684 sage: t=tmp_filename(ext='.sage'); open(t,'w').write("print 'hi',2/3; s=-2/7") 1685 sage: sage.misc.preparser.load(t,globals()) 1684 A ``.sage`` file *is* preparsed:: 1685 1686 sage: t = tmp_filename(ext='.sage') 1687 sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") 1688 sage: z = 1 1689 sage: sage.misc.preparser.load(t, globals()) 1686 1690 hi 2/3 1687 sage: s1691 sage: z 1688 1692 -2/7 1689 1693 1690 1694 Cython files are *not* preparsed:: 1691 1692 sage: t=tmp_filename(ext='.pyx'); open(t,'w').write("print 'hi',2/3; z=-2/9") 1693 sage: z=0; sage.misc.preparser.load(t,globals()) 1695 1696 sage: t = tmp_filename(ext='.pyx') 1697 sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") 1698 sage: z = 1 1699 sage: sage.misc.preparser.load(t, globals()) 1700 Compiling ... 1694 1701 hi 0 1695 1702 sage: z 1696 1703 -1 -
sage/misc/session.pyx
diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
a b 244 244 - creates a file 245 245 246 246 EXAMPLES: 247 247 248 For testing, we use a temporary file, that will be removed as soon 248 249 as Sage is left. Of course, for permanently saving your session, 249 you should choose a permanent file. ::250 you should choose a permanent file. :: 250 251 251 252 sage: a = 5 252 253 sage: tmp_f = tmp_filename() … … 257 258 5 258 259 259 260 We illustrate what happens when one of the variables is a function.:: 261 260 262 sage: f = lambda x : x^2 261 263 sage: save_session(tmp_f) 262 264 sage: save_session(tmp_f, verbose=True) … … 268 270 269 271 sage: g = cython_lambda('double x', 'x*x + 1.5') 270 272 sage: save_session(tmp_f, verbose=True) 271 Saving...272 273 Not saving g: g is a function, method, class or type 273 274 ... 274 275 """ -
sage/misc/sh.py
diff --git a/sage/misc/sh.py b/sage/misc/sh.py
a b 17 17 the following really only tests that the command doesn't bomb, 18 18 not that it gives the right output:: 19 19 20 sage: sh.eval('''echo "Hello there"\nif [ $? -eq 0 ]; then\necho "good"\nfi''') 21 /... 22 '' 20 sage: sh.eval('''echo "Hello there"\nif [ $? -eq 0 ]; then\necho "good"\nfi''') # random output 23 21 """ 24 22 # Print out the current absolute path, which is where the code 25 23 # 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 b 358 358 sage: f.qexp(1) 359 359 O(q^1) 360 360 """ 361 pass 361 362 362 363 #def _repr_(self): 363 364 # A = self.ambient_module() 364 365 # 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()) 365 366 366 367 367 368 368 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 b 710 710 0.953760808... 711 711 sage: w = vector(CDF, [-1,0,1]) 712 712 sage: w.norm(p=-1.6) 713 Warning: divide by zero encountered in power 713 714 0.0 714 715 715 716 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 b 1215 1215 sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3) 1216 1216 sage: p.set_objective([2, 5]) 1217 1217 sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) 1218 Writing problem data to ... 1219 9 lines were written 1218 1220 """ 1219 1221 glp_write_lp(self.lp, NULL, filename) 1220 1222 … … 1235 1237 sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3) 1236 1238 sage: p.set_objective([2, 5]) 1237 1239 sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps"), 2) 1240 Writing problem data to... 1241 17 records were written 1238 1242 """ 1239 1243 glp_write_mps(self.lp, modern, NULL, filename) 1240 1244 … … 1740 1744 sage: import sage.numerical.backends.glpk_backend as backend 1741 1745 sage: p.solver_parameter(backend.glp_simplex_or_intopt, backend.glp_simplex_only) 1742 1746 sage: p.print_ranges() 1743 ...1747 glp_print_ranges: optimal basic solution required 1744 1748 1 1745 1749 sage: p.solve() 1746 1750 0 1747 1751 sage: p.print_ranges() 1752 Write sensitivity analysis report to... 1748 1753 GLPK ... - SENSITIVITY ANALYSIS REPORT Page 1 1749 1754 <BLANKLINE> 1750 Problem: 1755 Problem: 1751 1756 Objective: 7.5 (MAXimum) 1752 1757 <BLANKLINE> 1753 1758 No. Row name St Activity Slack Lower bound Activity Obj coef Obj value at Limiting 1754 1759 Marginal Upper bound range range break point variable 1755 1760 ------ ------------ -- ------------- ------------- ------------- ------------- ------------- ------------- ------------ 1756 1 NU 3.00000 . -Inf . -2.50000 . 1761 1 NU 3.00000 . -Inf . -2.50000 . 1757 1762 2.50000 3.00000 +Inf +Inf +Inf 1758 1763 <BLANKLINE> 1759 1764 GLPK ... - SENSITIVITY ANALYSIS REPORT Page 2 1760 1765 <BLANKLINE> 1761 Problem: 1766 Problem: 1762 1767 Objective: 7.5 (MAXimum) 1763 1768 <BLANKLINE> 1764 1769 No. Column name St Activity Obj coef Lower bound Activity Obj coef Obj value at Limiting … … 1773 1778 End of report 1774 1779 <BLANKLINE> 1775 1780 0 1776 1777 1778 1781 """ 1779 1782 1780 1783 from sage.misc.all import SAGE_TMP -
sage/numerical/mip.pyx
diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
a b 855 855 sage: p.set_objective(x[1] + x[2]) 856 856 sage: p.add_constraint(-3*x[1] + 2*x[2], max=2,name="OneConstraint") 857 857 sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps")) 858 Writing problem data to ... 859 17 records were written 858 860 859 861 For information about the MPS file format : 860 862 http://en.wikipedia.org/wiki/MPS_%28format%29 … … 880 882 sage: p.set_objective(x[1] + x[2]) 881 883 sage: p.add_constraint(-3*x[1] + 2*x[2], max=2) 882 884 sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) 885 Writing problem data to ... 886 9 lines were written 883 887 884 888 For more information about the LP file format : 885 889 http://lpsolve.sourceforge.net/5.5/lp-format.htm … … 1852 1856 sage: b = p.get_backend() 1853 1857 sage: b.solver_parameter("simplex_or_intopt", "simplex_only") 1854 1858 sage: b.solver_parameter("verbosity_simplex", "GLP_MSG_ALL") 1855 sage: p.solve() # tol 0.00001 1859 sage: p.solve() # tol 0.00001 1860 GLPK Simplex Optimizer, v4.44 1861 2 rows, 2 columns, 4 non-zeros 1862 * 0: obj = 7.000000000e+00 infeas = 0.000e+00 (0) 1863 * 2: obj = 9.400000000e+00 infeas = 0.000e+00 (0) 1864 OPTIMAL SOLUTION FOUND 1856 1865 9.4 1857 1858 1866 """ 1859 1867 return self._backend 1860 1868 -
sage/numerical/optimize.py
diff --git a/sage/numerical/optimize.py b/sage/numerical/optimize.py
a b 525 525 sage: sol['x'] 526 526 (45.000000..., 6.2499999...3, 1.00000000...) 527 527 sage: sol=linear_program(v,m,h,solver='glpk') 528 GLPK Simplex Optimizer... 529 OPTIMAL SOLUTION FOUND 528 530 sage: sol['x'] 529 531 (45.0..., 6.25, 1.0...) 530 532 """ -
sage/parallel/decorate.py
diff --git a/sage/parallel/decorate.py b/sage/parallel/decorate.py
a b 556 556 sage: cython('def f(): print <char*>0') 557 557 sage: @fork 558 558 ... def g(): f() 559 sage: g() 559 sage: print "this works"; g() 560 this works... 561 <BLANKLINE> 562 ------------------------------------------------------------------------ 563 Unhandled SIG... 564 ------------------------------------------------------------------------ 560 565 'NO DATA' 561 566 """ 562 567 F = Fork(timeout=timeout, verbose=verbose) -
sage/plot/line.py
diff --git a/sage/plot/line.py b/sage/plot/line.py
a b 426 426 427 427 sage: E = EllipticCurve('37a') 428 428 sage: vals = E.lseries().values_along_line(1-I, 1+10*I, 100) # critical line 429 *** Warning: new stack size = ... 429 430 sage: L = [(z[1].real(), z[1].imag()) for z in vals] 430 431 sage: line(L, rgbcolor=(3/4,1/2,5/8)) 431 432 -
sage/rings/fraction_field_FpT.pyx
diff --git a/sage/rings/fraction_field_FpT.pyx b/sage/rings/fraction_field_FpT.pyx
a b 988 988 return self.cur 989 989 990 990 cdef class Polyring_FpT_coerce(RingHomomorphism_coercion): 991 cdef long p992 991 """ 993 992 This class represents the coercion map from GF(p)[t] to GF(p)(t) 994 993 … … 1003 1002 sage: type(f) 1004 1003 <type 'sage.rings.fraction_field_FpT.Polyring_FpT_coerce'> 1005 1004 """ 1005 cdef long p 1006 1006 1007 def __init__(self, R): 1007 1008 """ 1008 1009 INPUTS: … … 1113 1114 return FpT_Polyring_section(self) 1114 1115 1115 1116 cdef class FpT_Polyring_section(Section): 1116 cdef long p1117 1117 """ 1118 1118 This class represents the section from GF(p)(t) back to GF(p)[t] 1119 1119 … … 1128 1128 sage: type(f) 1129 1129 <type 'sage.rings.fraction_field_FpT.FpT_Polyring_section'> 1130 1130 """ 1131 cdef long p 1132 1131 1133 def __init__(self, Polyring_FpT_coerce f): 1132 1134 """ 1133 1135 INPUTS: … … 1180 1182 return ans 1181 1183 1182 1184 cdef class Fp_FpT_coerce(RingHomomorphism_coercion): 1183 cdef long p1184 1185 """ 1185 1186 This class represents the coercion map from GF(p) to GF(p)(t) 1186 1187 … … 1195 1196 sage: type(f) 1196 1197 <type 'sage.rings.fraction_field_FpT.Fp_FpT_coerce'> 1197 1198 """ 1199 cdef long p 1200 1198 1201 def __init__(self, R): 1199 1202 """ 1200 1203 INPUTS: … … 1310 1313 return FpT_Fp_section(self) 1311 1314 1312 1315 cdef class FpT_Fp_section(Section): 1313 cdef long p1314 1316 """ 1315 1317 This class represents the section from GF(p)(t) back to GF(p)[t] 1316 1318 … … 1325 1327 sage: type(f) 1326 1328 <type 'sage.rings.fraction_field_FpT.FpT_Fp_section'> 1327 1329 """ 1330 cdef long p 1331 1328 1332 def __init__(self, Fp_FpT_coerce f): 1329 1333 """ 1330 1334 INPUTS: … … 1385 1389 return ans 1386 1390 1387 1391 cdef class ZZ_FpT_coerce(RingHomomorphism_coercion): 1388 cdef long p1389 1392 """ 1390 1393 This class represents the coercion map from ZZ to GF(p)(t) 1391 1394 … … 1400 1403 sage: type(f) 1401 1404 <type 'sage.rings.fraction_field_FpT.ZZ_FpT_coerce'> 1402 1405 """ 1406 cdef long p 1407 1403 1408 def __init__(self, R): 1404 1409 """ 1405 1410 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 b 814 814 sage: P = EllipticCurve(L, '57a1').lift_x(z_x) * 3 815 815 sage: ideal = L.fractional_ideal(P[0], P[1]) 816 816 sage: ideal.is_principal(proof=False) 817 *** Warning: precision too low for generators, not given. 817 818 True 818 819 sage: len(ideal.gens_reduced(proof=False)) 819 820 1 -
sage/rings/number_field/order.py
diff --git a/sage/rings/number_field/order.py b/sage/rings/number_field/order.py
a b 237 237 sage: k.<a> = NumberField(x^2 + 5077); G = k.class_group(); G 238 238 Class group of order 22 with structure C22 of Number Field in a with defining polynomial x^2 + 5077 239 239 sage: G.0 240 Fractional ideal class (11, a + 7) # 32-bit 241 Fractional ideal class (23, a + 12) # 64-bit 240 Fractional ideal class (11, a + 7) 242 241 sage: Ok = k.maximal_order(); Ok 243 242 Maximal Order in Number Field in a with defining polynomial x^2 + 5077 244 243 sage: Ok * (11, a + 7) -
sage/rings/padics/padic_capped_relative_element.pyx
diff --git a/sage/rings/padics/padic_capped_relative_element.pyx b/sage/rings/padics/padic_capped_relative_element.pyx
a b 2369 2369 sage: hash(R(17)) #indirect doctest 2370 2370 17 2371 2371 2372 sage: hash(R(-1)) # 32-bit 2373 1977822444 2374 2375 sage: hash(R(-1)) # 64-bit 2376 95367431640624 2372 sage: hash(R(-1)) 2373 1977822444 # 32-bit 2374 95367431640624 # 64-bit 2377 2375 """ 2378 2376 return hash(self.lift_c()) 2379 2377 -
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 b 3695 3695 product criterion:1 chain criterion:0 3696 3696 [x^3 + y^2, x^2*y + 1, y^3 - x] 3697 3697 sage: I.groebner_basis(prot=False) 3698 std in (0),(x,y),(dp(2),C) 3699 [4294967295:2]3ss4s6 3700 (S:2)-- 3701 product criterion:1 chain criterion:0 3698 3702 [x^3 + y^2, x^2*y + 1, y^3 - x] 3699 3703 sage: set_verbose(0) 3700 3704 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 b 2770 2770 2771 2771 sage: pari.default("debug", 3) 2772 2772 sage: F = pol.factor() 2773 2773 <BLANKLINE> 2774 2774 Entering nffactor: 2775 2775 ... 2776 2776 sage: pari.default("debug", 0) … … 4733 4733 (... + 1.25992104989*I, 1), 4734 4734 (1.09112363597 - 0.629960524947*I, 1)] 4735 4735 sage: f.roots(multiplicities=False) 4736 [-1.09112363597 - 0.629960524947*I, 4737 ... + 1.25992104989r*I, 4738 1.09112363597 - 0.629960524947*I] 4736 [-1.09112363597 - 0.629960524947*I, ... + 1.25992104989*I, 1.09112363597 - 0.629960524947*I] 4739 4737 sage: [f(z) for z in f.roots(multiplicities=False)] # random, too close to 0 4740 4738 [-2.56337823492e-15 - 6.66133814775e-15*I, 4741 4739 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 b 154 154 155 155 sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^3: 1}) 156 156 x^8 157 sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^30: 1}) # 32-bit158 sage: PolynomialRing(ZZ, 'x', implementation='NTL')({ 2^62: 1}) # 64-bit157 sage: import sys 158 sage: PolynomialRing(ZZ, 'x', implementation='NTL')({sys.maxint>>1: 1}) 159 159 Traceback (most recent call last): 160 160 ... 161 161 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 b 462 462 sage: I.interreduction(report=True) 463 463 Symmetric interreduction 464 464 [1/2] > 465 [2/2] : 465 [2/2] :> 466 466 [1/2] > 467 [2/2] T[1] 467 [2/2] T[1]> 468 468 > 469 469 Symmetric Ideal (-x_1^2, x_2 + x_1) of Infinite polynomial ring in x over Rational Field 470 470 … … 824 824 sage: I1.groebner_basis(report=True, reduced=True) 825 825 Symmetric interreduction 826 826 [1/2] > 827 [2/2] : 827 [2/2] :> 828 828 [1/2] > 829 829 [2/2] > 830 830 Symmetrise 2 polynomials at level 2 … … 834 834 Symmetric interreduction 835 835 [1/3] > 836 836 [2/3] > 837 [3/3] : 837 [3/3] :> 838 838 -> 0 839 839 [1/2] > 840 840 [2/2] > … … 854 854 ::> 855 855 Symmetric interreduction 856 856 [1/4] > 857 [2/4] : 857 [2/4] :> 858 858 -> 0 859 [3/4] :: 859 [3/4] ::> 860 860 -> 0 861 [4/4] : 861 [4/4] :> 862 862 -> 0 863 863 [1/1] > 864 864 Apply permutations … … 881 881 :> 882 882 Symmetric interreduction 883 883 [1/2] > 884 [2/2] : 884 [2/2] :> 885 885 -> 0 886 886 [1/1] > 887 887 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 b 1305 1305 sage: E.analytic_rank(algorithm='pari') 1306 1306 2 1307 1307 sage: E.analytic_rank(algorithm='rubinstein') 1308 *** Warning: new stack size = ... 1308 1309 2 1309 1310 sage: E.analytic_rank(algorithm='sympow') 1310 1311 2 1311 1312 sage: E.analytic_rank(algorithm='magma') # optional - magma 1312 1313 2 1313 1314 sage: E.analytic_rank(algorithm='all') 1315 *** Warning: new stack size = ... 1314 1316 2 1315 1317 1316 1318 With the optional parameter leading_coefficient set to ``True``, a … … 2128 2130 sage: E.saturation([P]) 2129 2131 ([(-192128125858676194585718821667542660822323528626273/336995568430319276695106602174283479617040716649 : 70208213492933395764907328787228427430477177498927549075405076353624188436/195630373799784831667835900062564586429333568841391304129067339731164107 : 1)], 1, 113.302910926080) 2130 2132 sage: E.saturation([2*P]) ## needs higher precision 2133 After 10 attempts at enlargement, giving up! 2131 2134 ... 2132 2135 ([(1755450733726721618440965414535034458701302721700399/970334851896750960577261378321772998240802013604 : -59636173615502879504846810677646864329901430096139563516090202443694810309127/955833935771565601591243078845907133814963790187832340692216425242529192 : 1)], 2, 113.302910926080) 2133 2136 -
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 b 224 224 EXAMPLES: 225 225 sage: E = EllipticCurve('37a') 226 226 sage: E.lseries().zeros(2) 227 *** Warning: new stack size = ... 227 228 [0.000000000, 5.00317001] 228 229 229 230 sage: a = E.lseries().zeros(20) # long time 231 *** Warning: new stack size = ... 230 232 sage: point([(1,x) for x in a]) # graph (long time) 231 233 232 234 AUTHOR: … … 256 258 EXAMPLES: 257 259 sage: E = EllipticCurve('37a') 258 260 sage: E.lseries().zeros_in_interval(6, 10, 0.1) # long time 261 *** Warning: new stack size = ... 259 262 [(6.87039122, 0.248922780), (8.01433081, -0.140168533), (9.93309835, -0.129943029)] 260 263 """ 261 264 from sage.lfunctions.lcalc import lcalc … … 341 344 EXAMPLES: 342 345 sage: E = EllipticCurve('37a') 343 346 sage: E.lseries().twist_zeros(3, -4, -3) # long time 347 *** Warning: new stack size = ... 344 348 {-4: [1.60813783, 2.96144840, 3.89751747], -3: [2.06170900, 3.48216881, 4.45853219]} 345 349 """ 346 350 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 b 1337 1337 #******************************************************************* 1338 1338 # Abelian varieties 1339 1339 #******************************************************************* 1340 class SchemeMorphism_point_abelian_variety_field \1341 (AdditiveGroupElement, SchemeMorphism_point_projective_field):1340 class SchemeMorphism_point_abelian_variety_field( 1341 AdditiveGroupElement, SchemeMorphism_point_projective_field): 1342 1342 """ 1343 1343 A rational point of an abelian variety over a field. 1344 1344 -
sage/schemes/toric/variety.py
diff --git a/sage/schemes/toric/variety.py b/sage/schemes/toric/variety.py
a b 1 r""" 1 # -*- coding: utf-8 -*- 2 r""" 2 3 Toric varieties 3 4 4 5 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 b 57 57 """ 58 58 Parents are the SAGE/mathematical analogues of container objects 59 59 in computer science. 60 61 TESTS:: 62 63 sage: V = VectorSpace(GF(2,'a'),2) 64 sage: V.list() 65 [(0, 0), (1, 0), (0, 1), (1, 1)] 66 sage: MatrixSpace(GF(3), 1, 1).list() 67 [[0], [1], [2]] 68 sage: DirichletGroup(3).list() 69 [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1, 70 Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1] 71 sage: K = GF(7^6,'a') 72 sage: K.list()[:10] # long time 73 [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2] 74 sage: K.<a> = GF(4) 75 sage: K.list() 76 [0, a, a + 1, 1] 60 77 """ 61 78 62 79 def __init__(self, coerce_from=[], actions=[], embeddings=[], category=None): … … 400 417 # This is just a convenient spot to cover the relevant cython parents, 401 418 # without bothering the new parents 402 419 list = parent.Parent._list_from_iterator_cached 403 """404 TESTS::405 406 sage: V = VectorSpace(GF(2,'a'),2)407 sage: V.list()408 [(0, 0), (1, 0), (0, 1), (1, 1)]409 sage: MatrixSpace(GF(3), 1, 1).list()410 [[0], [1], [2]]411 sage: DirichletGroup(3).list()412 [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1,413 Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1]414 sage: K = GF(7^6,'a')415 sage: K.list()[:10] # long time416 [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2]417 sage: K.<a> = GF(4)418 sage: K.list()419 [0, a, a + 1, 1]420 """421 422 420 423 421 424 422 ################################################ -
sage/symbolic/expression.pyx
diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a b 3525 3525 3526 3526 EXAMPLES:: 3527 3527 3528 sage: var('x,y,z,a,b,c,d, e,f')3529 (x, y, z, a, b, c, d, e, f)3528 sage: var('x,y,z,a,b,c,d,f,g') 3529 (x, y, z, a, b, c, d, f, g) 3530 3530 sage: w0 = SR.wild(0); w1 = SR.wild(1); w2 = SR.wild(2) 3531 3531 sage: ((x+y)^a).match((x+y)^a) # no wildcards, so empty dict 3532 3532 {} … … 3549 3549 sage: t = (a*(x+y)+a*z+b).match(a*w0+w1) 3550 3550 sage: t[w0], t[w1] 3551 3551 (x + y, a*z + b) 3552 sage: print (a+b+c+d+ e+f).match(c)3552 sage: print (a+b+c+d+f+g).match(c) 3553 3553 None 3554 sage: (a+b+c+d+ e+f).has(c)3554 sage: (a+b+c+d+f+g).has(c) 3555 3555 True 3556 sage: (a+b+c+d+ e+f).match(c+w0)3557 {$0: a + b + d + e + f}3558 sage: (a+b+c+d+ e+f).match(c+e+w0)3556 sage: (a+b+c+d+f+g).match(c+w0) 3557 {$0: a + b + d + f + g} 3558 sage: (a+b+c+d+f+g).match(c+g+w0) 3559 3559 {$0: a + b + d + f} 3560 3560 sage: (a+b).match(a+b+w0) 3561 3561 {$0: 0} … … 3691 3691 """ 3692 3692 EXAMPLES:: 3693 3693 3694 sage: var('x,y,z,a,b,c,d, e,f')3695 (x, y, z, a, b, c, d, e, f)3694 sage: var('x,y,z,a,b,c,d,f,g') 3695 (x, y, z, a, b, c, d, f, g) 3696 3696 sage: w0 = SR.wild(0); w1 = SR.wild(1) 3697 3697 sage: t = a^2 + b^2 + (x+y)^3 3698 3698 … … 3814 3814 """ 3815 3815 EXAMPLES:: 3816 3816 3817 sage: var('x,y,z,a,b,c,d, e,f')3818 (x, y, z, a, b, c, d, e,f)3817 sage: var('x,y,z,a,b,c,d,f') 3818 (x, y, z, a, b, c, d, f) 3819 3819 sage: w0 = SR.wild(0); w1 = SR.wild(1) 3820 3820 sage: (a^2 + b^2 + (x+y)^2)._subs_expr(w0^2 == w0^3) 3821 3821 (x + y)^3 + a^3 + b^3 … … 6725 6725 6726 6726 :: 6727 6727 6728 sage: gp('gamma(1+I)') # 32-bit 6729 0.4980156681183560427136911175 - 0.1549498283018106851249551305*I 6730 6731 :: 6732 6733 sage: gp('gamma(1+I)') # 64-bit 6734 0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I 6728 sage: gp('gamma(1+I)') 6729 0.4980156681183560427136911175 - 0.1549498283018106851249551305*I # 32-bit 6730 0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I # 64-bit 6735 6731 6736 6732 We plot the familiar plot of this log-convex function:: 6737 6733 … … 8447 8443 assumed to be an integer, a real if with ``r``, and so on:: 8448 8444 8449 8445 sage: solve( sin(x)==cos(x), x, to_poly_solve=True) 8450 [x == 1/4*pi + pi*z 74]8446 [x == 1/4*pi + pi*z...] 8451 8447 8452 8448 An effort is made to only return solutions that satisfy the current assumptions:: 8453 8449 … … 8487 8483 sage: from sage.calculus.calculus import maxima 8488 8484 sage: sol = maxima(cos(x)==0).to_poly_solve(x) 8489 8485 sage: sol.sage() 8490 [[x == -1/2*pi + 2*pi*z 86], [x == 1/2*pi + 2*pi*z88]]8486 [[x == -1/2*pi + 2*pi*z...], [x == 1/2*pi + 2*pi*z...]] 8491 8487 8492 8488 If a returned unsolved expression has a denominator, but the 8493 8489 original one did not, this may also be true:: … … 8497 8493 sage: from sage.calculus.calculus import maxima 8498 8494 sage: sol = maxima(cos(x) * sin(x) == 1/2).to_poly_solve(x) 8499 8495 sage: sol.sage() 8500 [[x == 1/4*pi + pi*z 102]]8496 [[x == 1/4*pi + pi*z...]] 8501 8497 8502 8498 Some basic inequalities can be also solved:: 8503 8499 … … 8554 8550 :: 8555 8551 8556 8552 sage: solve(sin(x)==1/2,x,to_poly_solve='force') 8557 [x == 5/6*pi + 2*pi*z 116, x == 1/6*pi + 2*pi*z114]8553 [x == 5/6*pi + 2*pi*z..., x == 1/6*pi + 2*pi*z...] 8558 8554 8559 8555 :trac:`11618` fixed:: 8560 8556 … … 8792 8788 sage: b.solve(t) 8793 8789 [] 8794 8790 sage: b.solve(t, to_poly_solve=True) 8795 [t == 1/450*I*pi*z 128 + 1/900*log(3/4*sqrt(41) + 25/4), t == 1/450*I*pi*z126+ 1/900*log(-3/4*sqrt(41) + 25/4)]8791 [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)] 8796 8792 sage: n(1/900*log(-3/4*sqrt(41) + 25/4)) 8797 8793 0.000411051404934985 8798 8794 -
sage/symbolic/function.pyx
diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx
a b 622 622 sage: import numpy 623 623 sage: a = numpy.arange(5) 624 624 sage: csc(a) 625 Warning: divide by zero encountered in divide 625 626 array([ inf, 1.18839511, 1.09975017, 7.0861674 , -1.32134871]) 626 627 627 628 sage: factorial(a) -
sage/tests/cmdline.py
diff --git a/sage/tests/cmdline.py b/sage/tests/cmdline.py
a b 332 332 sage: (out, err, ret) = test_executable(["sage", "-t", script]) 333 333 sage: ret 334 334 128 335 sage: out.find("1 item shad failures:") >= 0335 sage: out.find("1 item had failures:") >= 0 336 336 True 337 337 sage: os.environ['SAGE_TESTDIR'] = OLD_TESTDIR # just in case 338 338