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'

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-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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

Reply via email to