passagemath-repl 10.5.28__py3-none-any.whl → 10.5.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/kernel.json +1 -0
  2. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo-64x64.png +0 -0
  3. passagemath_repl-10.5.30.data/data/share/jupyter/kernels/sagemath/logo.svg +352 -0
  4. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/METADATA +3 -3
  5. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/RECORD +95 -24
  6. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/top_level.txt +1 -0
  7. sage/ext_data/all__sagemath_repl.py +1 -0
  8. sage/interfaces/all__sagemath_repl.py +1 -0
  9. sage/repl/ipython_kernel/install.py +6 -8
  10. sage/tests/books/__init__.py +2 -0
  11. sage/tests/books/computational-mathematics-with-sagemath/__init__.py +1 -0
  12. sage/tests/books/computational-mathematics-with-sagemath/calculus_doctest.py +550 -0
  13. sage/tests/books/computational-mathematics-with-sagemath/combinat_doctest.py +1054 -0
  14. sage/tests/books/computational-mathematics-with-sagemath/domaines_doctest.py +444 -0
  15. sage/tests/books/computational-mathematics-with-sagemath/float_doctest.py +478 -0
  16. sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +255 -0
  17. sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py +419 -0
  18. sage/tests/books/computational-mathematics-with-sagemath/integration_doctest.py +291 -0
  19. sage/tests/books/computational-mathematics-with-sagemath/linalg_doctest.py +455 -0
  20. sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py +422 -0
  21. sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +235 -0
  22. sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +561 -0
  23. sage/tests/books/computational-mathematics-with-sagemath/nonlinear_doctest.py +491 -0
  24. sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py +156 -0
  25. sage/tests/books/computational-mathematics-with-sagemath/polynomes_doctest.py +406 -0
  26. sage/tests/books/computational-mathematics-with-sagemath/premierspas_doctest.py +181 -0
  27. sage/tests/books/computational-mathematics-with-sagemath/programmation_doctest.py +663 -0
  28. sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +393 -0
  29. sage/tests/books/computational-mathematics-with-sagemath/sol/__init__.py +1 -0
  30. sage/tests/books/computational-mathematics-with-sagemath/sol/calculus_doctest.py +265 -0
  31. sage/tests/books/computational-mathematics-with-sagemath/sol/combinat_doctest.py +218 -0
  32. sage/tests/books/computational-mathematics-with-sagemath/sol/domaines_doctest.py +60 -0
  33. sage/tests/books/computational-mathematics-with-sagemath/sol/float_doctest.py +142 -0
  34. sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py +106 -0
  35. sage/tests/books/computational-mathematics-with-sagemath/sol/graphtheory_doctest.py +54 -0
  36. sage/tests/books/computational-mathematics-with-sagemath/sol/integration_doctest.py +57 -0
  37. sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +57 -0
  38. sage/tests/books/computational-mathematics-with-sagemath/sol/linsolve_doctest.py +26 -0
  39. sage/tests/books/computational-mathematics-with-sagemath/sol/lp_doctest.py +48 -0
  40. sage/tests/books/computational-mathematics-with-sagemath/sol/mpoly_doctest.py +116 -0
  41. sage/tests/books/computational-mathematics-with-sagemath/sol/nonlinear_doctest.py +112 -0
  42. sage/tests/books/computational-mathematics-with-sagemath/sol/numbertheory_doctest.py +168 -0
  43. sage/tests/books/computational-mathematics-with-sagemath/sol/polynomes_doctest.py +108 -0
  44. sage/tests/books/computational-mathematics-with-sagemath/sol/recequadiff_doctest.py +59 -0
  45. sage/tests/books/judson-abstract-algebra/__init__.py +1 -0
  46. sage/tests/books/judson-abstract-algebra/actions-sage-exercises.py +52 -0
  47. sage/tests/books/judson-abstract-algebra/actions-sage.py +174 -0
  48. sage/tests/books/judson-abstract-algebra/algcodes-sage.py +131 -0
  49. sage/tests/books/judson-abstract-algebra/boolean-sage.py +270 -0
  50. sage/tests/books/judson-abstract-algebra/cosets-sage-exercises.py +88 -0
  51. sage/tests/books/judson-abstract-algebra/cosets-sage.py +171 -0
  52. sage/tests/books/judson-abstract-algebra/crypt-sage.py +152 -0
  53. sage/tests/books/judson-abstract-algebra/cyclic-sage.py +451 -0
  54. sage/tests/books/judson-abstract-algebra/domains-sage.py +164 -0
  55. sage/tests/books/judson-abstract-algebra/fields-sage.py +300 -0
  56. sage/tests/books/judson-abstract-algebra/finite-sage.py +109 -0
  57. sage/tests/books/judson-abstract-algebra/galois-sage.py +485 -0
  58. sage/tests/books/judson-abstract-algebra/groups-sage.py +281 -0
  59. sage/tests/books/judson-abstract-algebra/homomorph-sage-exercises.py +66 -0
  60. sage/tests/books/judson-abstract-algebra/homomorph-sage.py +201 -0
  61. sage/tests/books/judson-abstract-algebra/integers-sage.py +198 -0
  62. sage/tests/books/judson-abstract-algebra/isomorph-sage.py +173 -0
  63. sage/tests/books/judson-abstract-algebra/normal-sage.py +134 -0
  64. sage/tests/books/judson-abstract-algebra/permute-sage.py +320 -0
  65. sage/tests/books/judson-abstract-algebra/poly-sage.py +301 -0
  66. sage/tests/books/judson-abstract-algebra/rings-sage.py +414 -0
  67. sage/tests/books/judson-abstract-algebra/sets-sage.py +164 -0
  68. sage/tests/books/judson-abstract-algebra/struct-sage.py +64 -0
  69. sage/tests/books/judson-abstract-algebra/sylow-sage.py +251 -0
  70. sage/tests/books/judson-abstract-algebra/vect-sage-exercises.py +49 -0
  71. sage/tests/books/judson-abstract-algebra/vect-sage.py +212 -0
  72. sage/tests/memcheck/__init__.py +1 -0
  73. sage/tests/memcheck/run_tests.py +25 -0
  74. sage/tests/memcheck/run_tests_in_valgrind.py +36 -0
  75. sage/tests/memcheck/symbolic_expression.py +12 -0
  76. sage/tests/memcheck/verify_no_leak.py +28 -0
  77. sage/tests/all.py +0 -0
  78. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cachegrind +0 -0
  79. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-callgrind +0 -0
  80. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-cleaner +0 -0
  81. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-coverage +0 -0
  82. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-eval +0 -0
  83. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-fixdoctests +0 -0
  84. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-inline-fortran +0 -0
  85. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipynb2rst +0 -0
  86. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-ipython +0 -0
  87. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-massif +0 -0
  88. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-notebook +0 -0
  89. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-omega +0 -0
  90. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-preparse +0 -0
  91. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run +0 -0
  92. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-run-cython +0 -0
  93. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-runtests +0 -0
  94. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-startuptime.py +0 -0
  95. {passagemath_repl-10.5.28.data → passagemath_repl-10.5.30.data}/scripts/sage-valgrind +0 -0
  96. {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.30.dist-info}/WHEEL +0 -0
