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.Tue, 21 Sep 2021 18:46:14 +0200entering permutation as product of not necessarily disjoint cycleshttps://ask.sagemath.org/question/59114/entering-permutation-as-product-of-not-necessarily-disjoint-cycles/I was expecting to get the identity when I did the following:
sage: G = SymmetricGroup(3)
sage: G('(1,2)(1,2)')
but I get (1,2).
How to tell Sage to compute a product of not necessarily disjoint cycles?Tue, 21 Sep 2021 18:39:30 +0200https://ask.sagemath.org/question/59114/entering-permutation-as-product-of-not-necessarily-disjoint-cycles/Answer by slelievre for <p>I was expecting to get the identity when I did the following:</p>
<pre><code>sage: G = SymmetricGroup(3)
sage: G('(1,2)(1,2)')
</code></pre>
<p>but I get (1,2).</p>
<p>How to tell Sage to compute a product of not necessarily disjoint cycles?</p>
https://ask.sagemath.org/question/59114/entering-permutation-as-product-of-not-necessarily-disjoint-cycles/?answer=59115#post-id-59115Here is one solution, suggested by the phrasing of the question itself.
Use a product of cycles, individually
turning each cycle into a group element:
sage: G = SymmetricGroup(3)
sage: G('(1,2)') * G('(1,2)')
()
Tue, 21 Sep 2021 18:46:14 +0200https://ask.sagemath.org/question/59114/entering-permutation-as-product-of-not-necessarily-disjoint-cycles/?answer=59115#post-id-59115