-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.py
More file actions
executable file
·52 lines (44 loc) · 1.2 KB
/
Program.py
File metadata and controls
executable file
·52 lines (44 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import Models
import MyGroup
import Functions
def PrintTask(n):
k = 29
print('\n')
print('#' * k + " TASK {0} ".format(n) + '#' * k)
print()
G = Functions.MakeMyGroup()
#print("G = {0}".format(G))
'''task 1'''
PrintTask(1)
Functions.PrintOrders(G)
Functions.PrintSubgroupWithOrder(G, 4)
'''task 2'''
PrintTask(2)
H = Functions.GenerateGroup(MyGroup.ZQ(0, 3, 1))
print("H = <0, k> = {0}".format(str(H)))
Functions.PrintIfSubgroupIsNormal(G, H)
Functions.PrintClasses(G, H)
print('*' * 58)
Functions.PrintClasses(G, H, left=False)
'''task 3'''
PrintTask(3)
H = Functions.GenerateGroup(MyGroup.ZQ(1, 0, 1))
print("H = <1, 1> = {0}".format(str(H)))
Functions.PrintIfSubgroupIsNormal(G, H)
GH = Models.FactorGroup(G, H)
print("The G/H FactorGroup:\n{0}".format(GH))
print("Cayley table of the G/H FactorGroup:")
Functions.CayleyTable(GH)
'''task 4'''
PrintTask(4)
print(Functions.GenerateGroup(MyGroup.ZQ(0, 2, 1)))
print("Cayley table of the Group of Quaternions:")
Quat = Models.Group([MyGroup.Q(q, s) for q in range(4)
for s in range(1, -2, -2)])
Functions.CayleyTable(Quat)
'''task 5'''
PrintTask(5)
print("Commutant of the G group:")
print(Models.Commutant(G))