passagemath-repl 10.5.27__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.27.dist-info → passagemath_repl-10.5.29.dist-info}/METADATA +38 -13
- {passagemath_repl-10.5.27.dist-info → passagemath_repl-10.5.29.dist-info}/RECORD +95 -24
- {passagemath_repl-10.5.27.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.27.data → passagemath_repl-10.5.29.data}/scripts/sage-cachegrind +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-callgrind +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-cleaner +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-coverage +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-eval +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-fixdoctests +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-inline-fortran +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-ipynb2rst +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-ipython +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-massif +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-notebook +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-omega +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-preparse +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-run +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-run-cython +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-runtests +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-startuptime.py +0 -0
- {passagemath_repl-10.5.27.data → passagemath_repl-10.5.29.data}/scripts/sage-valgrind +0 -0
- {passagemath_repl-10.5.27.dist-info → passagemath_repl-10.5.29.dist-info}/WHEEL +0 -0
@@ -0,0 +1,280 @@
|
|
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 3.7 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: Z8 = Integers(8)
|
44
|
+
sage: Z8
|
45
|
+
Ring of integers modulo 8
|
46
|
+
|
47
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
48
|
+
|
49
|
+
sage: Z8.list()
|
50
|
+
[0, 1, 2, 3, 4, 5, 6, 7]
|
51
|
+
|
52
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
53
|
+
|
54
|
+
sage: a = Z8.an_element(); a
|
55
|
+
0
|
56
|
+
|
57
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
58
|
+
|
59
|
+
sage: a.parent()
|
60
|
+
Ring of integers modulo 8
|
61
|
+
|
62
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
63
|
+
|
64
|
+
sage: a = 6
|
65
|
+
sage: a
|
66
|
+
6
|
67
|
+
|
68
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
69
|
+
|
70
|
+
sage: a.parent()
|
71
|
+
Integer Ring
|
72
|
+
|
73
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
74
|
+
|
75
|
+
sage: b = 7
|
76
|
+
sage: c = a + b; c
|
77
|
+
13
|
78
|
+
|
79
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
80
|
+
|
81
|
+
sage: d = Z8(6)
|
82
|
+
sage: d
|
83
|
+
6
|
84
|
+
|
85
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
86
|
+
|
87
|
+
sage: d.parent()
|
88
|
+
Ring of integers modulo 8
|
89
|
+
|
90
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
91
|
+
|
92
|
+
sage: e = Z8(7)
|
93
|
+
sage: f = d+e; f
|
94
|
+
5
|
95
|
+
|
96
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
97
|
+
|
98
|
+
sage: g = Z8(85); g
|
99
|
+
5
|
100
|
+
|
101
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
102
|
+
|
103
|
+
sage: f == g
|
104
|
+
True
|
105
|
+
|
106
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
107
|
+
|
108
|
+
sage: Z8.addition_table(names='elements')
|
109
|
+
+ 0 1 2 3 4 5 6 7
|
110
|
+
+----------------
|
111
|
+
0| 0 1 2 3 4 5 6 7
|
112
|
+
1| 1 2 3 4 5 6 7 0
|
113
|
+
2| 2 3 4 5 6 7 0 1
|
114
|
+
3| 3 4 5 6 7 0 1 2
|
115
|
+
4| 4 5 6 7 0 1 2 3
|
116
|
+
5| 5 6 7 0 1 2 3 4
|
117
|
+
6| 6 7 0 1 2 3 4 5
|
118
|
+
7| 7 0 1 2 3 4 5 6
|
119
|
+
|
120
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
121
|
+
|
122
|
+
sage: triangle = SymmetricGroup(3)
|
123
|
+
sage: rho2 = triangle([3,1,2])
|
124
|
+
sage: rho2
|
125
|
+
(1,3,2)
|
126
|
+
|
127
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
128
|
+
|
129
|
+
sage: [rho2(x) for x in triangle.domain()]
|
130
|
+
[3, 1, 2]
|
131
|
+
|
132
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
133
|
+
|
134
|
+
sage: [[a(x) for x in triangle.domain()] for a in triangle]
|
135
|
+
[[1, 2, 3], [3, 1, 2], [2, 3, 1], [1, 3, 2], [3, 2, 1], [2, 1, 3]]
|
136
|
+
|
137
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
138
|
+
|
139
|
+
sage: mu1 = triangle([1,3,2])
|
140
|
+
sage: mu2 = triangle([3,2,1])
|
141
|
+
sage: mu3 = triangle([2,1,3])
|
142
|
+
sage: rho1 = triangle([2,3,1])
|
143
|
+
sage: product = rho1*mu1
|
144
|
+
sage: product == mu2
|
145
|
+
True
|
146
|
+
|
147
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
148
|
+
|
149
|
+
sage: [product(x) for x in triangle.domain()]
|
150
|
+
[3, 2, 1]
|
151
|
+
|
152
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
153
|
+
|
154
|
+
sage: rho1*mu1 == mu1*rho1
|
155
|
+
False
|
156
|
+
|
157
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
158
|
+
|
159
|
+
sage: mu1*rho1 == mu3
|
160
|
+
True
|
161
|
+
|
162
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
163
|
+
|
164
|
+
sage: triangle.cayley_table()
|
165
|
+
* a b c d e f
|
166
|
+
+------------
|
167
|
+
a| a b c d e f
|
168
|
+
b| b a d c f e
|
169
|
+
c| c e a f b d
|
170
|
+
d| d f b e a c
|
171
|
+
e| e c f a d b
|
172
|
+
f| f d e b c a
|
173
|
+
|
174
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
175
|
+
|
176
|
+
sage: triangle.cayley_table(names='elements')
|
177
|
+
* () (2,3) (1,2) (1,2,3) (1,3,2) (1,3)
|
178
|
+
+------------------------------------------------
|
179
|
+
()| () (2,3) (1,2) (1,2,3) (1,3,2) (1,3)
|
180
|
+
(2,3)| (2,3) () (1,2,3) (1,2) (1,3) (1,3,2)
|
181
|
+
(1,2)| (1,2) (1,3,2) () (1,3) (2,3) (1,2,3)
|
182
|
+
(1,2,3)| (1,2,3) (1,3) (2,3) (1,3,2) () (1,2)
|
183
|
+
(1,3,2)| (1,3,2) (1,2) (1,3) () (1,2,3) (2,3)
|
184
|
+
(1,3)| (1,3) (1,2,3) (1,3,2) (2,3) (1,2) ()
|
185
|
+
|
186
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
187
|
+
|
188
|
+
sage: triangle.cayley_table(names=['id','u1','u3','r1','r2','u2'])
|
189
|
+
* id u1 u3 r1 r2 u2
|
190
|
+
+------------------
|
191
|
+
id| id u1 u3 r1 r2 u2
|
192
|
+
u1| u1 id r1 u3 u2 r2
|
193
|
+
u3| u3 r2 id u2 u1 r1
|
194
|
+
r1| r1 u2 u1 r2 id u3
|
195
|
+
r2| r2 u3 u2 id r1 u1
|
196
|
+
u2| u2 r1 r2 u1 u3 id
|
197
|
+
|
198
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
199
|
+
|
200
|
+
sage: Q = QuaternionGroup()
|
201
|
+
sage: [[a(x) for x in Q.domain()] for a in Q]
|
202
|
+
[[1, 2, 3, 4, 5, 6, 7, 8],
|
203
|
+
[3, 4, 1, 2, 7, 8, 5, 6],
|
204
|
+
[4, 1, 2, 3, 8, 5, 6, 7],
|
205
|
+
[2, 3, 4, 1, 6, 7, 8, 5],
|
206
|
+
[7, 6, 5, 8, 1, 4, 3, 2],
|
207
|
+
[5, 8, 7, 6, 3, 2, 1, 4],
|
208
|
+
[8, 7, 6, 5, 2, 1, 4, 3],
|
209
|
+
[6, 5, 8, 7, 4, 3, 2, 1]]
|
210
|
+
|
211
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
212
|
+
|
213
|
+
sage: Q.cayley_table()
|
214
|
+
* a b c d e f g h
|
215
|
+
+----------------
|
216
|
+
a| a b c d e f g h
|
217
|
+
b| b c d a h e f g
|
218
|
+
c| c d a b g h e f
|
219
|
+
d| d a b c f g h e
|
220
|
+
e| e f g h c d a b
|
221
|
+
f| f g h e b c d a
|
222
|
+
g| g h e f a b c d
|
223
|
+
h| h e f g d a b c
|
224
|
+
|
225
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
226
|
+
|
227
|
+
sage: id = Q.identity()
|
228
|
+
sage: [id(x) for x in Q.domain()]
|
229
|
+
[1, 2, 3, 4, 5, 6, 7, 8]
|
230
|
+
|
231
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
232
|
+
|
233
|
+
sage: minus_one = Q([3, 4, 1, 2, 7, 8, 5, 6])
|
234
|
+
sage: minus_one*minus_one == Q.identity()
|
235
|
+
True
|
236
|
+
|
237
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
238
|
+
|
239
|
+
sage: Q.is_finite()
|
240
|
+
True
|
241
|
+
|
242
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
243
|
+
|
244
|
+
sage: Q.order()
|
245
|
+
8
|
246
|
+
|
247
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
248
|
+
|
249
|
+
sage: Q.is_abelian()
|
250
|
+
False
|
251
|
+
|
252
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
253
|
+
|
254
|
+
sage: S8 = SymmetricGroup(8)
|
255
|
+
sage: a = S8.random_element()
|
256
|
+
sage: [a(x) for x in S8.domain()] # random
|
257
|
+
[5, 2, 6, 4, 1, 8, 3, 7]
|
258
|
+
|
259
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
260
|
+
|
261
|
+
sage: S8.order()
|
262
|
+
40320
|
263
|
+
|
264
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
265
|
+
|
266
|
+
sage: Q.is_subgroup(S8)
|
267
|
+
True
|
268
|
+
|
269
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
270
|
+
|
271
|
+
sage: H = [CC(1), CC(-1), CC(I), CC(-I)]
|
272
|
+
sage: CC.multiplication_table(elements=H,
|
273
|
+
....: names=['1', '-1', 'i', '-i'])
|
274
|
+
* 1 -1 i -i
|
275
|
+
+------------
|
276
|
+
1| 1 -1 i -i
|
277
|
+
-1| -1 1 -i i
|
278
|
+
i| i -i -1 1
|
279
|
+
-i| -i i 1 -1
|
280
|
+
"""
|
@@ -0,0 +1,65 @@
|
|
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
|
+
## Exercises 11.6 Sage Exercises
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: G = CyclicPermutationGroup(3)
|
44
|
+
sage: H = DihedralGroup(4)
|
45
|
+
sage: results = G.direct_product(H)
|
46
|
+
sage: phi = results[2]
|
47
|
+
sage: H.gens()
|
48
|
+
((1,2,3,4), (1,4)(2,3))
|
49
|
+
|
50
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
51
|
+
|
52
|
+
sage: a = H.gen(0); a
|
53
|
+
(1,2,3,4)
|
54
|
+
|
55
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
56
|
+
|
57
|
+
sage: phi(a)
|
58
|
+
(4,5,6,7)
|
59
|
+
|
60
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
61
|
+
|
62
|
+
sage: G = DihedralGroup(20)
|
63
|
+
sage: l=[H.order() for H in G.normal_subgroups()]; l.sort(); l
|
64
|
+
[1, 2, 4, 5, 10, 20, 20, 20, 40]
|
65
|
+
"""
|
@@ -0,0 +1,200 @@
|
|
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 11.5 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: C12 = CyclicPermutationGroup(12)
|
44
|
+
sage: C20 = CyclicPermutationGroup(20)
|
45
|
+
sage: domain_gens = C12.gens()
|
46
|
+
sage: [g.order() for g in domain_gens]
|
47
|
+
[12]
|
48
|
+
|
49
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
50
|
+
|
51
|
+
sage: x = C20.gen(0)
|
52
|
+
sage: y = x^5
|
53
|
+
sage: y.order()
|
54
|
+
4
|
55
|
+
|
56
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
57
|
+
|
58
|
+
sage: phi = PermutationGroupMorphism(C12, C20, [y])
|
59
|
+
sage: phi
|
60
|
+
Permutation group morphism:
|
61
|
+
From: Cyclic group of order 12 as a permutation group
|
62
|
+
To: Cyclic group of order 20 as a permutation group
|
63
|
+
Defn: [(1,2,3,4,5,6,7,8,9,10,11,12)] ->
|
64
|
+
[(1,6,11,16)(2,7,12,17)(3,8,13,18)(4,9,14,19)(5,10,15,20)]
|
65
|
+
|
66
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
67
|
+
|
68
|
+
sage: a = C12("(1,6,11,4,9,2,7,12,5,10,3,8)")
|
69
|
+
sage: phi(a)
|
70
|
+
(1,6,11,16)(2,7,12,17)(3,8,13,18)(4,9,14,19)(5,10,15,20)
|
71
|
+
|
72
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
73
|
+
|
74
|
+
sage: b = C12("(1,3,5,7,9,11)(2,4,6,8,10,12)")
|
75
|
+
sage: phi(b)
|
76
|
+
(1,11)(2,12)(3,13)(4,14)(5,15)(6,16)(7,17)(8,18)(9,19)(10,20)
|
77
|
+
|
78
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
79
|
+
|
80
|
+
sage: c = C12("(1,9,5)(2,10,6)(3,11,7)(4,12,8)")
|
81
|
+
sage: phi(c)
|
82
|
+
()
|
83
|
+
|
84
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
85
|
+
|
86
|
+
sage: K = phi.kernel(); K
|
87
|
+
Subgroup generated by [(1,5,9)(2,6,10)(3,7,11)(4,8,12)]
|
88
|
+
of (Cyclic group of order 12 as a permutation group)
|
89
|
+
|
90
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
91
|
+
|
92
|
+
sage: Im = phi.image(C12); Im
|
93
|
+
Subgroup generated by
|
94
|
+
[(1,6,11,16)(2,7,12,17)(3,8,13,18)(4,9,14,19)(5,10,15,20)]
|
95
|
+
of (Cyclic group of order 20 as a permutation group)
|
96
|
+
|
97
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
98
|
+
|
99
|
+
sage: Im.is_isomorphic(C12.quotient(K))
|
100
|
+
True
|
101
|
+
|
102
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
103
|
+
|
104
|
+
sage: G = DihedralGroup(5)
|
105
|
+
sage: H = DihedralGroup(20)
|
106
|
+
sage: G.gens()
|
107
|
+
((1,2,3,4,5), (1,5)(2,4))
|
108
|
+
|
109
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
110
|
+
|
111
|
+
sage: H.gens()
|
112
|
+
((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20),
|
113
|
+
(1,20)(2,19)(3,18)(4,17)(5,16)(6,15)(7,14)(8,13)(9,12)(10,11))
|
114
|
+
|
115
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
116
|
+
|
117
|
+
sage: x = H.gen(0)^4
|
118
|
+
sage: y = H.gen(1)
|
119
|
+
sage: rho = PermutationGroupMorphism(G, H, [x, y])
|
120
|
+
sage: rho.kernel()
|
121
|
+
Subgroup generated by
|
122
|
+
[()] of (Dihedral group of order 10 as a permutation group)
|
123
|
+
|
124
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
125
|
+
|
126
|
+
sage: Im = rho.image(G); Im
|
127
|
+
Subgroup generated by
|
128
|
+
[(1,5,9,13,17)(2,6,10,14,18)(3,7,11,15,19)(4,8,12,16,20),
|
129
|
+
(1,20)(2,19)(3,18)(4,17)(5,16)(6,15)(7,14)(8,13)(9,12)(10,11)]
|
130
|
+
of (Dihedral group of order 40 as a permutation group)
|
131
|
+
|
132
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
133
|
+
|
134
|
+
sage: Im.is_subgroup(H)
|
135
|
+
True
|
136
|
+
|
137
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
138
|
+
|
139
|
+
sage: Im.is_isomorphic(G)
|
140
|
+
True
|
141
|
+
|
142
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
143
|
+
|
144
|
+
sage: G = CyclicPermutationGroup(7)
|
145
|
+
sage: H = CyclicPermutationGroup(4)
|
146
|
+
sage: tau = PermutationGroupMorphism_im_gens(G, H, H.gens())
|
147
|
+
sage: tau
|
148
|
+
Permutation group morphism:
|
149
|
+
From: Cyclic group of order 7 as a permutation group
|
150
|
+
To: Cyclic group of order 4 as a permutation group
|
151
|
+
Defn: [(1,2,3,4,5,6,7)] -> [(1,2,3,4)]
|
152
|
+
|
153
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
154
|
+
|
155
|
+
sage: tau.kernel()
|
156
|
+
Traceback (most recent call last):
|
157
|
+
...
|
158
|
+
sage.libs.gap.util.GAPError: Error, no method found! Error, no 1st choice method found for `Kernel' on 1 arguments
|
159
|
+
The 1st argument is 'fail' which might point to an earlier problem
|
160
|
+
|
161
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
162
|
+
|
163
|
+
sage: G = CyclicPermutationGroup(3)
|
164
|
+
sage: H = DihedralGroup(4)
|
165
|
+
sage: results = G.direct_product(H)
|
166
|
+
sage: results[0]
|
167
|
+
Permutation Group with generators [(1,2,3), (4,5,6,7), (4,7)(5,6)]
|
168
|
+
|
169
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
170
|
+
|
171
|
+
sage: results[1]
|
172
|
+
Permutation group morphism:
|
173
|
+
From: Cyclic group of order 3 as a permutation group
|
174
|
+
To: Permutation Group with generators [(1,2,3), (4,5,6,7), (4,7)(5,6)]
|
175
|
+
Defn: Embedding( Group( [ (1,2,3), (4,5,6,7), (4,7)(5,6) ] ), 1 )
|
176
|
+
|
177
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
178
|
+
|
179
|
+
sage: results[2]
|
180
|
+
Permutation group morphism:
|
181
|
+
From: Dihedral group of order 8 as a permutation group
|
182
|
+
To: Permutation Group with generators [(1,2,3), (4,5,6,7), (4,7)(5,6)]
|
183
|
+
Defn: Embedding( Group( [ (1,2,3), (4,5,6,7), (4,7)(5,6) ] ), 2 )
|
184
|
+
|
185
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
186
|
+
|
187
|
+
sage: results[3]
|
188
|
+
Permutation group morphism:
|
189
|
+
From: Permutation Group with generators [(1,2,3), (4,5,6,7), (4,7)(5,6)]
|
190
|
+
To: Cyclic group of order 3 as a permutation group
|
191
|
+
Defn: Projection( Group( [ (1,2,3), (4,5,6,7), (4,7)(5,6) ] ), 1 )
|
192
|
+
|
193
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
194
|
+
|
195
|
+
sage: results[4]
|
196
|
+
Permutation group morphism:
|
197
|
+
From: Permutation Group with generators [(1,2,3), (4,5,6,7), (4,7)(5,6)]
|
198
|
+
To: Dihedral group of order 8 as a permutation group
|
199
|
+
Defn: Projection( Group( [ (1,2,3), (4,5,6,7), (4,7)(5,6) ] ), 2 )
|
200
|
+
"""
|