# Ticket #14791: trac_14791-review-ts.patch

File trac_14791-review-ts.patch, 14.8 KB (added by tscrim, 8 years ago)
• ## sage/groups/finitely_presented.py

# HG changeset patch
# User Travis Scrimshaw <tscrim at ucdavis.edu>
# Date 1378230149 25200
# Node ID 6367db73940102489b922cec8c42d7f1fc44850b
# Parent 951d0079daa9b5c6758250921b9a61362877a523
#14791: review patch.

diff --git a/sage/groups/finitely_presented.py b/sage/groups/finitely_presented.py
 a Finitely Presented Groups Finitely presented groups are constructed as quotients of :mod:~sage.groups.free_group :: :mod:~sage.groups.free_group:: sage: F. = FreeGroup() sage: G = F / [a^2, b^2, c^2, a*b*c*a*b*c] obtained by modding out the commutator s ... ValueError: the values do not satisfy all relations of the group .. warning:: .. WARNING:: Some methods are not guaranteed to finish since the word problem for finitely presented groups is, in general, undecidable. In obtained by modding out the commutator s REFERENCES: - http://en.wikipedia.org/wiki/Presentation_of_a_group - :wikipedia:Presentation_of_a_group - http://en.wikipedia.org/wiki/Word_problem_for_groups - :wikipedia:Word_problem_for_groups AUTHOR: class FinitelyPresentedGroupElement(Free def __reduce__(self): """ Used in pickling. TESTS:: sage: F. = FreeGroup() class FinitelyPresentedGroupElement(Free sage: H.simplified() Finitely presented group < a |  > b can be eliminated using the relation a=b. Any values that you plug into a word must satisfy this relation:: The generator b can be eliminated using the relation a=b. Any values that you plug into a word must satisfy this relation:: sage: A, B = H.gens() sage: w = A^2 * B def wrap_FpGroup(libgap_fpgroup): This function changes the comparison method of libgap_free_group to comparison by Python id. If you want to put the LibGAP free group into a container (set, dict) then you to put the LibGAP free group into a container (set, dict) then you should understand the implications of :meth:~sage.libs.gap.element.GapElement._set_compare_by_id. To be safe, it is recommended that you just work with the resulting def wrap_FpGroup(libgap_fpgroup): class FinitelyPresentedGroup(UniqueRepresentation, Group, ParentLibGAP): """ A class that wraps GAP's Finitely Presented Groups A class that wraps GAP's Finitely Presented Groups. .. warning:: .. WARNING:: You should use :meth:~sage.groups.free_group.FreeGroup_class.quotient to class FinitelyPresentedGroup(UniqueRepre def __init__(self, free_group, relations): """ The Python constructor The Python constructor. TESTS:: class FinitelyPresentedGroup(UniqueRepre def __reduce__(self): """ Used in pickling. TESTS:: sage: F = FreeGroup(4) class FinitelyPresentedGroup(UniqueRepre OUTPUT: The relations as a touple of elements of :meth:free_group. The relations as a tuple of elements of :meth:free_group. EXAMPLES:: class FinitelyPresentedGroup(UniqueRepre @cached_method def cardinality(self, limit=4096000): """ Compute the size of self. Compute the cardinality of self. INPUT: class FinitelyPresentedGroup(UniqueRepre def _element_constructor_(self, *args, **kwds): """ Construct an element of self. TESTS:: sage: G. = FreeGroup() class FinitelyPresentedGroup(UniqueRepre @cached_method def abelian_invariants(self): """ Return the abelian invariants of self. r""" Return the abelian invariants of self. The abelian invariants are given by a list of integers $i_1 \dots i_j$, such that the abelianization of the group is isomorphic to $\mathbb{Z}/(i_1) \\times \dots \\times \mathbb{Z}/(i_j)$. The abelian invariants are given by a list of integers (i_1, \ldots, i_j), such that the abelianization of the group is isomorphic to \ZZ / (i_1) \times \cdots \times \ZZ / (i_j). EXAMPLES:: class FinitelyPresentedGroup(UniqueRepre ALGORITHM: Uses GAP. Uses GAP. """ invariants = self.gap().AbelianInvariants() return tuple( i.sage() for i in invariants ) def simplification_isomorphism(self): """ Return an isomorphism from self to a finitely presented group with a (hopefully) simpler presentation. Return an isomorphism from self to a finitely presented group with a (hopefully) simpler presentation. EXAMPLES:: class FinitelyPresentedGroup(UniqueRepre ALGORITM: Uses GAP. Uses GAP. """ I = self.gap().IsomorphismSimplifiedFpGroup() domain = self class FinitelyPresentedGroup(UniqueRepre OUTPUT: A new finitely presented group. Use :meth:simplification_isomorphism if you want to know the :meth:simplification_isomorphism if you want to know the isomorphism. EXAMPLES::
• ## sage/groups/finitely_presented_named.py

