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,197 @@
|
|
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 2.6 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: r = 14 % 3
|
44
|
+
sage: r
|
45
|
+
2
|
46
|
+
|
47
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
48
|
+
|
49
|
+
sage: q = (14 - r)/3
|
50
|
+
sage: q
|
51
|
+
4
|
52
|
+
|
53
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
54
|
+
|
55
|
+
sage: a = 14
|
56
|
+
sage: b = 3
|
57
|
+
sage: a.quo_rem(b)
|
58
|
+
(4, 2)
|
59
|
+
|
60
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
61
|
+
|
62
|
+
sage: (20 % 5) == 0
|
63
|
+
True
|
64
|
+
|
65
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
66
|
+
|
67
|
+
sage: (17 % 4) == 0
|
68
|
+
False
|
69
|
+
|
70
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
71
|
+
|
72
|
+
sage: c = 5
|
73
|
+
sage: c.divides(20)
|
74
|
+
True
|
75
|
+
|
76
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
77
|
+
|
78
|
+
sage: d = 4
|
79
|
+
sage: d.divides(17)
|
80
|
+
False
|
81
|
+
|
82
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
83
|
+
|
84
|
+
sage: gcd(2776, 2452)
|
85
|
+
4
|
86
|
+
|
87
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
88
|
+
|
89
|
+
sage: a = 31049
|
90
|
+
sage: b = 2105
|
91
|
+
sage: gcd(a, b) == 1
|
92
|
+
True
|
93
|
+
|
94
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
95
|
+
|
96
|
+
sage: a = 3563
|
97
|
+
sage: b = 2947
|
98
|
+
sage: gcd(a, b) == 1
|
99
|
+
False
|
100
|
+
|
101
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
102
|
+
|
103
|
+
sage: xgcd(633,331)
|
104
|
+
(1, -137, 262)
|
105
|
+
|
106
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
107
|
+
|
108
|
+
sage: a = 633
|
109
|
+
sage: b = 331
|
110
|
+
sage: extended = xgcd(a, b)
|
111
|
+
sage: g = extended[0]
|
112
|
+
sage: r = extended[1]
|
113
|
+
sage: s = extended[2]
|
114
|
+
sage: g == r*a + s*b
|
115
|
+
True
|
116
|
+
|
117
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
118
|
+
|
119
|
+
sage: a = 117371
|
120
|
+
sage: a.is_prime()
|
121
|
+
True
|
122
|
+
|
123
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
124
|
+
|
125
|
+
sage: b = 14547073
|
126
|
+
sage: b.is_prime()
|
127
|
+
False
|
128
|
+
|
129
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
130
|
+
|
131
|
+
sage: b == 1597 * 9109
|
132
|
+
True
|
133
|
+
|
134
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
135
|
+
|
136
|
+
sage: a = random_prime(10^21, proof=True)
|
137
|
+
sage: a # random
|
138
|
+
424729101793542195193
|
139
|
+
|
140
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
141
|
+
|
142
|
+
sage: a.is_prime()
|
143
|
+
True
|
144
|
+
|
145
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
146
|
+
|
147
|
+
sage: prime_range(500, 550)
|
148
|
+
[503, 509, 521, 523, 541, 547]
|
149
|
+
|
150
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
151
|
+
|
152
|
+
sage: a = 2600
|
153
|
+
sage: a.factor()
|
154
|
+
2^3 * 5^2 * 13
|
155
|
+
|
156
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
157
|
+
|
158
|
+
sage: a = 2600
|
159
|
+
sage: factored = a.factor()
|
160
|
+
sage: first_term = factored[0]
|
161
|
+
sage: first_term
|
162
|
+
(2, 3)
|
163
|
+
|
164
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
165
|
+
|
166
|
+
sage: second_term = factored[1]
|
167
|
+
sage: second_term
|
168
|
+
(5, 2)
|
169
|
+
|
170
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
171
|
+
|
172
|
+
sage: third_term = factored[2]
|
173
|
+
sage: third_term
|
174
|
+
(13, 1)
|
175
|
+
|
176
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
177
|
+
|
178
|
+
sage: first_prime = first_term[0]
|
179
|
+
sage: first_prime
|
180
|
+
2
|
181
|
+
|
182
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
183
|
+
|
184
|
+
sage: first_exponent = first_term[1]
|
185
|
+
sage: first_exponent
|
186
|
+
3
|
187
|
+
|
188
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
189
|
+
|
190
|
+
sage: list(factored)
|
191
|
+
[(2, 3), (5, 2), (13, 1)]
|
192
|
+
|
193
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
194
|
+
|
195
|
+
sage: len(factored)
|
196
|
+
3
|
197
|
+
"""
|
@@ -0,0 +1,172 @@
|
|
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 9.4 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: m = 12
|
44
|
+
sage: n = 7
|
45
|
+
sage: gcd(m, n)
|
46
|
+
1
|
47
|
+
|
48
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
49
|
+
|
50
|
+
sage: G = CyclicPermutationGroup(m)
|
51
|
+
sage: H = CyclicPermutationGroup(n)
|
52
|
+
sage: dp = direct_product_permgroups([G, H])
|
53
|
+
sage: K = CyclicPermutationGroup(m*n)
|
54
|
+
sage: K.is_isomorphic(dp)
|
55
|
+
True
|
56
|
+
|
57
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
58
|
+
|
59
|
+
sage: m = 15
|
60
|
+
sage: n = 21
|
61
|
+
sage: gcd(m, n)
|
62
|
+
3
|
63
|
+
|
64
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
65
|
+
|
66
|
+
sage: G = CyclicPermutationGroup(m)
|
67
|
+
sage: H = CyclicPermutationGroup(n)
|
68
|
+
sage: dp = direct_product_permgroups([G, H])
|
69
|
+
sage: K = CyclicPermutationGroup(m*n)
|
70
|
+
sage: K.is_isomorphic(dp)
|
71
|
+
False
|
72
|
+
|
73
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
74
|
+
|
75
|
+
sage: m = 6
|
76
|
+
sage: n = 5
|
77
|
+
sage: r = 7
|
78
|
+
sage: G = CyclicPermutationGroup(m)
|
79
|
+
sage: H = CyclicPermutationGroup(n)
|
80
|
+
sage: L = CyclicPermutationGroup(r)
|
81
|
+
sage: dp = direct_product_permgroups([G, H, L])
|
82
|
+
sage: K = CyclicPermutationGroup(m*n*r)
|
83
|
+
sage: K.is_isomorphic(dp)
|
84
|
+
True
|
85
|
+
|
86
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
87
|
+
|
88
|
+
sage: [CyclicPermutationGroup(p) for p in [1, 2, 3, 5, 7, 11, 13]]
|
89
|
+
[Cyclic group of order 1 as a permutation group,
|
90
|
+
Cyclic group of order 2 as a permutation group,
|
91
|
+
Cyclic group of order 3 as a permutation group,
|
92
|
+
Cyclic group of order 5 as a permutation group,
|
93
|
+
Cyclic group of order 7 as a permutation group,
|
94
|
+
Cyclic group of order 11 as a permutation group,
|
95
|
+
Cyclic group of order 13 as a permutation group]
|
96
|
+
|
97
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
98
|
+
|
99
|
+
sage: G = CyclicPermutationGroup(4)
|
100
|
+
sage: H = KleinFourGroup()
|
101
|
+
sage: T1 = CyclicPermutationGroup(2)
|
102
|
+
sage: T2 = CyclicPermutationGroup(2)
|
103
|
+
sage: K = direct_product_permgroups([T1, T2])
|
104
|
+
sage: G.is_isomorphic(H)
|
105
|
+
False
|
106
|
+
|
107
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
108
|
+
|
109
|
+
sage: H.is_isomorphic(K)
|
110
|
+
True
|
111
|
+
|
112
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
113
|
+
|
114
|
+
sage: G = CyclicPermutationGroup(6)
|
115
|
+
sage: H = SymmetricGroup(3)
|
116
|
+
sage: G.is_isomorphic(H)
|
117
|
+
False
|
118
|
+
|
119
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
120
|
+
|
121
|
+
sage: G = DihedralGroup(3)
|
122
|
+
sage: H = SymmetricGroup(3)
|
123
|
+
sage: G.is_isomorphic(H)
|
124
|
+
True
|
125
|
+
|
126
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
127
|
+
|
128
|
+
sage: Z36 = Integers(36)
|
129
|
+
sage: U = [x for x in Z36 if gcd(ZZ(x), 36) == 1]
|
130
|
+
sage: U
|
131
|
+
[1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35]
|
132
|
+
|
133
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
134
|
+
|
135
|
+
sage: [x.multiplicative_order() for x in U]
|
136
|
+
[1, 6, 6, 6, 3, 2, 2, 6, 3, 6, 6, 2]
|
137
|
+
|
138
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
139
|
+
|
140
|
+
sage: a = U[1]
|
141
|
+
sage: A = [a^i for i in srange(6)]
|
142
|
+
sage: A
|
143
|
+
[1, 5, 25, 17, 13, 29]
|
144
|
+
|
145
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
146
|
+
|
147
|
+
sage: b = U[11]
|
148
|
+
sage: B = [b^i for i in srange(2)]
|
149
|
+
sage: B
|
150
|
+
[1, 35]
|
151
|
+
|
152
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
153
|
+
|
154
|
+
sage: [x for x in A if x in B]
|
155
|
+
[1]
|
156
|
+
|
157
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
158
|
+
|
159
|
+
sage: all(x*y == y*x for x in A for y in B)
|
160
|
+
True
|
161
|
+
|
162
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
163
|
+
|
164
|
+
sage: T = sorted(x*y for x in A for y in B)
|
165
|
+
sage: T
|
166
|
+
[1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35]
|
167
|
+
|
168
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
169
|
+
|
170
|
+
sage: T == U
|
171
|
+
True
|
172
|
+
"""
|
@@ -0,0 +1,133 @@
|
|
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 10.4 Sage
|
39
|
+
##
|
40
|
+
r"""
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
42
|
+
|
43
|
+
sage: G = DihedralGroup(8)
|
44
|
+
sage: quarter_turn = G('(1,3,5,7)(2,4,6,8)')
|
45
|
+
sage: S = G.subgroup([quarter_turn])
|
46
|
+
sage: C = G.cosets(S)
|
47
|
+
|
48
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
49
|
+
|
50
|
+
sage: p = C[1][0]*C[3][0]
|
51
|
+
sage: [i for i in srange(len(C)) if p in C[i]]
|
52
|
+
[2]
|
53
|
+
|
54
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
55
|
+
|
56
|
+
sage: p = C[1][2]*C[3][1]
|
57
|
+
sage: [i for i in srange(len(C)) if p in C[i]]
|
58
|
+
[2]
|
59
|
+
|
60
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
61
|
+
|
62
|
+
sage: def coset_product(i, j, C):
|
63
|
+
....: p = C[i][0]*C[j][0]
|
64
|
+
....: c = [k for k in srange(len(C)) if p in C[k]]
|
65
|
+
....: return c[0]
|
66
|
+
|
67
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
68
|
+
|
69
|
+
sage: coset_product(1, 3, C)
|
70
|
+
2
|
71
|
+
|
72
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
73
|
+
|
74
|
+
sage: G = AlternatingGroup(4)
|
75
|
+
sage: face_turn = G("(1,2,3)")
|
76
|
+
sage: S = G.subgroup([face_turn])
|
77
|
+
sage: C = G.cosets(S)
|
78
|
+
|
79
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
80
|
+
|
81
|
+
sage: p = C[1][0]*C[3][0]
|
82
|
+
sage: [i for i in srange(len(C)) if p in C[i]]
|
83
|
+
[0]
|
84
|
+
|
85
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
86
|
+
|
87
|
+
sage: p = C[1][0]*C[3][1]
|
88
|
+
sage: [i for i in srange(len(C)) if p in C[i]]
|
89
|
+
[2]
|
90
|
+
|
91
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
92
|
+
|
93
|
+
sage: G = DihedralGroup(8)
|
94
|
+
sage: quarter_turn = G('(1,3,5,7)(2,4,6,8)')
|
95
|
+
sage: S = G.subgroup([quarter_turn])
|
96
|
+
sage: S.is_normal(G)
|
97
|
+
True
|
98
|
+
|
99
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
100
|
+
|
101
|
+
sage: G = AlternatingGroup(4)
|
102
|
+
sage: face_turn = G("(1,2,3)")
|
103
|
+
sage: S = G.subgroup([face_turn])
|
104
|
+
sage: S.is_normal(G)
|
105
|
+
False
|
106
|
+
|
107
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
108
|
+
|
109
|
+
sage: G = AlternatingGroup(5)
|
110
|
+
sage: G.is_simple()
|
111
|
+
True
|
112
|
+
|
113
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
114
|
+
|
115
|
+
sage: G = DihedralGroup(8)
|
116
|
+
sage: quarter_turn = G('(1,3,5,7)(2,4,6,8)')
|
117
|
+
sage: S = G.subgroup([quarter_turn])
|
118
|
+
sage: Q = G.quotient(S)
|
119
|
+
sage: Q
|
120
|
+
Permutation Group with generators [(1,2)(3,4), (1,3)(2,4)]
|
121
|
+
|
122
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
123
|
+
|
124
|
+
sage: Q.is_isomorphic(KleinFourGroup())
|
125
|
+
True
|
126
|
+
|
127
|
+
~~~~~~~~~~~~~~~~~~~~~~ ::
|
128
|
+
|
129
|
+
sage: G = DihedralGroup(8)
|
130
|
+
sage: N = G.normal_subgroups()
|
131
|
+
sage: l=[H.order() for H in N]; l.sort(); l
|
132
|
+
[1, 2, 4, 8, 8, 8, 16]
|
133
|
+
"""
|