On 2013-01-31, Jori Mantysalo <jori.mantys...@uta.fi> wrote: > There is function is_isomorphic in Sage, but there is not is_conjugate. > For curiosity I looked source, and it seems to be an oneliner to write > one: > > def are_conjugates(self, g1, g2): > """ > Returns ``True`` if ``g1`` and ``g2`` are conjugates under the > action of ``self``. > > EXAMPLES:: > > sage: G = SymmetricGroup(4) > sage: G1 = PermutationGroup(['(1,2)(3,4)', '(1,3)(2,4)']) > sage: G2 = PermutationGroup(['(1,2)', '(3,4)']) > sage: G3 = PermutationGroup(['(1,3)', '(2,4)']) > sage: G1.is_isomorphic(G2) > True > sage: G.are_conjugates(G1, G2) > False > sage: G.are_conjugates(G2, G3) > True > """ > # Add check for types here > return gap.IsConjugate(self, g1, g2).bool() > > However, I have never before modified the source code of Sage itself. At > least > two question came in mind: > > - What is naming policy? Should this be is_conjugate? What is best order for > arguments? Indeed, I would keep the naming as close to GAP's one as possible.
Aslo, please note that GAP's IsConjugate works for g1 and g2 being group elements, not only groups. So it's best to provide both versions, I think. > > - Should there be a function that only looks to cycle structure? I mean > something like > > sage: G1 = PermutationGroup(['(1,2)']) > sage: G2 = PermutationGroup(['(2,3)']) > sage: G1.is_conjugate(G2) > True > > ? I.e. in this example assuming group S_3 as acting group. Well, if it's less that the action of the full symmetric group, cyclic structure is not a guarantee of anything, even for group elements. > > and a third one is, of course: > > - Is this stupid idea at beginning, and if not, is this oneliner going to > blow > up when trying with real examples? no, why? Perhaps, if you're up it, it's best to start also adding that kind of functionality via libGAP... Dima > > -- > Jori Mäntysalo > -- 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 post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.