Ask Your Question
0

How to return s1*s2 of a symmetric group in Sage?

asked 2021-11-03 12:27:10 +0200

lijr07 gravatar image

I wrote a function and would like to return reduced expressions of the form in Sage.

def LongestPermInDoubleCoset(S1,w,S2): # longest element in S1 w S2, S1,S2 are subgroups of S_n

    winner = W.identity()
    for u1 in S1:
        for u2 in S2:
            t1=u1*w*u2
            if t1.length()>winner.length():
                winner=t1
    r=winner

return r

W=SymmetricGroup(6)
[s1,s2,s3,s4,s5] = W.simple_reflections()
S1=[W.identity(), s1]
S2=[W.identity(),s2]
t1=LongestPermInDoubleCoset(S1,s1,S2)
t2=t1.reduced_word()
t2

I obtained t2=[1,2]. But I would like to return s1*s2. How to do that? Thank you very much.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-11-03 16:20:10 +0200

Max Alekseyev gravatar image

updated 2021-11-03 16:33:34 +0200

I'm not sure what you mean under "return s1*s2" since s1 and s2 are two transpositions (not symbolic variables) and their product is t1. So, if you want their product, simply take t1. If you want to get them as a list like [s1,s2], then replace t2=t1.reduced_word() with

R = W.simple_reflections()
t2 = [R[s] for s in t1.reduced_word()]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-11-03 12:27:10 +0200

Seen: 113 times

Last updated: Nov 03 '21