passagemath-repl 10.5.28__py3-none-any.whl → 10.5.29__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.
- passagemath_repl-10.5.29.data/data/share/jupyter/kernels/sagemath/kernel.json +1 -0
- passagemath_repl-10.5.29.data/data/share/jupyter/kernels/sagemath/logo-64x64.png +0 -0
- passagemath_repl-10.5.29.data/data/share/jupyter/kernels/sagemath/logo.svg +352 -0
- {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/METADATA +3 -3
- {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/RECORD +95 -24
- {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/top_level.txt +1 -0
- sage/ext_data/all__sagemath_repl.py +1 -0
- sage/interfaces/all__sagemath_repl.py +1 -0
- sage/repl/ipython_kernel/install.py +6 -8
- sage/tests/books/__init__.py +2 -0
- sage/tests/books/computational-mathematics-with-sagemath/__init__.py +1 -0
- sage/tests/books/computational-mathematics-with-sagemath/calculus_doctest.py +549 -0
- sage/tests/books/computational-mathematics-with-sagemath/combinat_doctest.py +1053 -0
- sage/tests/books/computational-mathematics-with-sagemath/domaines_doctest.py +443 -0
- sage/tests/books/computational-mathematics-with-sagemath/float_doctest.py +477 -0
- sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +254 -0
- sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py +418 -0
- sage/tests/books/computational-mathematics-with-sagemath/integration_doctest.py +290 -0
- sage/tests/books/computational-mathematics-with-sagemath/linalg_doctest.py +454 -0
- sage/tests/books/computational-mathematics-with-sagemath/linsolve_doctest.py +421 -0
- sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +234 -0
- sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py +560 -0
- sage/tests/books/computational-mathematics-with-sagemath/nonlinear_doctest.py +490 -0
- sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py +155 -0
- sage/tests/books/computational-mathematics-with-sagemath/polynomes_doctest.py +405 -0
- sage/tests/books/computational-mathematics-with-sagemath/premierspas_doctest.py +180 -0
- sage/tests/books/computational-mathematics-with-sagemath/programmation_doctest.py +662 -0
- sage/tests/books/computational-mathematics-with-sagemath/recequadiff_doctest.py +392 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/__init__.py +1 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/calculus_doctest.py +264 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/combinat_doctest.py +217 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/domaines_doctest.py +59 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/float_doctest.py +141 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py +105 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/graphtheory_doctest.py +53 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/integration_doctest.py +56 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/linalg_doctest.py +56 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/linsolve_doctest.py +25 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/lp_doctest.py +47 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/mpoly_doctest.py +115 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/nonlinear_doctest.py +111 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/numbertheory_doctest.py +167 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/polynomes_doctest.py +107 -0
- sage/tests/books/computational-mathematics-with-sagemath/sol/recequadiff_doctest.py +58 -0
- sage/tests/books/judson-abstract-algebra/__init__.py +1 -0
- sage/tests/books/judson-abstract-algebra/actions-sage-exercises.py +51 -0
- sage/tests/books/judson-abstract-algebra/actions-sage.py +173 -0
- sage/tests/books/judson-abstract-algebra/algcodes-sage.py +130 -0
- sage/tests/books/judson-abstract-algebra/boolean-sage.py +269 -0
- sage/tests/books/judson-abstract-algebra/cosets-sage-exercises.py +87 -0
- sage/tests/books/judson-abstract-algebra/cosets-sage.py +170 -0
- sage/tests/books/judson-abstract-algebra/crypt-sage.py +151 -0
- sage/tests/books/judson-abstract-algebra/cyclic-sage.py +450 -0
- sage/tests/books/judson-abstract-algebra/domains-sage.py +163 -0
- sage/tests/books/judson-abstract-algebra/fields-sage.py +299 -0
- sage/tests/books/judson-abstract-algebra/finite-sage.py +108 -0
- sage/tests/books/judson-abstract-algebra/galois-sage.py +484 -0
- sage/tests/books/judson-abstract-algebra/groups-sage.py +280 -0
- sage/tests/books/judson-abstract-algebra/homomorph-sage-exercises.py +65 -0
- sage/tests/books/judson-abstract-algebra/homomorph-sage.py +200 -0
- sage/tests/books/judson-abstract-algebra/integers-sage.py +197 -0
- sage/tests/books/judson-abstract-algebra/isomorph-sage.py +172 -0
- sage/tests/books/judson-abstract-algebra/normal-sage.py +133 -0
- sage/tests/books/judson-abstract-algebra/permute-sage.py +319 -0
- sage/tests/books/judson-abstract-algebra/poly-sage.py +300 -0
- sage/tests/books/judson-abstract-algebra/rings-sage.py +413 -0
- sage/tests/books/judson-abstract-algebra/sets-sage.py +163 -0
- sage/tests/books/judson-abstract-algebra/struct-sage.py +63 -0
- sage/tests/books/judson-abstract-algebra/sylow-sage.py +250 -0
- sage/tests/books/judson-abstract-algebra/vect-sage-exercises.py +48 -0
- sage/tests/books/judson-abstract-algebra/vect-sage.py +211 -0
- sage/tests/memcheck/__init__.py +1 -0
- sage/tests/memcheck/run_tests.py +25 -0
- sage/tests/memcheck/run_tests_in_valgrind.py +36 -0
- sage/tests/memcheck/symbolic_expression.py +12 -0
- sage/tests/memcheck/verify_no_leak.py +28 -0
- sage/tests/all.py +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-cachegrind +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-callgrind +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-cleaner +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-coverage +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-eval +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-fixdoctests +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-inline-fortran +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-ipynb2rst +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-ipython +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-massif +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-notebook +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-omega +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-preparse +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-run +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-run-cython +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-runtests +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-startuptime.py +0 -0
- {passagemath_repl-10.5.28.data → passagemath_repl-10.5.29.data}/scripts/sage-valgrind +0 -0
- {passagemath_repl-10.5.28.dist-info → passagemath_repl-10.5.29.dist-info}/WHEEL +0 -0
@@ -0,0 +1,299 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-repl
|
2
|
+
## Sage Doctest File ##
|
3
|
+
#**************************************#
|
4
|
+
#* Generated from PreTeXt source *#
|
5
|
+
#* on 2017-08-24T11:43:34-07:00 *#
|
6
|
+
#* *#
|
7
|
+
#* http://mathbook.pugetsound.edu *#
|
8
|
+
#* *#
|
9
|
+
#**************************************#
|
10
|
+
##
|
11
|
+
"""
|
12
|
+
Please contact Rob Beezer (beezer@ups.edu) with
|
13
|
+
any test failures here that need to be changed
|
14
|
+
as a result of changes accepted into Sage. You
|
15
|
+
may edit/change this file in any sensible way, so
|
16
|
+
that development work may procede. Your changes
|
17
|
+
may later be replaced by the authors of "Abstract
|
18
|
+
Algebra: Theory and Applications" when the text is
|
19
|
+
updated, and a replacement of this file is proposed
|
20
|
+
for review.
|
21
|
+
"""
|
22
|
+
##
|
23
|
+
## To execute doctests in these files, run
|
24
|
+
## $ $SAGE_ROOT/sage -t <directory-of-these-files>
|
25
|
+
## or
|
26
|
+
## $ $SAGE_ROOT/sage -t <a-single-file>
|
27
|
+
##
|
28
|
+
## Replace -t by "-tp n" for parallel testing,
|
29
|
+
## "-tp 0" will use a sensible number of threads
|
30
|
+
##
|
31
|
+
## See: http://www.sagemath.org/doc/developer/doctesting.html
|
32
|
+
## or run $ $SAGE_ROOT/sage --advanced for brief help
|
33
|
+
##
|
34
|
+
## Generated at 2017-08-24T11:43:34-07:00
|
35
|
+
## From "Abstract Algebra"
|
36
|
+
## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
|
37
|
+
##
|
38
|
+
## Section 21.6 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: M.<a> = QQ[sqrt(2)+sqrt(3)]; M
|
44
|
+
Number Field in a with defining polynomial x^4 - 10*x^2 + 1 with a = 3.146264369941973?
|
45
|
+
|
46
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
47
|
+
|
48
|
+
sage: F.<y> = QQ[]
|
49
|
+
sage: p = y^3 - 1/4*y^2 - 1/16*y + 1/4
|
50
|
+
sage: p.is_irreducible()
|
51
|
+
True
|
52
|
+
|
53
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
54
|
+
|
55
|
+
sage: N.<b> = NumberField(p, 'b'); N
|
56
|
+
Number Field in b with
|
57
|
+
defining polynomial y^3 - 1/4*y^2 - 1/16*y + 1/4
|
58
|
+
|
59
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
60
|
+
|
61
|
+
sage: z = polygen(QQ, 'z')
|
62
|
+
sage: q = z^3 - 1/4*z^2 - 1/16*z + 1/4
|
63
|
+
sage: q.parent()
|
64
|
+
Univariate Polynomial Ring in z over Rational Field
|
65
|
+
|
66
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
67
|
+
|
68
|
+
sage: P.<c> = NumberField(q, 'c'); P
|
69
|
+
Number Field in c with
|
70
|
+
defining polynomial z^3 - 1/4*z^2 - 1/16*z + 1/4
|
71
|
+
|
72
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
73
|
+
|
74
|
+
sage: M.polynomial()
|
75
|
+
x^4 - 10*x^2 + 1
|
76
|
+
|
77
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
78
|
+
|
79
|
+
sage: N.polynomial()
|
80
|
+
y^3 - 1/4*y^2 - 1/16*y + 1/4
|
81
|
+
|
82
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
83
|
+
|
84
|
+
sage: element = -b^2 + 1/3*b + 4
|
85
|
+
sage: element.parent()
|
86
|
+
Number Field in b with
|
87
|
+
defining polynomial y^3 - 1/4*y^2 - 1/16*y + 1/4
|
88
|
+
|
89
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
90
|
+
|
91
|
+
sage: r = element.minpoly('t'); r
|
92
|
+
t^3 - 571/48*t^2 + 108389/2304*t - 13345/216
|
93
|
+
|
94
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
95
|
+
|
96
|
+
sage: r.parent()
|
97
|
+
Univariate Polynomial Ring in t over Rational Field
|
98
|
+
|
99
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
100
|
+
|
101
|
+
sage: r.subs(t=element)
|
102
|
+
0
|
103
|
+
|
104
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
105
|
+
|
106
|
+
sage: A.<a,b> = QQ[sqrt(2), sqrt(3)]
|
107
|
+
sage: A
|
108
|
+
Number Field in sqrt2 with defining polynomial x^2 - 2 over
|
109
|
+
its base field
|
110
|
+
|
111
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
112
|
+
|
113
|
+
sage: B = A.base_field(); B
|
114
|
+
Number Field in sqrt3 with defining polynomial x^2 - 3
|
115
|
+
|
116
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
117
|
+
|
118
|
+
sage: A.is_relative()
|
119
|
+
True
|
120
|
+
|
121
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
122
|
+
|
123
|
+
sage: B.is_relative()
|
124
|
+
False
|
125
|
+
|
126
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
127
|
+
|
128
|
+
sage: C.<c> = A.absolute_field()
|
129
|
+
sage: C
|
130
|
+
Number Field in c with defining polynomial x^4 - 10*x^2 + 1
|
131
|
+
|
132
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
133
|
+
|
134
|
+
sage: fromC, toC = C.structure()
|
135
|
+
sage: fromC(c)
|
136
|
+
sqrt2 - sqrt3
|
137
|
+
|
138
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
139
|
+
|
140
|
+
sage: toC(a)
|
141
|
+
1/2*c^3 - 9/2*c
|
142
|
+
|
143
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
144
|
+
|
145
|
+
sage: toC(b)
|
146
|
+
1/2*c^3 - 11/2*c
|
147
|
+
|
148
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
149
|
+
|
150
|
+
sage: B.degree()
|
151
|
+
2
|
152
|
+
|
153
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
154
|
+
|
155
|
+
sage: A.absolute_degree()
|
156
|
+
4
|
157
|
+
|
158
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
159
|
+
|
160
|
+
sage: A.relative_degree()
|
161
|
+
2
|
162
|
+
|
163
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
164
|
+
|
165
|
+
sage: x = polygen(QQ, 'x')
|
166
|
+
sage: p = x^4 + x^2 - 1
|
167
|
+
sage: p.parent()
|
168
|
+
Univariate Polynomial Ring in x over Rational Field
|
169
|
+
|
170
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
171
|
+
|
172
|
+
sage: p.is_irreducible()
|
173
|
+
True
|
174
|
+
|
175
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
176
|
+
|
177
|
+
sage: M.<a> = NumberField(p, 'a')
|
178
|
+
sage: y = polygen(M, 'y')
|
179
|
+
sage: p = p.subs(x = y)
|
180
|
+
sage: p
|
181
|
+
y^4 + y^2 - 1
|
182
|
+
|
183
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
184
|
+
|
185
|
+
sage: p.parent()
|
186
|
+
Univariate Polynomial Ring in y over Number Field in a with
|
187
|
+
defining polynomial x^4 + x^2 - 1
|
188
|
+
|
189
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
190
|
+
|
191
|
+
sage: p.factor()
|
192
|
+
(y - a) * (y + a) * (y^2 + a^2 + 1)
|
193
|
+
|
194
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
195
|
+
|
196
|
+
sage: a^2 + 1 in QQ
|
197
|
+
False
|
198
|
+
|
199
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
200
|
+
|
201
|
+
sage: q = y^2 + a^2 + 1
|
202
|
+
sage: N.<b> = NumberField(q, 'b')
|
203
|
+
sage: R.<z> = N[]
|
204
|
+
sage: s = R(p)
|
205
|
+
sage: s
|
206
|
+
z^4 + z^2 - 1
|
207
|
+
|
208
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
209
|
+
|
210
|
+
sage: s.parent()
|
211
|
+
Univariate Polynomial Ring in z over Number Field in b with
|
212
|
+
defining polynomial y^2 + a^2 + 1 over its base field
|
213
|
+
|
214
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
215
|
+
|
216
|
+
sage: s.factor()
|
217
|
+
(z + b) * (z + a) * (z - a) * (z - b)
|
218
|
+
|
219
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
220
|
+
|
221
|
+
sage: a in N, b in N
|
222
|
+
(True, True)
|
223
|
+
|
224
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
225
|
+
|
226
|
+
sage: P.<c> = N.absolute_field()
|
227
|
+
sage: w = polygen(P, 'w')
|
228
|
+
sage: p = w^4 + w^2- 1
|
229
|
+
sage: p.factor()
|
230
|
+
(w - 7/18966*c^7 + 110/9483*c^5 + 923/9483*c^3 + 3001/6322*c) *
|
231
|
+
(w - 7/37932*c^7 + 55/9483*c^5 + 923/18966*c^3 - 3321/12644*c) *
|
232
|
+
(w + 7/37932*c^7 - 55/9483*c^5 - 923/18966*c^3 + 3321/12644*c) *
|
233
|
+
(w + 7/18966*c^7 - 110/9483*c^5 - 923/9483*c^3 - 3001/6322*c)
|
234
|
+
|
235
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
236
|
+
|
237
|
+
sage: fromP, toP = P.structure()
|
238
|
+
sage: fromP(7/18966*c^7 - 110/9483*c^5 - 923/9483*c^3 - 3001/6322*c)
|
239
|
+
-b
|
240
|
+
|
241
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
242
|
+
|
243
|
+
sage: M.degree()
|
244
|
+
4
|
245
|
+
|
246
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
247
|
+
|
248
|
+
sage: N.relative_degree()
|
249
|
+
2
|
250
|
+
|
251
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
252
|
+
|
253
|
+
sage: P.degree()
|
254
|
+
8
|
255
|
+
|
256
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
257
|
+
|
258
|
+
sage: M.degree()*N.relative_degree() == P.degree()
|
259
|
+
True
|
260
|
+
|
261
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
262
|
+
|
263
|
+
sage: x = polygen(QQ, 'x')
|
264
|
+
sage: p = x^4 + x^2 - 1
|
265
|
+
sage: r = p.roots(ring=QQbar); r
|
266
|
+
[(-0.7861513777574233?, 1), (0.7861513777574233?, 1),
|
267
|
+
(-1.272019649514069?*I, 1), (1.272019649514069?*I, 1)]
|
268
|
+
|
269
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
270
|
+
|
271
|
+
sage: r1 = r[0][0]; r1
|
272
|
+
-0.7861513777574233?
|
273
|
+
|
274
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
275
|
+
|
276
|
+
sage: r1.as_number_field_element()
|
277
|
+
(Number Field in a with defining polynomial y^4 - y^2 - 1,
|
278
|
+
a^3 - a,
|
279
|
+
Ring morphism:
|
280
|
+
From: Number Field in a with defining polynomial y^4 - y^2 - 1
|
281
|
+
To: Algebraic Real Field
|
282
|
+
Defn: a |--> -1.272019649514069?)
|
283
|
+
|
284
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
285
|
+
|
286
|
+
sage: r1^4 + r1^2 - 1
|
287
|
+
0
|
288
|
+
|
289
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
290
|
+
|
291
|
+
sage: N, rexact, homomorphism = r1.as_number_field_element()
|
292
|
+
sage: (rexact)^4 + rexact^2 - 1
|
293
|
+
0
|
294
|
+
|
295
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
296
|
+
|
297
|
+
sage: log(QQ[cos(pi/9)].degree(), 2) in ZZ
|
298
|
+
False
|
299
|
+
"""
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-repl
|
2
|
+
## Sage Doctest File ##
|
3
|
+
#**************************************#
|
4
|
+
#* Generated from PreTeXt source *#
|
5
|
+
#* on 2017-08-24T11:43:34-07:00 *#
|
6
|
+
#* *#
|
7
|
+
#* http://mathbook.pugetsound.edu *#
|
8
|
+
#* *#
|
9
|
+
#**************************************#
|
10
|
+
##
|
11
|
+
"""
|
12
|
+
Please contact Rob Beezer (beezer@ups.edu) with
|
13
|
+
any test failures here that need to be changed
|
14
|
+
as a result of changes accepted into Sage. You
|
15
|
+
may edit/change this file in any sensible way, so
|
16
|
+
that development work may procede. Your changes
|
17
|
+
may later be replaced by the authors of "Abstract
|
18
|
+
Algebra: Theory and Applications" when the text is
|
19
|
+
updated, and a replacement of this file is proposed
|
20
|
+
for review.
|
21
|
+
"""
|
22
|
+
##
|
23
|
+
## To execute doctests in these files, run
|
24
|
+
## $ $SAGE_ROOT/sage -t <directory-of-these-files>
|
25
|
+
## or
|
26
|
+
## $ $SAGE_ROOT/sage -t <a-single-file>
|
27
|
+
##
|
28
|
+
## Replace -t by "-tp n" for parallel testing,
|
29
|
+
## "-tp 0" will use a sensible number of threads
|
30
|
+
##
|
31
|
+
## See: http://www.sagemath.org/doc/developer/doctesting.html
|
32
|
+
## or run $ $SAGE_ROOT/sage --advanced for brief help
|
33
|
+
##
|
34
|
+
## Generated at 2017-08-24T11:43:34-07:00
|
35
|
+
## From "Abstract Algebra"
|
36
|
+
## At commit 26d3cac0b4047f4b8d6f737542be455606e2c4b4
|
37
|
+
##
|
38
|
+
## Section 22.6 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: F.<a> = GF(7^15); F
|
44
|
+
Finite Field in a of size 7^15
|
45
|
+
|
46
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
47
|
+
|
48
|
+
sage: F.polynomial()
|
49
|
+
a^15 + 5*a^6 + 6*a^5 + 6*a^4 + 4*a^3 + a^2 + 2*a + 4
|
50
|
+
|
51
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
52
|
+
|
53
|
+
sage: a^15 + 5*a^6 + 6*a^5 + 6*a^4 + 4*a^3 + a^2 + 2*a + 4
|
54
|
+
0
|
55
|
+
|
56
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
57
|
+
|
58
|
+
sage: conway_polynomial(7, 15)
|
59
|
+
x^15 + 5*x^6 + 6*x^5 + 6*x^4 + 4*x^3 + x^2 + 2*x + 4
|
60
|
+
|
61
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
62
|
+
|
63
|
+
sage: y = polygen(Integers(7), 'y')
|
64
|
+
sage: P = y.parent()
|
65
|
+
sage: p = P([4, 5, 2, 6, 3, 3, 6, 2, 1, 1, 2, 5, 6, 3, 5, 1]); p
|
66
|
+
y^15 + 5*y^14 + 3*y^13 + 6*y^12 + 5*y^11 + 2*y^10 + y^9 +
|
67
|
+
y^8 + 2*y^7 + 6*y^6 + 3*y^5 + 3*y^4 + 6*y^3 + 2*y^2 + 5*y + 4
|
68
|
+
|
69
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
70
|
+
|
71
|
+
sage: p.is_irreducible()
|
72
|
+
True
|
73
|
+
|
74
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
75
|
+
|
76
|
+
sage: T.<b> = GF(7^15, modulus=p); T
|
77
|
+
Finite Field in b of size 7^15
|
78
|
+
|
79
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
80
|
+
|
81
|
+
sage: F.<a> = GF(5^4)
|
82
|
+
sage: a^458
|
83
|
+
3*a^3 + 2*a^2 + a + 3
|
84
|
+
|
85
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
86
|
+
|
87
|
+
sage: (3*a^3 + 2*a^2 + a + 3).log(a)
|
88
|
+
458
|
89
|
+
|
90
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
91
|
+
|
92
|
+
sage: exponent = (3*a^3 + 2*a^2 + a + 3).log(2*a^3 + 4*a^2 + 4*a)
|
93
|
+
sage: exponent
|
94
|
+
211
|
95
|
+
|
96
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
97
|
+
|
98
|
+
sage: (2*a^3 + 4*a^2 + 4*a)^exponent == 3*a^3 + 2*a^2 + a + 3
|
99
|
+
True
|
100
|
+
|
101
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
102
|
+
|
103
|
+
sage: (3*a^3 + 2*a^2 + a + 3).log(a^2 + 4*a + 4)
|
104
|
+
Traceback (most recent call last):
|
105
|
+
...
|
106
|
+
ValueError: no discrete log of 3*a^3 + 2*a^2 + a + 3 found
|
107
|
+
to base a^2 + 4*a + 4
|
108
|
+
"""
|