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.Fri, 10 Apr 2020 18:01:42 +0200How to convert an element in a Symmetric group to a one-line notation in Sagehttps://ask.sagemath.org/question/50656/how-to-convert-an-element-in-a-symmetric-group-to-a-one-line-notation-in-sage/Let $S_n$ be the symmetric group over $\{1,2,\ldots,n\}$. Let $w=s_{i_1} \cdots s_{i_m} \in S_n$, where $s_i$'s are simple reflections. How to convert $w$ to a one-line notation in Sage? The following are my codes.
W = WeylGroup("A7", prefix="s")
[s1,s2,s3,s4,s5,s6,s7] = W.simple_reflections()
w=s2*s4*s6
I want to convert $w$ to a one line nation. Thank you very much.Fri, 10 Apr 2020 16:59:43 +0200https://ask.sagemath.org/question/50656/how-to-convert-an-element-in-a-symmetric-group-to-a-one-line-notation-in-sage/Answer by FrédéricC for <p>Let $S_n$ be the symmetric group over ${1,2,\ldots,n}$. Let $w=s_{i_1} \cdots s_{i_m} \in S_n$, where $s_i$'s are simple reflections. How to convert $w$ to a one-line notation in Sage? The following are my codes.</p>
<pre><code>W = WeylGroup("A7", prefix="s")
[s1,s2,s3,s4,s5,s6,s7] = W.simple_reflections()
w=s2*s4*s6
</code></pre>
<p>I want to convert $w$ to a one line nation. Thank you very much.</p>
https://ask.sagemath.org/question/50656/how-to-convert-an-element-in-a-symmetric-group-to-a-one-line-notation-in-sage/?answer=50658#post-id-50658Rather use the symmetric group, in that case.
sage: W = SymmetricGroup(8)
sage: [s1,s2,s3,s4,s5,s6,s7] = W.simple_reflections()
sage: w = s2*s4*s6; w
(2,3)(4,5)(6,7)
sage: w.tuple()
(1, 3, 2, 5, 4, 7, 6, 8)
Fri, 10 Apr 2020 18:01:42 +0200https://ask.sagemath.org/question/50656/how-to-convert-an-element-in-a-symmetric-group-to-a-one-line-notation-in-sage/?answer=50658#post-id-50658