# Ticket #10911: trac_10911-inverses-permutation-group-v2.patch

File trac_10911-inverses-permutation-group-v2.patch, 1.5 KB (added by rbeezer, 11 years ago)
• ## sage/groups/perm_gps/permgroup_element.pyx

```# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1299784522 28800
# Node ID 25aa3b3919010583fa0ce820b86d8a3f9495d046
# Parent  8438b7c20d79c02a2ece3e1c3f7224a772ff8f07
10911: inverse method for permutation group elements

diff -r 8438b7c20d79 -r 25aa3b391901 sage/groups/perm_gps/permgroup_element.pyx```
 a order = Integer(order_c) sage_free(seen) return int(order_c) if order is None else order def inverse(self): r""" Returns the inverse permutation. OUTPUT: For an element of a permutation group, this method returns the inverse element, which is both the inverse function and the inverse as an element of a group. EXAMPLES:: sage: s = PermutationGroupElement("(1,2,3)(4,5)") sage: s.inverse() (1,3,2)(4,5) sage: A = AlternatingGroup(4) sage: t = A("(1,2,3)") sage: t.inverse() (1,3,2) There are several ways (syntactically) to get an inverse of a permutation group element.  :: sage: s = PermutationGroupElement("(1,2,3,4)(6,7,8)") sage: s.inverse() == s^-1 True sage: s.inverse() == ~s True """ return ~self def sign(self): """