# Ticket #10871: trac_10871-intersection-permutation-groups-v2.patch

File trac_10871-intersection-permutation-groups-v2.patch, 2.5 KB (added by rbeezer, 10 years ago)
• ## sage/groups/perm_gps/permgroup.py

```# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1299188053 28800
# Node ID c1af1d0a24733a90ffac4247374a34e2e6c7aabc
# Parent  8438b7c20d79c02a2ece3e1c3f7224a772ff8f07
10871: intersection of permutation groups

diff -r 8438b7c20d79 -r c1af1d0a2473 sage/groups/perm_gps/permgroup.py```
 a C = self._gap_().Center() return PermutationGroup(gap_group=C) def intersection(self, other): r""" Returns the permutation group that is the intersection of ``self`` and ``other``. INPUT: - ``other`` - a permutation group. OUTPUT: A permutation group that is the set-theoretic intersection of ``self`` with ``other``.  The groups are viewed as subgroups of a symmetric group big enough to contain both group's symbol sets.  So there is no strict notion of the two groups being subgroups of a common parent. EXAMPLES:: sage: H = DihedralGroup(4) sage: K = CyclicPermutationGroup(4) sage: H.intersection(K) Permutation Group with generators [(1,2,3,4)] sage: L = DihedralGroup(5) sage: H.intersection(L) Permutation Group with generators [(1,4)(2,3)] sage: M = PermutationGroup(["()"]) sage: H.intersection(M) Permutation Group with generators [()] Some basic properties. :: sage: H = DihedralGroup(4) sage: L = DihedralGroup(5) sage: H.intersection(L) == L.intersection(H) True sage: H.intersection(H) == H True The group ``other`` is verified as such.  :: sage: H = DihedralGroup(4) sage: H.intersection('junk') Traceback (most recent call last): ... TypeError: junk is not a permutation group """ from sage.categories.finite_permutation_groups import FinitePermutationGroups if other not in FinitePermutationGroups(): raise TypeError("{0} is not a permutation group".format(other)) return PermutationGroup(gap_group=gap.Intersection(self, other)) def direct_product(self,other,maps=True): """ Wraps GAP's ``DirectProduct``, ``Embedding``, and ``Projection``.