>>> I guess it'd be better to make g*h mean "first apply g, then h", since
>>> that's how other CAS that handle permutations do it.
>>
>> According to David, this is not the case. e.g. in gap (1, 2)*(2, 3)
>> gives a R to L multiplication of those cycles.
>>
>
> I would call gap's method L or R: first see what happens to 1 as you
> scan left to right:
> 1 goes to 2 which goes to 3, so 1 goes to 3, etc, This gives (1,3,2).

Very interesting way to look at it. Since I am looking at these as
shorthand for permutations, and you get the correct answer by applying
the rightmost permutations first. But if you think of trying to find
the correct cycle notation, you do so by reading left to right. So
perhaps the docstring should say that products of disjoint cycles
computes the product of the corresponding permutations from right to
left.

Note that at least one author (
http://www.usna.edu/Users/math/wdj/tonybook/gpthry/node13.html ) gets
this wrong, reconstructing the *cycle* by reading right to left. To
get the right permutation, apply permutations from right to left for a
given cycle notation; to get the cycle notation correct, read from
left to right. The example is

(1,2)*(2,4,5)*(1,3)*(1,2,5)

Here are the permutations (in left to right order) starting after the
identity with the result of applying that to the previous result:

[0, 1, 2, 3, 4, 5]
[0, 2, 1, 3, 4, 5] -> [0, 2, 1, 3, 4, 5]
[0, 1, 4, 3, 5, 2] -> [0, 2, 4, 3, 5, 1]
[0, 3, 2, 1, 4, 5] -> [0, 3, 4, 2, 5, 1]
[0, 2, 5, 3, 4, 1] -> [0, 4, 1, 2, 5, 3]

That answer, in cyclic form is, [[1, 4, 5, 3, 2]]. This is the result
you get when you process permutations from left to right or read cycle
notation from right to left.

If you do the reverse (apply permutations from right to left) or
cycles from left to right you get [[1, 4], [2, 3]] .

I'll add a note to the documentation.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to