On Mar 5, 4:13 am, Tom Boothby <tomas.boot...@gmail.com> wrote:
> Yes, and I think that Permutations should support exponentiation, too:
>
> sage: P = Permutation([1,2,3,4,5])
> sage: P^2
> Traceback (most recent call last):
> ...
> TypeError: unsupported operand type(s) for ** or pow():
> 'Permutation_class' and 'int'
>

I suppose Permutation_class does not delegate to GAP. Which might be
meaningful, given the
present inefficiency of doing this.

But why no exponentiation? This is weird. I cc to sage-combinat.

Dima



>
>
> On Fri, Mar 4, 2011 at 10:47 AM, Rob Beezer <goo...@beezer.cotse.net> wrote:
> > Any thoughts on the following inconsistency?  As near as I can tell,
> > the  inverse()  method is being supplied by some code meant for
> > combinatorics (words?).  Should permutation elements be given their
> > own inverse method?
>
> > sage: S = SymmetricGroup(4)
> > sage: s = S("(1,2,3)")
> > sage: type(s)
> > <type
> > 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>
> > sage: s^-1
> > (1,3,2)
> > sage: s.inverse()
> > (1,3,2)
>
> > sage: A = AlternatingGroup(4)
> > sage: a = A("(1,2,3)")
> > sage: type(a)
> > <type
> > 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>
> > sage: a^-1
> > (1,3,2)
> > sage: a.inverse()
> > ---------------------------------------------------------------------------
> > AttributeError                            Traceback (most recent call
> > last)
> > <snip>
> > AttributeError:
> > 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'
> > object has no attribute 'inverse'
>
> > --
> > To post to this group, send an email to sage-de...@googlegroups.com
> > To unsubscribe from this group, send an email to 
> > sage-devel+unsubscr...@googlegroups.com
> > For more options, visit this group 
> > athttp://groups.google.com/group/sage-devel
> > URL:http://www.sagemath.org

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

Reply via email to