@@ -0,0 +1,174 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.graphs sage.groups
3
+ ## Sage Doctest File ##
4
+ #**************************************#
5
+ #* Generated from PreTeXt source *#
6
+ #* on 2017-08-24T11:43:34-07:00 *#
7
+ #* *#
8
+ #* http://mathbook.pugetsound.edu *#
9
+ #* *#
10
+ #**************************************#
11
+ ##
12
+ """
13
+ Please contact Rob Beezer (beezer@ups.edu) with
14
+ any test failures here that need to be changed
15
+ as a result of changes accepted into Sage. You
16
+ may edit/change this file in any sensible way, so
17
+ that development work may procede. Your changes
18
+ may later be replaced by the authors of "Abstract
19
+ Algebra: Theory and Applications" when the text is
20
+ updated, and a replacement of this file is proposed
21
+ for review.
22
+ """
23
+ ##
24
+ ## To execute doctests in these files, run
25
+ ## $ $SAGE_ROOT/sage -t <directory-of-these-files>
26
+ ## or
27
+ ## $ $SAGE_ROOT/sage -t <a-single-file>
28
+ ##
29
+ ## Replace -t by "-tp n" for parallel testing,
30
+ ## "-tp 0" will use a sensible number of threads
31
+ ##
32
+ ## See: http://www.sagemath.org/doc/developer/doctesting.html
33
+ ## or run $ $SAGE_ROOT/sage --advanced for brief help
34
+ ##
35
+ ## Generated at 2017-08-24T11:43:34-07:00
36
+ ## From "Abstract Algebra"
37
+ ## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
38
+ ##
39
+ ## Section 14.7 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: D = DihedralGroup(8)
45
+ sage: C = D.center(); C
46
+ Subgroup generated by [(1,5)(2,6)(3,7)(4,8)]
47
+ of (Dihedral group of order 16 as a permutation group)
48
+
49
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
50
+
51
+ sage: C.list()
52
+ [(), (1,5)(2,6)(3,7)(4,8)]
53
+
54
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
55
+
56
+ sage: a = D("(1,2)(3,8)(4,7)(5,6)")
57
+ sage: C1 = D.centralizer(a); C1.list()
58
+ [(), (1,2)(3,8)(4,7)(5,6), (1,5)(2,6)(3,7)(4,8), (1,6)(2,5)(3,4)(7,8)]
59
+
60
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
61
+
62
+ sage: b = D("(1,2,3,4,5,6,7,8)")
63
+ sage: C2 = D.centralizer(b); C2.order()
64
+ 8
65
+
66
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
67
+
68
+ sage: CCR = D.conjugacy_classes_representatives(); CCR
69
+ [(), (2,8)(3,7)(4,6), (1,2)(3,8)(4,7)(5,6), (1,2,3,4,5,6,7,8),
70
+ (1,3,5,7)(2,4,6,8), (1,4,7,2,5,8,3,6), (1,5)(2,6)(3,7)(4,8)]
71
+
72
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
73
+
74
+ sage: r = CCR[2]; r
75
+ (1,2)(3,8)(4,7)(5,6)
76
+
77
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
78
+
79
+ sage: conj = []
80
+ sage: x = [conj.append(g^-1*r*g) for g in D if not g^-1*r*g in conj]
81
+ sage: conj
82
+ [(1,2)(3,8)(4,7)(5,6),
83
+ (1,6)(2,5)(3,4)(7,8),
84
+ (1,8)(2,7)(3,6)(4,5),
85
+ (1,4)(2,3)(5,8)(6,7)]
86
+
87
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
88
+
89
+ sage: sizes = [D.order()/D.centralizer(g).order()
90
+ ....: for g in D.conjugacy_classes_representatives()]
91
+ sage: sizes
92
+ [1, 4, 4, 2, 2, 2, 1]
93
+
94
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
95
+
96
+ sage: D.order() == sum(sizes)
97
+ True
98
+
99
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
100
+
101
+ sage: Q = graphs.CubeGraph(3)
102
+ sage: Q.plot(layout='spring') # not tested
103
+
104
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
105
+
106
+ sage: A = Q.automorphism_group()
107
+ sage: A.order()
108
+ 48
109
+
110
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
111
+
112
+ sage: a = A("('000','001')('010','011')('110','111')('100','101')")
113
+ sage: a in A
114
+ True
115
+
116
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
117
+
118
+ sage: A.orbits() # random
119
+ [['000', '001', '010', '100', '011', '101', '110', '111']]
120
+
121
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
122
+
123
+ sage: A.is_transitive()
124
+ True
125
+
126
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
127
+
128
+ sage: S = A.stabilizer('000')
129
+ sage: S.list() # random
130
+ [(),
131
+ ('001','100','010')('011','101','110'),
132
+ ('010','100')('011','101'),
133
+ ('001','010','100')('011','110','101'),
134
+ ('001','100')('011','110'),
135
+ ('001','010')('101','110')]
136
+
137
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
138
+
139
+ sage: P = graphs.PathGraph(11)
140
+ sage: P.plot() # not tested
141
+
142
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
143
+
144
+ sage: A = P.automorphism_group()
145
+ sage: A.list()
146
+ [(), (0,10)(1,9)(2,8)(3,7)(4,6)]
147
+
148
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
149
+
150
+ sage: A.is_transitive()
151
+ False
152
+
153
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
154
+
155
+ sage: A.orbits()
156
+ ((0, 10), (1, 9), (2, 8), (3, 7), (4, 6), (5,))
157
+
158
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
159
+
160
+ sage: A.stabilizer(2).list()
161
+ [()]
162
+
163
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
164
+
165
+ sage: A.stabilizer(5).list()
166
+ [(), (0,10)(1,9)(2,8)(3,7)(4,6)]
167
+
168
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
169
+
170
+ sage: G = SymmetricGroup(4)
171
+ sage: S = G.stabilizer(4)
172
+ sage: S.orbits()
173
+ ((1, 2, 3), (4,))
174
+ """
@@ -0,0 +1,131 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.libs.pari sage.modules
3
+ ## Sage Doctest File ##
4
+ #**************************************#
5
+ #* Generated from PreTeXt source *#
6
+ #* on 2017-08-24T11:43:34-07:00 *#
7
+ #* *#
8
+ #* http://mathbook.pugetsound.edu *#
9
+ #* *#
10
+ #**************************************#
11
+ ##
12
+ """
13
+ Please contact Rob Beezer (beezer@ups.edu) with
14
+ any test failures here that need to be changed
15
+ as a result of changes accepted into Sage. You
16
+ may edit/change this file in any sensible way, so
17
+ that development work may procede. Your changes
18
+ may later be replaced by the authors of "Abstract
19
+ Algebra: Theory and Applications" when the text is
20
+ updated, and a replacement of this file is proposed
21
+ for review.
22
+ """
23
+ ##
24
+ ## To execute doctests in these files, run
25
+ ## $ $SAGE_ROOT/sage -t <directory-of-these-files>
26
+ ## or
27
+ ## $ $SAGE_ROOT/sage -t <a-single-file>
28
+ ##
29
+ ## Replace -t by "-tp n" for parallel testing,
30
+ ## "-tp 0" will use a sensible number of threads
31
+ ##
32
+ ## See: http://www.sagemath.org/doc/developer/doctesting.html
33
+ ## or run $ $SAGE_ROOT/sage --advanced for brief help
34
+ ##
35
+ ## Generated at 2017-08-24T11:43:34-07:00
36
+ ## From "Abstract Algebra"
37
+ ## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
38
+ ##
39
+ ## Section 8.8 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: codes. # not tested
45
+
46
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
47
+
48
+ sage: H = codes.HammingCode(GF(2), 3); H
49
+ [7, 4] Hamming Code over GF(2)
50
+
51
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
52
+
53
+ sage: H.dimension()
54
+ 4
55
+
56
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
57
+
58
+ sage: H.list()
59
+ [(0, 0, 0, 0, 0, 0, 0), (1, 0, 0, 0, 0, 1, 1), (0, 1, 0, 0, 1, 0, 1),
60
+ (1, 1, 0, 0, 1, 1, 0), (0, 0, 1, 0, 1, 1, 0), (1, 0, 1, 0, 1, 0, 1),
61
+ (0, 1, 1, 0, 0, 1, 1), (1, 1, 1, 0, 0, 0, 0), (0, 0, 0, 1, 1, 1, 1),
62
+ (1, 0, 0, 1, 1, 0, 0), (0, 1, 0, 1, 0, 1, 0), (1, 1, 0, 1, 0, 0, 1),
63
+ (0, 0, 1, 1, 0, 0, 1), (1, 0, 1, 1, 0, 1, 0), (0, 1, 1, 1, 1, 0, 0),
64
+ (1, 1, 1, 1, 1, 1, 1)]
65
+
66
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
67
+
68
+ sage: H.minimum_distance()
69
+ 3
70
+
71
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
72
+
73
+ sage: C = H.parity_check_matrix(); C
74
+ [1 0 1 0 1 0 1]
75
+ [0 1 1 0 0 1 1]
76
+ [0 0 0 1 1 1 1]
77
+
78
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
79
+
80
+ sage: G = H.generator_matrix(); G
81
+ [1 0 0 0 0 1 1]
82
+ [0 1 0 0 1 0 1]
83
+ [0 0 1 0 1 1 0]
84
+ [0 0 0 1 1 1 1]
85
+
86
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
87
+
88
+ sage: C*G.transpose() == zero_matrix(3, 4)
89
+ True
90
+
91
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
92
+
93
+ sage: H.systematic_generator_matrix()
94
+ [1 0 0 0 0 1 1]
95
+ [0 1 0 0 1 0 1]
96
+ [0 0 1 0 1 1 0]
97
+ [0 0 0 1 1 1 1]
98
+
99
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
100
+
101
+ sage: r = vector(GF(2), [1, 1, 1, 1, 0, 0, 1]); r
102
+ (1, 1, 1, 1, 0, 0, 1)
103
+
104
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
105
+
106
+ sage: C*r
107
+ (1, 1, 0)
108
+
109
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
110
+
111
+ sage: H.decode_to_code(r)
112
+ (1, 1, 0, 1, 0, 0, 1)
113
+
114
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
115
+
116
+ sage: message = vector(GF(2), [1, 1, 0, 1, 0, 0, 1])
117
+ sage: errors = vector(GF(2), [0, 0, 1, 0, 1, 1, 0])
118
+ sage: received = message + errors
119
+ sage: received
120
+ (1, 1, 1, 1, 1, 1, 1)
121
+
122
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
123
+
124
+ sage: H.decode_to_code(received) == message
125
+ False
126
+
127
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
128
+
129
+ sage: H.decode_to_code(received) == received
130
+ True
131
+ """
@@ -0,0 +1,270 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.graphs sage.modules
3
+ ## Sage Doctest File ##
4
+ #**************************************#
5
+ #* Generated from PreTeXt source *#
6
+ #* on 2017-08-24T11:43:34-07:00 *#
7
+ #* *#
8
+ #* http://mathbook.pugetsound.edu *#
9
+ #* *#
10
+ #**************************************#
11
+ ##
12
+ """
13
+ Please contact Rob Beezer (beezer@ups.edu) with
14
+ any test failures here that need to be changed
15
+ as a result of changes accepted into Sage. You
16
+ may edit/change this file in any sensible way, so
17
+ that development work may procede. Your changes
18
+ may later be replaced by the authors of "Abstract
19
+ Algebra: Theory and Applications" when the text is
20
+ updated, and a replacement of this file is proposed
21
+ for review.
22
+ """
23
+ ##
24
+ ## To execute doctests in these files, run
25
+ ## $ $SAGE_ROOT/sage -t <directory-of-these-files>
26
+ ## or
27
+ ## $ $SAGE_ROOT/sage -t <a-single-file>
28
+ ##
29
+ ## Replace -t by "-tp n" for parallel testing,
30
+ ## "-tp 0" will use a sensible number of threads
31
+ ##
32
+ ## See: http://www.sagemath.org/doc/developer/doctesting.html
33
+ ## or run $ $SAGE_ROOT/sage --advanced for brief help
34
+ ##
35
+ ## Generated at 2017-08-24T11:43:34-07:00
36
+ ## From "Abstract Algebra"
37
+ ## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
38
+ ##
39
+ ## Section 19.7 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: X = (24).divisors()
45
+ sage: X
46
+ [1, 2, 3, 4, 6, 8, 12, 24]
47
+
48
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
49
+
50
+ sage: R = [(a,b) for a in X for b in X if a.divides(b)]; R
51
+ [(1, 1), (1, 2), (1, 3), (1, 4), (1, 6), (1, 8), (1, 12), (1, 24),
52
+ (2, 2), (2, 4), (2, 6), (2, 8), (2, 12), (2, 24), (3, 3), (3, 6),
53
+ (3, 12), (3, 24), (4, 4), (4, 8), (4, 12), (4, 24), (6, 6),
54
+ (6, 12), (6, 24), (8, 8), (8, 24), (12, 12), (12, 24), (24, 24)]
55
+
56
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
57
+
58
+ sage: D = Poset([X, R])
59
+ sage: D.plot() # not tested
60
+
61
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
62
+
63
+ sage: divisible = lambda x, y: x.divides(y)
64
+ sage: L = Poset([X, divisible])
65
+ sage: L == D
66
+ True
67
+
68
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
69
+
70
+ sage: L.plot() # not tested
71
+
72
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
73
+
74
+ sage: Q = Posets.PentagonPoset()
75
+ sage: Q.plot() # not tested
76
+
77
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
78
+
79
+ sage: S = Posets.BooleanLattice(4)
80
+ sage: S.plot() # not tested
81
+
82
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
83
+
84
+ sage: T = Posets.RandomPoset(20,0.05)
85
+ sage: T.plot() # not tested
86
+
87
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
88
+
89
+ sage: D.is_lequal(4, 8)
90
+ True
91
+
92
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
93
+
94
+ sage: D.is_lequal(4, 4)
95
+ True
96
+
97
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
98
+
99
+ sage: D.is_less_than(4, 8)
100
+ True
101
+
102
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
103
+
104
+ sage: D.is_less_than(4, 4)
105
+ False
106
+
107
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
108
+
109
+ sage: D.is_lequal(6, 8)
110
+ False
111
+
112
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
113
+
114
+ sage: D.is_lequal(8, 6)
115
+ False
116
+
117
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
118
+
119
+ sage: D.is_gequal(8, 4)
120
+ True
121
+
122
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
123
+
124
+ sage: D.is_greater_than(4, 8)
125
+ False
126
+
127
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
128
+
129
+ sage: X = range(20)
130
+ sage: C = [[18, 7], [9, 11], [9, 10], [11, 8], [6, 10],
131
+ ....: [10, 2], [0, 2], [2, 1], [1, 8], [8, 12],
132
+ ....: [8, 3], [3, 15], [15, 7], [7, 16], [7, 4],
133
+ ....: [16, 17], [16, 13], [4, 19], [4, 14], [14, 5]]
134
+ sage: P = Poset([X, C])
135
+ sage: P.plot() # not tested
136
+
137
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
138
+
139
+ sage: P.minimal_elements()
140
+ [18, 9, 6, 0]
141
+
142
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
143
+
144
+ sage: P.maximal_elements()
145
+ [5, 19, 13, 17, 12]
146
+
147
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
148
+
149
+ sage: P.level_sets()
150
+ [[18, 9, 6, 0], [11, 10], [2], [1], [8], [3, 12],
151
+ [15], [7], [4, 16], [14, 19, 13, 17], [5]]
152
+
153
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
154
+
155
+ sage: linear = P.linear_extension(); linear
156
+ [18, 9, 11, 6, 10, 0, 2, 1, 8, 3, 15,
157
+ 7, 4, 14, 5, 19, 16, 13, 17, 12]
158
+
159
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
160
+
161
+ sage: level = P.level_sets()
162
+ sage: bottomhalf = sum([level[i] for i in range(5)], [])
163
+ sage: B = P.subposet(bottomhalf)
164
+ sage: B.plot() # not tested
165
+
166
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
167
+
168
+ sage: Pdual = P.dual()
169
+ sage: Pdual.plot() # not tested
170
+
171
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
172
+
173
+ sage: Ddual = D.dual()
174
+ sage: Ddual.plot() # not tested
175
+
176
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
177
+
178
+ sage: P = Posets.AntichainPoset(8)
179
+ sage: P.is_lattice()
180
+ False
181
+
182
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
183
+
184
+ sage: LatticePoset(P)
185
+ Traceback (most recent call last):
186
+ ...
187
+ ValueError: not a meet-semilattice: no bottom element
188
+
189
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
190
+
191
+ sage: CP = Posets.IntegerCompositions(5)
192
+ sage: C = LatticePoset(CP)
193
+ sage: C.plot() # not tested
194
+
195
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
196
+
197
+ sage: par = C.an_element().parent()
198
+ sage: a = par([1, 1, 1, 2])
199
+ sage: b = par([2, 1, 1, 1])
200
+ sage: a, b
201
+ ([1, 1, 1, 2], [2, 1, 1, 1])
202
+
203
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
204
+
205
+ sage: C.meet(a, b)
206
+ [2, 1, 2]
207
+
208
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
209
+
210
+ sage: c = par([1, 4])
211
+ sage: d = par([2, 3])
212
+ sage: c, d
213
+ ([1, 4], [2, 3])
214
+
215
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
216
+
217
+ sage: C.join(c, d)
218
+ [1, 1, 3]
219
+
220
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
221
+
222
+ sage: C.is_distributive()
223
+ True
224
+
225
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
226
+
227
+ sage: C.top()
228
+ [1, 1, 1, 1, 1]
229
+
230
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
231
+
232
+ sage: C.bottom()
233
+ [5]
234
+
235
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
236
+
237
+ sage: comp = C.complements()
238
+ sage: comp[par([1, 1, 1, 2])]
239
+ [[4, 1]]
240
+
241
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
242
+
243
+ sage: comp # not tested
244
+ {[1, 1, 1, 1, 1]: [[5]],
245
+ [1, 1, 1, 2]: [[4, 1]],
246
+ [1, 1, 2, 1]: [[3, 2]],
247
+ [1, 1, 3]: [[3, 1, 1]],
248
+ [1, 2, 1, 1]: [[2, 3]],
249
+ [1, 2, 2]: [[2, 2, 1]],
250
+ [1, 3, 1]: [[2, 1, 2]],
251
+ [1, 4]: [[2, 1, 1, 1]],
252
+ [2, 1, 1, 1]: [[1, 4]],
253
+ [2, 1, 2]: [[1, 3, 1]],
254
+ [2, 2, 1]: [[1, 2, 2]],
255
+ [2, 3]: [[1, 2, 1, 1]],
256
+ [3, 1, 1]: [[1, 1, 3]],
257
+ [3, 2]: [[1, 1, 2, 1]],
258
+ [4, 1]: [[1, 1, 1, 2]],
259
+ [5]: [[1, 1, 1, 1, 1]]}
260
+
261
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
262
+
263
+ sage: [len(e[1]) for e in comp.items()]
264
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
265
+
266
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
267
+
268
+ sage: C.is_complemented()
269
+ True
270
+ """
@@ -0,0 +1,88 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.libs.pari
3
+ ## Sage Doctest File ##
4
+ #**************************************#
5
+ #* Generated from PreTeXt source *#
6
+ #* on 2017-08-24T11:43:34-07:00 *#
7
+ #* *#
8
+ #* http://mathbook.pugetsound.edu *#
9
+ #* *#
10
+ #**************************************#
11
+ ##
12
+ """
13
+ Please contact Rob Beezer (beezer@ups.edu) with
14
+ any test failures here that need to be changed
15
+ as a result of changes accepted into Sage. You
16
+ may edit/change this file in any sensible way, so
17
+ that development work may procede. Your changes
18
+ may later be replaced by the authors of "Abstract
19
+ Algebra: Theory and Applications" when the text is
20
+ updated, and a replacement of this file is proposed
21
+ for review.
22
+ """
23
+ ##
24
+ ## To execute doctests in these files, run
25
+ ## $ $SAGE_ROOT/sage -t <directory-of-these-files>
26
+ ## or
27
+ ## $ $SAGE_ROOT/sage -t <a-single-file>
28
+ ##
29
+ ## Replace -t by "-tp n" for parallel testing,
30
+ ## "-tp 0" will use a sensible number of threads
31
+ ##
32
+ ## See: http://www.sagemath.org/doc/developer/doctesting.html
33
+ ## or run $ $SAGE_ROOT/sage --advanced for brief help
34
+ ##
35
+ ## Generated at 2017-08-24T11:43:34-07:00
36
+ ## From "Abstract Algebra"
37
+ ## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
38
+ ##
39
+ ## Exercises 6.6 Sage Exercises
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: a = 5
45
+ sage: b = 10
46
+ sage: c = 6
47
+ sage: d = 13
48
+ sage: a.divides(b)
49
+ True
50
+
51
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
52
+
53
+ sage: not (b in [c,d])
54
+ True
55
+
56
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
57
+
58
+ sage: a.divides(b) and not (b in [c,d])
59
+ True
60
+
61
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
62
+
63
+ sage: a = 20
64
+ sage: b = 6
65
+ sage: a.mod(b)
66
+ 2
67
+
68
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
69
+
70
+ sage: prime_range(50, 100)
71
+ [53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
72
+
73
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
74
+
75
+ sage: all([True, True, True, True])
76
+ True
77
+
78
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
79
+
80
+ sage: all([True, True, False, True])
81
+ False
82
+
83
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
84
+
85
+ sage: [a/b for a in srange(9) for b in srange(1,a) if gcd(a,b)==1]
86
+ [2, 3, 3/2, 4, 4/3, 5, 5/2, 5/3, 5/4, 6, 6/5,
87
+ 7, 7/2, 7/3, 7/4, 7/5, 7/6, 8, 8/3, 8/5, 8/7]
88
+ """