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,300 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.symbolic
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 21.6 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: M.<a> = QQ[sqrt(2)+sqrt(3)]; M
45
+ Number Field in a with defining polynomial x^4 - 10*x^2 + 1 with a = 3.146264369941973?
46
+
47
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
48
+
49
+ sage: F.<y> = QQ[]
50
+ sage: p = y^3 - 1/4*y^2 - 1/16*y + 1/4
51
+ sage: p.is_irreducible()
52
+ True
53
+
54
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
55
+
56
+ sage: N.<b> = NumberField(p, 'b'); N
57
+ Number Field in b with
58
+ defining polynomial y^3 - 1/4*y^2 - 1/16*y + 1/4
59
+
60
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
61
+
62
+ sage: z = polygen(QQ, 'z')
63
+ sage: q = z^3 - 1/4*z^2 - 1/16*z + 1/4
64
+ sage: q.parent()
65
+ Univariate Polynomial Ring in z over Rational Field
66
+
67
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
68
+
69
+ sage: P.<c> = NumberField(q, 'c'); P
70
+ Number Field in c with
71
+ defining polynomial z^3 - 1/4*z^2 - 1/16*z + 1/4
72
+
73
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
74
+
75
+ sage: M.polynomial()
76
+ x^4 - 10*x^2 + 1
77
+
78
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
79
+
80
+ sage: N.polynomial()
81
+ y^3 - 1/4*y^2 - 1/16*y + 1/4
82
+
83
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
84
+
85
+ sage: element = -b^2 + 1/3*b + 4
86
+ sage: element.parent()
87
+ Number Field in b with
88
+ defining polynomial y^3 - 1/4*y^2 - 1/16*y + 1/4
89
+
90
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
91
+
92
+ sage: r = element.minpoly('t'); r
93
+ t^3 - 571/48*t^2 + 108389/2304*t - 13345/216
94
+
95
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
96
+
97
+ sage: r.parent()
98
+ Univariate Polynomial Ring in t over Rational Field
99
+
100
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
101
+
102
+ sage: r.subs(t=element)
103
+ 0
104
+
105
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
106
+
107
+ sage: A.<a,b> = QQ[sqrt(2), sqrt(3)]
108
+ sage: A
109
+ Number Field in sqrt2 with defining polynomial x^2 - 2 over
110
+ its base field
111
+
112
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
113
+
114
+ sage: B = A.base_field(); B
115
+ Number Field in sqrt3 with defining polynomial x^2 - 3
116
+
117
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
118
+
119
+ sage: A.is_relative()
120
+ True
121
+
122
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
123
+
124
+ sage: B.is_relative()
125
+ False
126
+
127
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
128
+
129
+ sage: C.<c> = A.absolute_field()
130
+ sage: C
131
+ Number Field in c with defining polynomial x^4 - 10*x^2 + 1
132
+
133
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
134
+
135
+ sage: fromC, toC = C.structure()
136
+ sage: fromC(c)
137
+ sqrt2 - sqrt3
138
+
139
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
140
+
141
+ sage: toC(a)
142
+ 1/2*c^3 - 9/2*c
143
+
144
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
145
+
146
+ sage: toC(b)
147
+ 1/2*c^3 - 11/2*c
148
+
149
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
150
+
151
+ sage: B.degree()
152
+ 2
153
+
154
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
155
+
156
+ sage: A.absolute_degree()
157
+ 4
158
+
159
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
160
+
161
+ sage: A.relative_degree()
162
+ 2
163
+
164
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
165
+
166
+ sage: x = polygen(QQ, 'x')
167
+ sage: p = x^4 + x^2 - 1
168
+ sage: p.parent()
169
+ Univariate Polynomial Ring in x over Rational Field
170
+
171
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
172
+
173
+ sage: p.is_irreducible()
174
+ True
175
+
176
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
177
+
178
+ sage: M.<a> = NumberField(p, 'a')
179
+ sage: y = polygen(M, 'y')
180
+ sage: p = p.subs(x = y)
181
+ sage: p
182
+ y^4 + y^2 - 1
183
+
184
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
185
+
186
+ sage: p.parent()
187
+ Univariate Polynomial Ring in y over Number Field in a with
188
+ defining polynomial x^4 + x^2 - 1
189
+
190
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
191
+
192
+ sage: p.factor()
193
+ (y - a) * (y + a) * (y^2 + a^2 + 1)
194
+
195
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
196
+
197
+ sage: a^2 + 1 in QQ
198
+ False
199
+
200
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
201
+
202
+ sage: q = y^2 + a^2 + 1
203
+ sage: N.<b> = NumberField(q, 'b')
204
+ sage: R.<z> = N[]
205
+ sage: s = R(p)
206
+ sage: s
207
+ z^4 + z^2 - 1
208
+
209
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
210
+
211
+ sage: s.parent()
212
+ Univariate Polynomial Ring in z over Number Field in b with
213
+ defining polynomial y^2 + a^2 + 1 over its base field
214
+
215
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
216
+
217
+ sage: s.factor()
218
+ (z + b) * (z + a) * (z - a) * (z - b)
219
+
220
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
221
+
222
+ sage: a in N, b in N
223
+ (True, True)
224
+
225
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
226
+
227
+ sage: P.<c> = N.absolute_field()
228
+ sage: w = polygen(P, 'w')
229
+ sage: p = w^4 + w^2- 1
230
+ sage: p.factor()
231
+ (w - 7/18966*c^7 + 110/9483*c^5 + 923/9483*c^3 + 3001/6322*c) *
232
+ (w - 7/37932*c^7 + 55/9483*c^5 + 923/18966*c^3 - 3321/12644*c) *
233
+ (w + 7/37932*c^7 - 55/9483*c^5 - 923/18966*c^3 + 3321/12644*c) *
234
+ (w + 7/18966*c^7 - 110/9483*c^5 - 923/9483*c^3 - 3001/6322*c)
235
+
236
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
237
+
238
+ sage: fromP, toP = P.structure()
239
+ sage: fromP(7/18966*c^7 - 110/9483*c^5 - 923/9483*c^3 - 3001/6322*c)
240
+ -b
241
+
242
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
243
+
244
+ sage: M.degree()
245
+ 4
246
+
247
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
248
+
249
+ sage: N.relative_degree()
250
+ 2
251
+
252
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
253
+
254
+ sage: P.degree()
255
+ 8
256
+
257
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
258
+
259
+ sage: M.degree()*N.relative_degree() == P.degree()
260
+ True
261
+
262
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
263
+
264
+ sage: x = polygen(QQ, 'x')
265
+ sage: p = x^4 + x^2 - 1
266
+ sage: r = p.roots(ring=QQbar); r
267
+ [(-0.7861513777574233?, 1), (0.7861513777574233?, 1),
268
+ (-1.272019649514069?*I, 1), (1.272019649514069?*I, 1)]
269
+
270
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
271
+
272
+ sage: r1 = r[0][0]; r1
273
+ -0.7861513777574233?
274
+
275
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
276
+
277
+ sage: r1.as_number_field_element()
278
+ (Number Field in a with defining polynomial y^4 - y^2 - 1,
279
+ a^3 - a,
280
+ Ring morphism:
281
+ From: Number Field in a with defining polynomial y^4 - y^2 - 1
282
+ To: Algebraic Real Field
283
+ Defn: a |--> -1.272019649514069?)
284
+
285
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
286
+
287
+ sage: r1^4 + r1^2 - 1
288
+ 0
289
+
290
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
291
+
292
+ sage: N, rexact, homomorphism = r1.as_number_field_element()
293
+ sage: (rexact)^4 + rexact^2 - 1
294
+ 0
295
+
296
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
297
+
298
+ sage: log(QQ[cos(pi/9)].degree(), 2) in ZZ
299
+ False
300
+ """
@@ -0,0 +1,109 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.rings.finite_rings
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 22.6 Sage
40
+ ##
41
+ r"""
42
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
43
+
44
+ sage: F.<a> = GF(7^15); F
45
+ Finite Field in a of size 7^15
46
+
47
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
48
+
49
+ sage: F.polynomial()
50
+ a^15 + 5*a^6 + 6*a^5 + 6*a^4 + 4*a^3 + a^2 + 2*a + 4
51
+
52
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
53
+
54
+ sage: a^15 + 5*a^6 + 6*a^5 + 6*a^4 + 4*a^3 + a^2 + 2*a + 4
55
+ 0
56
+
57
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
58
+
59
+ sage: conway_polynomial(7, 15)
60
+ x^15 + 5*x^6 + 6*x^5 + 6*x^4 + 4*x^3 + x^2 + 2*x + 4
61
+
62
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
63
+
64
+ sage: y = polygen(Integers(7), 'y')
65
+ sage: P = y.parent()
66
+ sage: p = P([4, 5, 2, 6, 3, 3, 6, 2, 1, 1, 2, 5, 6, 3, 5, 1]); p
67
+ y^15 + 5*y^14 + 3*y^13 + 6*y^12 + 5*y^11 + 2*y^10 + y^9 +
68
+ y^8 + 2*y^7 + 6*y^6 + 3*y^5 + 3*y^4 + 6*y^3 + 2*y^2 + 5*y + 4
69
+
70
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
71
+
72
+ sage: p.is_irreducible()
73
+ True
74
+
75
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
76
+
77
+ sage: T.<b> = GF(7^15, modulus=p); T
78
+ Finite Field in b of size 7^15
79
+
80
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
81
+
82
+ sage: F.<a> = GF(5^4)
83
+ sage: a^458
84
+ 3*a^3 + 2*a^2 + a + 3
85
+
86
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
87
+
88
+ sage: (3*a^3 + 2*a^2 + a + 3).log(a)
89
+ 458
90
+
91
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
92
+
93
+ sage: exponent = (3*a^3 + 2*a^2 + a + 3).log(2*a^3 + 4*a^2 + 4*a)
94
+ sage: exponent
95
+ 211
96
+
97
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
98
+
99
+ sage: (2*a^3 + 4*a^2 + 4*a)^exponent == 3*a^3 + 2*a^2 + a + 3
100
+ True
101
+
102
+ ~~~~~~~~~~~~~~~~~~~~~~ ::
103
+
104
+ sage: (3*a^3 + 2*a^2 + a + 3).log(a^2 + 4*a + 4)
105
+ Traceback (most recent call last):
106
+ ...
107
+ ValueError: no discrete log of 3*a^3 + 2*a^2 + a + 3 found
108
+ to base a^2 + 4*a + 4
109
+ """