These examples reveal a bug in the commutator method --- it ignores the domain of the permutation group. I have opened .github issue #39416 <https://github.com/sagemath/sage/issues/39416> for this.
On Tuesday, January 28, 2025 at 3:43:56 AM UTC-7 grh...@gmail.com wrote: > It seems that this is intended? The correct equivalent code is: > > sage: gens = [[(2, 4)], [(1, 2)]] > sage: pg = PermutationGroup(gens=gens); pg > Permutation Group with generators [(2,4), (1,2)] > sage: pg._libgap_() > Group([ (2,4), (1,2) ]) > sage: pg = PermutationGroup(gens=gens, domain={1, 2, 4}); pg > Permutation Group with generators [(2,4), (1,2)] > sage: pg._libgap_() > Group([ (2,3), (1,2) ]) > > Which is what's done at > > https://github.com/sagemath/sage/blob/develop/src/sage/graphs/generic_graph.py#L24161-L24170 > . > But I'm not an expert in this part of the code. > > Also, I didn't know we have a 25k lines file. > > On 1/28/25 10:27 AM, 'Peter Mueller' via sage-devel wrote: > > The following code shows that subgroups of automorphism groups of graphs > are > > handled wrongly: > > > > sage: g = Graph([[1, 2, 4], []]) > > sage: a = g.automorphism_group() > > sage: print(a) > > Permutation Group with generators [(2,4), (1,2)] > > sage: print(a.commutator()) > > Permutation Group with generators [(1,2,3)] > > > > Note that a.commutator() moves 3 though 3 is not a vertex of the graph. > > Somewhat strangely, if one defines directly a = PermutationGroup([[(2, > 4)], [(1, > > 2)]]), then a.commutator() returns the correct subgroup. > > > > By the way, it doesn't help if the n vertices of the graph consist of > the list > > [1..n]. I have a complicated example where the automorphism group is > computed > > correctly, but the action of the commutator subgroup is with respect to a > > different labeling of the vertices. > > > > -- Peter Mueller > > > > -- > > You received this message because you are subscribed to the Google > Groups "sage- > > devel" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email > > to sage-devel+...@googlegroups.com <mailto:sage- > > devel+un...@googlegroups.com>. > > To view this discussion visit > https://groups.google.com/d/msgid/sage-devel/ > > fec1df7a-9db7-43b2-9af2-8dcdf6658585n%40googlegroups.com <https:// > > groups.google.com/d/msgid/sage-devel/ > > fec1df7a-9db7-43b2-9af2-8dcdf6658585n%40googlegroups.com? > > utm_medium=email&utm_source=footer>. > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/sage-devel/6c0d0d79-71e2-445f-b207-50e8b8753fben%40googlegroups.com.