[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-14 Thread David Joyner

I must be missing something. Why can't you just check the order of the element?


On Thu, May 14, 2009 at 7:53 PM, jimfar  wrote:
>
> I can generate a list from any given group, but how would I go about
> generating a list of just 3 or 5 cycles?
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-14 Thread jimfar

I can find the order of the element, but I am looking to generate a
list of all of the 3 cycles in something like AlternatingGroup(5)
where the list will not go on for too long.

On May 14, 5:04 pm, David Joyner  wrote:
> I must be missing something. Why can't you just check the order of the 
> element?
>
> On Thu, May 14, 2009 at 7:53 PM, jimfar  wrote:
>
> > I can generate a list from any given group, but how would I go about
> > generating a list of just 3 or 5 cycles?
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-14 Thread David Joyner

Why doesn't the obvious 1-liner

[x for x in AlternatingGroup(5) if x.order()==3]

work? Again, am I missing something?



On Thu, May 14, 2009 at 8:57 PM, jimfar  wrote:
>
> I can find the order of the element, but I am looking to generate a
> list of all of the 3 cycles in something like AlternatingGroup(5)
> where the list will not go on for too long.
>
> On May 14, 5:04 pm, David Joyner  wrote:
>> I must be missing something. Why can't you just check the order of the 
>> element?
>>
>> On Thu, May 14, 2009 at 7:53 PM, jimfar  wrote:
>>
>> > I can generate a list from any given group, but how would I go about
>> > generating a list of just 3 or 5 cycles?
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-14 Thread jimfar

Thanks, I was confusing myself with the definition of the order of an
element with order of the cycle.

On May 14, 6:52 pm, David Joyner  wrote:
> Why doesn't the obvious 1-liner
>
> [x for x in AlternatingGroup(5) if x.order()==3]
>
> work? Again, am I missing something?
>
> On Thu, May 14, 2009 at 8:57 PM, jimfar  wrote:
>
> > I can find the order of the element, but I am looking to generate a
> > list of all of the 3 cycles in something like AlternatingGroup(5)
> > where the list will not go on for too long.
>
> > On May 14, 5:04 pm, David Joyner  wrote:
> >> I must be missing something. Why can't you just check the order of the 
> >> element?
>
> >> On Thu, May 14, 2009 at 7:53 PM, jimfar  wrote:
>
> >> > I can generate a list from any given group, but how would I go about
> >> > generating a list of just 3 or 5 cycles?
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-14 Thread simon . king

Dear Jim,

On May 15, 4:03 am, jimfar  wrote:
> Thanks, I was confusing myself with the definition of the order of an
> element with order of the cycle.

Are you really confusing it?

As much as I understood, you only want those elements that have a
single (!) cycle of length 3. Then, order() is the wrong thing to ask
for!

sage: G=PermutationGroup([((1,2,3),(4,5,6))])
sage: G.0
(1,2,3)(4,5,6)
sage: G.0.order()
3

So, G.0 is not a 3-cycle, but it is of order 3.

I don't know if there is better way to test the number of cycles, but
you could do:
  [x for x in AlternatingGroup(5) if x.order()==3 and len(x.cycles())
==1]

The difference becomes apparent when you do it for AlternatingGroup
(6), rather than AlternatingGroup(5).

Cheers,
  Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How would I list just the 3 cycles in AlternatingGroup()

2009-05-15 Thread David Joyner

On Fri, May 15, 2009 at 2:36 AM,   wrote:
>
> Dear Jim,
>
> On May 15, 4:03 am, jimfar  wrote:
>> Thanks, I was confusing myself with the definition of the order of an
>> element with order of the cycle.
>
> Are you really confusing it?
>
> As much as I understood, you only want those elements that have a
> single (!) cycle of length 3. Then, order() is the wrong thing to ask
> for!
>
> sage: G=PermutationGroup([((1,2,3),(4,5,6))])
> sage: G.0
> (1,2,3)(4,5,6)
> sage: G.0.order()
> 3
>
> So, G.0 is not a 3-cycle, but it is of order 3.
>
> I don't know if there is better way to test the number of cycles, but
> you could do:
>  [x for x in AlternatingGroup(5) if x.order()==3 and len(x.cycles())
> ==1]
>
> The difference becomes apparent when you do it for AlternatingGroup
> (6), rather than AlternatingGroup(5).


The point is that for Alt(5) it is a simple one liner!

Of course, for more complicated groups, it is not the same thing as order=3
so you need to use len(x.cycle_tuples())==1.



>
> Cheers,
>      Simon
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---