On Sun, Aug 26, 2012 at 7:50 PM, David Joyner <wdjoy...@gmail.com> wrote:
> On Sun, Aug 26, 2012 at 9:39 AM, Chris Smith <smi...@gmail.com> wrote:
>> Here's another idea: create a DisjointCycle object for which
>> multiplication is R to L. In use it would look like this:
>>
>>>>> C = DisjointCycle
>>>>> C(1, 2)*C(2, 3)
>> (1, 3, 2)
>>>>> Permutation(_).array_form(0)
>> [0, 3, 1, 2]
>>
>
> How would these be used to construct  permutation group?
> If you used elements of this class then the elements of a
> perm group would not be Perms but DisjointCycles?
>

in order to preserve the R to L multiplication, yes, they would have
to stay DC. But to convert to Permutation I would allow Permutation to
accept DC as shown above.  DisjointCycle is a defaultdict that gives a
value equal to the key. Multiplication switches around the entries. If
an element hasn't been addressed it returns itself. So in c, the first
element, 3, is at position 1 whereas in

>>> C(0, 1)*C(1,2)
(0, 2, 1)

the first 0 is at position 0 and in

>>> C(3, 4)*C(4, 5)
(3, 5, 4)

the first position is at 3. Conversion to array form will fill in the
missing values as in

>>> [_[i] for i in range(6)]
[0, 1, 2, 3, 5, 4]

/c

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

Reply via email to