Python de symmetric group

Python dihedral group

Since the program starts counting from 0 by default, I made a function to display from 1 which is usually used.

from sympy.combinatorics import *
from sympy import *
init_printing(pretty_print=False)

SymmetricGroup(3)[1]
#Permutation(2)(0, 1)
n = 3
def plusone(x):
    X = tuple([0])
    for i in range(n):
        a = tuple([tuple(x)[i] + 1])
        X = X + a
    return Permutation(tuple(X))
plusone(SymmetricGroup(3)[1])
#Permutation(3)(1, 2)

The goal is a product table of fifth-order symmetric groups.

Next article: Python de Symmetric Group 2-Qiita

Recommended Posts

Python de symmetric group 3
Python de symmetric group 2
Python de symmetric group
Python de BDD (in Lettuce)
Python
Let's create a free group with Python