| | 200 | r""" |
| | 201 | Initializes instance of self, a \code{PermutationGroup_generic} object. |
| | 202 | The flag from_group determines whether or not self should be |
| | 203 | initialized as a Gap \code{Group} object and sent to the Gap |
| | 204 | interpreter. If gens are Gap objects, then self is intialized as a Gap |
| | 205 | \code{Group}. |
| | 206 | |
| | 207 | EXAMPLES: |
| | 208 | We explicitly construct the alternating group on four elements. |
| | 209 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 210 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 211 | sage: A4.__init__([[(1,2,3)],[(2,3,4)]]); A4 |
| | 212 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 213 | sage: A4.center() |
| | 214 | Permutation Group with generators [()] |
| | 215 | sage: loads(A4.dumps()) == A4 |
| | 216 | True |
| | 217 | """ |
| | 257 | r""" |
| | 258 | Returns a string showing how to declare / initialize self in Gap. |
| | 259 | Stored in the \code{self.__gap} attribute. |
| | 260 | |
| | 261 | EXAMPLES: |
| | 262 | The \code{_gap_init_} method shows how you would define the Sage |
| | 263 | \code{PermutationGroup_generic} object in Gap: |
| | 264 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 265 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 266 | sage: A4._gap_init_() |
| | 267 | 'Group([((1,2,3)), ((2,3,4))])' |
| | 268 | """ |
| | 272 | r""" |
| | 273 | Returns a string showing how to declare / intialize self in Magma. |
| | 274 | |
| | 275 | EXAMPLES: |
| | 276 | We explicitly construct the alternating group on four elements. In |
| | 277 | Magma, one would type the string below to construct the group. |
| | 278 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 279 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 280 | sage: A4._magma_init_() |
| | 281 | 'PermutationGroup<4 | (1,2,3), (2,3,4)>' |
| | 282 | """ |
| | 556 | r""" |
| | 557 | Returns the ith generator of self; that is, the ith element of the |
| | 558 | list \code{self.gens()}. |
| | 559 | |
| | 560 | EXAMPLES: |
| | 561 | We explicitly construct the alternating group on four elements: |
| | 562 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 563 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 564 | sage: A4.gens() |
| | 565 | ((1,2,3), (2,3,4)) |
| | 566 | sage: A4.gen(0) |
| | 567 | (1,2,3) |
| | 568 | sage: A4.gen(1) |
| | 569 | (2,3,4) |
| | 570 | sage: A4.gens()[0]; A4.gens()[1] |
| | 571 | (1,2,3) |
| | 572 | (2,3,4) |
| | 573 | """ |
| | 744 | r""" |
| | 745 | Returns a string describing self. |
| | 746 | |
| | 747 | EXAMPLES: |
| | 748 | We explicitly construct the alternating group on four elements. Note |
| | 749 | that |
| | 750 | the \code{AlternatingGroup} class has its own representation string: |
| | 751 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 752 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 753 | sage: A4._repr_() |
| | 754 | 'Permutation Group with generators [(1,2,3), (2,3,4)]' |
| | 755 | sage: AlternatingGroup(4)._repr_() |
| | 756 | 'Alternating group of order 4!/2 as a permutation group' |
| | 757 | """ |
| | 762 | r""" |
| | 763 | Method for describing self in LaTeX. Encapsulates \code{self.gens()} |
| | 764 | in angle brackets to denote that self in generated by these elements. |
| | 765 | Called by the \code{latex()} function. |
| | 766 | |
| | 767 | EXAMPLES: |
| | 768 | We explicitly construct the alternating group on four elements. |
| | 769 | sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 |
| | 770 | Permutation Group with generators [(1,2,3), (2,3,4)] |
| | 771 | sage: latex(A4) |
| | 772 | \langle (1,2,3), (2,3,4) \rangle |
| | 773 | sage: A4._latex_() |
| | 774 | '\\langle (1,2,3), (2,3,4) \\rangle' |
| | 775 | """ |
| | 1809 | r""" |
| | 1810 | Initialization method for the \code{PermutationGroup_subgroup} class. |
| | 1811 | |
| | 1812 | INPUTS: |
| | 1813 | ambient -- the ambient group from which to construct this subgroup |
| | 1814 | gens -- the generators of the subgroup |
| | 1815 | from_group -- True: subroup is generated from a Gap string representation of the generators |
| | 1816 | check-- True: checks if gens are indeed elements of the ambient group |
| | 1817 | |
| | 1818 | EXAMPLES: |
| | 1819 | An example involving the dihedral group on four elements. $D_8$ |
| | 1820 | contains a cyclic subgroup or order four: |
| | 1821 | sage: G = DihedralGroup(4) |
| | 1822 | sage: H = CyclicPermutationGroup(4) |
| | 1823 | sage: gens = H.gens(); gens |
| | 1824 | ((1,2,3,4),) |
| | 1825 | sage: S = PermutationGroup_subgroup(G,list(gens)) |
| | 1826 | sage: S |
| | 1827 | Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)] |
| | 1828 | sage: S.list() |
| | 1829 | [(), (1,2,3,4), (1,3)(2,4), (1,4,3,2)] |
| | 1830 | sage: S.ambient_group() |
| | 1831 | Dihedral group of order 8 as a permutation group |
| | 1832 | |
| | 1833 | However, $D_8$ does not contain a cyclic subgroup of order three: |
| | 1834 | sage: G = DihedralGroup(4) |
| | 1835 | sage: H = CyclicPermutationGroup(3) |
| | 1836 | sage: gens = H.gens() |
| | 1837 | sage: S = PermutationGroup_subgroup(G,list(gens)) |
| | 1838 | Traceback (most recent call last): |
| | 1839 | ... |
| | 1840 | TypeError: each generator must be in the ambient group |
| | 1841 | """ |
| | 1893 | r""" |
| | 1894 | Returns a string representation / description of the permutation |
| | 1895 | subgroup. |
| | 1896 | |
| | 1897 | EXAMPLES: |
| | 1898 | An example involving the dihedral group on four elements, $D_8$: |
| | 1899 | sage: G = DihedralGroup(4) |
| | 1900 | sage: H = CyclicPermutationGroup(4) |
| | 1901 | sage: gens = H.gens() |
| | 1902 | sage: S = PermutationGroup_subgroup(G, list(gens)) |
| | 1903 | sage: S |
| | 1904 | Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)] |
| | 1905 | sage: S._repr_() |
| | 1906 | 'Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)]' |
| | 1907 | """ |
| | 1914 | |
| | 1915 | EXAMPLES: |
| | 1916 | An example involving the dihedral group on four elements, $D_8$: |
| | 1917 | sage: G = DihedralGroup(4) |
| | 1918 | sage: H = CyclicPermutationGroup(4) |
| | 1919 | sage: gens = H.gens() |
| | 1920 | sage: S = PermutationGroup_subgroup(G, list(gens)) |
| | 1921 | sage: latex(S) |
| | 1922 | Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)] |
| | 1923 | sage: S._latex_() |
| | 1924 | 'Subgroup of Dihedral group of order 8 as a permutation group generated by [(1,2,3,4)]' |