Advertisement
thezer0th

aut.py

Nov 4th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import itertools as it
  2.  
  3. S4 = list(it.permutations(range(4)))
  4. X = {(0, 1, 2, 3), (1, 2, 0, 3), (2, 0, 1, 3)}
  5.  
  6. S4_inv = { s: inv for s in S4 for inv in S4 if all([s[inv[n]] == n for n in range(4)]) }
  7.  
  8. def aut(s, x):
  9. inv = S4_inv[s]
  10. return tuple(inv[x[s[n]]] for n in range(4))
  11.  
  12. Gx = { tuple(sorted(aut(s, x) for x in X)) for s in S4 }
  13. G_x = { s for s in S4 if all(aut(s, x) in X for x in X) }
  14.  
  15. print(f"Gx: {Gx}")
  16. print(f"G_x: {G_x}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement