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,320 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.groups 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 5.4 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: G = SymmetricGroup(5)
45
+ sage: sigma = G("(1,3)(2,5,4)")
46
+ sage: sigma*sigma
47
+ (2,4,5)
48
+
49
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
50
+
51
+ sage: rho = G("(2,4)(1,5)")
52
+ sage: rho^3
53
+ (1,5)(2,4)
54
+
55
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
56
+
57
+ sage: sigma*rho
58
+ (1,3,5,2)
59
+
60
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
61
+
62
+ sage: rho*sigma
63
+ (1,4,5,3)
64
+
65
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
66
+
67
+ sage: rho^-1*sigma*rho
68
+ (1,2,4)(3,5)
69
+
70
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
71
+
72
+ sage: sigma1 = G("(1,3)(2,5,4)")
73
+ sage: sigma1
74
+ (1,3)(2,5,4)
75
+
76
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
77
+
78
+ sage: sigma2 = G([(1,3),(2,5,4)])
79
+ sage: sigma2
80
+ (1,3)(2,5,4)
81
+
82
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
83
+
84
+ sage: sigma3 = G([3,5,1,2,4])
85
+ sage: sigma3
86
+ (1,3)(2,5,4)
87
+
88
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
89
+
90
+ sage: sigma1 == sigma2
91
+ True
92
+
93
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
94
+
95
+ sage: sigma2 == sigma3
96
+ True
97
+
98
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
99
+
100
+ sage: sigma2.cycle_tuples()
101
+ [(1, 3), (2, 5, 4)]
102
+
103
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
104
+
105
+ sage: [sigma3(x) for x in G.domain()]
106
+ [3, 5, 1, 2, 4]
107
+
108
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
109
+
110
+ sage: H = SymmetricGroup(4)
111
+ sage: sigma = H("(1,2,3,4)")
112
+ sage: G = SymmetricGroup(6)
113
+ sage: tau = G("(1,2,3,4,5,6)")
114
+ sage: rho = tau * sigma
115
+ sage: rho
116
+ (1,3)(2,4,5,6)
117
+
118
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
119
+
120
+ sage: sigma.parent()
121
+ Symmetric group of order 4! as a permutation group
122
+
123
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
124
+
125
+ sage: tau.parent()
126
+ Symmetric group of order 6! as a permutation group
127
+
128
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
129
+
130
+ sage: rho.parent()
131
+ Symmetric group of order 6! as a permutation group
132
+
133
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
134
+
135
+ sage: tau.parent() == rho.parent()
136
+ True
137
+
138
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
139
+
140
+ sage: sigmaG = G(sigma)
141
+ sage: sigmaG.parent()
142
+ Symmetric group of order 6! as a permutation group
143
+
144
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
145
+
146
+ sage: tauH = H(tau)
147
+ Traceback (most recent call last):
148
+ ...
149
+ ValueError: invalid data to initialize a permutation
150
+
151
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
152
+
153
+ sage: groups.permutation. # not tested
154
+
155
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
156
+
157
+ sage: D = DihedralGroup(5)
158
+ sage: elements = D.list(); elements
159
+ [(),
160
+ (1,5,4,3,2),
161
+ (1,4,2,5,3),
162
+ (1,3,5,2,4),
163
+ (1,2,3,4,5),
164
+ (2,5)(3,4),
165
+ (1,5)(2,4),
166
+ (1,4)(2,3),
167
+ (1,3)(4,5),
168
+ (1,2)(3,5)]
169
+
170
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
171
+
172
+ sage: rotate = elements[4]
173
+ sage: flip = elements[5]
174
+ sage: flip*rotate == rotate* flip
175
+ False
176
+
177
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
178
+
179
+ sage: D = DihedralGroup(5)
180
+ sage: D.is_abelian()
181
+ False
182
+
183
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
184
+
185
+ sage: A4 = AlternatingGroup(4)
186
+ sage: A4.order()
187
+ 12
188
+
189
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
190
+
191
+ sage: A4.is_finite()
192
+ True
193
+
194
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
195
+
196
+ sage: A4.is_abelian()
197
+ False
198
+
199
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
200
+
201
+ sage: A4.is_cyclic()
202
+ False
203
+
204
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
205
+
206
+ sage: sigma = A4("(1,2,4)")
207
+ sage: sigma^-1
208
+ (1,4,2)
209
+
210
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
211
+
212
+ sage: sigma.order()
213
+ 3
214
+
215
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
216
+
217
+ sage: G = SymmetricGroup(3)
218
+ sage: sigma = G("(1,2)")
219
+ sage: tau = G("(1,3)")
220
+ sage: rho = sigma*tau
221
+ sage: sigma.sign()
222
+ -1
223
+
224
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
225
+
226
+ sage: rho.sign()
227
+ 1
228
+
229
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
230
+
231
+ sage: A4 = AlternatingGroup(4)
232
+ sage: sigma = A4("(1,2,4)")
233
+ sage: sg = A4.subgroup([sigma])
234
+ sage: sg
235
+ Subgroup generated by
236
+ [(1,2,4)] of (Alternating group of order 4!/2 as a permutation group)
237
+
238
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
239
+
240
+ sage: sg.order()
241
+ 3
242
+
243
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
244
+
245
+ sage: sg.list()
246
+ [(), (1,2,4), (1,4,2)]
247
+
248
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
249
+
250
+ sage: sg.is_abelian()
251
+ True
252
+
253
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
254
+
255
+ sage: sg.is_cyclic()
256
+ True
257
+
258
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
259
+
260
+ sage: sg.is_subgroup(A4)
261
+ True
262
+
263
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
264
+
265
+ sage: G = SymmetricGroup(5)
266
+ sage: sigma = G("(4,5)")
267
+ sage: tau = G("(1,3)")
268
+ sage: H = G.subgroup([sigma, tau])
269
+ sage: H.list()
270
+ [(), (4,5), (1,3), (1,3)(4,5)]
271
+
272
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
273
+
274
+ sage: text_names = ['id', 'sigma', 'tau', 'mu']
275
+ sage: H.cayley_table(names=text_names)
276
+ * id sigma tau mu
277
+ +------------------------
278
+ id| id sigma tau mu
279
+ sigma| sigma id mu tau
280
+ tau| tau mu id sigma
281
+ mu| mu tau sigma id
282
+
283
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
284
+
285
+ sage: G = SymmetricGroup(8)
286
+ sage: above = G("(1,2,3,4)(5,6,7,8)")
287
+ sage: front = G("(1,4,8,5)(2,3,7,6)")
288
+ sage: right = G("(1,2,6,5)(3,7,8,4)")
289
+ sage: cube = G.subgroup([above, front, right])
290
+ sage: cube.order()
291
+ 24
292
+
293
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
294
+
295
+ sage: cube.list()
296
+ [(),
297
+ (1,3)(2,4)(5,7)(6,8),
298
+ (1,6)(2,5)(3,8)(4,7),
299
+ (1,8)(2,7)(3,6)(4,5),
300
+ (1,4,3,2)(5,8,7,6),
301
+ (1,2,3,4)(5,6,7,8),
302
+ (1,5)(2,8)(3,7)(4,6),
303
+ (1,7)(2,6)(3,5)(4,8),
304
+ (2,5,4)(3,6,8),
305
+ (1,3,8)(2,7,5),
306
+ (1,6,3)(4,5,7),
307
+ (1,8,6)(2,4,7),
308
+ (1,4)(2,8)(3,5)(6,7),
309
+ (1,2,6,5)(3,7,8,4),
310
+ (1,5,6,2)(3,4,8,7),
311
+ (1,7)(2,3)(4,6)(5,8),
312
+ (2,4,5)(3,8,6),
313
+ (1,3,6)(4,7,5),
314
+ (1,6,8)(2,7,4),
315
+ (1,8,3)(2,5,7),
316
+ (1,4,8,5)(2,3,7,6),
317
+ (1,2)(3,5)(4,6)(7,8),
318
+ (1,5,8,4)(2,6,7,3),
319
+ (1,7)(2,8)(3,4)(5,6)]
320
+ """
@@ -0,0 +1,301 @@
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
+ ## Section 17.6 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: R.<x> = Integers(8)[]; R
45
+ Univariate Polynomial Ring in x over Ring of integers modulo 8
46
+
47
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
48
+
49
+ sage: S.<y> = ZZ[]; S
50
+ Univariate Polynomial Ring in y over Integer Ring
51
+
52
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
53
+
54
+ sage: T.<z> = QQ[]; T
55
+ Univariate Polynomial Ring in z over Rational Field
56
+
57
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
58
+
59
+ sage: R.is_finite()
60
+ False
61
+
62
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
63
+
64
+ sage: R.is_integral_domain()
65
+ False
66
+
67
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
68
+
69
+ sage: S.is_integral_domain()
70
+ True
71
+
72
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
73
+
74
+ sage: T.is_field()
75
+ False
76
+
77
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
78
+
79
+ sage: R.characteristic()
80
+ 8
81
+
82
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
83
+
84
+ sage: T.characteristic()
85
+ 0
86
+
87
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
88
+
89
+ sage: y in S
90
+ True
91
+
92
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
93
+
94
+ sage: x in S
95
+ False
96
+
97
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
98
+
99
+ sage: q = (3/2) + (5/4)*z^2
100
+ sage: q in T
101
+ True
102
+
103
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
104
+
105
+ sage: 3 in S
106
+ True
107
+
108
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
109
+
110
+ sage: r = 3
111
+ sage: r.parent()
112
+ Integer Ring
113
+
114
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
115
+
116
+ sage: s = 3*y^0
117
+ sage: s.parent()
118
+ Univariate Polynomial Ring in y over Integer Ring
119
+
120
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
121
+
122
+ sage: p = 3 + 5*x + 2*x^2
123
+ sage: p.parent()
124
+ Univariate Polynomial Ring in x over Ring of integers modulo 8
125
+
126
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
127
+
128
+ sage: p(1)
129
+ 2
130
+
131
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
132
+
133
+ sage: [p(t) for t in Integers(8)]
134
+ [3, 2, 5, 4, 7, 6, 1, 0]
135
+
136
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
137
+
138
+ sage: q = 4*x^2+4*x
139
+ sage: [q(t) for t in Integers(8)]
140
+ [0, 0, 0, 0, 0, 0, 0, 0]
141
+
142
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
143
+
144
+ sage: M.<s, t> = QQ[]; M
145
+ Multivariate Polynomial Ring in s, t over Rational Field
146
+
147
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
148
+
149
+ sage: R.<x> = QQ[]
150
+ sage: p = 1/4*x^4 - x^3 + x^2 - x - 1/2
151
+ sage: p.is_irreducible()
152
+ True
153
+
154
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
155
+
156
+ sage: p.factor()
157
+ (1/4) * (x^4 - 4*x^3 + 4*x^2 - 4*x - 2)
158
+
159
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
160
+
161
+ sage: q = 2*x^5 + 5/2*x^4 + 3/4*x^3 - 25/24*x^2 - x - 1/2
162
+ sage: q.is_irreducible()
163
+ False
164
+
165
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
166
+
167
+ sage: q.factor()
168
+ (2) * (x^2 + 3/2*x + 3/4) * (x^3 - 1/4*x^2 - 1/3)
169
+
170
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
171
+
172
+ sage: F.<a> = FiniteField(5^2)
173
+ sage: S.<y> = F[]
174
+ sage: p = 2*y^5 + 2*y^4 + 4*y^3 + 2*y^2 + 3*y + 1
175
+ sage: p.is_irreducible()
176
+ True
177
+
178
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
179
+
180
+ sage: p.factor()
181
+ (2) * (y^5 + y^4 + 2*y^3 + y^2 + 4*y + 3)
182
+
183
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
184
+
185
+ sage: q = 3*y^4+2*y^3-y+4; q.factor()
186
+ (3) * (y^2 + (a + 4)*y + 2*a + 3) * (y^2 + 4*a*y + 3*a)
187
+
188
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
189
+
190
+ sage: r = y^4+2*y^3+3*y^2+4; r.factor()
191
+ (y + 4) * (y^3 + 3*y^2 + y + 1)
192
+
193
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
194
+
195
+ sage: s = 3*y^4+2*y^3-y+3; s.factor()
196
+ (3) * (y + 1) * (y + 3) * (y + 2*a + 4) * (y + 3*a + 1)
197
+
198
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
199
+
200
+ sage: F.modulus()
201
+ x^2 + 4*x + 2
202
+
203
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
204
+
205
+ sage: [t for t in F if r(t)==0]
206
+ [1]
207
+
208
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
209
+
210
+ sage: [t for t in F if s(t)==0]
211
+ [2, 3*a + 1, 4, 2*a + 4]
212
+
213
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
214
+
215
+ sage: W.<w> = QQ[]
216
+ sage: p = 16*w^5 - 9*w^4 +3*w^2 + 6*w -21
217
+ sage: p.is_irreducible()
218
+ True
219
+
220
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
221
+
222
+ sage: W.<w> = QQ[]
223
+ sage: r = -w^5 + 5*w^4 - 4*w^3 + 14*w^2 - 67*w + 17
224
+ sage: s = 3*w^5 - 14*w^4 + 12*w^3 - 6*w^2 + w
225
+ sage: S = W.ideal(r, s)
226
+ sage: S
227
+ Principal ideal (w^2 - 4*w + 1) of
228
+ Univariate Polynomial Ring in w over Rational Field
229
+
230
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
231
+
232
+ sage: (w^2)*r + (3*w-6)*s in S
233
+ True
234
+
235
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
236
+
237
+ sage: F = Integers(7)
238
+ sage: R.<x> = F[]
239
+ sage: p = x^5+ x + 4
240
+ sage: p.is_irreducible()
241
+ True
242
+
243
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
244
+
245
+ sage: id = R.ideal(p)
246
+ sage: Q = R.quotient(id); Q
247
+ Univariate Quotient Polynomial Ring in xbar over
248
+ Ring of integers modulo 7 with modulus x^5 + x + 4
249
+
250
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
251
+
252
+ sage: Q.is_field()
253
+ True
254
+
255
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
256
+
257
+ sage: Q.order() == 7^5
258
+ True
259
+
260
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
261
+
262
+ sage: Q.gen(0)
263
+ xbar
264
+
265
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
266
+
267
+ sage: Q.<t> = R.quotient(id); Q
268
+ Univariate Quotient Polynomial Ring in t over
269
+ Ring of integers modulo 7 with modulus x^5 + x + 4
270
+
271
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
272
+
273
+ sage: t^5 + t + 4
274
+ 0
275
+
276
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
277
+
278
+ sage: t^5 == -(t+4)
279
+ True
280
+
281
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
282
+
283
+ sage: t^5
284
+ 6*t + 3
285
+
286
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
287
+
288
+ sage: (3*t^3 + t + 5)*(t^2 + 4*t + 2)
289
+ 5*t^4 + 2*t^2 + 5*t + 5
290
+
291
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
292
+
293
+ sage: a = 3*t^4 - 6*t^3 + 3*t^2 + 5*t + 2
294
+ sage: ainv = a^-1; ainv
295
+ 6*t^4 + 5*t^2 + 4
296
+
297
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
298
+
299
+ sage: a*ainv
300
+ 1
301
+ """