1 | { |
---|
2 | "cells": [ |
---|
3 | { |
---|
4 | "cell_type": "code", |
---|
5 | "execution_count": 1, |
---|
6 | "metadata": {}, |
---|
7 | "outputs": [], |
---|
8 | "source": [ |
---|
9 | "S = GF(8)\n", |
---|
10 | "T = S.multiplication_table()" |
---|
11 | ] |
---|
12 | }, |
---|
13 | { |
---|
14 | "cell_type": "code", |
---|
15 | "execution_count": 2, |
---|
16 | "metadata": {}, |
---|
17 | "outputs": [ |
---|
18 | { |
---|
19 | "data": { |
---|
20 | "text/plain": [ |
---|
21 | "* a b c d e f g h\n", |
---|
22 | " +----------------\n", |
---|
23 | "a| a a a a a a a a\n", |
---|
24 | "b| a b c d e f g h\n", |
---|
25 | "c| a c e g d b h f\n", |
---|
26 | "d| a d g f h e b c\n", |
---|
27 | "e| a e d h g c f b\n", |
---|
28 | "f| a f b e c h d g\n", |
---|
29 | "g| a g h b f d c e\n", |
---|
30 | "h| a h f c b g e d\n" |
---|
31 | ] |
---|
32 | }, |
---|
33 | "execution_count": 2, |
---|
34 | "metadata": {}, |
---|
35 | "output_type": "execute_result" |
---|
36 | } |
---|
37 | ], |
---|
38 | "source": [ |
---|
39 | "T" |
---|
40 | ] |
---|
41 | }, |
---|
42 | { |
---|
43 | "cell_type": "code", |
---|
44 | "execution_count": 3, |
---|
45 | "metadata": {}, |
---|
46 | "outputs": [ |
---|
47 | { |
---|
48 | "data": { |
---|
49 | "text/plain": [ |
---|
50 | "{\\setlength{\\arraycolsep}{2ex}\n", |
---|
51 | "\\begin{array}{r|*{8}{r}}\n", |
---|
52 | "\\multicolumn{1}{c|}{\\ast}&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
53 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
54 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
55 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
56 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
57 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
58 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
59 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
60 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
61 | "\\end{array}}" |
---|
62 | ] |
---|
63 | }, |
---|
64 | "execution_count": 3, |
---|
65 | "metadata": {}, |
---|
66 | "output_type": "execute_result" |
---|
67 | } |
---|
68 | ], |
---|
69 | "source": [ |
---|
70 | "latex(T)" |
---|
71 | ] |
---|
72 | }, |
---|
73 | { |
---|
74 | "cell_type": "code", |
---|
75 | "execution_count": 4, |
---|
76 | "metadata": {}, |
---|
77 | "outputs": [ |
---|
78 | { |
---|
79 | "data": { |
---|
80 | "text/html": [ |
---|
81 | "\\begin{array}{r|*{8}{r}}\n", |
---|
82 | "\\hfil\\ast\\hfil&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
83 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
84 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
85 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
86 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
87 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
88 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
89 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
90 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
91 | "\\end{array}" |
---|
92 | ], |
---|
93 | "text/latex": [ |
---|
94 | "\\[ {\\setlength{\\arraycolsep}{2ex}\n", |
---|
95 | "\\begin{array}{r|*{8}{r}}\n", |
---|
96 | "\\multicolumn{1}{c|}{\\ast}&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
97 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
98 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
99 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
100 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
101 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
102 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
103 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
104 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
105 | "\\end{array}} \\]" |
---|
106 | ], |
---|
107 | "text/plain": [ |
---|
108 | "* a b c d e f g h\n", |
---|
109 | " +----------------\n", |
---|
110 | "a| a a a a a a a a\n", |
---|
111 | "b| a b c d e f g h\n", |
---|
112 | "c| a c e g d b h f\n", |
---|
113 | "d| a d g f h e b c\n", |
---|
114 | "e| a e d h g c f b\n", |
---|
115 | "f| a f b e c h d g\n", |
---|
116 | "g| a g h b f d c e\n", |
---|
117 | "h| a h f c b g e d\n" |
---|
118 | ] |
---|
119 | }, |
---|
120 | "metadata": {}, |
---|
121 | "output_type": "display_data" |
---|
122 | } |
---|
123 | ], |
---|
124 | "source": [ |
---|
125 | "show(T)" |
---|
126 | ] |
---|
127 | }, |
---|
128 | { |
---|
129 | "cell_type": "code", |
---|
130 | "execution_count": 5, |
---|
131 | "metadata": {}, |
---|
132 | "outputs": [ |
---|
133 | { |
---|
134 | "data": { |
---|
135 | "text/html": [ |
---|
136 | "\\begin{array}{r|*{8}{r}}\n", |
---|
137 | "\\hfil\\ast\\hfil&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
138 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
139 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
140 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
141 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
142 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
143 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
144 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
145 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
146 | "\\end{array}" |
---|
147 | ], |
---|
148 | "text/latex": [ |
---|
149 | "\\[ {\\setlength{\\arraycolsep}{2ex}\n", |
---|
150 | "\\begin{array}{r|*{8}{r}}\n", |
---|
151 | "\\multicolumn{1}{c|}{\\ast}&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
152 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
153 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
154 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
155 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
156 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
157 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
158 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
159 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
160 | "\\end{array}} \\]" |
---|
161 | ], |
---|
162 | "text/plain": [ |
---|
163 | "* a b c d e f g h\n", |
---|
164 | " +----------------\n", |
---|
165 | "a| a a a a a a a a\n", |
---|
166 | "b| a b c d e f g h\n", |
---|
167 | "c| a c e g d b h f\n", |
---|
168 | "d| a d g f h e b c\n", |
---|
169 | "e| a e d h g c f b\n", |
---|
170 | "f| a f b e c h d g\n", |
---|
171 | "g| a g h b f d c e\n", |
---|
172 | "h| a h f c b g e d\n" |
---|
173 | ] |
---|
174 | }, |
---|
175 | "metadata": {}, |
---|
176 | "output_type": "display_data" |
---|
177 | } |
---|
178 | ], |
---|
179 | "source": [ |
---|
180 | "pretty_print(T)" |
---|
181 | ] |
---|
182 | }, |
---|
183 | { |
---|
184 | "cell_type": "code", |
---|
185 | "execution_count": 6, |
---|
186 | "metadata": {}, |
---|
187 | "outputs": [], |
---|
188 | "source": [ |
---|
189 | "f = sqrt(x)/x+2" |
---|
190 | ] |
---|
191 | }, |
---|
192 | { |
---|
193 | "cell_type": "code", |
---|
194 | "execution_count": 7, |
---|
195 | "metadata": {}, |
---|
196 | "outputs": [ |
---|
197 | { |
---|
198 | "data": { |
---|
199 | "text/plain": [ |
---|
200 | "1/sqrt(x) + 2" |
---|
201 | ] |
---|
202 | }, |
---|
203 | "execution_count": 7, |
---|
204 | "metadata": {}, |
---|
205 | "output_type": "execute_result" |
---|
206 | } |
---|
207 | ], |
---|
208 | "source": [ |
---|
209 | "f" |
---|
210 | ] |
---|
211 | }, |
---|
212 | { |
---|
213 | "cell_type": "code", |
---|
214 | "execution_count": 8, |
---|
215 | "metadata": {}, |
---|
216 | "outputs": [], |
---|
217 | "source": [ |
---|
218 | "%display latex" |
---|
219 | ] |
---|
220 | }, |
---|
221 | { |
---|
222 | "cell_type": "code", |
---|
223 | "execution_count": 9, |
---|
224 | "metadata": {}, |
---|
225 | "outputs": [ |
---|
226 | { |
---|
227 | "data": { |
---|
228 | "text/html": [ |
---|
229 | "<html>\\[\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{1}{\\sqrt{x}} + 2\\]</html>" |
---|
230 | ], |
---|
231 | "text/latex": [ |
---|
232 | "$$\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{1}{\\sqrt{x}} + 2$$" |
---|
233 | ], |
---|
234 | "text/plain": [ |
---|
235 | "1/sqrt(x) + 2" |
---|
236 | ] |
---|
237 | }, |
---|
238 | "execution_count": 9, |
---|
239 | "metadata": {}, |
---|
240 | "output_type": "execute_result" |
---|
241 | } |
---|
242 | ], |
---|
243 | "source": [ |
---|
244 | "f" |
---|
245 | ] |
---|
246 | }, |
---|
247 | { |
---|
248 | "cell_type": "code", |
---|
249 | "execution_count": 10, |
---|
250 | "metadata": {}, |
---|
251 | "outputs": [ |
---|
252 | { |
---|
253 | "data": { |
---|
254 | "text/html": [ |
---|
255 | "\\begin{array}{r|*{8}{r}}\n", |
---|
256 | "\\hfil\\ast\\hfil&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
257 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
258 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
259 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
260 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
261 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
262 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
263 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
264 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
265 | "\\end{array}" |
---|
266 | ], |
---|
267 | "text/latex": [ |
---|
268 | "\\[ {\\setlength{\\arraycolsep}{2ex}\n", |
---|
269 | "\\begin{array}{r|*{8}{r}}\n", |
---|
270 | "\\multicolumn{1}{c|}{\\ast}&a&b&c&d&e&f&g&h\\\\\\hline\n", |
---|
271 | "{}a&a&a&a&a&a&a&a&a\\\\\n", |
---|
272 | "{}b&a&b&c&d&e&f&g&h\\\\\n", |
---|
273 | "{}c&a&c&e&g&d&b&h&f\\\\\n", |
---|
274 | "{}d&a&d&g&f&h&e&b&c\\\\\n", |
---|
275 | "{}e&a&e&d&h&g&c&f&b\\\\\n", |
---|
276 | "{}f&a&f&b&e&c&h&d&g\\\\\n", |
---|
277 | "{}g&a&g&h&b&f&d&c&e\\\\\n", |
---|
278 | "{}h&a&h&f&c&b&g&e&d\\\\\n", |
---|
279 | "\\end{array}} \\]" |
---|
280 | ], |
---|
281 | "text/plain": [ |
---|
282 | "* a b c d e f g h\n", |
---|
283 | " +----------------\n", |
---|
284 | "a| a a a a a a a a\n", |
---|
285 | "b| a b c d e f g h\n", |
---|
286 | "c| a c e g d b h f\n", |
---|
287 | "d| a d g f h e b c\n", |
---|
288 | "e| a e d h g c f b\n", |
---|
289 | "f| a f b e c h d g\n", |
---|
290 | "g| a g h b f d c e\n", |
---|
291 | "h| a h f c b g e d\n" |
---|
292 | ] |
---|
293 | }, |
---|
294 | "execution_count": 10, |
---|
295 | "metadata": {}, |
---|
296 | "output_type": "execute_result" |
---|
297 | } |
---|
298 | ], |
---|
299 | "source": [ |
---|
300 | "T" |
---|
301 | ] |
---|
302 | }, |
---|
303 | { |
---|
304 | "cell_type": "code", |
---|
305 | "execution_count": null, |
---|
306 | "metadata": {}, |
---|
307 | "outputs": [], |
---|
308 | "source": [] |
---|
309 | } |
---|
310 | ], |
---|
311 | "metadata": { |
---|
312 | "kernelspec": { |
---|
313 | "display_name": "SageMath 9.4", |
---|
314 | "language": "sage", |
---|
315 | "name": "sagemath" |
---|
316 | }, |
---|
317 | "language_info": { |
---|
318 | "codemirror_mode": { |
---|
319 | "name": "ipython", |
---|
320 | "version": 3 |
---|
321 | }, |
---|
322 | "file_extension": ".py", |
---|
323 | "mimetype": "text/x-python", |
---|
324 | "name": "python", |
---|
325 | "nbconvert_exporter": "python", |
---|
326 | "pygments_lexer": "ipython3", |
---|
327 | "version": "3.9.6" |
---|
328 | } |
---|
329 | }, |
---|
330 | "nbformat": 4, |
---|
331 | "nbformat_minor": 4 |
---|
332 | } |
---|