Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook Introduction/Permutation Groups/PermutationsNotes.ipynb

Project: Course
Views: 50
Kernel: Python 2 (SageMath)
from IPython.display import Image, VimeoVideo VimeoVideo("164623027")

Today, we've encounter two concepts from group theory(Permutations group and homomorphism). It is instructive to manipulate permutations. Assume that you have (12345672315674) \begin{pmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7\\ 2 & 3 & 1 & 5 & 6 & 7 & 4 \end{pmatrix} To check if your cycle decompositions is correct, plug list thact contains pair (element, its image), in our case [(1,2),(2,3),(3,1),(4,5),(5,6),(6,7),(7,4)][(1,2), (2,3), (3,1), (4,5), (5, 6), (6,7), (7,4)]

from sage.all import * #Because we are using Jupyter not sagemath's worksheet from permutations import permutations #Leave it print permutations([(1,2), (2,3), (3,1), (4,5), (5, 6), (6,7), (7,4)]) #Edit the input
[(1, 2, 3), (4, 5, 6, 7)]

For permutations group, you need to define the group first, then define an element by passing its representaion as string to the created group. Now you can do what ever you like.

G = SymmetricGroup(8) #Edit the group size r = G("(1, 2, 3), (4, 5, 6, 7)") s = G("(5,8)(4,7,3)") r*s
(1,2,4,8,5,6,3)

Zn\mathbb{Z}_n

Z10 = AbelianGroup([10]) Z10.cayley_table(names='elements')
* 1 f f^2 f^3 f^4 f^5 f^6 f^7 f^8 f^9 +---------------------------------------- 1| 1 f f^2 f^3 f^4 f^5 f^6 f^7 f^8 f^9 f| f f^2 f^3 f^4 f^5 f^6 f^7 f^8 f^9 1 f^2| f^2 f^3 f^4 f^5 f^6 f^7 f^8 f^9 1 f f^3| f^3 f^4 f^5 f^6 f^7 f^8 f^9 1 f f^2 f^4| f^4 f^5 f^6 f^7 f^8 f^9 1 f f^2 f^3 f^5| f^5 f^6 f^7 f^8 f^9 1 f f^2 f^3 f^4 f^6| f^6 f^7 f^8 f^9 1 f f^2 f^3 f^4 f^5 f^7| f^7 f^8 f^9 1 f f^2 f^3 f^4 f^5 f^6 f^8| f^8 f^9 1 f f^2 f^3 f^4 f^5 f^6 f^7 f^9| f^9 1 f f^2 f^3 f^4 f^5 f^6 f^7 f^8
H = SymmetricGroup(4) #Show all methods for G r = H("(1,3)") print len(dir(H)) #To see the methods remove len print len(dir(r)) print len([meth for meth in dir(r) if meth not in dir(H)])
385 210 116
T = AbelianGroup([4,4]) T.cayley_graph().show( color_by_label=True, edge_labels=True) #It doesn't work here, please go to PermutationsNotes.sagews file and run it
Graphics object consisting of 81 graphics primitives

Appendix: permutations source code

import permutations as pr pr??