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