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,455 @@
1
+ # sage_setup: distribution = sagemath-repl
2
+ # sage.doctest: needs sage.graphs sage.groups sage.modules sage.rings.finite_rings
3
+ """
4
+ This file (./linalg_doctest.sage) was *autogenerated* from ./linalg.tex,
5
+ with sagetex.sty version 2011/05/27 v2.3.1.
6
+ It contains the contents of all the sageexample environments from this file.
7
+ You should be able to doctest this file with:
8
+ sage -t ./linalg_doctest.sage
9
+ It is always safe to delete this file; it is not used in typesetting your
10
+ document.
11
+
12
+ Sage example in ./linalg.tex, line 168::
13
+
14
+ sage: MS = MatrixSpace(ZZ,2,3); MS
15
+ Full MatrixSpace of 2 by 3 dense matrices over Integer Ring
16
+ sage: VS = VectorSpace(GF(3^2,'x'),3); VS
17
+ Vector space of dimension 3 over Finite Field in x of size 3^2
18
+
19
+ Sage example in ./linalg.tex, line 184::
20
+
21
+ sage: B = MatrixSpace(ZZ,2,3).basis()
22
+ sage: list(B)
23
+ [
24
+ [1 0 0] [0 1 0] [0 0 1] [0 0 0] [0 0 0] [0 0 0]
25
+ [0 0 0], [0 0 0], [0 0 0], [1 0 0], [0 1 0], [0 0 1]
26
+ ]
27
+
28
+ Sage example in ./linalg.tex, line 220::
29
+
30
+ sage: B[1,2]
31
+ [0 0 0]
32
+ [0 0 1]
33
+
34
+ Sage example in ./linalg.tex, line 260::
35
+
36
+ sage: A = matrix(GF(11), 2, 2, [1,0,0,2])
37
+ sage: B = matrix(GF(11), 2, 2, [0,1,1,0])
38
+ sage: MG = MatrixGroup([A,B])
39
+ sage: MG.cardinality()
40
+ 200
41
+ sage: identity_matrix(GF(11),2) in MG
42
+ True
43
+
44
+ Sage example in ./linalg.tex, line 292::
45
+
46
+ sage: MS = MatrixSpace(ZZ,2,3); A = MS([1,2,3,4,5,6]); A
47
+ [1 2 3]
48
+ [4 5 6]
49
+
50
+ Sage example in ./linalg.tex, line 323::
51
+
52
+ sage: a = matrix(); a.parent()
53
+ Full MatrixSpace of 0 by 0 dense matrices over Integer Ring
54
+
55
+ Sage example in ./linalg.tex, line 341::
56
+
57
+ sage: a = matrix(GF(8,'x'),3,4); a.parent()
58
+ Full MatrixSpace of 3 by 4 dense matrices over Finite Field
59
+ in x of size 2^3
60
+
61
+ Sage example in ./linalg.tex, line 356::
62
+
63
+ sage: g = graphs.PetersenGraph()
64
+ sage: m = matrix(g); m; m.parent()
65
+ [0 1 0 0 1 1 0 0 0 0]
66
+ [1 0 1 0 0 0 1 0 0 0]
67
+ [0 1 0 1 0 0 0 1 0 0]
68
+ [0 0 1 0 1 0 0 0 1 0]
69
+ [1 0 0 1 0 0 0 0 0 1]
70
+ [1 0 0 0 0 0 0 1 1 0]
71
+ [0 1 0 0 0 0 0 0 1 1]
72
+ [0 0 1 0 0 1 0 0 0 1]
73
+ [0 0 0 1 0 1 1 0 0 0]
74
+ [0 0 0 0 1 0 1 1 0 0]
75
+ Full MatrixSpace of 10 by 10 dense matrices over Integer Ring
76
+
77
+ Sage example in ./linalg.tex, line 380::
78
+
79
+ sage: A = matrix([[1,2],[3,4]])
80
+ sage: block_matrix([[A,-A],[2*A, A^2]])
81
+ [ 1 2|-1 -2]
82
+ [ 3 4|-3 -4]
83
+ [-----+-----]
84
+ [ 2 4| 7 10]
85
+ [ 6 8|15 22]
86
+
87
+ Sage example in ./linalg.tex, line 413::
88
+
89
+ sage: A = matrix([[1,2,3],[4,5,6]])
90
+ sage: block_matrix([1,A,0,0,-A,2], ncols=3)
91
+ [ 1 0| 1 2 3| 0 0]
92
+ [ 0 1| 4 5 6| 0 0]
93
+ [-----+--------+-----]
94
+ [ 0 0|-1 -2 -3| 2 0]
95
+ [ 0 0|-4 -5 -6| 0 2]
96
+
97
+ Sage example in ./linalg.tex, line 443::
98
+
99
+ sage: A = matrix([[1,2,3],[0,1,0]])
100
+ sage: block_diagonal_matrix(A, A.transpose())
101
+ [1 2 3|0 0]
102
+ [0 1 0|0 0]
103
+ [-----+---]
104
+ [0 0 0|1 0]
105
+ [0 0 0|2 1]
106
+ [0 0 0|3 0]
107
+
108
+ Sage example in ./linalg.tex, line 517::
109
+
110
+ sage: A = matrix(3,3,range(9))
111
+ sage: A[:,1] = vector([1,1,1]); A
112
+ [0 1 2]
113
+ [3 1 5]
114
+ [6 1 8]
115
+
116
+ Sage example in ./linalg.tex, line 535::
117
+
118
+ sage: A[::-1], A[:,::-1], A[::2,-1]
119
+ (
120
+ [6 1 8] [2 1 0]
121
+ [3 1 5] [5 1 3] [2]
122
+ [0 1 2], [8 1 6], [8]
123
+ )
124
+
125
+ Sage example in ./linalg.tex, line 571::
126
+
127
+ sage: A = matrix(ZZ,4,4,range(16)); A
128
+ [ 0 1 2 3]
129
+ [ 4 5 6 7]
130
+ [ 8 9 10 11]
131
+ [12 13 14 15]
132
+
133
+
134
+ Sage example in ./linalg.tex, line 587::
135
+
136
+ sage: A.matrix_from_rows_and_columns([0,2,3],[1,2])
137
+ [ 1 2]
138
+ [ 9 10]
139
+ [13 14]
140
+
141
+ Sage example in ./linalg.tex, line 639::
142
+
143
+ sage: MS = MatrixSpace(GF(3),2,3)
144
+ sage: MS.base_extend(GF(9,'x'))
145
+ Full MatrixSpace of 2 by 3 dense matrices over Finite Field
146
+ in x of size 3^2
147
+ sage: MS = MatrixSpace(ZZ,2,3)
148
+ sage: MS.change_ring(GF(3))
149
+ Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 3
150
+
151
+ Sage example in ./linalg.tex, line 1167::
152
+
153
+ sage: a = matrix(GF(7),4,3,[6,2,2,5,4,4,6,4,5,5,1,3]); a
154
+ [6 2 2]
155
+ [5 4 4]
156
+ [6 4 5]
157
+ [5 1 3]
158
+
159
+ Sage example in ./linalg.tex, line 1181::
160
+
161
+ sage: u = copy(identity_matrix(GF(7),4)); u[1:,0] = -a[1:,0]/a[0,0]
162
+ sage: u, u*a
163
+ (
164
+ [1 0 0 0] [6 2 2]
165
+ [5 1 0 0] [0 0 0]
166
+ [6 0 1 0] [0 2 3]
167
+ [5 0 0 1], [0 4 6]
168
+ )
169
+
170
+ Sage example in ./linalg.tex, line 1203::
171
+
172
+ sage: v = copy(identity_matrix(GF(7),4)); v.swap_rows(1,2)
173
+ sage: b = v*u*a; v, b
174
+ (
175
+ [1 0 0 0] [6 2 2]
176
+ [0 0 1 0] [0 2 3]
177
+ [0 1 0 0] [0 0 0]
178
+ [0 0 0 1], [0 4 6]
179
+ )
180
+
181
+ Sage example in ./linalg.tex, line 1225::
182
+
183
+ sage: w = copy(identity_matrix(GF(7),4))
184
+ sage: w[2:,1] = -b[2:,1]/b[1,1]; w, w*b
185
+ (
186
+ [1 0 0 0] [6 2 2]
187
+ [0 1 0 0] [0 2 3]
188
+ [0 0 1 0] [0 0 0]
189
+ [0 5 0 1], [0 0 0]
190
+ )
191
+
192
+ Sage example in ./linalg.tex, line 1325::
193
+
194
+ sage: A = matrix(GF(7),4,5,[4,4,0,2,4,5,1,6,5,4,1,1,0,1,0,5,1,6,6,2])
195
+ sage: A, A.echelon_form()
196
+ (
197
+ [4 4 0 2 4] [1 0 5 0 3]
198
+ [5 1 6 5 4] [0 1 2 0 6]
199
+ [1 1 0 1 0] [0 0 0 1 5]
200
+ [5 1 6 6 2], [0 0 0 0 0]
201
+ )
202
+
203
+ Sage example in ./linalg.tex, line 1512::
204
+
205
+ sage: a = matrix(ZZ, 4, 6, [2,1,2,2,2,-1,1,2,-1,2,1,-1,2,1,-1,\
206
+ ....: -1,2,2,2,1,1,-1,-1,-1]); a.echelon_form()
207
+ [ 1 2 0 5 4 -1]
208
+ [ 0 3 0 2 -6 -7]
209
+ [ 0 0 1 3 3 0]
210
+ [ 0 0 0 6 9 3]
211
+
212
+ Sage example in ./linalg.tex, line 1528::
213
+
214
+ sage: a.base_extend(QQ).echelon_form()
215
+ [ 1 0 0 0 5/2 11/6]
216
+ [ 0 1 0 0 -3 -8/3]
217
+ [ 0 0 1 0 -3/2 -3/2]
218
+ [ 0 0 0 1 3/2 1/2]
219
+
220
+ Sage example in ./linalg.tex, line 1561::
221
+
222
+ sage: A = matrix(ZZ,4,5,[4,4,0,2,4,5,1,6,5,4,1,1,0,1,0,5,1,6,6,2])
223
+ sage: H, U = A.echelon_form(transformation=True); H, U
224
+ (
225
+ [ 1 1 0 0 2] [ 0 1 1 -1]
226
+ [ 0 4 -6 0 -4] [ 0 -1 5 0]
227
+ [ 0 0 0 1 -2] [ 0 -1 0 1]
228
+ [ 0 0 0 0 0], [ 1 -2 -4 2]
229
+ )
230
+
231
+ Sage example in ./linalg.tex, line 1640::
232
+
233
+ sage: A = matrix(ZZ, 4, 5,\
234
+ ....: [-1,-1,-1,-2,-2,-2,1,1,-1,2,2,2,2,2,-1,2,2,2,2,2])
235
+ sage: S,U,V = A.smith_form(); S,U,V
236
+ (
237
+ [ 3 1 2 -1 0]
238
+ [1 0 0 0 0] [ 0 0 1 0] [ 0 0 0 0 1]
239
+ [0 1 0 0 0] [ 0 1 0 0] [ 1 1 1 1 -1]
240
+ [0 0 3 0 0] [ 1 -2 -4 1] [-3 -2 -3 -1 0]
241
+ [0 0 0 6 0], [ 0 0 4 -1], [ 1 0 0 -2 0]
242
+ )
243
+
244
+ Sage example in ./linalg.tex, line 1674::
245
+
246
+ sage: A.elementary_divisors()
247
+ [1, 1, 3, 6]
248
+ sage: S == U*A*V
249
+ True
250
+
251
+ Sage example in ./linalg.tex, line 1746::
252
+
253
+ sage: B = matrix(GF(7),5,4,[4,5,1,5,4,1,1,1,0,6,0,6,2,5,1,6,4,4,0,2])
254
+ sage: B.transpose().echelon_form()
255
+ [1 0 5 0 3]
256
+ [0 1 2 0 6]
257
+ [0 0 0 1 5]
258
+ [0 0 0 0 0]
259
+
260
+ Sage example in ./linalg.tex, line 1761::
261
+
262
+ sage: B.pivot_rows()
263
+ (0, 1, 3)
264
+ sage: B.transpose().pivots() == B.pivot_rows()
265
+ True
266
+
267
+ Sage example in ./linalg.tex, line 1818::
268
+
269
+ sage: R.<x> = PolynomialRing(GF(5),'x')
270
+ sage: A = random_matrix(R,2,3); A # random
271
+ [ 3*x^2 + x x^2 + 2*x 2*x^2 + 2]
272
+ [ x^2 + x + 2 2*x^2 + 4*x + 3 x^2 + 4*x + 3]
273
+ sage: while A.rank() < 2:
274
+ ....: A = random_matrix(R,2,3)
275
+
276
+ Sage example in ./linalg.tex, line 1830::
277
+
278
+ sage: b = random_matrix(R,2,1); b # random
279
+ [ 4*x^2 + 1]
280
+ [3*x^2 + 2*x]
281
+
282
+ Sage example in ./linalg.tex, line 1841::
283
+
284
+ sage: A.solve_right(b) # random
285
+ [(4*x^3 + 2*x + 4)/(3*x^3 + 2*x^2 + 2*x)]
286
+ [ (3*x^2 + 4*x + 3)/(x^3 + 4*x^2 + 4*x)]
287
+ [ 0]
288
+
289
+ Sage example in ./linalg.tex, line 1855::
290
+
291
+ sage: A.solve_right(b) == A\b
292
+ doctest:...: DeprecationWarning: the backslash operator has been deprecated; use A.solve_right(B) instead
293
+ See https://github.com/sagemath/sage/issues/36394 for details.
294
+ True
295
+
296
+ Sage example in ./linalg.tex, line 1910::
297
+
298
+ sage: a = matrix(QQ,3,5,[2,2,-1,-2,-1,2,-1,1,2,-1/2,2,-2,-1,2,-1/2])
299
+ sage: a.image()
300
+ Vector space of degree 5 and dimension 3 over Rational Field
301
+ Basis matrix:
302
+ [ 1 0 0 1/4 -11/32]
303
+ [ 0 1 0 -1 -1/8]
304
+ [ 0 0 1 1/2 1/16]
305
+ sage: a.right_kernel()
306
+ Vector space of degree 5 and dimension 2 over Rational Field
307
+ Basis matrix:
308
+ [ 1 0 0 -1/3 8/3]
309
+ [ 0 1 -1/2 11/12 2/3]
310
+
311
+ Sage example in ./linalg.tex, line 1941::
312
+
313
+ sage: a = matrix(ZZ,5,3,[1,1,122,-1,-2,1,-188,2,1,1,-10,1,-1,-1,-1])
314
+ sage: a.kernel()
315
+ Free module of degree 5 and rank 2 over Integer Ring
316
+ Echelon basis matrix:
317
+ [ 1 979 -11 -279 811]
318
+ [ 0 2079 -22 -569 1488]
319
+ sage: b = a.base_extend(QQ)
320
+ sage: b.kernel()
321
+ Vector space of degree 5 and dimension 2 over Rational Field
322
+ Basis matrix:
323
+ [ 1 0 -121/189 -2090/189 6949/63]
324
+ [ 0 1 -2/189 -569/2079 496/693]
325
+ sage: b.integer_kernel()
326
+ Free module of degree 5 and rank 2 over Integer Ring
327
+ Echelon basis matrix:
328
+ [ 1 979 -11 -279 811]
329
+ [ 0 2079 -22 -569 1488]
330
+
331
+ Sage example in ./linalg.tex, line 2301::
332
+
333
+ sage: A = matrix(GF(97), 4, 4,\
334
+ ....: [86,1,6,68,34,24,8,35,15,36,68,42,27,1,78,26])
335
+ sage: e1 = identity_matrix(GF(97),4)[0]
336
+ sage: U = matrix(A.transpose().maxspin(e1)).transpose()
337
+ sage: F = U^-1*A*U; F
338
+ [ 0 0 0 83]
339
+ [ 1 0 0 77]
340
+ [ 0 1 0 20]
341
+ [ 0 0 1 10]
342
+
343
+ Sage example in ./linalg.tex, line 2320::
344
+
345
+ sage: K.<x> = GF(97)[]
346
+ sage: P = x^4-sum(F[i,3]*x^i for i in range(4)); P
347
+ x^4 + 87*x^3 + 77*x^2 + 20*x + 14
348
+
349
+ Sage example in ./linalg.tex, line 2326::
350
+
351
+ sage: P == A.charpoly()
352
+ True
353
+
354
+ Sage example in ./linalg.tex, line 2502::
355
+
356
+ sage: A = matrix(ZZ,8,[[6,0,-2,4,0,0,0,-2],[14,-1,0,6,0,-1,-1,1],\
357
+ ....: [2,2,0,1,0,0,1,0],[-12,0,5,-8,0,0,0,4],\
358
+ ....: [0,4,0,0,0,0,4,0],[0,0,0,0,1,0,0,0],\
359
+ ....: [-14,2,0,-6,0,2,2,-1],[-4,0,2,-4,0,0,0,4]])
360
+ sage: A.frobenius_form()
361
+ [0 0 0 4 0 0 0 0]
362
+ [1 0 0 4 0 0 0 0]
363
+ [0 1 0 1 0 0 0 0]
364
+ [0 0 1 0 0 0 0 0]
365
+ [0 0 0 0 0 0 4 0]
366
+ [0 0 0 0 1 0 0 0]
367
+ [0 0 0 0 0 1 1 0]
368
+ [0 0 0 0 0 0 0 2]
369
+
370
+ Sage example in ./linalg.tex, line 2540::
371
+
372
+ sage: A.frobenius_form(1)
373
+ [x^4 - x^2 - 4*x - 4, x^3 - x^2 - 4, x - 2]
374
+
375
+ Sage example in ./linalg.tex, line 2547::
376
+
377
+ sage: F,K = A.frobenius_form(2)
378
+ sage: K
379
+ [ 1 -15/56 17/224 15/56 -17/896 0 -15/112 17/64]
380
+ [ 0 29/224 -13/224 -23/448 -17/896 -17/896 29/448 13/128]
381
+ [ 0 -75/896 75/896 -47/896 0 -17/896 -23/448 11/128]
382
+ [ 0 17/896 -29/896 15/896 0 0 0 0]
383
+ [ 0 0 0 0 1 0 0 0]
384
+ [ 0 0 0 0 0 1 0 0]
385
+ [ 0 1 0 0 0 0 1 0]
386
+ [ 0 -4/21 -4/21 -10/21 0 0 -2/21 1]
387
+
388
+ Sage example in ./linalg.tex, line 2573::
389
+
390
+ sage: K^-1*F*K == A
391
+ True
392
+
393
+ Sage example in ./linalg.tex, line 2621::
394
+
395
+ sage: S.<x> = QQ[]
396
+ sage: B = x*identity_matrix(8) - A
397
+ sage: B.elementary_divisors()
398
+ [1, 1, 1, 1, 1, x - 2, x^3 - x^2 - 4, x^4 - x^2 - 4*x - 4]
399
+
400
+ Sage example in ./linalg.tex, line 2629::
401
+
402
+ sage: A.frobenius_form(1)
403
+ [x^4 - x^2 - 4*x - 4, x^3 - x^2 - 4, x - 2]
404
+
405
+ Sage example in ./linalg.tex, line 2726::
406
+
407
+ sage: A = matrix(GF(7),4,[5,5,4,3,0,3,3,4,0,1,5,4,6,0,6,3])
408
+ sage: A.eigenvalues()
409
+ [4, 1, 2, 2]
410
+ sage: A.eigenvectors_right()
411
+ [(4, [(1, 5, 5, 1)], 1),
412
+ (1, [(0, 1, 1, 4)], 1),
413
+ (2, [(1, 3, 0, 1), (0, 0, 1, 1)], 2)]
414
+ sage: A.eigenspaces_right()
415
+ [(4,
416
+ Vector space of degree 4 and dimension 1 over Finite Field of size 7
417
+ User basis matrix:
418
+ [1 5 5 1]),
419
+ (1,
420
+ Vector space of degree 4 and dimension 1 over Finite Field of size 7
421
+ User basis matrix:
422
+ [0 1 1 4]),
423
+ (2,
424
+ Vector space of degree 4 and dimension 2 over Finite Field of size 7
425
+ User basis matrix:
426
+ [1 3 0 1]
427
+ [0 0 1 1])]
428
+
429
+ Sage example in ./linalg.tex, line 2770::
430
+
431
+ sage: A.eigenmatrix_right()
432
+ (
433
+ [4 0 0 0] [1 0 1 0]
434
+ [0 1 0 0] [5 1 3 0]
435
+ [0 0 2 0] [5 1 0 1]
436
+ [0 0 0 2], [1 4 1 1]
437
+ )
438
+
439
+ Sage example in ./linalg.tex, line 2930::
440
+
441
+ sage: A = matrix(ZZ,4,[3,-1,0,-1,0,2,0,-1,1,-1,2,0,1,-1,-1,3])
442
+ sage: A.jordan_form()
443
+ [3|0|0 0]
444
+ [-+-+---]
445
+ [0|3|0 0]
446
+ [-+-+---]
447
+ [0|0|2 1]
448
+ [0|0|0 2]
449
+
450
+ Sage example in ./linalg.tex, line 2949::
451
+
452
+ sage: J,U = A.jordan_form(transformation=True)
453
+ sage: U^-1*A*U == J
454
+ True
455
+ """