diff --git a/sage/groups/finitely_presented_named.py b/sage/groups/finitely_presented_named.py
 a """ r""" Named Finitely Presented Groups Construct groups of small order and "named" groups as quotients of free groups. These from entries in [THOMAS-WOODS]_. Groups available as finite presentations: -- Cyclic group, $C_n$ of order $n$ - :func:groups.presentation.Cyclic  - Cyclic group, C_n of order n -- :func:groups.presentation.Cyclic  -- Dicyclic group, nonabelian groups of order $4n$ with a unique element of order 2 - :func:groups.presentation.DiCyclic  - Dicyclic group, nonabelian groups of order 4n with a unique element of order 2 -- :func:groups.presentation.DiCyclic  -- Dihedral group, $D_n$ of order $2n$ - :func:groups.presentation.Dihedral  - Dihedral group, D_n of order 2n -- :func:groups.presentation.Dihedral  -- Klein four group, C_2 \\times C_2 - :func:groups.presentation.KleinFour  - Klein four group, C_2 \times C_2 -- :func:groups.presentation.KleinFour  AUTHORS: EXAMPLES:: sage: groups.presentation.Cyclic(4) Finitely presented group < a | a^4 > You can also import the desired functions.:: You can also import the desired functions:: sage: from sage.groups.finitely_presented_named import CyclicPresentation sage: CyclicPresentation(4) from sage.groups.free_group import FreeG from sage.groups.finitely_presented import FinitelyPresentedGroup def CyclicPresentation(n): """ r""" Build cyclic group of order n as a finitely presented group. INPUT: def CyclicPresentation(n): return FinitelyPresentedGroup( F, rls ) def DihedralPresentation(n): """ Build the Dihedral group of order $2n$ as a finitely presented group. r""" Build the Dihedral group of order 2n as a finitely presented group. INPUT: def DihedralPresentation(n): return FinitelyPresentedGroup( F, rls ) def DiCyclicPresentation(n): """ Build the dicyclic group of order $4n$, for n\geq 2, as a finitely presented group. r""" Build the dicyclic group of order 4n, for n \geq 2, as a finitely presented group. INPUT: - n -- Possitive integer, 2 or greater, determining the order of the group (4n). - n -- positive integer, 2 or greater, determining the order of the group (4n). OUTPUT: def DiCyclicPresentation(n): .. MATH:: < a, x\mid a^{2n}=1, x^{2}=a^{n}, x^{-1}ax=a^{-1} > \langle a, x \mid a^{2n}=1, x^{2}=a^{n}, x^{-1}ax=a^{-1} \rangle .. note:: .. NOTE:: This group is also available as a permutation group via :class:groups.permutation.DiCyclic . def DiCyclicPresentation(n): return FinitelyPresentedGroup(F, rls) def KleinFourPresentation(): """ r""" Build the Klein group of order 4 as a finitely presented group. OUTPUT: Klein four group (C_2 \\times C_2) as a finitely presented group. Klein four group (C_2 \times C_2) as a finitely presented group. EXAMPLES::
• ## sage/groups/groups_catalog.py

diff --git a/sage/groups/groups_catalog.py b/sage/groups/groups_catalog.py
 a Let  indicate pressing the tab groups.matrix. to access various groups implemented as sets of matrices. - Permutation Groups  (groups.permutation.) - :class:groups.permutation.Symmetric  - :class:groups.permutation.Alternating  - :class:groups.permutation.KleinFour  - :class:groups.permutation.Quaternion  - :class:groups.permutation.Cyclic  - :class:groups.permutation.Dihedral  - :class:groups.permutation.DiCyclic  - :class:groups.permutation.Mathieu  - :class:groups.permutation.Suzuki  - :class:groups.permutation.PGL  - :class:groups.permutation.PSL  - :class:groups.permutation.PSp  - :class:groups.permutation.PSU  - :class:groups.permutation.PGU  - :class:groups.permutation.Transitive  - :class:groups.permutation.RubiksCube  - :class:groups.permutation.Symmetric  - :class:groups.permutation.Alternating  - :class:groups.permutation.KleinFour  - :class:groups.permutation.Quaternion  - :class:groups.permutation.Cyclic  - :class:groups.permutation.Dihedral  - :class:groups.permutation.DiCyclic  - :class:groups.permutation.Mathieu  - :class:groups.permutation.Suzuki  - :class:groups.permutation.PGL  - :class:groups.permutation.PSL  - :class:groups.permutation.PSp  - :class:groups.permutation.PSU  - :class:groups.permutation.PGU  - :class:groups.permutation.Transitive  - :class:groups.permutation.RubiksCube  - Matrix Groups (groups.matrix.) - :func:groups.matrix.QuaternionGF3  - :func:groups.matrix.GL  - :func:groups.matrix.SL  - :func:groups.matrix.Sp  - :func:groups.matrix.GU  - :func:groups.matrix.SU  - :func:groups.matrix.GO  - :func:groups.matrix.SO  - :func:groups.matrix.QuaternionGF3  - :func:groups.matrix.GL  - :func:groups.matrix.SL  - :func:groups.matrix.Sp  - :func:groups.matrix.GU  - :func:groups.matrix.SU  - :func:groups.matrix.GO  - :func:groups.matrix.SO  - Finitely Presented Groups (groups.presentation.) - :func:groups.presentation.Cyclic  - :func:groups.presentation.Dihedral  - :func:groups.presentation.DiCyclic  - :func:groups.presentation.KleinFour  - :func:groups.presentation.Cyclic  - :func:groups.presentation.Dihedral  - :func:groups.presentation.DiCyclic  - :func:groups.presentation.KleinFour  - Miscellaneous Groups (groups.misc.`) """