Let $S_n$ be the symmetric group over $\{1,2,\ldots,n\}$. Let $J$ be a subset of $\{1,\ldots, n-1\}$ and let $W_J$ be the subgroup of $S_n$ generated by $s_j, j\in J \subset \{1, \ldots, n-1\}$, where $s_j$'s are simple reflections. How to find the longest word in $W_J$ in Sage? The following is some codes.
W = SymmetricGroup(8)
[s1,s2,s3,s4,s5,s6,s7] = W.simple_reflections()
Thank you very much.