ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 06 Jan 2018 16:19:36 +0100Is there a way to relabel the domain of a permutation group?https://ask.sagemath.org/question/36592/is-there-a-way-to-relabel-the-domain-of-a-permutation-group/ Suppose I have a permutation group on the domain {1,2,3,4,5}, but instead I wanted this permutation group to be on the domain {a,b,c,d,e}. Is there a way to achieve this? Hopefully something like the `relabel` method for graphs...Mon, 13 Feb 2017 02:12:31 +0100https://ask.sagemath.org/question/36592/is-there-a-way-to-relabel-the-domain-of-a-permutation-group/Answer by tmonteil for <p>Suppose I have a permutation group on the domain {1,2,3,4,5}, but instead I wanted this permutation group to be on the domain {a,b,c,d,e}. Is there a way to achieve this? Hopefully something like the <code>relabel</code> method for graphs...</p>
https://ask.sagemath.org/question/36592/is-there-a-way-to-relabel-the-domain-of-a-permutation-group/?answer=40500#post-id-40500I could not find such a method, b ut you can use the generators of your permutations group as follows:
sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
sage: G
Permutation Group with generators [(3,4), (1,2,3)(4,5)]
sage: d = {1:'a',2:'b',3:'c',4:'d',5:'e'}
sage: H = PermutationGroup([[d[i] for i in g.tuple()] for g in G.gens()], domain=d.values())
sage: H
Permutation Group with generators [('c','d'), ('a','b','c')('d','e')]
sage: H.domain()
{'a', 'b', 'c', 'd', 'e'}
sage: H.random_element()
('a','d','b','c')
sage: H.random_element()
('a','c')('b','d','e')Sat, 06 Jan 2018 16:19:36 +0100https://ask.sagemath.org/question/36592/is-there-a-way-to-relabel-the-domain-of-a-permutation-group/?answer=40500#post-id-40500