|
4 | 4 | "cell_type": "markdown",
|
5 | 5 | "metadata": {},
|
6 | 6 | "source": [
|
| 7 | + "This document is one of [More SageMath Tutorials](https://more-sagemath-tutorials.readthedocs.io/en/latest/).\n", |
| 8 | + "You may [edit it on github](http://github.com/sagemath/more-sagemath-tutorials/).\n", |
7 | 9 | "$ \\def\\NN{\\mathbb{N}} $\n",
|
8 | 10 | "$ \\def\\ZZ{\\mathbb{Z}} $\n",
|
9 | 11 | "$ \\def\\QQ{\\mathbb{Q}} $\n",
|
|
18 | 20 | "cell_type": "markdown",
|
19 | 21 | "metadata": {},
|
20 | 22 | "source": [
|
21 |
| - "# Tutorial: start here!" |
| 23 | + "# Start here!" |
22 | 24 | ]
|
23 | 25 | },
|
24 | 26 | {
|
|
278 | 280 | "cell_type": "markdown",
|
279 | 281 | "metadata": {},
|
280 | 282 | "source": [
|
281 |
| - "### Algebra\n", |
282 |
| - "\n", |
283 |
| - "\n", |
284 |
| - " sage: factor(x^100 - 1)\n", |
285 |
| - "\n", |
286 |
| - "sage: p = 54*x^4+36*x^3-102*x^2-72*x-12\n", |
287 |
| - "sage: p.factor()\n", |
288 |
| - "6*(x^2 - 2)*(3*x + 1)^2\n", |
289 |
| - "\n", |
290 |
| - "sage: for K in [ZZ, QQ, ComplexField(16), QQ[sqrt(2)], GF(5)]:\n", |
291 |
| - "….: print K, “:”; print K[‘x’](p).factor()\n", |
292 |
| - "Integer Ring :\n", |
293 |
| - "2 * 3 * (3*x + 1)^2 * (x^2 - 2)\n", |
294 |
| - "Rational Field :\n", |
295 |
| - "(54) * (x + 1/3)^2 * (x^2 - 2)\n", |
296 |
| - "Complex Field with 16 bits of precision :\n", |
297 |
| - "(54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414)\n", |
298 |
| - "Number Field in sqrt2 with defining polynomial x^2 - 2 :\n", |
299 |
| - "(54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2\n", |
300 |
| - "Finite Field of size 5 :\n", |
301 |
| - "(4) * (x + 2)^2 * (x^2 + 3)\n", |
302 |
| - "\n", |
303 |
| - "sage: ZZ.category()\n", |
304 |
| - "Category of euclidean domains\n", |
305 |
| - "\n", |
306 |
| - "sage: sorted( ZZ.category().axioms() )\n", |
307 |
| - "[‘AdditiveAssociative’, ‘AdditiveCommutative’, ‘AdditiveInverse’, ‘AdditiveUnital’,\n", |
308 |
| - "\n", |
309 |
| - "‘Associative’, ‘Commutative’,\n", |
310 |
| - "‘Distributive’, ‘NoZeroDivisors’, ‘Unital’]\n", |
311 |
| - "\n", |
312 |
| - "\n", |
313 |
| - "\n", |
314 |
| - "\n", |
315 |
| - "\n", |
316 |
| - "\n", |
317 |
| - "\n", |
318 |
| - "\n", |
319 |
| - "\n", |
320 |
| - "\n", |
321 |
| - " ‘Associative’, ‘Commutative’,\n", |
322 |
| - "‘Distributive’, ‘NoZeroDivisors’, ‘Unital’]" |
| 283 | + "### Algebra" |
| 284 | + ] |
| 285 | + }, |
| 286 | + { |
| 287 | + "cell_type": "code", |
| 288 | + "execution_count": null, |
| 289 | + "metadata": {}, |
| 290 | + "outputs": [], |
| 291 | + "source": [ |
| 292 | + "factor(x^100 - 1)" |
| 293 | + ] |
| 294 | + }, |
| 295 | + { |
| 296 | + "cell_type": "code", |
| 297 | + "execution_count": null, |
| 298 | + "metadata": {}, |
| 299 | + "outputs": [ |
| 300 | + { |
| 301 | + "name": "stdout", |
| 302 | + "output_type": "stream", |
| 303 | + "text": [ |
| 304 | + "6*(x^2 - 2)*(3*x + 1)^2\n" |
| 305 | + ] |
| 306 | + } |
| 307 | + ], |
| 308 | + "source": [ |
| 309 | + "p = 54*x^4+36*x^3-102*x^2-72*x-12\n", |
| 310 | + "p.factor()" |
| 311 | + ] |
| 312 | + }, |
| 313 | + { |
| 314 | + "cell_type": "code", |
| 315 | + "execution_count": null, |
| 316 | + "metadata": {}, |
| 317 | + "outputs": [ |
| 318 | + { |
| 319 | + "name": "stdout", |
| 320 | + "output_type": "stream", |
| 321 | + "text": [ |
| 322 | + "Integer Ring :\n", |
| 323 | + "2 * 3 * (3*x + 1)^2 * (x^2 - 2)\n", |
| 324 | + "Rational Field :\n", |
| 325 | + "(54) * (x + 1/3)^2 * (x^2 - 2)\n", |
| 326 | + "Complex Field with 16 bits of precision :\n", |
| 327 | + "(54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414)\n", |
| 328 | + "Number Field in sqrt2 with defining polynomial x^2 - 2 :\n", |
| 329 | + "(54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2\n", |
| 330 | + "Finite Field of size 5 :\n", |
| 331 | + "(4) * (x + 2)^2 * (x^2 + 3)\n" |
| 332 | + ] |
| 333 | + } |
| 334 | + ], |
| 335 | + "source": [ |
| 336 | + "for K in [ZZ, QQ, ComplexField(16), QQ[sqrt(2)], GF(5)]:\n", |
| 337 | + " print K, \":\"; print K['x'](p).factor()" |
| 338 | + ] |
| 339 | + }, |
| 340 | + { |
| 341 | + "cell_type": "code", |
| 342 | + "execution_count": null, |
| 343 | + "metadata": {}, |
| 344 | + "outputs": [ |
| 345 | + { |
| 346 | + "name": "stdout", |
| 347 | + "output_type": "stream", |
| 348 | + "text": [ |
| 349 | + "Category of euclidean domains\n" |
| 350 | + ] |
| 351 | + } |
| 352 | + ], |
| 353 | + "source": [ |
| 354 | + "ZZ.category()" |
| 355 | + ] |
| 356 | + }, |
| 357 | + { |
| 358 | + "cell_type": "code", |
| 359 | + "execution_count": null, |
| 360 | + "metadata": {}, |
| 361 | + "outputs": [ |
| 362 | + { |
| 363 | + "name": "stdout", |
| 364 | + "output_type": "stream", |
| 365 | + "text": [ |
| 366 | + "['AdditiveAssociative', 'AdditiveCommutative', 'AdditiveInverse', 'AdditiveUnital',\n", |
| 367 | + " 'Associative', 'Commutative',\n", |
| 368 | + " 'Distributive', 'NoZeroDivisors', 'Unital']" |
| 369 | + ] |
| 370 | + } |
| 371 | + ], |
| 372 | + "source": [ |
| 373 | + "sorted( ZZ.category().axioms() )" |
323 | 374 | ]
|
324 | 375 | },
|
325 | 376 | {
|
|
577 | 628 | }
|
578 | 629 | ],
|
579 | 630 | "source": [
|
580 |
| - "Suit = Set([\"Coeur\", \"Carreau\", \"Pique\", \"Trefle\"])\n", |
581 |
| - "Values = Set([2, 3, 4, 5, 6, 7, 8, 9, 10, \"Valet\", \"Dame\", \"Roi\", \"As\"])\n", |
| 631 | + "Suits = Set([\"Hearts\", \"Diamonds\", \"Spades\", \"Clubs\"])\n", |
| 632 | + "Values = Set([2, 3, 4, 5, 6, 7, 8, 9, 10, \"Jack\", \"Queen\", \"King\", \"Ace\"])\n", |
582 | 633 | "Cards = cartesian_product([Values, Suits])\n",
|
583 |
| - "Hands = Subsets(Cartes, 5)\n", |
| 634 | + "Hands = Subsets(Cards, 5)\n", |
584 | 635 | "Hands.random_element()"
|
585 | 636 | ]
|
586 | 637 | },
|
|
598 | 649 | }
|
599 | 650 | ],
|
600 | 651 | "source": [
|
601 |
| - "Mains.cardinality()" |
| 652 | + "Hands.cardinality()" |
602 | 653 | ]
|
603 | 654 | },
|
604 | 655 | {
|
|
616 | 667 | "metadata": {},
|
617 | 668 | "outputs": [],
|
618 | 669 | "source": [
|
619 |
| - "L = RootSystem([\"G\",2,1]).ambient_space()\n", |
| 670 | + "L = RootSystem([\"G\", 2, 1]).ambient_space()\n", |
620 | 671 | "p = L.plot(affine=False, level=1)\n",
|
621 |
| - "p.show(aspect_ratio=[1,1,2], frame=False)" |
| 672 | + "p.show(aspect_ratio=[1, 1, 2], frame=False)" |
622 | 673 | ]
|
623 | 674 | },
|
624 | 675 | {
|
|
635 | 686 | "outputs": [],
|
636 | 687 | "source": [
|
637 | 688 | "E = EllipticCurve('389a')\n",
|
638 |
| - "plot(E,thickness=3)" |
| 689 | + "plot(E, thickness=3)" |
639 | 690 | ]
|
640 | 691 | },
|
641 | 692 | {
|
|
1735 | 1786 | "- Ask Sage: [https://ask.sagemath.org](https://ask.sagemath.org) \n",
|
1736 | 1787 | "- Bug Tracker: [https://trac.sagemath.org](https://trac.sagemath.org) \n",
|
1737 | 1788 | "- The open book [Computational Mathematics with Sage](http://sagebook.gforge.inria.fr/english.html)\n",
|
1738 |
| - " (originally written in $ French <http://sagebook.gforge.inria.fr/> $; also translated in $ German <http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf/> $) \n", |
1739 |
| - "- [Sage’s main tutorial](http://doc.sagemath.org/html/en/tutorial/index.html#tutorial) \n", |
| 1789 | + " (originally written in [French](http://sagebook.gforge.inria.fr/); also translated in $ German <http://www.loria.fr/~zimmerma/sagebook/CalculDeutsch.pdf/> $) \n", |
| 1790 | + "- :ref:`Sage's main tutorial <tutorial>`_ \n", |
1740 | 1791 | "- [Sage’s official thematic tutorials](https://doc.sagemath.org/html/en/thematic_tutorials/index.html) \n",
|
1741 | 1792 | "- [More Sage tutorials](https://more-sagemath-tutorials.readthedocs.io/) \n",
|
1742 | 1793 | "- [Sage’s quick reference cards](https://wiki.sagemath.org/quickref) "
|
|
0 commit comments