From abc9ef8c9270bea6e455c70bbce820e5a507aced Mon Sep 17 00:00:00 2001 From: Giorgos Mousa Date: Thu, 11 Apr 2024 18:05:24 +0300 Subject: [PATCH 1/4] Docstring improvements in groups --- src/sage/groups/abelian_gps/abelian_aut.py | 8 +- src/sage/groups/abelian_gps/abelian_group.py | 44 ++---- .../abelian_gps/abelian_group_element.py | 18 +-- .../groups/abelian_gps/abelian_group_gap.py | 44 ++---- .../abelian_gps/abelian_group_morphism.py | 8 +- .../groups/abelian_gps/dual_abelian_group.py | 12 +- .../abelian_gps/dual_abelian_group_element.py | 10 +- src/sage/groups/abelian_gps/element_base.py | 16 +-- src/sage/groups/abelian_gps/values.py | 30 ++-- .../additive_abelian_group.py | 11 +- .../additive_abelian_wrapper.py | 4 +- src/sage/groups/additive_abelian/qmodnz.py | 4 +- .../groups/additive_abelian/qmodnz_element.py | 6 +- src/sage/groups/affine_gps/affine_group.py | 12 +- src/sage/groups/affine_gps/group_element.py | 16 +-- src/sage/groups/artin.py | 29 ++-- src/sage/groups/braid.py | 136 ++++++------------ src/sage/groups/class_function.py | 111 ++++++-------- src/sage/groups/conjugacy_classes.py | 2 - src/sage/groups/cubic_braid.py | 14 +- src/sage/groups/finitely_presented.py | 56 ++------ src/sage/groups/finitely_presented_named.py | 34 ++--- src/sage/groups/fqf_orthogonal.py | 5 +- src/sage/groups/free_group.py | 29 ++-- src/sage/groups/generic.py | 30 ++-- src/sage/groups/group.pyx | 15 +- src/sage/groups/group_exp.py | 21 ++- src/sage/groups/group_semidirect_product.py | 4 +- src/sage/groups/libgap_mixin.py | 33 ++--- src/sage/groups/libgap_morphism.py | 23 ++- src/sage/groups/libgap_wrapper.pxd | 1 - src/sage/groups/libgap_wrapper.pyx | 61 +++----- .../groups/matrix_gps/finitely_generated.py | 15 +- src/sage/groups/matrix_gps/group_element.pyx | 4 +- .../groups/matrix_gps/group_element_gap.pyx | 2 +- src/sage/groups/matrix_gps/linear.py | 2 +- src/sage/groups/matrix_gps/matrix_group.py | 25 ++-- .../groups/matrix_gps/matrix_group_gap.py | 11 +- src/sage/groups/matrix_gps/named_group.py | 18 +-- src/sage/groups/matrix_gps/orthogonal.py | 20 +-- src/sage/groups/matrix_gps/symplectic.py | 2 +- src/sage/groups/matrix_gps/symplectic_gap.py | 2 +- src/sage/groups/matrix_gps/unitary.py | 14 +- src/sage/groups/matrix_gps/unitary_gap.py | 4 +- src/sage/groups/misc_gps/argument_groups.py | 60 ++------ src/sage/groups/misc_gps/imaginary_groups.py | 8 +- src/sage/groups/old.pyx | 12 +- src/sage/groups/perm_gps/constructor.py | 6 +- .../automorphism_group_canonical_label.pyx | 10 +- .../partn_ref/canonical_augmentation.pyx | 4 +- .../perm_gps/partn_ref/data_structures.pxd | 11 +- .../perm_gps/partn_ref/data_structures.pyx | 8 +- .../perm_gps/partn_ref/double_coset.pyx | 11 +- .../perm_gps/partn_ref/refinement_binary.pyx | 49 ++++--- .../perm_gps/partn_ref/refinement_graphs.pyx | 6 +- .../perm_gps/partn_ref/refinement_lists.pxd | 1 - .../partn_ref/refinement_matrices.pyx | 9 +- .../perm_gps/partn_ref/refinement_python.pyx | 28 +--- .../perm_gps/partn_ref/refinement_sets.pyx | 12 +- .../partn_ref2/refinement_generic.pyx | 19 +-- src/sage/groups/perm_gps/permgroup.py | 95 ++++-------- .../groups/perm_gps/permgroup_element.pyx | 42 +++--- src/sage/groups/perm_gps/permgroup_named.py | 128 ++++++----------- .../groups/perm_gps/symgp_conjugacy_class.py | 6 +- .../semimonomial_transformation.pyx | 4 +- .../semimonomial_transformation_group.py | 6 +- 66 files changed, 492 insertions(+), 1009 deletions(-) diff --git a/src/sage/groups/abelian_gps/abelian_aut.py b/src/sage/groups/abelian_gps/abelian_aut.py index b27f9bdb220..894b54f6736 100644 --- a/src/sage/groups/abelian_gps/abelian_aut.py +++ b/src/sage/groups/abelian_gps/abelian_aut.py @@ -176,9 +176,7 @@ def matrix(self): The `i`-th row is the exponent vector of the image of the `i`-th generator. - OUTPUT: - - - a square matrix over the integers + OUTPUT: a square matrix over the integers EXAMPLES:: @@ -315,9 +313,7 @@ def _coerce_map_from_(self, S): - ``S`` -- anything - OUTPUT: - - Boolean or nothing + OUTPUT: boolean or nothing EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/abelian_group.py b/src/sage/groups/abelian_gps/abelian_group.py index 90cdcaa42fd..a3db5c46179 100644 --- a/src/sage/groups/abelian_gps/abelian_group.py +++ b/src/sage/groups/abelian_gps/abelian_group.py @@ -448,7 +448,7 @@ def AbelianGroup(n, gens_orders=None, names="f"): def is_AbelianGroup(x): """ - Return True if ``x`` is an Abelian group. + Return ``True`` if ``x`` is an Abelian group. EXAMPLES:: @@ -558,9 +558,7 @@ def is_isomorphic(left, right): - ``right`` -- anything. - OUTPUT: - - Boolean. Whether ``left`` and ``right`` are isomorphic as abelian groups. + OUTPUT: boolean; whether ``left`` and ``right`` are isomorphic as abelian groups EXAMPLES:: @@ -682,9 +680,7 @@ def dual_group(self, names="X", base_ring=None): - ``base_ring`` -- the base ring. If ``None`` (default), then a suitable cyclotomic field is picked automatically. - OUTPUT: - - The :class:`dual abelian group `. + OUTPUT: the :class:`dual abelian group ` EXAMPLES:: @@ -721,7 +717,7 @@ def elementary_divisors(self): r""" This returns the elementary divisors of the group, using Pari. - .. note:: + .. NOTE:: Here is another algorithm for computing the elementary divisors `d_1, d_2, d_3, \ldots`, of a finite abelian group (where `d_1 | d_2 | d_3 | \ldots` @@ -736,9 +732,7 @@ def elementary_divisors(self): on these "smaller invariants" to compute `d_{i-1}`, and so on. (Thanks to Robert Miller for communicating this algorithm.) - OUTPUT: - - A tuple of integers. + OUTPUT: a tuple of integers EXAMPLES:: @@ -806,15 +800,13 @@ def identity(self): def _group_notation(self, eldv): """ - Return abstract group notation for generator orders ``eldv`` + Return abstract group notation for generator orders ``eldv``. INPUT: - ``eldv`` -- iterable of integers. - OUTPUT: - - String. + OUTPUT: a string EXAMPLES:: @@ -955,9 +947,7 @@ def gens_orders(self): Use :meth:`elementary_divisors` if you are looking for an invariant of the group. - OUTPUT: - - A tuple of integers. + OUTPUT: a tuple of integers EXAMPLES:: @@ -1018,9 +1008,7 @@ def invariants(self): Use :meth:`elementary_divisors` if you are looking for an invariant of the group. - OUTPUT: - - A tuple of integers. Zero means infinite cyclic factor. + OUTPUT: a tuple of integers; zero means infinite cyclic factor EXAMPLES:: @@ -1043,7 +1031,7 @@ def invariants(self): def is_cyclic(self): """ - Return True if the group is a cyclic group. + Return ``True`` if the group is a cyclic group. EXAMPLES:: @@ -1153,7 +1141,7 @@ def permutation_group(self): def is_commutative(self): """ - Return True since this group is commutative. + Return ``True`` since this group is commutative. EXAMPLES:: @@ -1787,11 +1775,9 @@ def __contains__(self, x): def ambient_group(self): """ - Return the ambient group related to self. + Return the ambient group related to ``self``. - OUTPUT: - - A multiplicative Abelian group. + OUTPUT: a multiplicative Abelian group EXAMPLES:: @@ -1879,9 +1865,7 @@ def gens(self) -> tuple: """ Return the generators for this subgroup. - OUTPUT: - - A tuple of group elements generating the subgroup. + OUTPUT: a tuple of group elements generating the subgroup EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/abelian_group_element.py b/src/sage/groups/abelian_gps/abelian_group_element.py index b081f1e1c4e..501872aaedd 100644 --- a/src/sage/groups/abelian_gps/abelian_group_element.py +++ b/src/sage/groups/abelian_gps/abelian_group_element.py @@ -120,22 +120,24 @@ def as_permutation(self): def word_problem(self, words): """ - TODO - this needs a rewrite - see stuff in the matrix_grp - directory. - - G and H are abelian groups, g in G, H is a subgroup of G generated - by a list (words) of elements of G. If self is in H, return the - expression for self as a word in the elements of (words). + ``G`` and ``H`` are abelian groups, ``g`` in ``G``, ``H`` is a + subgroup of ``G`` generated by a list (words) of elements of ``G``. If + ``self`` is in ``H``, return the expression for ``self`` as a word in + the elements of (words). This function does not solve the word problem in Sage. Rather it pushes it over to GAP, which has optimized (non-deterministic) algorithms for the word problem. - .. warning:: + .. WARNING:: - Don't use E (or other GAP-reserved letters) as a generator + Don't use ``E`` (or other GAP-reserved letters) as a generator name. + .. TODO:: + + This needs a rewrite - see stuff in the ``matrix_grp`` directory. + EXAMPLES:: sage: # needs sage.libs.gap diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py index 9ce83a6e33c..41316f3b433 100644 --- a/src/sage/groups/abelian_gps/abelian_group_gap.py +++ b/src/sage/groups/abelian_gps/abelian_group_gap.py @@ -92,9 +92,7 @@ def __reduce__(self): r""" Implement pickling. - OUTPUT: - - - a tuple ``f`` such that this element is ``f[0](*f[1])`` + OUTPUT: a tuple ``f`` such that this element is ``f[0](*f[1])`` EXAMPLES:: @@ -112,9 +110,7 @@ def exponents(self): r""" Return the tuple of exponents of this element. - OUTPUT: - - - a tuple of integers + OUTPUT: a tuple of integers EXAMPLES:: @@ -172,9 +168,7 @@ def order(self): r""" Return the order of this element. - OUTPUT: - - - an integer or infinity + OUTPUT: an integer or infinity EXAMPLES:: @@ -204,9 +198,7 @@ def exponents(self): r""" Return the tuple of exponents of ``self``. - OUTPUT: - - - a tuple of integers + OUTPUT: a tuple of integers EXAMPLES:: @@ -272,9 +264,7 @@ def _coerce_map_from_(self, S): - ``S`` -- anything - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -492,9 +482,7 @@ def gens_orders(self): Use :meth:`elementary_divisors` if you are looking for an invariant of the group. - OUTPUT: - - - a tuple of integers + OUTPUT: a tuple of integers EXAMPLES:: @@ -598,9 +586,7 @@ def subgroup(self, gens): - ``gens`` -- a list of elements coercible into this group - OUTPUT: - - - a subgroup + OUTPUT: a subgroup EXAMPLES:: @@ -643,9 +629,7 @@ class AbelianGroupGap(AbelianGroup_gap): - ``generator_orders`` -- a list of nonnegative integers where `0` gives a factor isomorphic to `\ZZ` - OUTPUT: - - - an abelian group + OUTPUT: an abelian group EXAMPLES:: @@ -850,9 +834,7 @@ def lift(self, x): - ``x`` -- an element of this subgroup - OUTPUT: - - The corresponding element of the ambient group + OUTPUT: the corresponding element of the ambient group EXAMPLES:: @@ -881,9 +863,7 @@ def retract(self, x): - ``x`` -- an element of the ambient group that actually lies in this subgroup. - OUTPUT: - - The corresponding element of this subgroup + OUTPUT: the corresponding element of this subgroup EXAMPLES:: @@ -980,9 +960,7 @@ def _coerce_map_from_(self, S): - ``S`` -- anything - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/abelian_group_morphism.py b/src/sage/groups/abelian_gps/abelian_group_morphism.py index e4b7b82b42b..a44abb83df9 100644 --- a/src/sage/groups/abelian_gps/abelian_group_morphism.py +++ b/src/sage/groups/abelian_gps/abelian_group_morphism.py @@ -44,10 +44,10 @@ def _repr_type(self): class AbelianGroupMorphism(Morphism): """ - Some python code for wrapping GAP's GroupHomomorphismByImages - function for abelian groups. Returns "fail" if gens does not - generate self or if the map does not extend to a group - homomorphism, self - other. + Some python code for wrapping GAP's ``GroupHomomorphismByImages`` + function for abelian groups. Returns "fail" if ``gens`` does not + generate ``self`` or if the map does not extend to a group + homomorphism, ``self`` - ``other``. EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/dual_abelian_group.py b/src/sage/groups/abelian_gps/dual_abelian_group.py index 4aecfd69816..7b1bbaee40d 100644 --- a/src/sage/groups/abelian_gps/dual_abelian_group.py +++ b/src/sage/groups/abelian_gps/dual_abelian_group.py @@ -78,7 +78,7 @@ def is_DualAbelianGroup(x): """ - Return True if `x` is the dual group of an abelian group. + Return ``True`` if `x` is the dual group of an abelian group. EXAMPLES:: @@ -271,9 +271,7 @@ def gens(self) -> tuple: """ Return the generators for the group. - OUTPUT: - - A tuple of group elements generating the group. + OUTPUT: a tuple of group elements generating the group EXAMPLES:: @@ -301,9 +299,7 @@ def gens_orders(self): """ The orders of the generators of the dual group. - OUTPUT: - - A tuple of integers. + OUTPUT: a tuple of integers EXAMPLES:: @@ -361,7 +357,7 @@ def order(self): def is_commutative(self): """ - Return True since this group is commutative. + Return ``True`` since this group is commutative. EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/dual_abelian_group_element.py b/src/sage/groups/abelian_gps/dual_abelian_group_element.py index 6fdb8a68c4e..ecf17404bdd 100644 --- a/src/sage/groups/abelian_gps/dual_abelian_group_element.py +++ b/src/sage/groups/abelian_gps/dual_abelian_group_element.py @@ -64,9 +64,7 @@ def is_DualAbelianGroupElement(x) -> bool: - ``x`` -- anything - OUTPUT: - - Boolean + OUTPUT: boolean EXAMPLES:: @@ -89,10 +87,8 @@ def __call__(self, g): """ Evaluate ``self`` on a group element ``g``. - OUTPUT: - - An element in - :meth:`~sage.groups.abelian_gps.dual_abelian_group.DualAbelianGroup_class.base_ring`. + OUTPUT: an element in + :meth:`~sage.groups.abelian_gps.dual_abelian_group.DualAbelianGroup_class.base_ring` EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/element_base.py b/src/sage/groups/abelian_gps/element_base.py index 0435c9835b9..43d77c29494 100644 --- a/src/sage/groups/abelian_gps/element_base.py +++ b/src/sage/groups/abelian_gps/element_base.py @@ -165,10 +165,6 @@ def _repr_(self): """ Return a string representation of ``self``. - OUTPUT: - - String. - EXAMPLES:: sage: G = AbelianGroup([2]) @@ -199,9 +195,7 @@ def _richcmp_(self, other, op): The comparison is based on the exponents. - OUTPUT: - - boolean + OUTPUT: boolean EXAMPLES:: @@ -220,9 +214,7 @@ def order(self): """ Return the order of this element. - OUTPUT: - - An integer or ``infinity``. + OUTPUT: an integer or ``infinity`` EXAMPLES:: @@ -335,9 +327,7 @@ def is_trivial(self): """ Test whether ``self`` is the trivial group element ``1``. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/values.py b/src/sage/groups/abelian_gps/values.py index 3db117123f0..eda0858b1f8 100644 --- a/src/sage/groups/abelian_gps/values.py +++ b/src/sage/groups/abelian_gps/values.py @@ -193,16 +193,12 @@ def __init__(self, domain, codomain): def _call_(self, x): """ - Return the value associated to ``x`` + Return the value associated to ``x``. INPUT: - ``x`` -- a group element - OUTPUT: - - Its value. - EXAMPLES:: sage: # needs sage.symbolic @@ -257,10 +253,8 @@ def value(self): """ Return the value of the group element. - OUTPUT: - - The value according to the values for generators, see - :meth:`~AbelianGroupWithValues.gens_values`. + OUTPUT: the value according to the values for generators; see + :meth:`~AbelianGroupWithValues.gens_values` EXAMPLES:: @@ -414,9 +408,7 @@ def gen(self, i=0): - ``i`` -- integer (default: 0). The index of the generator. - OUTPUT: - - A group element. + OUTPUT: a group element EXAMPLES:: @@ -442,9 +434,7 @@ def gens_values(self): """ Return the values associated to the generators. - OUTPUT: - - A tuple. + OUTPUT: a tuple EXAMPLES:: @@ -465,10 +455,8 @@ def values_group(self): units in a ring then the :meth:`values_group` would be the whole ring. - OUTPUT: - - The common parent of the values, containing the group - generated by all values. + OUTPUT: the common parent of the values, containing the group + generated by all values EXAMPLES:: @@ -486,9 +474,7 @@ def values_embedding(self): """ Return the embedding of ``self`` in :meth:`values_group`. - OUTPUT: - - A morphism. + OUTPUT: a morphism EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/additive_abelian_group.py b/src/sage/groups/additive_abelian/additive_abelian_group.py index 167b38a9cc0..394ef807944 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_group.py +++ b/src/sage/groups/additive_abelian/additive_abelian_group.py @@ -25,9 +25,8 @@ def AdditiveAbelianGroup(invs, remember_generators=True): generators (corresponding to the given invariants, which need not be in Smith form). - OUTPUT: - - The abelian group `\bigoplus_i \ZZ / n_i \ZZ`, where `n_i` are the invariants. + OUTPUT: the abelian group `\bigoplus_i \ZZ / n_i \ZZ`, where `n_i` are the + invariants EXAMPLES:: @@ -246,7 +245,7 @@ def _repr_(self): def _latex_(self): r""" - Returns a Latex representation of the group, using the invariants. + Return a Latex representation of the group, using the invariants. EXAMPLES:: @@ -375,7 +374,7 @@ def is_multiplicative(self): def is_cyclic(self): r""" - Returns ``True`` if the group is cyclic. + Return ``True`` if the group is cyclic. EXAMPLES: @@ -422,7 +421,7 @@ def __init__(self, cover, rels, gens): def gens(self) -> tuple: r""" - Return the specified generators for self (as a tuple). Compare + Return the specified generators for ``self`` (as a tuple). Compare ``self.smithform_gens()``. EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py index 3edddea25e7..c12a67725b6 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py +++ b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py @@ -160,7 +160,7 @@ def element(self): def _repr_(self): r""" - String representation of self. + String representation of ``self``. EXAMPLES:: @@ -290,7 +290,7 @@ def discrete_exp(self, v): r""" Given a list (or other iterable) of length equal to the number of generators of this group, compute the element of the ambient group - with those exponents in terms of the generators of self. + with those exponents in terms of the generators of ``self``. EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/qmodnz.py b/src/sage/groups/additive_abelian/qmodnz.py index db0b23d5fe4..34e9a0e9132 100644 --- a/src/sage/groups/additive_abelian/qmodnz.py +++ b/src/sage/groups/additive_abelian/qmodnz.py @@ -54,9 +54,7 @@ class QmodnZ(Parent, UniqueRepresentation): - `n` -- an integer (including 0 or negative integers). - OUTPUT: - - The abelian group `\Q/n\Z`. + OUTPUT: the abelian group `\Q/n\Z` EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/qmodnz_element.py b/src/sage/groups/additive_abelian/qmodnz_element.py index 10f92f76bf9..73557159161 100644 --- a/src/sage/groups/additive_abelian/qmodnz_element.py +++ b/src/sage/groups/additive_abelian/qmodnz_element.py @@ -38,9 +38,7 @@ class QmodnZ_Element(AdditiveGroupElement): - ``parent`` -- the parent abelian group `\Q/n\Z`. - OUTPUT: - - The element `q` of abelian group `\Q/n\Z`, in standard form. + OUTPUT: the element `q` of abelian group `\Q/n\Z`, in standard form EXAMPLES:: @@ -330,7 +328,7 @@ def _richcmp_(self, right, op): def additive_order(self): r""" - Returns the order of this element in the abelian group `\Q/n\Z`. + Return the order of this element in the abelian group `\Q/n\Z`. EXAMPLES:: diff --git a/src/sage/groups/affine_gps/affine_group.py b/src/sage/groups/affine_gps/affine_group.py index a811640c3c0..38fa05058e0 100644 --- a/src/sage/groups/affine_gps/affine_group.py +++ b/src/sage/groups/affine_gps/affine_group.py @@ -308,7 +308,7 @@ def degree(self): """ Return the dimension of the affine space. - OUTPUT: An integer. + OUTPUT: an integer EXAMPLES:: @@ -327,10 +327,8 @@ def matrix_space(self): Return the space of matrices representing the general linear transformations. - OUTPUT: - - The parent of the matrices `A` defining the affine group - element `Ax+b`. + OUTPUT: the parent of the matrices `A` defining the affine group + element `Ax+b` EXAMPLES:: @@ -393,7 +391,7 @@ def linear(self, A): - ``A`` -- anything that determines a matrix - OUTPUT: The affine group element `x \mapsto A x`. + OUTPUT: The affine group element `x \mapsto A x` EXAMPLES:: @@ -414,7 +412,7 @@ def translation(self, b): - ``b`` -- anything that determines a vector - OUTPUT: The affine group element `x \mapsto x + b`. + OUTPUT: The affine group element `x \mapsto x + b` EXAMPLES:: diff --git a/src/sage/groups/affine_gps/group_element.py b/src/sage/groups/affine_gps/group_element.py index 42546194bb6..703137784e4 100644 --- a/src/sage/groups/affine_gps/group_element.py +++ b/src/sage/groups/affine_gps/group_element.py @@ -145,7 +145,7 @@ def A(self): """ Return the general linear part of an affine group element. - OUTPUT: The matrix `A` of the affine group element `Ax + b`. + OUTPUT: The matrix `A` of the affine group element `Ax + b` EXAMPLES:: @@ -162,7 +162,7 @@ def b(self): """ Return the translation part of an affine group element. - OUTPUT: The vector `b` of the affine group element `Ax + b`. + OUTPUT: The vector `b` of the affine group element `Ax + b` EXAMPLES:: @@ -328,11 +328,8 @@ def _mul_(self, other): - ``other`` -- another element of the same affine group. - OUTPUT: - - The product of the affine group elements ``self`` and - ``other`` defined by the composition of the two affine - transformations. + OUTPUT: the product of the affine group elements ``self`` and + ``other`` defined by the composition of the two affine transformations EXAMPLES:: @@ -359,7 +356,7 @@ def __call__(self, v): - ``v`` -- a polynomial, a multivariate polynomial, a polyhedron, a vector, or anything that can be converted into a vector. - OUTPUT: The image of ``v`` under the affine group element. + OUTPUT: the image of ``v`` under the affine group element EXAMPLES:: @@ -402,7 +399,6 @@ def __call__(self, v): sage: cube = polytopes.cube() # needs sage.geometry.polyhedron sage: f(cube) # needs sage.geometry.polyhedron A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 8 vertices - """ parent = self.parent() @@ -455,7 +451,7 @@ def __invert__(self): """ Return the inverse group element. - OUTPUT: Another affine group element. + OUTPUT: another affine group element EXAMPLES:: diff --git a/src/sage/groups/artin.py b/src/sage/groups/artin.py index afb40463206..a198bccef69 100644 --- a/src/sage/groups/artin.py +++ b/src/sage/groups/artin.py @@ -51,9 +51,7 @@ def _latex_(self): r""" Return a LaTeX representation of ``self``. - OUTPUT: - - String. A valid LaTeX math command sequence. + OUTPUT: a string; a valid LaTeX math command sequence TESTS:: @@ -79,9 +77,7 @@ def exponent_sum(self): """ Return the exponent sum of ``self``. - OUTPUT: - - Integer. + OUTPUT: an integer EXAMPLES:: @@ -111,11 +107,10 @@ def coxeter_group_element(self, W=None): INPUT: - - ``W`` -- (default: ``self.parent().coxeter_group()``) the image Coxeter group - - OUTPUT: + - ``W`` -- (default: ``self.parent().coxeter_group()``) the image + Coxeter group - An element of the Coxeter group ``W``. + OUTPUT: an element of the Coxeter group ``W`` EXAMPLES:: @@ -263,10 +258,8 @@ def _left_normal_form_coxeter(self): Return the left normal form of the element, in the `\Delta` exponent and Coxeter group element form. - OUTPUT: - - A tuple whose first element is the power of `\Delta`, and the rest - are the Coxeter elements corresponding to the simple factors. + OUTPUT: a tuple whose first element is the power of `\Delta`, and the + rest are the Coxeter elements corresponding to the simple factors EXAMPLES:: @@ -515,9 +508,7 @@ def cardinality(self): """ Return the number of elements of ``self``. - OUTPUT: - - Infinity. + OUTPUT: Infinity EXAMPLES:: @@ -605,9 +596,7 @@ def index_set(self): """ Return the index set of ``self``. - OUTPUT: - - A tuple. + OUTPUT: a tuple EXAMPLES:: diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py index 3b48e00effd..71550739296 100644 --- a/src/sage/groups/braid.py +++ b/src/sage/groups/braid.py @@ -170,9 +170,7 @@ def components_in_closure(self): """ Return the number of components of the trace closure of the braid. - OUTPUT: - - Positive integer. + OUTPUT: a positive integer EXAMPLES:: @@ -442,9 +440,7 @@ def permutation(self, W=None): - ``W`` -- (optional) the permutation group to project ``self`` to; the default is ``self.parent().coxeter_group()`` - OUTPUT: - - The image of ``self`` under the natural projection map to ``W``. + OUTPUT: the image of ``self`` under the natural projection map to ``W`` EXAMPLES:: @@ -676,9 +672,8 @@ def LKB_matrix(self, variables='x,y'): - ``variables`` -- string (default: ``'x,y'``). A string containing the names of the variables, separated by a comma. - OUTPUT: - - The matrix corresponding to the Lawrence-Krammer-Bigelow representation of the braid. + OUTPUT: the matrix corresponding to the Lawrence-Krammer-Bigelow + representation of the braid EXAMPLES:: @@ -811,10 +806,9 @@ def links_gould_matrix(self, symbolics=False): are elements of a quotient ring of a three variate Laurent polynomial ring. - OUTPUT: - - The representation matrix of ``self`` over the ring according to the choice - of the keyword ``symbolics`` (see the corresponding explanation). + OUTPUT: the representation matrix of ``self`` over the ring according + to the choice of the keyword ``symbolics`` (see the corresponding + explanation) EXAMPLES:: @@ -849,9 +843,7 @@ def links_gould_polynomial(self, varnames=None, use_symbolics=False): - ``varnames`` -- string (default ``t0, t1``) - OUTPUT: - - A Laurent polynomial in the given variable names. + OUTPUT: a Laurent polynomial in the given variable names EXAMPLES:: @@ -908,9 +900,7 @@ def tropical_coordinates(self): r""" Return the tropical coordinates of ``self`` in the braid group `B_n`. - OUTPUT: - - - a list of `2n` tropical integers + OUTPUT: a list of `2n` tropical integers EXAMPLES:: @@ -1325,9 +1315,7 @@ def _annular_khovanov_complex_cached(self, qagrad, ring=None): - ``ring`` -- (default: ``ZZ``) the coefficient ring - OUTPUT: - - The annular Khovanov complex of the braid in the given grading. + OUTPUT: the annular Khovanov complex of the braid in the given grading .. NOTE:: @@ -1380,8 +1368,8 @@ def annular_khovanov_complex(self, qagrad=None, ring=None): OUTPUT: The annular Khovanov complex of the braid, given as a dictionary whose - keys are tuples of quantum and annular grading. - If ``qagrad`` is specified only return the chain complex of that grading. + keys are tuples of quantum and annular grading. If ``qagrad`` is + specified only return the chain complex of that grading. EXAMPLES:: @@ -1437,9 +1425,9 @@ def annular_khovanov_homology(self, qagrad=None, ring=IntegerRing()): OUTPUT: - If ``qagrad`` is ``None``, return a dictionary of homogies in all - gradings indexed by grading. If qagrad is specified, return homology - of that grading. + If ``qagrad`` is ``None``, return a dictionary of homologies in all + gradings indexed by grading. If ``qagrad`` is specified, return the + homology of that grading. .. NOTE:: @@ -1535,10 +1523,8 @@ def _left_normal_form_coxeter(self): r""" Return the left normal form of the braid, in permutation form. - OUTPUT: - - A tuple whose first element is the power of `\Delta`, and the - rest are the permutations corresponding to the simple factors. + OUTPUT: a tuple whose first element is the power of `\Delta`, and the + rest are the permutations corresponding to the simple factors EXAMPLES:: @@ -1633,7 +1619,6 @@ def centralizer(self): sage: b = B([2, 1, 3, 2]) sage: b.centralizer() [s1*s0*s2*s1, s0*s2] - """ c = centralizer(self) B = self.parent() @@ -1652,7 +1637,6 @@ def super_summit_set(self): (s0^-1*s1^-1*s0^-1)^2*s1^2*s0^3*s1, (s0^-1*s1^-1*s0^-1)^2*s1*s0^3*s1^2, s0^-1*s1^-1*s0^-2*s1^-1*s0*s1^3*s0] - """ sss = supersummitset(self) B = self.parent() @@ -1710,10 +1694,8 @@ def conjugating_braid(self, other): OUTPUT: - A conjugating braid. - - More precisely, if the output is `d`, `o` equals ``other``, and `s` equals ``self`` - then `o = d^{-1} \cdot s \cdot d`. + A conjugating braid. More precisely, if the output is `d`, `o` equals + ``other``, and `s` equals ``self`` then `o = d^{-1} \cdot s \cdot d`. EXAMPLES:: @@ -1798,10 +1780,9 @@ def pure_conjugating_braid(self, other): OUTPUT: - A pure conjugating braid. - - More precisely, if the output is `d`, `o` equals ``other``, and `s` equals ``self`` - then `o = d^{-1} \cdot s \cdot d`. + A pure conjugating braid. More precisely, if the output is `d`, `o` + equals ``other``, and `s` equals ``self`` then + `o = d^{-1} \cdot s \cdot d`. EXAMPLES:: @@ -1914,9 +1895,7 @@ def thurston_type(self): """ Return the thurston_type of ``self``. - OUTPUT: - - One of ``'reducible'``, ``'periodic'`` or ``'pseudo-anosov'``. + OUTPUT: one of ``'reducible'``, ``'periodic'`` or ``'pseudo-anosov'`` EXAMPLES:: @@ -1946,7 +1925,6 @@ def is_reducible(self): sage: a = B([2, 2, -1, -1, 2, 2]) sage: a.is_reducible() False - """ return self.thurston_type() == 'reducible' @@ -2002,9 +1980,7 @@ def sliding_circuits(self): """ Return the sliding circuits of the braid. - OUTPUT: - - A list of sliding circuits. Each sliding circuit is itself + OUTPUT: a list of sliding circuits. Each sliding circuit is itself a list of braids. EXAMPLES:: @@ -2081,9 +2057,7 @@ def deformed_burau_matrix(self, variab='q'): resulting laurent polynomial, which is the base ring for the free algebra constructed - OUTPUT: - - A matrix with elements in the free algebra ``self._algebra``. + OUTPUT: a matrix with elements in the free algebra ``self._algebra`` EXAMPLES:: @@ -2333,10 +2307,8 @@ def tuples(self): This is in the reduced form as outlined in Definition 4.1 of [HL2018]_. - OUTPUT: - - A dict of tuples of ints corresponding to the exponents in the - generators with values in the algebra's base ring. + OUTPUT: a dict of tuples of ints corresponding to the exponents in the + generators with values in the algebra's base ring EXAMPLES:: @@ -2384,9 +2356,7 @@ def reduced_word(self): r""" Return the (reduced) right quantum word. - OUTPUT: - - An element in the free algebra. + OUTPUT: an element in the free algebra EXAMPLES:: @@ -2619,11 +2589,7 @@ def __reduce__(self): def _repr_(self): """ - Return a string representation - - OUTPUT: - - String. + Return a string representation. TESTS:: @@ -2637,9 +2603,7 @@ def cardinality(self): """ Return the number of group elements. - OUTPUT: - - Infinity. + OUTPUT: Infinity TESTS:: @@ -2656,10 +2620,8 @@ def as_permutation_group(self): """ Return an isomorphic permutation group. - OUTPUT: - - This raises a :class:`ValueError` error since braid groups - are infinite. + OUTPUT: this raises a :class:`ValueError` error since braid groups + are infinite TESTS:: @@ -2675,9 +2637,7 @@ def strands(self): """ Return the number of strands. - OUTPUT: - - Integer. + OUTPUT: an integer EXAMPLES:: @@ -2753,10 +2713,7 @@ def _standard_lift_Tietze(self, p): - Every two strands cross each other at most once. - OUTPUT: - - A shortest word that represents the braid, - in Tietze list form. + OUTPUT: a shortest word that represents the braid, in Tietze list form EXAMPLES:: @@ -2887,9 +2844,7 @@ def _LKB_matrix_(self, braid, variab): appear in the matrix. They must be given as a string, separated by a comma - OUTPUT: - - The LKB matrix of the braid, with respect to the variables. + OUTPUT: the LKB matrix of the braid, with respect to the variables TESTS:: @@ -3036,9 +2991,7 @@ def TL_basis_with_drain(self, drain_size): - ``drain_size`` -- integer between 0 and the number of strands (both inclusive) - OUTPUT: - - A list of basis elements, each of which is a list of integers. + OUTPUT: a list of basis elements, each of which is a list of integers EXAMPLES: @@ -3220,10 +3173,8 @@ def TL_representation(self, drain_size, variab=None): entries of the matrices; if ``None``, then use a default variable in `\ZZ[A,A^{-1}]` - OUTPUT: - - A list of matrices corresponding to the representations of each - of the standard generators and their inverses. + OUTPUT: a list of matrices corresponding to the representations of each + of the standard generators and their inverses EXAMPLES:: @@ -3311,7 +3262,8 @@ def TL_representation(self, drain_size, variab=None): def mapping_class_action(self, F): """ - Return the action of self in the free group F as mapping class group. + Return the action of ``self`` in the free group F as mapping class + group. This action corresponds to the action of the braid over the punctured disk, whose fundamental group is the free group on @@ -3321,9 +3273,7 @@ def mapping_class_action(self, F): element with a braid. So you generally do not have to construct this action yourself. - OUTPUT: - - A :class:`MappingClassGroupAction`. + OUTPUT: a :class:`MappingClassGroupAction` EXAMPLES:: @@ -3650,9 +3600,7 @@ def _act_(self, b, x): - ``x`` -- a free group element. - OUTPUT: - - A new braid. + OUTPUT: a new braid TESTS:: diff --git a/src/sage/groups/class_function.py b/src/sage/groups/class_function.py index 6ca0d9ee2cb..0af4d5ce646 100644 --- a/src/sage/groups/class_function.py +++ b/src/sage/groups/class_function.py @@ -4,11 +4,13 @@ This module implements a wrapper of GAP's ClassFunction function. -NOTE: The ordering of the columns of the character table of a group -corresponds to the ordering of the list. However, in general there is -no way to canonically list (or index) the conjugacy classes of a group. -Therefore the ordering of the columns of the character table of -a group is somewhat random. +.. NOTE: + + The ordering of the columns of the character table of a group + corresponds to the ordering of the list. However, in general there is + no way to canonically list (or index) the conjugacy classes of a group. + Therefore the ordering of the columns of the character table of + a group is somewhat random. AUTHORS: @@ -53,7 +55,6 @@ def ClassFunction(group, values): - ``values`` -- list/tuple/iterable of numbers. The values of the class function on the conjugacy classes, in that order. - EXAMPLES:: sage: G = CyclicPermutationGroup(4) @@ -132,7 +133,7 @@ def __init__(self, G, values): def _gap_init_(self): r""" - Return a string showing how to declare / initialize self in Gap. + Return a string showing how to declare / initialize ``self`` in Gap. Stored in the \code{self._gap_string} attribute. EXAMPLES:: @@ -146,7 +147,7 @@ def _gap_init_(self): def _gap_(self, *args): r""" - Coerce self into a GAP element. + Coerce ``self`` into a GAP element. EXAMPLES:: @@ -182,7 +183,7 @@ def __repr__(self): def __iter__(self): r""" - Iterate through the values of self evaluated on the conjugacy + Iterate through the values of ``self`` evaluated on the conjugacy classes. EXAMPLES:: @@ -296,16 +297,13 @@ def __call__(self, g): def __add__(self, other): r""" - Return the sum of the characters self and other. + Return the sum of the characters of ``self`` and other. INPUT: - - ``other`` -- a :class:`ClassFunction` of the same group as - ``self``. - - OUTPUT: + - ``other`` -- a :class:`ClassFunction` of the same group as ``self`` - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -330,9 +328,7 @@ def __sub__(self, other): - ``other`` -- a :class:`ClassFunction` of the same group as ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -361,9 +357,7 @@ def __mul__(self, other): can be converted into GAP: integers, rational, and elements of certain number fields. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -376,7 +370,6 @@ def __mul__(self, other): sage: (3*chi1).values() [9, 3, -3, 0, -3] - sage: (1/2*chi1).values() [3/2, 1/2, -1/2, 0, -1/2] @@ -420,9 +413,7 @@ def __pos__(self): r""" Return ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -440,9 +431,7 @@ def __neg__(self): r""" Return the additive inverse of ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -458,7 +447,7 @@ def __neg__(self): def __pow__(self, other): r""" - Return the product of self with itself other times. + Return the product of ``self`` with itself other times. EXAMPLES:: @@ -475,7 +464,7 @@ def __pow__(self, other): def symmetric_power(self, n): r""" - Return the symmetrized product of self with itself ``n`` times. + Return the symmetrized product of ``self`` with itself ``n`` times. INPUT: @@ -501,21 +490,20 @@ def symmetric_power(self, n): def exterior_power(self, n): r""" - Return the anti-symmetrized product of self with itself ``n`` times. + Return the antisymmetrized product of ``self`` with itself ``n`` + times. INPUT: - ``n`` -- a positive integer. - OUTPUT: - - The ``n``-th anti-symmetrized power of ``self`` as a - :class:`ClassFunction`. + OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a + :class:`ClassFunction` EXAMPLES:: sage: chi = ClassFunction(SymmetricGroup(4), gap([3, 1, -1, 0, -1])) - sage: p = chi.exterior_power(3) # the highest anti-symmetric power for a 3-d character + sage: p = chi.exterior_power(3) # the highest antisymmetric power for a 3-d character sage: p Character of Symmetric group of order 4! as a permutation group sage: p.values() @@ -529,7 +517,7 @@ def exterior_power(self, n): def scalar_product(self, other): r""" - Return the scalar product of self with other. + Return the scalar product of ``self`` with other. EXAMPLES:: @@ -546,8 +534,8 @@ def scalar_product(self, other): def is_irreducible(self): r""" - Return True if self cannot be written as the sum of two nonzero - characters of self. + Return ``True`` if ``self`` cannot be written as the sum of two nonzero + characters of ``self``. EXAMPLES:: @@ -635,7 +623,7 @@ def norm(self): def values(self) -> list: r""" - Return the list of values of self on the conjugacy classes. + Return the list of values of ``self`` on the conjugacy classes. EXAMPLES:: @@ -1005,9 +993,7 @@ def __add__(self, other): - ``other`` -- a :class:`ClassFunction` of the same group as ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -1032,9 +1018,7 @@ def __sub__(self, other): - ``other`` -- a :class:`ClassFunction` of the same group as ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -1063,9 +1047,7 @@ def __mul__(self, other): can be converted into GAP: integers, rational, and elements of certain number fields. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -1078,7 +1060,6 @@ def __mul__(self, other): sage: (3*chi1).values() [9, 3, -3, 0, -3] - sage: (1/2*chi1).values() [3/2, 1/2, -1/2, 0, -1/2] @@ -1122,9 +1103,7 @@ def __pos__(self): r""" Return ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -1142,9 +1121,7 @@ def __neg__(self): r""" Return the additive inverse of ``self``. - OUTPUT: - - A :class:`ClassFunction` + OUTPUT: a :class:`ClassFunction` EXAMPLES:: @@ -1183,10 +1160,8 @@ def symmetric_power(self, n): - ``n`` -- a positive integer - OUTPUT: - - The ``n``-th symmetrized power of ``self`` as a - :class:`ClassFunction`. + OUTPUT: the ``n``-th symmetrized power of ``self`` as a + :class:`ClassFunction` EXAMPLES:: @@ -1203,21 +1178,19 @@ def symmetric_power(self, n): def exterior_power(self, n): r""" - Return the anti-symmetrized product of ``self`` with itself ``n`` times. + Return the antisymmetrized product of ``self`` with itself ``n`` times. INPUT: - ``n`` -- a positive integer - OUTPUT: - - The ``n``-th anti-symmetrized power of ``self`` as a - :class:`ClassFunction`. + OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a + :class:`ClassFunction` EXAMPLES:: sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1]) - sage: p = chi.exterior_power(3) # the highest anti-symmetric power for a 3-d character + sage: p = chi.exterior_power(3) # the highest antisymmetric power for a 3-d character sage: p Character of Symmetric group of order 4! as a permutation group sage: p.values() @@ -1338,7 +1311,7 @@ def norm(self): def values(self): r""" - Return the list of values of self on the conjugacy classes. + Return the list of values of ``self`` on the conjugacy classes. EXAMPLES:: @@ -1410,9 +1383,7 @@ def restrict(self, H): - ``H`` -- a subgroup of the underlying group of ``self``. - OUTPUT: - - A :class:`ClassFunction` of ``H`` defined by restriction. + OUTPUT: a :class:`ClassFunction` of ``H`` defined by restriction EXAMPLES:: diff --git a/src/sage/groups/conjugacy_classes.py b/src/sage/groups/conjugacy_classes.py index 147cc803842..2208389e17d 100644 --- a/src/sage/groups/conjugacy_classes.py +++ b/src/sage/groups/conjugacy_classes.py @@ -216,7 +216,6 @@ def __iter__(self): True sage: any(x == m2 for x in C) True - """ from sage.sets.recursively_enumerated_set import RecursivelyEnumeratedSet g = self._representative @@ -517,7 +516,6 @@ def set(self): sage: S = [(1,3,2,4), (1,4,3,2), (1,3,4,2), (1,2,3,4), (1,4,2,3), (1,2,4,3)] sage: C.set() == Set(G(x) for x in S) True - """ from sage.sets.set import Set try: diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py index c80da80520e..17e543687a4 100644 --- a/src/sage/groups/cubic_braid.py +++ b/src/sage/groups/cubic_braid.py @@ -807,10 +807,6 @@ def _repr_(self): r""" Return a string representation. - OUTPUT: - - String describing ``self``. - EXAMPLES:: sage: CubicBraidGroup(2) @@ -1423,10 +1419,8 @@ def braid_group(self): Return a :class:`BraidGroup` with identical generators, such that there exists an epimorphism to ``self``. - OUTPUT: - - A :class:`BraidGroup` having conversion maps to and from ``self`` - (which is just a section in the latter case). + OUTPUT: a :class:`BraidGroup` having conversion maps to and from + ``self`` (which is just a section in the latter case) EXAMPLES:: @@ -1973,9 +1967,7 @@ def order(self): To avoid long wait-time on calculations the order will be obtained using the classical realization. - OUTPUT: - - Cardinality of the group as Integer or infinity. + OUTPUT: cardinality of the group as integer or infinity EXAMPLES:: diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index 7d96975fe22..adb166093cd 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -269,10 +269,6 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. - EXAMPLES:: sage: G. = FreeGroup() @@ -300,9 +296,7 @@ def Tietze(self): the letter corresponding to the `i`-th generator of the group. Negative integers represent the inverses of generators. - OUTPUT: - - A tuple of integers. + OUTPUT: a tuple of integers EXAMPLES:: @@ -332,10 +326,8 @@ def __call__(self, *values, **kwds): ``True``). Whether to verify that ``values`` satisfy the relations in the finitely presented group. - OUTPUT: - - The product of ``values`` in the order and with exponents - specified by ``self``. + OUTPUT: the product of ``values`` in the order and with exponents + specified by ``self`` EXAMPLES:: @@ -386,9 +378,7 @@ def wrap_FpGroup(libgap_fpgroup): - ``libgap_fpgroup`` -- a LibGAP finitely presented group - OUTPUT: - - A Sage :class:`FinitelyPresentedGroup`. + OUTPUT: a Sage :class:`FinitelyPresentedGroup` EXAMPLES: @@ -813,10 +803,6 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. - TESTS:: sage: G. = FreeGroup() @@ -834,9 +820,7 @@ def _latex_(self): """ Return a LaTeX representation - OUTPUT: - - String. A valid LaTeX math command sequence. + OUTPUT: a string; a valid LaTeX math command sequence TESTS:: @@ -864,9 +848,7 @@ def free_group(self): """ Return the free group (without relations). - OUTPUT: - - A :func:`~sage.groups.free_group.FreeGroup`. + OUTPUT: a :func:`~sage.groups.free_group.FreeGroup` EXAMPLES:: @@ -883,9 +865,7 @@ def relations(self): """ Return the relations of the group. - OUTPUT: - - The relations as a tuple of elements of :meth:`free_group`. + OUTPUT: the relations as a tuple of elements of :meth:`free_group` EXAMPLES:: @@ -910,9 +890,7 @@ def cardinality(self, limit=4096000): - ``limit`` -- integer (default: 4096000). The maximal number of cosets before the computation is aborted. - OUTPUT: - - Integer or ``Infinity``. The number of elements in the group. + OUTPUT: integer or ``Infinity``; the number of elements in the group EXAMPLES:: @@ -1036,10 +1014,8 @@ def direct_product(self, H, reduced=False, new_names=True): to keep the old variable names, as they may change meaning in the output group if its presentation is reduced. - OUTPUT: - - The direct product of ``self`` with ``H`` as a finitely - presented group. + OUTPUT: the direct product of ``self`` with ``H`` as a finitely + presented group EXAMPLES:: @@ -1358,9 +1334,8 @@ def abelianization_map(self): r""" Return the abelianization map of ``self``. - OUTPUT: - - The abelianization map of ``self`` as a homomorphism of finitely presented groups. + OUTPUT: the abelianization map of ``self`` as a homomorphism of + finitely presented groups EXAMPLES:: @@ -1530,11 +1505,10 @@ def simplified(self): def sorted_presentation(self): """ - Return the same presentation with the relations sorted to ensure equality. - - OUTPUT: + Return the same presentation with the relations sorted to ensure + equality. - A new finitely presented group with the relations sorted. + OUTPUT: a new finitely presented group with the relations sorted EXAMPLES:: diff --git a/src/sage/groups/finitely_presented_named.py b/src/sage/groups/finitely_presented_named.py index d800bf014d0..256ad33404f 100644 --- a/src/sage/groups/finitely_presented_named.py +++ b/src/sage/groups/finitely_presented_named.py @@ -79,9 +79,7 @@ def CyclicPresentation(n): - ``n`` -- The order of the cyclic presentation to be returned. - OUTPUT: - - The cyclic group of order `n` as finite presentation. + OUTPUT: the cyclic group of order `n` as finite presentation EXAMPLES:: @@ -219,10 +217,8 @@ def FinitelyGeneratedHeisenbergPresentation(n=1, p=0): - ``p`` -- (optional) a prime number, where we construct the Heisenberg group over the finite field `\ZZ/p\ZZ` - OUTPUT: - - Finitely generated Heisenberg group over the finite field - of order ``p`` or over the integers. + OUTPUT: finitely generated Heisenberg group over the finite field + of order ``p`` or over the integers .. SEEALSO:: @@ -304,9 +300,7 @@ def DihedralPresentation(n): - ``n`` -- The size of the set that `D_n` is acting on. - OUTPUT: - - Dihedral group of order `2n`. + OUTPUT: Dihedral group of order `2n` EXAMPLES:: @@ -343,9 +337,7 @@ def DiCyclicPresentation(n): - ``n`` -- positive integer, 2 or greater, determining the order of the group (`4n`). - OUTPUT: - - The dicyclic group of order `4n` is defined by the presentation + OUTPUT: the dicyclic group of order `4n` is defined by the presentation .. MATH:: @@ -441,9 +433,7 @@ def QuaternionPresentation(): r""" Build the Quaternion group of order 8 as a finitely presented group. - OUTPUT: - - Quaternion group as a finite presentation. + OUTPUT: Quaternion group as a finite presentation EXAMPLES:: @@ -520,9 +510,7 @@ 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. + OUTPUT: Klein four group (`C_2 \times C_2`) as a finitely presented group EXAMPLES:: @@ -548,9 +536,7 @@ def BinaryDihedralPresentation(n): - ``n`` -- the value `n` - OUTPUT: - - The binary dihedral group of order `4n` as finite presentation. + OUTPUT: the binary dihedral group of order `4n` as finite presentation EXAMPLES:: @@ -579,9 +565,7 @@ def CactusPresentation(n): r""" Build the `n`-fruit cactus group as a finitely presented group. - OUTPUT: - - Cactus group `J_n` as a finitely presented group. + OUTPUT: Cactus group `J_n` as a finitely presented group EXAMPLES:: diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py index 8c996ad3c6a..f810e8dccb3 100644 --- a/src/sage/groups/fqf_orthogonal.py +++ b/src/sage/groups/fqf_orthogonal.py @@ -5,7 +5,6 @@ consists of all linear self-maps of `T` which preserve the torsion quadratic form. - EXAMPLES:: sage: L = IntegralLattice("A2").twist(2) # needs sage.graphs @@ -436,9 +435,7 @@ def _act_(self, g, a): - ``a`` -- an element of the invariant submodule - ``g`` -- an element of the acting group - OUTPUT: - - - an element of the invariant submodule + OUTPUT: an element of the invariant submodule EXAMPLES:: diff --git a/src/sage/groups/free_group.py b/src/sage/groups/free_group.py index 471940f6b95..1da411b3036 100644 --- a/src/sage/groups/free_group.py +++ b/src/sage/groups/free_group.py @@ -82,9 +82,7 @@ def is_FreeGroup(x): - ``x`` -- anything. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -245,9 +243,7 @@ def _latex_(self): r""" Return a LaTeX representation - OUTPUT: - - String. A valid LaTeX math command sequence. + OUTPUT: a string; a valid LaTeX math command sequence EXAMPLES:: @@ -305,9 +301,7 @@ def Tietze(self): the letter corresponding to the `i`-th generator of the group. Negative integers represent the inverses of generators. - OUTPUT: - - A tuple of integers. + OUTPUT: a tuple of integers EXAMPLES:: @@ -527,10 +521,8 @@ def __call__(self, *values): list/tuple/iterable of the same length as the number of generators of the free group. - OUTPUT: - - The product of ``values`` in the order and with exponents - specified by ``self``. + OUTPUT: the product of ``values`` in the order and with exponents + specified by ``self`` EXAMPLES:: @@ -700,9 +692,7 @@ def wrap_FreeGroup(libgap_free_group): - ``libgap_free_group`` -- a LibGAP free group. - OUTPUT: - - A Sage :class:`FreeGroup_class`. + OUTPUT: a Sage :class:`FreeGroup_class` EXAMPLES: @@ -792,13 +782,11 @@ def _repr_(self): def rank(self): """ - Return the number of generators of self. + Return the number of generators of ``self``. Alias for :meth:`ngens`. - OUTPUT: - - Integer. + OUTPUT: an integer EXAMPLES:: @@ -951,7 +939,6 @@ def quotient(self, relations, **kwds): Free Group on generators {a, b} sage: F1/[r] Finitely presented group < a, b, c, d | a*b*a^-1 > - """ from sage.groups.finitely_presented import FinitelyPresentedGroup return FinitelyPresentedGroup(self, tuple(map(self, relations) ), **kwds) diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index fccb76fe0ef..5a540088d2c 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -15,7 +15,6 @@ multiplication_names = ('multiplication', 'times', 'product', '*') addition_names = ('addition', 'plus', 'sum', '+') - Also included are a generic function for computing multiples (or powers), and an iterator for general multiples and powers. @@ -401,10 +400,12 @@ def bsgs(a, b, bounds, operation='*', identity=None, inverse=None, op=None): An integer `n` such that `a^n = b` (or `na = b`). If no such `n` exists, this function raises a :class:`ValueError` exception. - NOTE: This is a generalization of discrete logarithm. One - situation where this version is useful is to find the order of - an element in a group where we only have bounds on the group - order (see the elliptic curve example below). + .. NOTE:: + + This is a generalization of discrete logarithm. One + situation where this version is useful is to find the order of + an element in a group where we only have bounds on the group + order (see the elliptic curve example below). ALGORITHM: Baby step giant step. Time and space are soft `O(\sqrt{n})` where `n` is the difference between upper and lower @@ -992,7 +993,7 @@ def discrete_log_lambda(a, base, bounds, operation='*', identity=None, inverse=N - op() -- function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group - hash_function -- having an efficient hash function is critical for this algorithm - OUTPUT: Returns an integer `n` such that `a=base^n` (or `a=n*base`) + OUTPUT: an integer `n` such that `a=base^n` (or `a=n*base`) ALGORITHM: Pollard Lambda, if bounds are (lb,ub) it has time complexity O(sqrt(ub-lb)) and space complexity O(log(ub-lb)) @@ -1213,10 +1214,10 @@ def order_from_multiple(P, m, plist=None, factorization=None, check=True, - ``inverse()`` -- function of 1 argument ``x``, returning inverse of ``x``; - ``op()`` - function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group. - .. note:: + .. NOTE:: - It is more efficient for the caller to factor ``m`` and cache - the factors for subsequent calls. + It is more efficient for the caller to factor ``m`` and cache + the factors for subsequent calls. EXAMPLES:: @@ -1362,8 +1363,7 @@ def order_from_bounds(P, bounds, d=None, operation='+', - ``op()`` -- a function of 2 arguments defining the group binary operation. - - .. note:: + .. NOTE:: Typically ``lb`` and ``ub`` will be bounds on the group order, and from previous calculation we know that the group order is @@ -1549,9 +1549,7 @@ def merge_points(P1, P2, operation='+', - ``op()`` -- a function of 2 arguments defining the group binary operation. - OUTPUT: - - A pair `(g_3,n_3)` where `g_3` has order `n_3=\hbox{lcm}(n_1,n_2)`. + OUTPUT: a pair `(g_3,n_3)` where `g_3` has order `n_3=\hbox{lcm}(n_1,n_2)` EXAMPLES:: @@ -1631,9 +1629,7 @@ def structure_description(G, latex=False): - ``latex`` -- a boolean (default: ``False``). If ``True``, return a LaTeX formatted string. - OUTPUT: - - string + OUTPUT: a string .. WARNING:: diff --git a/src/sage/groups/group.pyx b/src/sage/groups/group.pyx index 9ecbfde9d6f..2f1a6cc1846 100644 --- a/src/sage/groups/group.pyx +++ b/src/sage/groups/group.pyx @@ -29,9 +29,7 @@ def is_Group(x): - ``x`` -- anything. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -175,7 +173,7 @@ cdef class Group(Parent): def is_finite(self): """ - Returns True if this group is finite. + Return ``True`` if this group is finite. EXAMPLES:: @@ -223,8 +221,7 @@ cdef class Group(Parent): def is_multiplicative(self): r""" - Returns True if the group operation is given by \* (rather than - +). + Return ``True`` if the group operation is given by \* (rather than +). Override for additive groups. @@ -239,11 +236,9 @@ cdef class Group(Parent): def _an_element_(self): """ - Return an element - - OUTPUT: + Return an element. - An element of the group. + OUTPUT: an element of the group EXAMPLES:: diff --git a/src/sage/groups/group_exp.py b/src/sage/groups/group_exp.py index ffae5e73cb2..58d9ba4b512 100644 --- a/src/sage/groups/group_exp.py +++ b/src/sage/groups/group_exp.py @@ -111,9 +111,8 @@ def _apply_functor(self, x): - A commutative additive group `x` - OUTPUT: - - - An isomorphic group whose operation is multiplication rather than addition. + OUTPUT: an isomorphic group whose operation is multiplication rather + than addition In the following example, ``self`` is the functor `GroupExp()`, `x` is the additive group `QQ^2`, and the output group is stored as `EQ2`. @@ -143,12 +142,13 @@ def _apply_functor_to_morphism(self, f): - A homomorphism `f` of commutative additive groups. - OUTPUT: + OUTPUT: the above homomorphism, but between the corresponding + multiplicative groups - The above homomorphism, but between the corresponding multiplicative groups. - In the following example, ``self`` is the functor `GroupExp()` and `f` is an endomorphism of the - additive group of integers. + In the following example, ``self`` is the functor `GroupExp()` and `f` + is an endomorphism of the additive group of integers. EXAMPLES:: @@ -245,11 +245,9 @@ class GroupExp_Class(UniqueRepresentation, Parent): INPUT: - - `G`: a commutative additive group - - OUTPUT: + - `G` -- a commutative additive group - - The multiplicative form of `G`. + OUTPUT: the multiplicative form of `G` EXAMPLES:: @@ -263,7 +261,6 @@ def __init__(self, G): sage: EG = GroupExp()(QQ^2) sage: TestSuite(EG).run(skip = "_test_elements") - """ if G not in CommutativeAdditiveGroups(): raise TypeError("%s must be a commutative additive group" % G) @@ -307,7 +304,6 @@ def one(self): (1, 0) sage: x == x * G.one() True - """ return GroupExpElement(self, self._G.zero()) @@ -349,7 +345,6 @@ def group_generators(self): sage: GroupExp()(ZZ).group_generators() (1,) - """ if hasattr(self._G, 'gens'): additive_generators = self._G.gens() diff --git a/src/sage/groups/group_semidirect_product.py b/src/sage/groups/group_semidirect_product.py index 1805dbbc53a..0c8ba8a96aa 100644 --- a/src/sage/groups/group_semidirect_product.py +++ b/src/sage/groups/group_semidirect_product.py @@ -291,8 +291,8 @@ def check_implemented_group(x): def act_to_right(self): r""" - True if the left factor acts on the right factor and - False if the right factor acts on the left factor. + Return ``True`` if the left factor acts on the right factor and + ``False`` if the right factor acts on the left factor. EXAMPLES:: diff --git a/src/sage/groups/libgap_mixin.py b/src/sage/groups/libgap_mixin.py index 476fb4e9416..aeb100f2ca2 100644 --- a/src/sage/groups/libgap_mixin.py +++ b/src/sage/groups/libgap_mixin.py @@ -56,10 +56,8 @@ def is_abelian(self): r""" Return whether the group is Abelian. - OUTPUT: - - Boolean. ``True`` if this group is an Abelian group and ``False`` - otherwise. + OUTPUT: boolean; ``True`` if this group is an Abelian group and + ``False`` otherwise EXAMPLES:: @@ -184,9 +182,7 @@ def is_finite(self): """ Test whether the matrix group is finite. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -272,7 +268,6 @@ def conjugacy_classes_representatives(self): Traceback (most recent call last): ... NotImplementedError: only implemented for finite groups - """ if not self.is_finite(): raise NotImplementedError("only implemented for finite groups") @@ -352,9 +347,7 @@ def center(self): """ Return the center of this group as a subgroup. - OUTPUT: - - The center as a subgroup. + OUTPUT: the center as a subgroup EXAMPLES:: @@ -654,9 +647,7 @@ def irreducible_characters(self): """ Return the irreducible characters of the group. - OUTPUT: - - A tuple containing all irreducible characters. + OUTPUT: a tuple containing all irreducible characters EXAMPLES:: @@ -784,9 +775,7 @@ def random_element(self): """ Return a random element of this group. - OUTPUT: - - A group element. + OUTPUT: a group element EXAMPLES:: @@ -864,10 +853,8 @@ def list(self): """ List all elements of this group. - OUTPUT: - - A tuple containing all group elements in a random but fixed - order. + OUTPUT: a tuple containing all group elements in a random but fixed + order EXAMPLES:: @@ -941,9 +928,7 @@ def is_isomorphic(self, H): - ``H`` -- a group. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: diff --git a/src/sage/groups/libgap_morphism.py b/src/sage/groups/libgap_morphism.py index daac871629b..5b780ceb922 100644 --- a/src/sage/groups/libgap_morphism.py +++ b/src/sage/groups/libgap_morphism.py @@ -378,9 +378,7 @@ def pushforward(self, J, *args, **kwds): - ``J`` -- a subgroup or an element of the domain of ``self`` - OUTPUT: - - The image of ``J`` under ``self``. + OUTPUT: the image of ``J`` under ``self`` .. NOTE:: @@ -558,13 +556,11 @@ def preimage(self, S): def section(self): r""" - This method returns a section map of self by use of :meth:`lift`. + This method returns a section map of ``self`` by use of :meth:`lift`. See :meth:`section` of :class:`sage.categories.map.Map`, as well. - OUTPUT: - - an instance of :class:`sage.categories.morphism.SetMorphism` - mapping an element of the codomain of self to one of its preimages + OUTPUT: an instance of :class:`sage.categories.morphism.SetMorphism` + mapping an element of the codomain of ``self`` to one of its preimages EXAMPLES:: @@ -596,9 +592,7 @@ class GroupHomset_libgap(HomsetWithBase): - ``H`` -- a libgap group - ``category`` -- a category - OUTPUT: - - The homset of two libgap groups. + OUTPUT: the homset of two libgap groups EXAMPLES:: @@ -730,9 +724,10 @@ def natural_map(self): OUTPUT: - an instance of the element class of self if there exists a group homomorphism - mapping the generators of the domain of self to the according generators of - the codomain. Else the method falls back to the default. + An instance of the element class of ``self`` if there exists a group + homomorphism mapping the generators of the domain of ``self`` to the + according generators of the codomain. Otherwise, the method falls back + to the default. EXAMPLES:: diff --git a/src/sage/groups/libgap_wrapper.pxd b/src/sage/groups/libgap_wrapper.pxd index 0c43b098140..2f76d978afd 100644 --- a/src/sage/groups/libgap_wrapper.pxd +++ b/src/sage/groups/libgap_wrapper.pxd @@ -1,7 +1,6 @@ from sage.structure.element cimport MultiplicativeGroupElement from sage.libs.gap.element cimport GapElement - cdef class ElementLibGAP(MultiplicativeGroupElement): cdef GapElement _libgap cpdef GapElement gap(self) diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index 3d27ec44ea0..0834a304c66 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -159,9 +159,7 @@ class ParentLibGAP(SageObject): You can access the containing group with :meth:`ambient`. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -180,9 +178,7 @@ class ParentLibGAP(SageObject): - ``G`` -- group; the codomain - ``cat`` -- category - OUTPUT: - - The set of homomorphisms from ``self`` to ``G``. + OUTPUT: the set of homomorphisms from ``self`` to ``G`` EXAMPLES:: @@ -201,10 +197,7 @@ class ParentLibGAP(SageObject): You should override this with a derived class. Its constructor must accept the same arguments as :meth:`__init__`. - OUTPUT: - - A new instance of a group (derived class of - :class:`ParentLibGAP`). + OUTPUT: a new instance of a group (derived class of :class:`ParentLibGAP`) TESTS:: @@ -225,9 +218,7 @@ class ParentLibGAP(SageObject): - ``generators`` -- a list/tuple/iterable of group elements. - OUTPUT: - - The subgroup generated by ``generators``. + OUTPUT: the subgroup generated by ``generators`` EXAMPLES:: @@ -269,11 +260,9 @@ class ParentLibGAP(SageObject): def gap(self): """ - Return the gap representation of self. - - OUTPUT: + Return the gap representation of ``self``. - A :class:`~sage.libs.gap.element.GapElement` + OUTPUT: a :class:`~sage.libs.gap.element.GapElement` EXAMPLES:: @@ -309,11 +298,9 @@ class ParentLibGAP(SageObject): def ngens(self): """ - Return the number of generators of self. + Return the number of generators of ``self``. - OUTPUT: - - Integer. + OUTPUT: an integer EXAMPLES:: @@ -332,10 +319,6 @@ class ParentLibGAP(SageObject): """ Return a string representation. - OUTPUT: - - String. - TESTS:: sage: from sage.groups.libgap_wrapper import ElementLibGAP, ParentLibGAP @@ -407,7 +390,7 @@ class ParentLibGAP(SageObject): def gen(self, i): """ - Return the `i`-th generator of self. + Return the `i`-th generator of ``self``. .. warning:: @@ -419,9 +402,7 @@ class ParentLibGAP(SageObject): - ``i`` -- integer between `0` (inclusive) and :meth:`ngens` (exclusive). The index of the generator. - OUTPUT: - - The `i`-th generator of the group. + OUTPUT: the `i`-th generator of the group EXAMPLES:: @@ -438,7 +419,7 @@ class ParentLibGAP(SageObject): @cached_method def one(self): """ - Return the identity element of self. + Return the identity element of ``self``. EXAMPLES:: @@ -454,7 +435,7 @@ class ParentLibGAP(SageObject): def _an_element_(self): """ - Return an element of self. + Return an element of ``self``. EXAMPLES:: @@ -522,9 +503,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): """ Return a LibGAP representation of the element. - OUTPUT: - - A :class:`~sage.libs.gap.element.GapElement` + OUTPUT: a :class:`~sage.libs.gap.element.GapElement` EXAMPLES:: @@ -572,9 +551,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): """ Test whether the group element is the trivial element. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -591,10 +568,6 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): """ Return a string representation. - OUTPUT: - - String. - EXAMPLES:: sage: G. = FreeGroup() @@ -622,9 +595,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): r""" Return a LaTeX representation - OUTPUT: - - String. A valid LaTeX math command sequence. + OUTPUT: a string; a valid LaTeX math command sequence EXAMPLES:: @@ -727,7 +698,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): def __invert__(self): """ - Return the inverse of self. + Return the inverse of ``self``. TESTS:: diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py index 6d487e5d123..3ad8719a5dd 100644 --- a/src/sage/groups/matrix_gps/finitely_generated.py +++ b/src/sage/groups/matrix_gps/finitely_generated.py @@ -83,9 +83,7 @@ def normalize_square_matrices(matrices): """ Find a common space for all matrices. - OUTPUT: - - A list of matrices, all elements of the same matrix space. + OUTPUT: a list of matrices, all elements of the same matrix space EXAMPLES:: @@ -151,7 +149,8 @@ def QuaternionMatrixGroupGF3(): is not isomorphic to the group of symmetries of a square (the dihedral group `D_4`). - .. note:: + .. NOTE:: + This group is most easily available via ``groups.matrix.QuaternionGF3()``. EXAMPLES: @@ -413,9 +412,7 @@ def gen(self, i): """ Return the `i`-th generator - OUTPUT: - - The `i`-th generator of the group. + OUTPUT: the `i`-th generator of the group EXAMPLES:: @@ -435,9 +432,7 @@ def ngens(self): """ Return the number of generators - OUTPUT: - - An integer. The number of generators. + OUTPUT: an integer; the number of generators EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/group_element.pyx b/src/sage/groups/matrix_gps/group_element.pyx index 38bf1f03279..2e6428fc714 100644 --- a/src/sage/groups/matrix_gps/group_element.pyx +++ b/src/sage/groups/matrix_gps/group_element.pyx @@ -97,7 +97,7 @@ cpdef is_MatrixGroupElement(x): - ``x`` -- anything. - OUTPUT: Boolean. + OUTPUT: boolean EXAMPLES:: @@ -372,7 +372,7 @@ cdef class MatrixGroupElement_generic(MultiplicativeGroupElement): """ Return the inverse group element - OUTPUT: A matrix group element. + OUTPUT: a matrix group element EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/group_element_gap.pyx b/src/sage/groups/matrix_gps/group_element_gap.pyx index b07c0f01a44..2f7eb82cb8d 100644 --- a/src/sage/groups/matrix_gps/group_element_gap.pyx +++ b/src/sage/groups/matrix_gps/group_element_gap.pyx @@ -306,7 +306,7 @@ cdef class MatrixGroupElement_gap(ElementLibGAP): This method writes the group element as a product of the elements of the list ``gens``, or the standard generators of - the parent of self if ``gens`` is None. + the parent of ``self`` if ``gens`` is ``None``. INPUT: diff --git a/src/sage/groups/matrix_gps/linear.py b/src/sage/groups/matrix_gps/linear.py index ef2bf1aa0be..759faf2db18 100644 --- a/src/sage/groups/matrix_gps/linear.py +++ b/src/sage/groups/matrix_gps/linear.py @@ -201,7 +201,7 @@ def SL(n, R, var='a'): matrices that are invertible over the ring `R` with determinant one. - .. note:: + .. NOTE:: This group is also available via ``groups.matrix.SL()``. diff --git a/src/sage/groups/matrix_gps/matrix_group.py b/src/sage/groups/matrix_gps/matrix_group.py index 2b87493fbc5..e7ad5183e45 100644 --- a/src/sage/groups/matrix_gps/matrix_group.py +++ b/src/sage/groups/matrix_gps/matrix_group.py @@ -131,9 +131,7 @@ def _check_matrix(self, x, *args): - ``*args`` -- optional other representations of ``x``, depending on the group implementation. Ignored by default. - OUTPUT: - - A :class:`TypeError` must be raised if ``x`` is invalid. + OUTPUT: a :class:`TypeError` must be raised if ``x`` is invalid EXAMPLES:: @@ -186,9 +184,11 @@ def subgroup(self, generators, check=True): INPUT: - ``generators`` -- a list/tuple/iterable of group elements of ``self`` - - ``check`` -- boolean (optional, default: ``True``). Whether to check that each matrix is invertible. + - ``check`` -- boolean (optional, default: ``True``). Whether to check + that each matrix is invertible. - OUTPUT: The subgroup generated by ``generators`` as an instance of :class:`FinitelyGeneratedMatrixGroup_gap` + OUTPUT: the subgroup generated by ``generators`` as an instance of + :class:`FinitelyGeneratedMatrixGroup_gap` EXAMPLES:: @@ -262,10 +262,6 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. - EXAMPLES:: sage: F = GF(5); MS = MatrixSpace(F, 2, 2) @@ -429,10 +425,8 @@ def degree(self): """ Return the degree of this matrix group. - OUTPUT: - - Integer. The size (number of rows equals number of columns) of - the matrices. + OUTPUT: an integer; the size (number of rows equals number of columns) + of the matrices EXAMPLES:: @@ -474,9 +468,7 @@ def __richcmp__(self, other, op): - ``op`` -- comparison operator - OUTPUT: - - boolean + OUTPUT: boolean EXAMPLES:: @@ -573,6 +565,5 @@ def is_trivial(self): 2 sage: G.is_trivial() True - """ return all(g.is_one() for g in self.gens()) diff --git a/src/sage/groups/matrix_gps/matrix_group_gap.py b/src/sage/groups/matrix_gps/matrix_group_gap.py index 84fd3d74996..f413c87bdde 100644 --- a/src/sage/groups/matrix_gps/matrix_group_gap.py +++ b/src/sage/groups/matrix_gps/matrix_group_gap.py @@ -137,7 +137,6 @@ def __init__(self, degree, base_ring, libgap_group, ambient=None, category=None) Traceback (most recent call last): ... NotImplementedError: group must be finite - """ ParentLibGAP.__init__(self, libgap_group, ambient=ambient) MatrixGroup_generic.__init__(self, degree, base_ring, category=category) @@ -202,9 +201,7 @@ def _check_matrix(self, x_sage, x_gap): - ``x_gap`` -- the corresponding LibGAP matrix. - OUTPUT: - - A :class:`TypeError` must be raised if ``x`` is invalid. + OUTPUT: a :class:`TypeError` must be raised if ``x`` is invalid EXAMPLES:: @@ -232,9 +229,11 @@ def subgroup(self, generators, check=True): INPUT: - ``generators`` -- a list/tuple/iterable of group elements of ``self`` - - ``check`` -- boolean (optional, default: ``True``). Whether to check that each matrix is invertible. + - ``check`` -- boolean (optional, default: ``True``). Whether to check + that each matrix is invertible. - OUTPUT: The subgroup generated by ``generators`` as an instance of :class:`FinitelyGeneratedMatrixGroup_gap` + OUTPUT: The subgroup generated by ``generators`` as an instance of + :class:`FinitelyGeneratedMatrixGroup_gap` EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/named_group.py b/src/sage/groups/matrix_gps/named_group.py index 90c01e232e7..1aae7019e3c 100644 --- a/src/sage/groups/matrix_gps/named_group.py +++ b/src/sage/groups/matrix_gps/named_group.py @@ -78,9 +78,7 @@ def normalize_args_vectorspace(*args, **kwds): field generator name in the case where ``ring`` is a prime power. - OUTPUT: - - A pair ``(degree, ring)``. + OUTPUT: a pair ``(degree, ring)`` TESTS:: @@ -237,9 +235,7 @@ def _an_element_(self): """ Return an element. - OUTPUT: - - A group element. + OUTPUT: a group element EXAMPLES:: @@ -253,10 +249,6 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. - EXAMPLES:: sage: GL(2, QQ)._repr_() @@ -266,11 +258,9 @@ def _repr_(self): def _latex_(self): """ - Return a LaTeX representation - - OUTPUT: + Return a LaTeX representation. - String. + OUTPUT: a string EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/orthogonal.py b/src/sage/groups/matrix_gps/orthogonal.py index c30fc14a331..ab1b770e4cf 100644 --- a/src/sage/groups/matrix_gps/orthogonal.py +++ b/src/sage/groups/matrix_gps/orthogonal.py @@ -116,9 +116,7 @@ def normalize_args_e(degree, ring, e): finite fields and if the degree is even. A parameter that distinguishes inequivalent invariant forms. - OUTPUT: - - The integer ``e`` with values required by GAP. + OUTPUT: the integer ``e`` with values required by GAP TESTS:: @@ -263,10 +261,8 @@ def GO(n, R, e=0, var='a', invariant_form=None): by the orthogonal group; the form is checked to be non-degenerate and symmetric but not to be positive definite - OUTPUT: - - The general orthogonal group of given degree, base ring, and - choice of invariant form. + OUTPUT: the general orthogonal group of given degree, base ring, and + choice of invariant form EXAMPLES:: @@ -373,10 +369,8 @@ def SO(n, R, e=None, var='a', invariant_form=None): by the orthogonal group; the form is checked to be non-degenerate and symmetric but not to be positive definite - OUTPUT: - - The special orthogonal group of given degree, base ring, and choice of - invariant form. + OUTPUT: the special orthogonal group of given degree, base ring, and choice + of invariant form EXAMPLES:: @@ -482,9 +476,7 @@ def invariant_bilinear_form(self): """ Return the symmetric bilinear form preserved by ``self``. - OUTPUT: - - A matrix. + OUTPUT: a matrix EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/symplectic.py b/src/sage/groups/matrix_gps/symplectic.py index 0e378b4d153..d139034107d 100644 --- a/src/sage/groups/matrix_gps/symplectic.py +++ b/src/sage/groups/matrix_gps/symplectic.py @@ -211,7 +211,7 @@ def invariant_form(self): """ Return the quadratic form preserved by the symplectic group. - OUTPUT: A matrix. + OUTPUT: a matrix EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/symplectic_gap.py b/src/sage/groups/matrix_gps/symplectic_gap.py index d348ed9f40f..b0d05c3be6e 100644 --- a/src/sage/groups/matrix_gps/symplectic_gap.py +++ b/src/sage/groups/matrix_gps/symplectic_gap.py @@ -48,7 +48,7 @@ def invariant_form(self): """ Return the quadratic form preserved by the symplectic group. - OUTPUT: A matrix. + OUTPUT: a matrix EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/unitary.py b/src/sage/groups/matrix_gps/unitary.py index 43ac69c3983..37a9cb826ee 100644 --- a/src/sage/groups/matrix_gps/unitary.py +++ b/src/sage/groups/matrix_gps/unitary.py @@ -68,11 +68,7 @@ def finite_field_sqrt(ring): """ Helper function. - INPUT: A ring. - - OUTPUT: - - Integer `q` such that ``ring`` is the finite field with `q^2` elements. + OUTPUT: an integer `q` such that ``ring`` is the finite field with `q^2` elements EXAMPLES:: @@ -189,7 +185,7 @@ def GU(n, R, var='a', invariant_form=None): by the unitary group; the form is checked to be non-degenerate and hermitian but not to be positive definite - OUTPUT: The general unitary group. + OUTPUT: the general unitary group EXAMPLES:: @@ -301,9 +297,7 @@ def SU(n, R, var='a', invariant_form=None): by the unitary group; the form is checked to be non-degenerate and hermitian but not to be positive definite - OUTPUT: - - Return the special unitary group. + OUTPUT: the special unitary group EXAMPLES:: @@ -396,7 +390,7 @@ def invariant_form(self): Return the hermitian form preserved by the unitary group. - OUTPUT: A square matrix describing the bilinear form + OUTPUT: a square matrix describing the bilinear form EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/unitary_gap.py b/src/sage/groups/matrix_gps/unitary_gap.py index ac2de20f96b..ab0512a4803 100644 --- a/src/sage/groups/matrix_gps/unitary_gap.py +++ b/src/sage/groups/matrix_gps/unitary_gap.py @@ -41,9 +41,7 @@ def invariant_form(self): """ Return the hermitian form preserved by the unitary group. - OUTPUT: - - A square matrix describing the bilinear form + OUTPUT: a square matrix describing the bilinear form EXAMPLES:: diff --git a/src/sage/groups/misc_gps/argument_groups.py b/src/sage/groups/misc_gps/argument_groups.py index 1c949a57f51..5cf9ead8c7d 100644 --- a/src/sage/groups/misc_gps/argument_groups.py +++ b/src/sage/groups/misc_gps/argument_groups.py @@ -114,9 +114,7 @@ def _normalize_(element): - ``element`` -- an element of the parent's base - OUTPUT: - - An element. + OUTPUT: an element TESTS:: @@ -151,9 +149,7 @@ def _symbolic_(self, R=None): The output will be an element of ``R``. If ``None``, then the symbolic ring is used. - OUTPUT: - - A symbolic expression. + OUTPUT: a symbolic expression EXAMPLES:: @@ -337,9 +333,7 @@ def _determine_category_(category): - ``category`` -- a category or ``None`` (in which case the output equals ``category``) - OUTPUT: - - A category. + OUTPUT: a category EXAMPLES:: @@ -414,9 +408,7 @@ def _normalize_(exponent): - ``exponent`` -- an element of the parent's base - OUTPUT: - - An element. + OUTPUT: an element TESTS:: @@ -463,9 +455,7 @@ def _symbolic_(self, R=None): The output will be an element of ``R``. If ``None``, then the symbolic ring is used. - OUTPUT: - - A symbolic expression. + OUTPUT: a symbolic expression EXAMPLES:: @@ -681,9 +671,7 @@ def _element_constructor_(self, data, exponent=None, **kwds): - ``kwds`` -- are passed on to element - OUTPUT: - - A :class:`UnitCirclePoint`. + OUTPUT: a :class:`UnitCirclePoint` TESTS:: @@ -796,9 +784,7 @@ def _create_element_in_extension_(self, exponent): - ``exponent`` -- the element data. - OUTPUT: - - An element. + OUTPUT: an element EXAMPLES:: @@ -828,9 +814,7 @@ def _coerce_map_from_(self, R): - ``R`` -- a parent. - OUTPUT: - - A boolean. + OUTPUT: boolean TESTS:: @@ -1088,9 +1072,7 @@ def _normalize_(element): - ``element`` -- an element of the parent's base - OUTPUT: - - An element. + OUTPUT: an element TESTS:: @@ -1123,9 +1105,7 @@ def _symbolic_(self, R=None): The output will be an element of ``R``. If ``None``, then the symbolic ring is used. - OUTPUT: - - A symbolic expression. + OUTPUT: a symbolic expression EXAMPLES:: @@ -1275,9 +1255,7 @@ def _element_constructor_(self, data, **kwds): - ``kwds`` -- are passed on to element - OUTPUT: - - A :class:`ArgumentByElement`. + OUTPUT: a :class:`ArgumentByElement` TESTS:: @@ -1345,9 +1323,7 @@ def _create_element_in_extension_(self, element): - ``element`` -- the element data. - OUTPUT: - - An element. + OUTPUT: an element EXAMPLES:: @@ -1379,9 +1355,7 @@ def _coerce_map_from_(self, R): - ``R`` -- a parent. - OUTPUT: - - A boolean. + OUTPUT: boolean TESTS:: @@ -1436,9 +1410,7 @@ def _normalize_(element): - ``element`` -- an element of the parent's base - OUTPUT: - - An element. + OUTPUT: an element TESTS:: @@ -1689,9 +1661,7 @@ def _element_constructor_(self, data): - ``data`` -- an object - OUTPUT: - - A :class:`Sign`. + OUTPUT: a :class:`Sign` TESTS:: diff --git a/src/sage/groups/misc_gps/imaginary_groups.py b/src/sage/groups/misc_gps/imaginary_groups.py index 41fe79f9959..428db810921 100644 --- a/src/sage/groups/misc_gps/imaginary_groups.py +++ b/src/sage/groups/misc_gps/imaginary_groups.py @@ -284,9 +284,7 @@ def _determine_category_(category): - ``category`` -- a category or ``None`` (in which case the output equals ``category``) - OUTPUT: - - A category. + OUTPUT: a category EXAMPLES:: @@ -376,9 +374,7 @@ def _element_constructor_(self, data, imag=None): - ``imag`` -- a number (of a subset of the reals) or ``None`` - OUTPUT: - - A :class:`ImaginaryElement`. + OUTPUT: a :class:`ImaginaryElement` TESTS:: diff --git a/src/sage/groups/old.pyx b/src/sage/groups/old.pyx index 1833b4a2b74..08df0405ffa 100644 --- a/src/sage/groups/old.pyx +++ b/src/sage/groups/old.pyx @@ -69,7 +69,7 @@ cdef class Group(sage.structure.parent.Parent): def __contains__(self, x): r""" - True if coercion of `x` into self is defined. + Return ``True`` if coercion of ``x`` into ``self`` is defined. EXAMPLES:: @@ -88,7 +88,7 @@ cdef class Group(sage.structure.parent.Parent): def is_abelian(self): """ - Return True if this group is abelian. + Return ``True`` if this group is abelian. EXAMPLES:: @@ -103,7 +103,7 @@ cdef class Group(sage.structure.parent.Parent): def is_commutative(self): r""" - Return True if this group is commutative. This is an alias for + Return ``True`` if this group is commutative. This is an alias for is_abelian, largely to make groups work well with the Factorization class. @@ -119,7 +119,7 @@ cdef class Group(sage.structure.parent.Parent): def order(self): """ - Returns the number of elements of this group, which is either a + Return the number of elements of this group, which is either a positive integer or infinity. EXAMPLES:: @@ -135,8 +135,7 @@ cdef class Group(sage.structure.parent.Parent): def is_multiplicative(self): r""" - Returns True if the group operation is given by \* (rather than - +). + Return ``True`` if the group operation is given by \* (rather than +). Override for additive groups. @@ -214,7 +213,6 @@ cdef class FiniteGroup(Group): """ return True - cdef class AlgebraicGroup(Group): """ Generic algebraic group. diff --git a/src/sage/groups/perm_gps/constructor.py b/src/sage/groups/perm_gps/constructor.py index 5a130eb19be..ab912f7667d 100644 --- a/src/sage/groups/perm_gps/constructor.py +++ b/src/sage/groups/perm_gps/constructor.py @@ -170,10 +170,8 @@ def standardize_generator(g, convert_dict=None, as_cycles=False): - ``as_cycles`` -- (default: ``False``) whether the output should be as cycles or in one-line notation - OUTPUT: - - The permutation in as a list in one-line notation or a list of cycles - as tuples. + OUTPUT: the permutation in as a list in one-line notation or a list of + cycles as tuples. EXAMPLES:: diff --git a/src/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx b/src/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx index 803f2533b7d..dd2647238f2 100644 --- a/src/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx +++ b/src/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx @@ -438,12 +438,12 @@ cdef aut_gp_and_can_lab *get_aut_gp_and_can_lab(void *S, int -- 0 if gamma_1(S1) = gamma_2(S2), otherwise -1 or 1 (see docs for cmp), such that the set of all structures is well-ordered - NOTE: - The partition ``partition1`` *must* satisfy the property that in each cell, - the smallest element occurs first! + .. NOTE:: - OUTPUT: - pointer to a aut_gp_and_can_lab struct + The partition ``partition1`` *must* satisfy the property that in each + cell, the smallest element occurs first! + + OUTPUT: a pointer to a ``aut_gp_and_can_lab`` struct """ cdef PartitionStack *current_ps diff --git a/src/sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx b/src/sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx index 6143e509caa..245ec5f7c06 100644 --- a/src/sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx +++ b/src/sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx @@ -467,9 +467,7 @@ cdef iterator *setup_canonical_generator(int degree, - ``max_depth`` - maximum depth of augmentations to be made from the seed object S - OUTPUT: - - pointer to an iterator of objects + OUTPUT: a pointer to an iterator of objects """ if max_depth <= 1: diff --git a/src/sage/groups/perm_gps/partn_ref/data_structures.pxd b/src/sage/groups/perm_gps/partn_ref/data_structures.pxd index f53184bd082..408fe26a15a 100644 --- a/src/sage/groups/perm_gps/partn_ref/data_structures.pxd +++ b/src/sage/groups/perm_gps/partn_ref/data_structures.pxd @@ -85,8 +85,7 @@ cdef inline OrbitPartition *OP_copy(OrbitPartition *OP) noexcept: """ Allocate and return a pointer to a copy of a OrbitPartition of degree n. - Returns a - null pointer in the case of an allocation failure. + Returns a null pointer in the case of an allocation failure. """ cdef OrbitPartition *OP2 = OP_new(OP.degree) if OP is NULL: @@ -172,7 +171,7 @@ cdef inline int PS_copy_from_to(PartitionStack *PS, PartitionStack *PS2) noexcep cdef inline bint PS_is_discrete(PartitionStack *PS) noexcept: """ - Returns whether the deepest partition consists only of singleton cells. + Return whether the deepest partition consists only of singleton cells. """ cdef int i for i from 0 <= i < PS.degree: @@ -182,7 +181,7 @@ cdef inline bint PS_is_discrete(PartitionStack *PS) noexcept: cdef inline int PS_num_cells(PartitionStack *PS) noexcept: """ - Returns the number of cells. + Return the number of cells. """ cdef int i, ncells = 0 for i from 0 <= i < PS.degree: @@ -206,13 +205,13 @@ cdef inline void PS_move_min_to_front(PartitionStack *PS, int start, int end) no cdef inline bint PS_is_mcr(PartitionStack *PS, int m) noexcept: """ - Returns whether PS.elements[m] (not m!) is the smallest element of its cell. + Return whether PS.elements[m] (not m!) is the smallest element of its cell. """ return m == 0 or PS.levels[m-1] <= PS.depth cdef inline bint PS_is_fixed(PartitionStack *PS, int m) noexcept: """ - Returns whether PS.elements[m] (not m!) is in a singleton cell, assuming + Return whether PS.elements[m] (not m!) is in a singleton cell, assuming PS_is_mcr(PS, m) is already true. """ return PS.levels[m] <= PS.depth diff --git a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx index cb25f23a4d3..e7a3e8c55f8 100644 --- a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx +++ b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx @@ -659,7 +659,7 @@ cdef inline void SC_dealloc(StabilizerChain *SC) noexcept: cdef StabilizerChain *SC_symmetric_group(int n) noexcept: """ - Returns a stabilizer chain for the symmetric group on {0, 1, ..., n-1}. + Return a stabilizer chain for the symmetric group on {0, 1, ..., n-1}. Returns NULL in the case of an allocation failure. """ @@ -700,7 +700,7 @@ cdef StabilizerChain *SC_symmetric_group(int n) noexcept: cdef StabilizerChain *SC_alternating_group(int n) noexcept: """ - Returns a stabilizer chain for the alternating group on {0, 1, ..., n-1}. + Return a stabilizer chain for the alternating group on {0, 1, ..., n-1}. Returns NULL in the case of an allocation failure. """ @@ -1142,8 +1142,8 @@ cdef bint SC_is_giant(int n, int num_perms, int *perms, float p, bitset_t suppor If the group is not a giant, this routine will return False. This could also indicate an allocation failure. - If the group is a giant, this routine will return True with approximate - probability p. It will set `support' to the support of the group in this + If the group is a giant, this routine will return ``True`` with approximate + probability ``p``. It will set `support' to the support of the group in this case. Use bitset_len to get the size of support. The bitset `support' must be initialized. Must have 0 <= p < 1. diff --git a/src/sage/groups/perm_gps/partn_ref/double_coset.pyx b/src/sage/groups/perm_gps/partn_ref/double_coset.pyx index 73631b395c4..051e3f78fa4 100644 --- a/src/sage/groups/perm_gps/partn_ref/double_coset.pyx +++ b/src/sage/groups/perm_gps/partn_ref/double_coset.pyx @@ -313,14 +313,13 @@ cdef int double_coset(void *S1, void *S2, PartitionStack *partition1, int *order isom -- space to store the isomorphism to, or NULL if isomorphism is not needed - NOTE: - The partition ``partition1`` and the resulting partition from ``ordering2`` - *must* satisfy the property that in each cell, the smallest element occurs - first! + .. NOTE:: - OUTPUT: - 1 if S1 and S2 are isomorphic, otherwise 0. + The partition ``partition1`` and the resulting partition from + ``ordering2`` *must* satisfy the property that in each cell, the + smallest element occurs first! + OUTPUT: ``1`` if ``S1`` and ``S2`` are isomorphic, otherwise ``0`` """ cdef PartitionStack *current_ps cdef PartitionStack *first_ps diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx index 6a3c07ac75d..c01634e1772 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx @@ -114,7 +114,7 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): def run(self, partition=None): """ Perform the canonical labeling and automorphism group computation, - storing results to self. + storing results to ``self``. INPUT: partition -- an optional list of lists partition of the columns. @@ -257,13 +257,13 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): order and a base for which the list of generators is a strong generating set. - EXAMPLES: (For more examples, see self.run()) + EXAMPLES: (For more examples, see self.run()):: + sage: from sage.groups.perm_gps.partn_ref.refinement_binary import LinearBinaryCodeStruct sage: B = LinearBinaryCodeStruct(matrix(GF(2),[[1,1,1,1]])) sage: B.automorphism_group() ([[0, 1, 3, 2], [0, 2, 1, 3], [1, 0, 2, 3]], 24, [0, 1, 2]) - """ cdef int i, j cdef list generators, base @@ -282,7 +282,8 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): """ Returns a canonical relabeling (in list permutation format). - EXAMPLES: (For more examples, see self.run()) + EXAMPLES: (For more examples, see self.run()):: + sage: from sage.groups.perm_gps.partn_ref.refinement_binary import LinearBinaryCodeStruct sage: B = LinearBinaryCodeStruct(matrix(GF(2), [[1,1,0]])) @@ -295,7 +296,6 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): ([[2, 1, 0]], 2, [0]) sage: B.canonical_relabeling() [1, 0, 2] - """ cdef int i if self.output is NULL: @@ -304,7 +304,7 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): def is_isomorphic(self, LinearBinaryCodeStruct other): """ - Calculate whether self is isomorphic to other. + Calculate whether ``self`` is isomorphic to ``other``. EXAMPLES:: @@ -314,7 +314,6 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): sage: C = LinearBinaryCodeStruct(Matrix(GF(2), [[1,1,1,0,0,1],[1,1,0,1,1,0]])) sage: B.is_isomorphic(C) [0, 1, 2, 5, 3, 4] - """ cdef int i, n = self.degree cdef int *output @@ -512,7 +511,6 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): [4, 0, 1, 2]) sage: B.canonical_relabeling() [2, 3, 4, 5, 0, 1] - """ cdef int n = self.degree cdef PartitionStack *part @@ -534,7 +532,8 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): order and a base for which the list of generators is a strong generating set. - EXAMPLES: (For more examples, see self.run()) + EXAMPLES: (For more examples, see self.run()):: + sage: from sage.groups.perm_gps.partn_ref.refinement_binary import NonlinearBinaryCodeStruct sage: B = NonlinearBinaryCodeStruct(Matrix(GF(2), [[1,1,1,0,0,0],[1,1,0,1,0,0],[1,0,1,1,0,0],[0,1,1,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]])) @@ -546,7 +545,6 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): [0, 1, 2, 3, 5, 4]], 48, [4, 0, 1, 2]) - """ cdef int i, j cdef list generators, base @@ -565,14 +563,14 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): """ Returns a canonical relabeling (in list permutation format). - EXAMPLES: (For more examples, see self.run()) + EXAMPLES: (For more examples, see self.run()):: + sage: from sage.groups.perm_gps.partn_ref.refinement_binary import NonlinearBinaryCodeStruct sage: B = NonlinearBinaryCodeStruct(Matrix(GF(2), [[1,1,1,0,0,0],[1,1,0,1,0,0],[1,0,1,1,0,0],[0,1,1,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]])) sage: B.run() sage: B.canonical_relabeling() [2, 3, 4, 5, 0, 1] - """ cdef int i if self.output is NULL: @@ -581,7 +579,7 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): def is_isomorphic(self, NonlinearBinaryCodeStruct other): """ - Calculate whether self is isomorphic to other. + Calculate whether ``self`` is isomorphic to ``other``. EXAMPLES:: @@ -591,7 +589,6 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): sage: C = NonlinearBinaryCodeStruct(Matrix(GF(2), [[1,1,0,0,1,1],[1,1,1,1,0,0]])) sage: B.is_isomorphic(C) [2, 3, 0, 1, 4, 5] - """ cdef int i, n = self.degree cdef int *output @@ -914,17 +911,19 @@ cdef int compare_nonlinear_codes(int *gamma_1, int *gamma_2, void *S1, void *S2, cdef bint all_children_are_equivalent(PartitionStack *col_ps, void *S) noexcept: """ - Returns True if any refinement of the current partition results in the same - structure. - - WARNING: - Converse does not hold in general! See Lemma 2.25 of [1] for details, noting - that the binary code is interpreted as a bipartite graph (see module docs - for details). + Return ``True`` if any refinement of the current partition results in the + same structure. INPUT: - col_ps -- the partition stack to be checked - S -- a binary code struct object + + - ``col_ps`` -- the partition stack to be checked + - ``S`` -- a binary code struct object + + .. WARNING:: + + Converse does not hold in general! See Lemma 2.25 of [1] for details, noting + that the binary code is interpreted as a bipartite graph (see module docs + for details). """ cdef BinaryCodeStruct BCS = S cdef PartitionStack *word_ps = BCS.word_ps @@ -957,7 +956,7 @@ cdef bint all_children_are_equivalent(PartitionStack *col_ps, void *S) noexcept: cdef inline int word_degree(PartitionStack *word_ps, BinaryCodeStruct BCS, int entry, int cell_index, PartitionStack *col_ps) noexcept: """ - Returns the number of edges from the vertex corresponding to entry to + Return the number of edges from the vertex corresponding to entry to vertices in the cell corresponding to cell_index. INPUT: @@ -987,7 +986,7 @@ cdef inline int word_degree(PartitionStack *word_ps, BinaryCodeStruct BCS, int e cdef inline int col_degree(PartitionStack *col_ps, BinaryCodeStruct BCS, int entry, int cell_index, PartitionStack *word_ps) noexcept: """ - Returns the number of edges from the vertex corresponding to entry to + Return the number of edges from the vertex corresponding to entry to vertices in the cell corresponding to cell_index. INPUT: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx index 1b588487d1c..2ebf9e08b56 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx @@ -676,12 +676,12 @@ cdef int compare_graphs(int *gamma_1, int *gamma_2, void *S1, void *S2, int degr cdef bint all_children_are_equivalent(PartitionStack *PS, void *S) noexcept: """ - Return True if every refinement of the current partition results in the + Return ``True`` if every refinement of the current partition results in the same structure. - WARNING: + .. WARNING:: - Converse does not hold in general! See Lemma 2.25 of [1] for details. + Converse does not hold in general! See Lemma 2.25 of [1] for details. INPUT: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_lists.pxd b/src/sage/groups/perm_gps/partn_ref/refinement_lists.pxd index e7b6cf42f6d..43cf567dc40 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_lists.pxd +++ b/src/sage/groups/perm_gps/partn_ref/refinement_lists.pxd @@ -11,7 +11,6 @@ from sage.groups.perm_gps.partn_ref.data_structures cimport * - # name of the three functions to customize cdef int refine_list(PartitionStack *, void *, int *, int) noexcept cdef int compare_lists(int *, int *, void *, void *, int) noexcept diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx index c8d4f86a8f1..1366fa8ceee 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx @@ -110,7 +110,6 @@ cdef class MatrixStruct: 00011 01100 4 - """ print(self.matrix) print("") @@ -127,7 +126,7 @@ cdef class MatrixStruct: def run(self, partition=None): """ Perform the canonical labeling and automorphism group computation, - storing results to self. + storing results to ``self``. INPUT: @@ -153,7 +152,6 @@ cdef class MatrixStruct: sage: M = MatrixStruct(matrix(GF(3),[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2]])) sage: M.automorphism_group()[1] == factorial(14) True - """ cdef int i, n = self.degree cdef PartitionStack *part @@ -189,7 +187,6 @@ cdef class MatrixStruct: sage: M = MatrixStruct(matrix(GF(3),[[0,1,2],[0,2,1]])) sage: M.automorphism_group() ([[0, 2, 1]], 2, [1]) - """ cdef int i, j cdef list generators, base @@ -217,7 +214,6 @@ cdef class MatrixStruct: sage: M = MatrixStruct(matrix(GF(3),[[0,1,2],[0,2,1]])) sage: M.canonical_relabeling() [0, 1, 2] - """ cdef int i if self.output is NULL: @@ -226,7 +222,7 @@ cdef class MatrixStruct: def is_isomorphic(self, MatrixStruct other): """ - Calculate whether self is isomorphic to other. + Calculate whether ``self`` is isomorphic to ``other``. EXAMPLES:: @@ -235,7 +231,6 @@ cdef class MatrixStruct: sage: N = MatrixStruct(Matrix(GF(11), [[0,1,0,2,0,3],[1,0,2,0,3,0]])) sage: M.is_isomorphic(N) [0, 2, 4, 1, 3, 5] - """ cdef int i, n = self.degree cdef int *output diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx index 23d5e7576c7..b73406b13a7 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx @@ -12,12 +12,11 @@ in pure Python, and still use the Cython algorithms. Experimentation with specific partition backtrack implementations no longer requires compilation, as the input functions can be dynamically changed at runtime. -NOTE: - -This is not intended for production quality implementations of partition -refinement, but instead for experimentation, learning, and use of the Python -debugger. +.. NOTE:: + This is not intended for production quality implementations of partition + refinement, but instead for experimentation, learning, and use of the + Python debugger. """ #***************************************************************************** @@ -53,7 +52,6 @@ cdef class PythonPartitionStack: sage: from sage.groups.perm_gps.partn_ref.refinement_python import PythonPartitionStack sage: P = PythonPartitionStack(7) # implicit doctest - """ self.c_ps = PS_new(n, 1) @@ -66,7 +64,6 @@ cdef class PythonPartitionStack: sage: from sage.groups.perm_gps.partn_ref.refinement_python import PythonPartitionStack sage: P = PythonPartitionStack(7) sage: del(P) # implicit doctest - """ PS_dealloc(self.c_ps) @@ -80,7 +77,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P # implicit doctest PythonPartitionStack of degree 7 and depth 0. - """ return "PythonPartitionStack of degree %d and depth %d."%(self.c_ps.degree, self.c_ps.depth) @@ -98,7 +94,6 @@ cdef class PythonPartitionStack: sage: P.display() (0 1 2 3 4 5 6) (0 1 2|3 4 5 6) - """ PS_print(self.c_ps) @@ -116,7 +111,6 @@ cdef class PythonPartitionStack: [None, None, None, None, None, None, None] sage: P.is_discrete() True - """ return PS_is_discrete(self.c_ps) @@ -130,7 +124,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P.num_cells() 1 - """ return PS_num_cells(self.c_ps) @@ -150,7 +143,6 @@ cdef class PythonPartitionStack: sage: P.move_min_to_front(0,1) sage: P.display() (0 1 2 3 4 5 6) - """ PS_move_min_to_front(self.c_ps, start, end) @@ -166,7 +158,6 @@ cdef class PythonPartitionStack: (0 1 2 3 4 5 6) sage: Q.display() (0 1 2 3 4 5 6) - """ cdef PythonPartitionStack cpy cpy = PythonPartitionStack(self.c_ps.degree) @@ -192,7 +183,6 @@ cdef class PythonPartitionStack: sage: P.display() (0 1 2 3 4 5 6) (0 1 2 3 4 5 6) - """ PS_clear(self.c_ps) @@ -208,7 +198,6 @@ cdef class PythonPartitionStack: [0, 1, 2, 3, 4, 5, 6] sage: P.levels() [7, 7, 7, 7, 7, 7, -1] - """ cdef int i return [self.c_ps.entries[i] for i from 0 <= i < self.c_ps.degree] @@ -225,7 +214,6 @@ cdef class PythonPartitionStack: sage: P.set_entry(0,1) sage: P.display() (1 0 2 3 4 5 6) - """ self.c_ps.entries[i] = entry @@ -239,7 +227,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P.get_entry(0) 0 - """ return self.c_ps.entries[i] @@ -255,7 +242,6 @@ cdef class PythonPartitionStack: [0, 1, 2, 3, 4, 5, 6] sage: P.levels() [7, 7, 7, 7, 7, 7, -1] - """ return [self.c_ps.levels[i] for i from 0 <= i < self.c_ps.degree] @@ -273,7 +259,6 @@ cdef class PythonPartitionStack: sage: P.display() (0 1 2 3 4 5 6) (0 1 2|3 4 5 6) - """ self.c_ps.levels[i] = level @@ -287,7 +272,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P.get_level(0) 7 - """ return self.c_ps.levels[i] @@ -302,7 +286,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P.depth() 0 - """ if new is not None: self.c_ps.depth = new @@ -319,7 +302,6 @@ cdef class PythonPartitionStack: sage: P = PythonPartitionStack(7) sage: P.degree() 7 - """ if new is not None: self.c_ps.degree = new @@ -340,7 +322,6 @@ cdef class PythonPartitionStack: [[0, 1, 2, 3, 4, 5, 6]] sage: P.partition(1) [[0, 1, 2], [3, 4, 5, 6]] - """ cdef int i cdef list partition = [], cell = [] @@ -380,7 +361,6 @@ class PythonObjectWrapper: sage: P.cs_fn - """ self.degree = degree self.obj = obj diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx index 6ccc0b28c45..c3a42da04d8 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx @@ -536,7 +536,7 @@ cdef void deallocate_sgd(void *data) noexcept: cdef void *subset_generator_next(void *data, int *degree, bint *mem_err) noexcept: r""" - Returns the next element to consider adding to the set. + Return the next element to consider adding to the set. """ cdef subset_generator_data *sgd = data while True: @@ -694,11 +694,11 @@ def sets_modulo_perm_group(list generators, int max_size, INPUT: - - ``generators`` - (list of lists) list of generators in list form - - ``max_size`` - (int) maximum size of subsets to be generated - - ``indicate_mem_err`` - (bool) whether to raise an error - if we run out of memory, or simply append a MemoryError - instance to the end of the output + - ``generators`` -- (list of lists) list of generators in list form + - ``max_size`` -- (int) maximum size of subsets to be generated + - ``indicate_mem_err`` -- (bool) whether to raise an error + if we run out of memory, or simply append a MemoryError + instance to the end of the output EXAMPLES:: diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx index 261d1987897..89529f4e8ce 100644 --- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx +++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx @@ -252,7 +252,6 @@ cdef tuple PS_refinement(PartitionStack * part, long *refine_vals, long *best, j += 1 - loc_begin = i + 1 i += 1 return (True, newly_fixed) @@ -495,17 +494,15 @@ cdef class PartitionRefinement_generic: ##################################################################### cdef bint _inner_min_(self, int pos, bint * inner_group_changed) noexcept: """ - Minimize the node by the action of the inner group on the i-th position. + Minimize the node by the action of the inner group on the ith position. INPUT: - - `pos` - A position in `range(self.n)` - - `inner_group_changed` - will be set to true if `G_y` got smaller - - OUTPUT: + - ``pos`` -- A position in ``range(self.n)`` + - ``inner_group_changed`` -- will be set to ``True`` if `G_y` got smaller - - `True` if and only if the actual node compares less or equal to - the candidate for the canonical form. + OUTPUT: ``True`` if and only if the actual node compares less or equal + to the candidate for the canonical form. """ raise NotImplementedError @@ -517,10 +514,8 @@ cdef class PartitionRefinement_generic: to a smaller subgroup of `S_n`. This function also has to take care on ``self._is_candidate_initialized``. - OUTPUT: - - - `False` only if the actual node compares larger than the candidate - for the canonical form. + OUTPUT: ``False`` only if the actual node compares larger than the + candidate for the canonical form """ raise NotImplementedError diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index 3f6431948ea..09c6f8ceab5 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -119,12 +119,12 @@ - Dixon, J. and Mortimer, B., Permutation Groups, Springer-Verlag, Berlin/New York, 1996. -.. note:: +.. NOTE:: - Though Suzuki groups are okay, Ree groups should *not* be wrapped - as permutation groups - the construction is too slow - unless (for - small values or the parameter) they are made using explicit - generators. + Though Suzuki groups are okay, Ree groups should *not* be wrapped + as permutation groups - the construction is too slow - unless (for + small values or the parameter) they are made using explicit + generators. """ # **************************************************************************** @@ -277,9 +277,7 @@ def PermutationGroup(gens=None, *args, **kwds): - ``canonicalize`` -- boolean (default: ``True``); if ``True``, sort generators and remove duplicates - OUTPUT: - - - a permutation group + OUTPUT: a permutation group EXAMPLES:: @@ -457,9 +455,7 @@ def __init__(self, gens=None, gap_group=None, canonicalize=True, - ``canonicalize`` -- bool (default: ``True``); if ``True``, sort generators and remove duplicates - OUTPUT: - - - A permutation group. + OUTPUT: a permutation group EXAMPLES: @@ -665,9 +661,8 @@ def gap(self): compatibility and have :class:`sage.groups.libgap_morphism.GroupHomset_libgap` work for permutation groups, as well - OUTPUT: - - an instance of :class:`sage.libs.gap.element.GapElement` representing this group + OUTPUT: an instance of :class:`sage.libs.gap.element.GapElement` + representing this group EXAMPLES:: @@ -730,9 +725,7 @@ def _Hom_(self, G, category=None, check=True): - ``G`` -- group; the codomain - ``cat`` -- category - OUTPUT: - - The set of homomorphisms from ``self`` to ``G``. + OUTPUT: the set of homomorphisms from ``self`` to ``G`` EXAMPLES:: @@ -751,7 +744,7 @@ def _Hom_(self, G, category=None, check=True): def _magma_init_(self, magma): r""" - Return a string showing how to declare / initialize self in Magma. + Return a string showing how to declare / initialize ``self`` in Magma. EXAMPLES: @@ -816,7 +809,6 @@ def __richcmp__(self, right, op): False sage: G != H False - """ if not isinstance(right, PermutationGroup_generic): return NotImplemented @@ -1467,7 +1459,6 @@ def exponent(self): sage: G = AlternatingGroup(4) sage: G.exponent() 6 - """ return Integer(self._libgap_().Exponent()) @@ -1593,7 +1584,7 @@ def smallest_moved_point(self): def representative_action(self, x, y): r""" - Return an element of self that maps `x` to `y` if it exists. + Return an element of ``self`` that maps `x` to `y` if it exists. This method wraps the gap function ``RepresentativeAction``, which can also return elements that map a given set of points on another set of @@ -1945,7 +1936,6 @@ def base(self, seed=None): [1, 2, 3, 4, 5] sage: S.base([1,3,5,7,9,11]) # create a base for M12 with only odd integers [1, 3, 5, 7, 9] - """ if seed is None: seed = self.domain() @@ -1992,10 +1982,8 @@ def strong_generating_system(self, base_of_group=None, implementation="sage"): * ``"gap"`` -- if used, the ``base_of_group`` must be ``None`` and the computation is directly performed in GAP - OUTPUT: - - A list of lists of permutations from the group, which form a strong - generating system. + OUTPUT: a list of lists of permutations from the group, which forms a + strong generating system .. WARNING:: @@ -2433,7 +2421,6 @@ def frattini_subgroup(self): sage: G.frattini_subgroup() Subgroup generated by [()] of (Symmetric group of order 4! as a permutation group) - """ return self.subgroup(gap_group=self._libgap_().FrattiniSubgroup()) @@ -2525,7 +2512,6 @@ def intersection(self, other): Traceback (most recent call last): ... TypeError: junk is not a permutation group - """ from sage.categories.finite_permutation_groups import FinitePermutationGroups @@ -2881,7 +2867,6 @@ def semidirect_product(self, N, mapping, check=True): AUTHOR: - Kevin Halasz (2012-8-12) - """ if check: @@ -2927,10 +2912,8 @@ def holomorph(self): See :wikipedia:`Holomorph (mathematics)` - OUTPUT: - - Return the holomorph of a given group as permutation group - via a wrapping of GAP's semidirect product function. + OUTPUT: the holomorph of a given group as permutation group + via a wrapping of GAP's semidirect product function EXAMPLES: @@ -3010,9 +2993,7 @@ def _subgroup_constructor(self, libgap_group): - ``libgap_group`` -- an instance of :class:`sage.libs.gap.element.GapElement` representing a GAP group whose generators belong to ``self.gap()`` - OUTPUT: - - The corresponding subgroup of ``self`` as an instance of this class + OUTPUT: the corresponding subgroup of ``self`` as an instance of this class EXAMPLES:: @@ -3045,10 +3026,9 @@ def as_finitely_presented_group(self, reduced=False): is called, attempting to simplify the presentation of the finitely presented group to be returned. - OUTPUT: - - Finite presentation of ``self``, obtained by taking the image - of the isomorphism returned by the GAP function ``IsomorphismFpGroupByGenerators``. + OUTPUT: finite presentation of ``self``, obtained by taking the image + of the isomorphism returned by the GAP function + ``IsomorphismFpGroupByGenerators`` ALGORITHM: @@ -3195,7 +3175,7 @@ def commutator(self, other=None): The two groups need only be permutation groups, there is no notion of requiring them to explicitly be subgroups of some other group. - .. note:: + .. NOTE:: For the identical statement, the generators of the returned group can vary from one execution to the next. @@ -3511,7 +3491,6 @@ def character_table(self): AUTHORS: - David Joyner and William Stein (2006-01-04) - """ G = self._libgap_() cl = G.ConjugacyClasses() @@ -3734,7 +3713,6 @@ def _regular_subgroup_gap(self): sage: S4._regular_subgroup_gap() # random ConjugacyClassSubgroups(SymmetricGroup( [ 1 .. 4 ] ),Group( [ (1,4)(2,3), (1,3)(2,4) ] )) - """ filt = libgap.eval('x -> IsRegular(Representative(x), [1..{}])'.format( self.degree())) @@ -3774,7 +3752,6 @@ def has_regular_subgroup(self, return_group=False): sage: G = graphs.PetersenGraph().automorphism_group() sage: G.has_regular_subgroup() False - """ b = False G = None @@ -3909,7 +3886,7 @@ def cosets(self, S, side='right'): the list of cosets, due to the ordering of the representatives). See below for examples of this. - .. note:: + .. NOTE:: This is a naive implementation intended for instructional purposes, and hence is slow for larger groups. Sage and GAP @@ -4237,15 +4214,11 @@ def isomorphism_to(self, right): INPUT: - - ``self`` -- this group - ``right`` -- a permutation group - - OUTPUT: - - - ``None`` or a morphism of permutation groups. + OUTPUT: ``None``, or a morphism of permutation groups EXAMPLES:: @@ -4290,16 +4263,12 @@ def is_isomorphic(self, right): INPUT: - - ``self`` -- this group - ``right`` -- a permutation group - - OUTPUT: - - - boolean; ``True`` if ``self`` and ``right`` are isomorphic groups; - ``False`` otherwise. + OUTPUT: boolean; ``True`` if ``self`` and ``right`` are isomorphic + groups; ``False`` otherwise EXAMPLES:: @@ -4392,7 +4361,6 @@ def is_pgroup(self): sage: G = PermutationGroup(['(1,2,3,4,5)']) sage: G.is_pgroup() True - """ return bool(self._libgap_().IsPGroup()) @@ -4425,7 +4393,6 @@ def is_simple(self): sage: G = PermutationGroup(['(1,2,3)(4,5)']) sage: G.is_simple() False - """ return bool(self._libgap_().IsSimpleGroup()) @@ -4610,7 +4577,6 @@ def is_primitive(self, domain=None): sage: G = PermutationGroup([[(1,2,3,4)],[(2,4)]]) sage: G.is_primitive([1,2,3]) False - """ #If the domain is not a subset of self.domain(), then the #action isn't primitive. @@ -4646,7 +4612,6 @@ def is_semi_regular(self, domain=None): True sage: G.is_semi_regular(G.non_fixed_points()) False - """ try: domain = libgap.eval(self._domain_gap(domain)) @@ -4679,7 +4644,6 @@ def is_regular(self, domain=None): True sage: G.is_regular(G.non_fixed_points()) False - """ try: domain = libgap.eval(self._domain_gap(domain)) @@ -4916,7 +4880,6 @@ def poincare_series(self, p=2, n=10): AUTHORS: - David Joyner and Graham Ellis - """ load_hap() from sage.arith.misc import is_prime @@ -4957,7 +4920,6 @@ def sylow_subgroup(self, p): sage: PSL(10,2).sylow_subgroup(7) Subgroup generated by... - """ return self.subgroup(gap_group=self._libgap_().SylowSubgroup(p)) @@ -5159,7 +5121,6 @@ def __richcmp__(self, other, op): True sage: G.subgroup([G((1,2,3))]) == G.subgroup([G((1,3,2))]) True - """ if self is other: return rich_to_bool(op, 0) @@ -5254,7 +5215,6 @@ def is_normal(self, other=None): (Symmetric group of order 3! as a permutation group) sage: H.is_normal() True - """ if other is None: other = self.ambient_group() @@ -5316,9 +5276,7 @@ def __init__(self, gens, action, domain, gap_group=None, category=None, canonica - ``canonicalize`` -- bool (default: ``True``); if ``True``, sort generators and remove duplicates - OUTPUT: - - - A finite group action given as a permutation group. + OUTPUT: a finite group action given as a permutation group. EXAMPLES:: @@ -5326,7 +5284,6 @@ def __init__(self, gens, action, domain, gap_group=None, category=None, canonica sage: G = PermutationGroup(action=a, domain=range(7)) # needs sage.combinat sage: G.orbits() # needs sage.combinat ((0,), (1, 2, 4), (3, 6, 5)) - """ from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition from sage.sets.disjoint_set import DisjointSet diff --git a/src/sage/groups/perm_gps/permgroup_element.pyx b/src/sage/groups/perm_gps/permgroup_element.pyx index 0d80d04a8af..4c52b386294 100644 --- a/src/sage/groups/perm_gps/permgroup_element.pyx +++ b/src/sage/groups/perm_gps/permgroup_element.pyx @@ -794,7 +794,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def __reduce__(self): r""" - Returns a function and its arguments needed to create this + Return a function and its arguments needed to create this permutation group element. This is used in pickling. EXAMPLES:: @@ -899,7 +899,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def _gap_init_(self): r""" - Returns a GAP string representation for this + Return a GAP string representation for this PermutationGroupElement. EXAMPLES:: @@ -961,7 +961,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def __getitem__(self, i): r""" Return the ``i``-th permutation cycle in the disjoint cycle - representation of self. + representation of ``self``. INPUT: @@ -1028,7 +1028,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def __call__(self, i): r""" - Returns the image of the integer i under this permutation. + Return the image of the integer i under this permutation. Alternately, if i is a list, tuple or string, returns the result of self acting on i. @@ -1091,7 +1091,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): cpdef list _act_on_list_on_position(self, list x): r""" - Returns the right action of ``self`` on the list ``x``. This is the + Return the right action of ``self`` on the list ``x``. This is the action on positions. EXAMPLES:: @@ -1119,7 +1119,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): cpdef ClonableIntArray _act_on_array_on_position(self, ClonableIntArray x): r""" - Returns the right action of ``self`` on the ClonableIntArray + Return the right action of ``self`` on the ClonableIntArray ``x``. This is the action on positions. EXAMPLES:: @@ -1422,7 +1422,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): cpdef _gap_list(self): r""" - Returns this permutation in list notation compatible with the + Return this permutation in list notation compatible with the GAP numbering. EXAMPLES:: @@ -1446,7 +1446,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def _gap_cycle_string(self): r""" - Returns a cycle string for this permutation compatible with + Return a cycle string for this permutation compatible with the GAP numbering. EXAMPLES:: @@ -1871,10 +1871,8 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): type should be returned as a :class:`list` or as a :class:`Partition` (default: ``False``) - OUTPUT: - - A :class:`Partition`, or :class:`list` if ``is_list`` is ``True``, - giving the cycle type of ``self`` + OUTPUT: a :class:`Partition`, or :class:`list` if ``is_list`` is + ``True``, giving the cycle type of ``self`` If speed is a concern, then ``as_list=True`` should be used. @@ -1905,13 +1903,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): def has_descent(self, i, side="right", positive=False): r""" - INPUT: - - - ``i`` -- an element of the index set - - ``side`` -- ``"left"`` or ``"right"`` (default: ``"right"``) - - ``positive`` -- a boolean (default: ``False``) - - Returns whether ``self`` has a left (resp. right) descent at + Return whether ``self`` has a left (resp. right) descent at position ``i``. If ``positive`` is ``True``, then test for a non descent instead. @@ -1920,6 +1912,12 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): convention. Hence, ``self`` has a left descent at position ``i`` if ``self(i) > self(i+1)``. + INPUT: + + - ``i`` -- an element of the index set + - ``side`` -- ``"left"`` or ``"right"`` (default: ``"right"``) + - ``positive`` -- a boolean (default: ``False``) + EXAMPLES:: sage: S = SymmetricGroup([1,2,3]) @@ -2124,10 +2122,10 @@ cdef class SymmetricGroupElement(PermutationGroupElement): cdef bint is_valid_permutation(int* perm, int n) noexcept: r""" - This is used in the __init__ method. + This is used in the ``__init__`` method. - Returns True iff the first n elements of perm are literally a - permutation of [0, ..., n-1]. + Return ``True`` iff the first ``n`` elements of perm are literally a + permutation of ``[0, ..., n-1]``. TESTS:: diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index 6e979561e43..514b676efbf 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -594,9 +594,7 @@ def conjugacy_class(self, g): - ``g`` -- a partition or an element of the symmetric group ``self`` - OUTPUT: - - A conjugacy class of a symmetric group. + OUTPUT: a conjugacy class of a symmetric group EXAMPLES:: @@ -678,7 +676,7 @@ def __init__(self, domain=None): - ``n`` -- a positive integer, or list or tuple thereof - .. note:: + .. NOTE:: This group is also available via ``groups.permutation.Alternating()``. @@ -753,7 +751,7 @@ def __init__(self, n): - ``n`` -- a positive integer - .. note:: + .. NOTE:: This group is also available via ``groups.permutation.Cyclic()``. @@ -874,7 +872,7 @@ class DiCyclicGroup(PermutationGroup_unique): `i+1` and code `a^{i}x` as the symbol `2n+i+1`. The two generators are then represented using a left regular representation. - .. note:: + .. NOTE:: This group is also available via ``groups.permutation.DiCyclic()``. @@ -1004,7 +1002,7 @@ def _repr_(self): def is_commutative(self): r""" - Return True if this group is commutative. + Return ``True`` if this group is commutative. EXAMPLES:: @@ -1016,7 +1014,7 @@ def is_commutative(self): def is_abelian(self): r""" - Return True if this group is abelian. + Return ``True`` if this group is abelian. EXAMPLES:: @@ -1033,13 +1031,11 @@ def __init__(self): The Klein 4 Group, which has order `4` and exponent `2`, viewed as a subgroup of `S_4`. - OUTPUT: + OUTPUT: the Klein 4 group of order 4, as a permutation group of degree 4 - the Klein 4 group of order 4, as a permutation group of degree 4. - - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.KleinFour()``. + This group is also available via ``groups.permutation.KleinFour()``. EXAMPLES:: @@ -1152,7 +1148,7 @@ class QuaternionGroup(DiCyclicGroup): See the :class:`DiCyclicGroup` class for a generalization of this construction. - .. note:: + .. NOTE:: This group is also available via ``groups.permutation.Quaternion()``. @@ -1431,9 +1427,7 @@ def __init__(self, n): - ``n`` -- a positive integer - OUTPUT: - - The dihedral group of order `2n`, as a permutation group + OUTPUT: the dihedral group of order `2n`, as a permutation group .. NOTE:: @@ -1730,7 +1724,6 @@ def __init__(self, m): AUTHOR: - Kevin Halasz (2012-8-7) - """ if not isinstance(m, Integer): raise TypeError('m must be an integer, not %s' % m) @@ -1776,13 +1769,11 @@ def __init__(self, n): - ``n`` -- a positive integer in {9, 10, 11, 12, 21, 22, 23, 24}. - OUTPUT: + OUTPUT: the Mathieu group of degree `n`, as a permutation group - the Mathieu group of degree `n`, as a permutation group - - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.Mathieu()``. + This group is also available via ``groups.permutation.Mathieu()``. EXAMPLES:: @@ -1830,13 +1821,11 @@ def __init__(self, d, n): - ``n`` -- positive integer; the index of the group in the GAP database, starting at 1 - OUTPUT: - - the `n`-th transitive group of degree `d` + OUTPUT: the `n`-th transitive group of degree `d` - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.Transitive()``. + This group is also available via ``groups.permutation.Transitive()``. EXAMPLES:: @@ -2225,9 +2214,7 @@ class PrimitiveGroup(PermutationGroup_unique): - ``n`` -- positive integer. the index of the group in the GAP database, starting at 1 - OUTPUT: - - The ``n``-th primitive group of degree ``d``. + OUTPUT: Tthe ``n``-th primitive group of degree ``d`` EXAMPLES:: @@ -2302,10 +2289,6 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. - EXAMPLES:: sage: G = PrimitiveGroup(5,1); G @@ -2317,9 +2300,7 @@ def group_primitive_id(self): """ Return the index of this group in the GAP database of primitive groups. - OUTPUT: - - A positive integer, following GAP's conventions. + OUTPUT: a positive integer, following GAP's conventions EXAMPLES:: @@ -2417,9 +2398,7 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. + OUTPUT: a string TESTS:: @@ -2436,9 +2415,7 @@ def __contains__(self, G): - `G` -- anything. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -2494,9 +2471,7 @@ def _repr_(self): """ Return a string representation. - OUTPUT: - - String. + OUTPUT: a string TESTS:: @@ -2513,9 +2488,7 @@ def __contains__(self, G): - `G` -- anything. - OUTPUT: - - Boolean. + OUTPUT: boolean EXAMPLES:: @@ -2568,10 +2541,8 @@ def cardinality(self): r""" Return the cardinality of ``self``. - OUTPUT: - - An integer. The number of primitive groups of a given degree - up to isomorphism. + OUTPUT: an integer; the number of primitive groups of a given degree + up to isomorphism EXAMPLES:: @@ -2648,13 +2619,11 @@ def __init__(self, n, q, name='a'): - ``q`` -- prime power; the size of the ground field - ``name`` -- (default: ``'a'``) variable name of indeterminate of finite field `\GF(q)` - OUTPUT: - - PGL(`n`, `q`) + OUTPUT: PGL(`n`, `q`) - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.PGL()``. + This group is also available via ``groups.permutation.PGL()``. EXAMPLES:: @@ -2710,11 +2679,9 @@ def __init__(self, n, q, name='a'): - ``q`` -- either a prime power (the size of the ground field) or a finite field - ``name`` -- (default: ``'a'``) variable name of indeterminate of finite field `\GF(q)` - OUTPUT: + OUTPUT: the group PSL(`n`, `q`) - the group PSL(`n`, `q`) - - .. note:: + .. NOTE:: This group is also available via ``groups.permutation.PSL()``. @@ -2892,13 +2859,11 @@ def __init__(self, n, q, name='a'): - ``q`` -- prime power; the size of the ground field - ``name`` -- (default: ``'a'``) variable name of indeterminate of finite field `\GF(q)` - OUTPUT: + OUTPUT: PSp(`n`, `q`) - PSp(`n`, `q`) - - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.PSp()``. + This group is also available via ``groups.permutation.PSp()``. EXAMPLES:: @@ -2970,13 +2935,11 @@ def __init__(self, n, q, name='a'): - q -- prime power; the size of the ground field - name -- (default: 'a') variable name of indeterminate of finite field GF(q) - OUTPUT: - - PSU(n,q) + OUTPUT: PSU(n,q) - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.PSU()``. + This group is also available via ``groups.permutation.PSU()``. EXAMPLES:: @@ -3006,7 +2969,6 @@ def _repr_(self): sage: PSU(2,3) # needs sage.rings.finite_rings The projective special unitary group of degree 2 over Finite Field of size 3 - """ return "The projective special unitary group of degree %s over %s" % (self._n, self.base_ring()) @@ -3022,13 +2984,11 @@ def __init__(self, n, q, name='a'): - ``q`` -- prime power; the size of the ground field - ``name`` -- (default: ``'a'``) variable name of indeterminate of finite field `\GF(q)` - OUTPUT: - - PGU(`n`, `q`) + OUTPUT: PGU(`n`, `q`) - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.PGU()``. + This group is also available via ``groups.permutation.PGU()``. EXAMPLES:: @@ -3059,7 +3019,6 @@ def _repr_(self): sage: PGU(2,3) # needs sage.rings.finite_rings The projective general unitary group of degree 2 over Finite Field of size 3 - """ return "The projective general unitary group of degree %s over %s" % (self._n, self.base_ring()) @@ -3080,13 +3039,11 @@ def __init__(self, q, name='a'): - ``name`` -- (default: ``'a'``) variable name of indeterminate of finite field `\GF(q)` - OUTPUT: + OUTPUT: a Suzuki group - A Suzuki group. - - .. note:: + .. NOTE:: - This group is also available via ``groups.permutation.Suzuki()``. + This group is also available via ``groups.permutation.Suzuki()``. EXAMPLES:: @@ -3141,7 +3098,6 @@ def __str__(self): sage: G = SuzukiGroup(32, name='alpha') # needs sage.rings.finite_rings sage: print(G) # needs sage.rings.finite_rings The Suzuki group over Finite Field in alpha of size 2^5 - """ return "The Suzuki group over %s" % self.base_ring() diff --git a/src/sage/groups/perm_gps/symgp_conjugacy_class.py b/src/sage/groups/perm_gps/symgp_conjugacy_class.py index 23f5cdab15c..da051a72523 100644 --- a/src/sage/groups/perm_gps/symgp_conjugacy_class.py +++ b/src/sage/groups/perm_gps/symgp_conjugacy_class.py @@ -307,10 +307,8 @@ def conjugacy_class_iterator(part, S=None): - ``S`` -- (optional, default: `\{ 1, 2, \ldots, n \}`, where `n` is the size of ``part``) a set - OUTPUT: - - An iterator over the conjugacy class consisting of all - permutations of the set ``S`` whose cycle type is ``part``. + OUTPUT: an iterator over the conjugacy class consisting of all + permutations of the set ``S`` whose cycle type is ``part`` EXAMPLES:: diff --git a/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx b/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx index baaefa1950e..c1fc37fda84 100644 --- a/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx +++ b/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx @@ -30,8 +30,6 @@ with and an elementwisely defined multiplication of vectors. (The indexing of vectors is `0`-based here, so `\psi = (\psi_0, \psi_1, \ldots, \psi_{n-1})`.) - - The parent is :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialTransformationGroup`. @@ -77,7 +75,7 @@ def _is_id(f, R): def _inverse(f, R): """ - Returns the inverse to the automorphism `f` of a ring `R`. + Return the inverse to the automorphism `f` of a ring `R`. EXAMPLES:: diff --git a/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py b/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py index 602896e3ee8..50b5e5741d5 100644 --- a/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py +++ b/src/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py @@ -128,11 +128,9 @@ def __init__(self, R, len): - ``R`` -- a ring - - ``len`` -- the degree of the monomial group + - ``len`` -- the degree of the monomial group - OUTPUT: - - - the complete semimonomial group + OUTPUT: the complete semimonomial group EXAMPLES:: From ad196d956f9bbb67c4746ad2cbab0aa5cb0c5ed6 Mon Sep 17 00:00:00 2001 From: Giorgos Mousa Date: Fri, 12 Apr 2024 02:30:44 +0300 Subject: [PATCH 2/4] More docstring improvements in groups --- src/sage/groups/abelian_gps/abelian_group.py | 101 +++++++++--------- .../abelian_gps/abelian_group_element.py | 8 +- .../groups/abelian_gps/abelian_group_gap.py | 18 ++-- src/sage/groups/abelian_gps/all.py | 7 +- .../groups/abelian_gps/dual_abelian_group.py | 10 +- src/sage/groups/abelian_gps/element_base.py | 8 +- src/sage/groups/abelian_gps/values.py | 44 ++++---- .../additive_abelian_group.py | 20 ++-- .../additive_abelian_wrapper.py | 10 +- src/sage/groups/additive_abelian/qmodnz.py | 2 +- .../groups/additive_abelian/qmodnz_element.py | 4 +- src/sage/groups/affine_gps/affine_group.py | 10 +- src/sage/groups/affine_gps/euclidean_group.py | 4 +- src/sage/groups/affine_gps/group_element.py | 18 ++-- src/sage/groups/artin.py | 10 +- src/sage/groups/braid.py | 22 ++-- src/sage/groups/cactus_group.py | 2 +- src/sage/groups/class_function.py | 64 ++++------- src/sage/groups/cubic_braid.py | 35 +++--- src/sage/groups/finitely_presented.py | 42 ++++---- src/sage/groups/finitely_presented_named.py | 18 ++-- src/sage/groups/fqf_orthogonal.py | 2 +- src/sage/groups/free_group.py | 44 ++++---- src/sage/groups/galois_group.py | 28 ++--- src/sage/groups/galois_group_perm.py | 10 +- src/sage/groups/generic.py | 40 +++---- src/sage/groups/group.pyx | 6 +- src/sage/groups/group_exp.py | 4 +- src/sage/groups/group_semidirect_product.py | 3 +- src/sage/groups/indexed_free_group.py | 5 +- src/sage/groups/libgap_mixin.py | 12 +-- src/sage/groups/libgap_morphism.py | 5 +- src/sage/groups/libgap_wrapper.pyx | 18 ++-- .../groups/matrix_gps/finitely_generated.py | 12 +-- .../matrix_gps/finitely_generated_gap.py | 8 +- src/sage/groups/matrix_gps/group_element.pyx | 6 +- .../groups/matrix_gps/group_element_gap.pyx | 4 +- src/sage/groups/matrix_gps/isometries.py | 17 +-- src/sage/groups/matrix_gps/linear.py | 8 +- src/sage/groups/matrix_gps/matrix_group.py | 21 ++-- .../groups/matrix_gps/matrix_group_gap.py | 22 ++-- src/sage/groups/matrix_gps/named_group.py | 4 +- src/sage/groups/matrix_gps/named_group_gap.py | 18 ++-- src/sage/groups/matrix_gps/orthogonal.py | 8 +- src/sage/groups/matrix_gps/unitary.py | 2 +- src/sage/groups/misc_gps/argument_groups.py | 10 +- src/sage/groups/old.pyx | 5 +- src/sage/groups/pari_group.py | 4 +- .../perm_gps/partn_ref/data_structures.pyx | 39 +++---- .../perm_gps/partn_ref/refinement_binary.pyx | 62 +++++------ .../perm_gps/partn_ref/refinement_graphs.pyx | 28 ++--- .../partn_ref/refinement_matrices.pyx | 11 +- .../perm_gps/partn_ref/refinement_python.pyx | 43 ++++---- .../perm_gps/partn_ref/refinement_sets.pyx | 28 ++--- .../partn_ref2/refinement_generic.pyx | 8 +- src/sage/groups/perm_gps/permgroup.py | 2 +- src/sage/groups/perm_gps/permgroup_named.py | 24 ++--- .../semimonomial_transformation.pyx | 12 +-- 58 files changed, 520 insertions(+), 520 deletions(-) diff --git a/src/sage/groups/abelian_gps/abelian_group.py b/src/sage/groups/abelian_gps/abelian_group.py index a3db5c46179..b0752d92908 100644 --- a/src/sage/groups/abelian_gps/abelian_group.py +++ b/src/sage/groups/abelian_gps/abelian_group.py @@ -40,21 +40,21 @@ invariant factors of the group. You should now use :meth:`~AbelianGroup_class.gens_orders` instead:: - sage: J = AbelianGroup([2,0,3,2,4]); J - Multiplicative Abelian group isomorphic to C2 x Z x C3 x C2 x C4 - sage: J.gens_orders() # use this instead - (2, 0, 3, 2, 4) - sage: J.invariants() # deprecated - (2, 0, 3, 2, 4) - sage: J.elementary_divisors() # these are the "invariant factors" - (2, 2, 12, 0) - sage: for i in range(J.ngens()): - ....: print((i, J.gen(i), J.gen(i).order())) # or use this form - (0, f0, 2) - (1, f1, +Infinity) - (2, f2, 3) - (3, f3, 2) - (4, f4, 4) + sage: J = AbelianGroup([2,0,3,2,4]); J + Multiplicative Abelian group isomorphic to C2 x Z x C3 x C2 x C4 + sage: J.gens_orders() # use this instead + (2, 0, 3, 2, 4) + sage: J.invariants() # deprecated + (2, 0, 3, 2, 4) + sage: J.elementary_divisors() # these are the "invariant factors" + (2, 2, 12, 0) + sage: for i in range(J.ngens()): + ....: print((i, J.gen(i), J.gen(i).order())) # or use this form + (0, f0, 2) + (1, f1, +Infinity) + (2, f2, 3) + (3, f3, 2) + (4, f4, 4) Background on invariant factors and the Smith normal form (according to section 4.1 of [Cohen1]_): An abelian group is a @@ -160,7 +160,7 @@ .. [Rotman] \J. Rotman, An introduction to the theory of groups, 4th ed, Springer, 1995. -.. warning:: +.. WARNING:: Many basic properties for infinite abelian groups are not implemented. @@ -221,15 +221,17 @@ from sage.structure.unique_representation import UniqueRepresentation -# TODO: this uses perm groups - the AbelianGroupElement instance method -# uses a different implementation. +# .. TODO:: + +# this uses perm groups - the AbelianGroupElement instance method +# uses a different implementation. def word_problem(words, g, verbose=False): r""" - G and H are abelian, g in G, H is a subgroup of G generated by a - list (words) of elements of G. If g is in H, return the expression - for g as a word in the elements of (words). + `G` and `H` are abelian, `g` in `G`, `H` is a subgroup of `G` generated by + a list (words) of elements of `G`. If `g` is in `H`, return the expression + for `g` as a word in the elements of (words). - The 'word problem' for a finite abelian group G boils down to the + The 'word problem' for a finite abelian group `G` boils down to the following matrix-vector analog of the Chinese remainder theorem. Problem: Fix integers `1 tuple: """ Return the generators for this subgroup. - OUTPUT: a tuple of group elements generating the subgroup + OUTPUT: tuple of group elements generating the subgroup EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/abelian_group_element.py b/src/sage/groups/abelian_gps/abelian_group_element.py index 501872aaedd..3dc764dd7d0 100644 --- a/src/sage/groups/abelian_gps/abelian_group_element.py +++ b/src/sage/groups/abelian_gps/abelian_group_element.py @@ -49,8 +49,8 @@ def is_AbelianGroupElement(x): """ - Return true if x is an abelian group element, i.e., an element of - type AbelianGroupElement. + Return ``True`` if x is an abelian group element, i.e., an element of + type ``AbelianGroupElement``. EXAMPLES: Though the integer 3 is in the integers, and the integers have an abelian group structure, 3 is not an AbelianGroupElement:: @@ -92,8 +92,8 @@ class AbelianGroupElement(AbelianGroupElementBase): """ def as_permutation(self): r""" - Return the element of the permutation group G (isomorphic to the - abelian group A) associated to a in A. + Return the element of the permutation group ``G`` (isomorphic to the + abelian group ``A``) associated to ``a`` in ``A``. EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py index 41316f3b433..45a6a8bdd1a 100644 --- a/src/sage/groups/abelian_gps/abelian_group_gap.py +++ b/src/sage/groups/abelian_gps/abelian_group_gap.py @@ -92,7 +92,7 @@ def __reduce__(self): r""" Implement pickling. - OUTPUT: a tuple ``f`` such that this element is ``f[0](*f[1])`` + OUTPUT: tuple ``f`` such that this element is ``f[0](*f[1])`` EXAMPLES:: @@ -110,7 +110,7 @@ def exponents(self): r""" Return the tuple of exponents of this element. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -168,7 +168,7 @@ def order(self): r""" Return the order of this element. - OUTPUT: an integer or infinity + OUTPUT: integer or infinity EXAMPLES:: @@ -198,7 +198,7 @@ def exponents(self): r""" Return the tuple of exponents of ``self``. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -283,7 +283,7 @@ def _coerce_map_from_(self, S): def _element_constructor_(self, x, check=True): r""" - Defines coercions and conversions. + Define coercions and conversions. INPUT: @@ -482,7 +482,7 @@ def gens_orders(self): Use :meth:`elementary_divisors` if you are looking for an invariant of the group. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -715,7 +715,7 @@ def _repr_(self): def __reduce__(self): r""" - Implements pickling. + Implement pickling. We have to work around the fact that gap does not provide pickling. @@ -804,7 +804,7 @@ def _repr_(self): def __reduce__(self): r""" - Implements pickling. + Implement pickling. We have to work around the fact that gap does not provide pickling. @@ -935,7 +935,7 @@ def _repr_(self): def __reduce__(self): r""" - Implements pickling. + Implement pickling. We have to work around the fact that gap does not provide pickling. diff --git a/src/sage/groups/abelian_gps/all.py b/src/sage/groups/abelian_gps/all.py index 2bb91f85f3b..fa418e36c0c 100644 --- a/src/sage/groups/abelian_gps/all.py +++ b/src/sage/groups/abelian_gps/all.py @@ -20,10 +20,11 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -#from dual_abelian_group import DualAbelianGroup +# from dual_abelian_group import DualAbelianGroup from .abelian_group import AbelianGroup, word_problem from .values import AbelianGroupWithValues -# TODO: -# Implement group homset, conversion of generator images to morphism +# .. TODO:: + +# Implement group homset, conversion of generator images to morphism from .abelian_group_morphism import AbelianGroupMorphism diff --git a/src/sage/groups/abelian_gps/dual_abelian_group.py b/src/sage/groups/abelian_gps/dual_abelian_group.py index 7b1bbaee40d..86966cf74d6 100644 --- a/src/sage/groups/abelian_gps/dual_abelian_group.py +++ b/src/sage/groups/abelian_gps/dual_abelian_group.py @@ -117,7 +117,7 @@ class DualAbelianGroup_class(UniqueRepresentation, AbelianGroupBase): def __init__(self, G, names, base_ring): """ - The Python constructor + The Python constructor. EXAMPLES:: @@ -271,7 +271,7 @@ def gens(self) -> tuple: """ Return the generators for the group. - OUTPUT: a tuple of group elements generating the group + OUTPUT: tuple of group elements generating the group EXAMPLES:: @@ -299,7 +299,7 @@ def gens_orders(self): """ The orders of the generators of the dual group. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -328,7 +328,7 @@ def invariants(self): def __contains__(self, X): """ - Implements "in". + Implement "in". EXAMPLES:: @@ -373,7 +373,7 @@ def is_commutative(self): @cached_method def list(self): """ - Return tuple of all elements of this group. + Return a tuple of all elements of this group. EXAMPLES:: diff --git a/src/sage/groups/abelian_gps/element_base.py b/src/sage/groups/abelian_gps/element_base.py index 43d77c29494..7712049e219 100644 --- a/src/sage/groups/abelian_gps/element_base.py +++ b/src/sage/groups/abelian_gps/element_base.py @@ -214,7 +214,7 @@ def order(self): """ Return the order of this element. - OUTPUT: an integer or ``infinity`` + OUTPUT: integer or ``infinity`` EXAMPLES:: @@ -248,7 +248,7 @@ def order(self): def _div_(left, right): """ - Divide ``left`` and ``right`` + Divide ``left`` and ``right``. TESTS:: @@ -266,7 +266,7 @@ def _div_(left, right): def _mul_(left, right): """ - Multiply ``left`` and ``right`` + Multiply ``left`` and ``right``. TESTS:: @@ -284,7 +284,7 @@ def _mul_(left, right): def __pow__(self, n): """ - Exponentiate ``self`` + Exponentiate ``self``. TESTS:: diff --git a/src/sage/groups/abelian_gps/values.py b/src/sage/groups/abelian_gps/values.py index eda0858b1f8..c38edcfb9f9 100644 --- a/src/sage/groups/abelian_gps/values.py +++ b/src/sage/groups/abelian_gps/values.py @@ -16,7 +16,7 @@ number field. The :func:`AbelianGroupWithValues` keeps track of these associated values. -.. warning:: +.. WARNING:: Really, this requires a group homomorphism from the abstract Abelian group to the set of values. This is only checked if you @@ -85,10 +85,10 @@ def AbelianGroupWithValues(values, n, gens_orders=None, names='f', check=False, INPUT: - ``values`` -- a list/tuple/iterable of values that you want to - associate to the generators. + associate to the generators - ``n`` -- integer (optional). If not specified, will be derived - from ``gens_orders``. + from ``gens_orders`` - ``gens_orders`` -- a list of non-negative integers in the form `[a_0, a_1, \dots, a_{n-1}]`, typically written in increasing @@ -156,7 +156,7 @@ class AbelianGroupWithValuesEmbedding(Morphism): - ``domain`` -- a :class:`AbelianGroupWithValues_class` - ``codomain`` -- the values group (need not be in the category of - groups, e.g. symbolic ring). + groups, e.g. symbolic ring) EXAMPLES:: @@ -176,7 +176,7 @@ class AbelianGroupWithValuesEmbedding(Morphism): def __init__(self, domain, codomain): """ - Construct the morphism + Construct the morphism. TESTS:: @@ -218,13 +218,13 @@ class AbelianGroupWithValuesElement(AbelianGroupElement): INPUT: - - ``exponents`` -- tuple of integers. The exponent vector defining - the group element. + - ``exponents`` -- tuple of integers; the exponent vector defining + the group element - - ``parent`` -- the parent. + - ``parent`` -- the parent - ``value`` -- the value assigned to the group element or ``None`` - (default). In the latter case, the value is computed as needed. + (default); in the latter case, the value is computed as needed EXAMPLES:: @@ -235,7 +235,7 @@ class AbelianGroupWithValuesElement(AbelianGroupElement): def __init__(self, parent, exponents, value=None): """ - Create an element + Create an element. EXAMPLES:: @@ -269,7 +269,7 @@ def value(self): def _div_(left, right): """ - Divide ``left`` by ``right`` + Divide ``left`` by ``right``. TESTS:: @@ -287,7 +287,7 @@ def _div_(left, right): def _mul_(left, right): """ - Multiply ``left`` and ``right`` + Multiply ``left`` and ``right``. TESTS:: @@ -305,11 +305,11 @@ def _mul_(left, right): def __pow__(self, n): """ - Exponentiate ``self`` + Exponentiate ``self``. INPUT: - - ``n`` -- integer. The exponent. + - ``n`` -- integer; the exponent TESTS:: @@ -357,15 +357,15 @@ class AbelianGroupWithValues_class(AbelianGroup_class): INPUT: - - ``generator_orders`` -- tuple of integers. The orders of the + - ``generator_orders`` -- tuple of integers; the orders of the generators. - - ``names`` -- string or list of strings. The names for the generators. + - ``names`` -- string or list of strings; the names for the generators - - ``values`` -- Tuple the same length as the number of - generators. The values assigned to the generators. + - ``values`` -- tuple the same length as the number of + generators; the values assigned to the generators. - - ``values_group`` -- the common parent of the values. + - ``values_group`` -- the common parent of the values EXAMPLES:: @@ -376,7 +376,7 @@ class AbelianGroupWithValues_class(AbelianGroup_class): def __init__(self, generator_orders, names, values, values_group): """ - The Python constructor + The Python constructor. TESTS:: @@ -406,7 +406,7 @@ def gen(self, i=0): INPUT: - - ``i`` -- integer (default: 0). The index of the generator. + - ``i`` -- integer (default: 0); the index of the generator OUTPUT: a group element @@ -434,7 +434,7 @@ def gens_values(self): """ Return the values associated to the generators. - OUTPUT: a tuple + OUTPUT: tuple EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/additive_abelian_group.py b/src/sage/groups/additive_abelian/additive_abelian_group.py index 394ef807944..bbf91165437 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_group.py +++ b/src/sage/groups/additive_abelian/additive_abelian_group.py @@ -18,12 +18,12 @@ def AdditiveAbelianGroup(invs, remember_generators=True): INPUT: - - ``invs`` (list of integers): the invariants. + - ``invs`` -- list of integers; the invariants. These should all be greater than or equal to zero. - - ``remember_generators`` (boolean): whether or not to fix a set of - generators (corresponding to the given invariants, which need not be in - Smith form). + - ``remember_generators`` -- boolean (default: ``True``); whether or not + to fix a set of generators (corresponding to the given invariants, which + need not be in Smith form). OUTPUT: the abelian group `\bigoplus_i \ZZ / n_i \ZZ`, where `n_i` are the invariants @@ -206,9 +206,9 @@ class AdditiveAbelianGroup_class(FGP_Module_class): INPUT: - - ``cover`` -- the covering group as `\ZZ`-module. + - ``cover`` -- the covering group as `\ZZ`-module - - ``relations`` -- the relations as submodule of ``cover``. + - ``relations`` -- the relations as submodule of ``cover`` """ # The element class must be overridden in derived classes @@ -295,11 +295,11 @@ def _module_constructor(self, cover, relations, check=True): INPUT: - - ``cover`` -- the covering group as `\ZZ`-module. + - ``cover`` -- the covering group as `\ZZ`-module - - ``relations`` -- the relations as submodule of ``cover``. + - ``relations`` -- the relations as submodule of ``cover`` - - ``check`` -- ignored, present for compatibility with ``fg_pid`` code. + - ``check`` -- ignored, present for compatibility with ``fg_pid`` code EXAMPLES:: @@ -325,7 +325,7 @@ def _module_constructor(self, cover, relations, check=True): def order(self): r""" - Return the order of this group (an integer or infinity) + Return the order of this group (integer or infinity). EXAMPLES:: diff --git a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py index c12a67725b6..966b3137cdb 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py +++ b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py @@ -2,7 +2,7 @@ Wrapper class for abelian groups This class is intended as a template for anything in Sage that needs the -functionality of abelian groups. One can create an AdditiveAbelianGroupWrapper +functionality of abelian groups. One can create an ``AdditiveAbelianGroupWrapper`` object from any given set of elements in some given parent, as long as an ``_add_`` method has been defined. @@ -41,10 +41,10 @@ .. TODO:: - - Think about subgroups and quotients, which probably won't work - in the current implementation -- some fiddly adjustments will be - needed in order to be able to pass extra arguments to the - subquotient's init method. + Think about subgroups and quotients, which probably won't work + in the current implementation -- some fiddly adjustments will be + needed in order to be able to pass extra arguments to the + subquotient's init method. AUTHORS: diff --git a/src/sage/groups/additive_abelian/qmodnz.py b/src/sage/groups/additive_abelian/qmodnz.py index 34e9a0e9132..8ae0dd35728 100644 --- a/src/sage/groups/additive_abelian/qmodnz.py +++ b/src/sage/groups/additive_abelian/qmodnz.py @@ -51,7 +51,7 @@ class QmodnZ(Parent, UniqueRepresentation): #. ``QQ/(n*ZZ)``, where - - `n` -- an integer (including 0 or negative integers). + - `n` -- integer (including 0 or negative integers). OUTPUT: the abelian group `\Q/n\Z` diff --git a/src/sage/groups/additive_abelian/qmodnz_element.py b/src/sage/groups/additive_abelian/qmodnz_element.py index 73557159161..b3ebe8e2335 100644 --- a/src/sage/groups/additive_abelian/qmodnz_element.py +++ b/src/sage/groups/additive_abelian/qmodnz_element.py @@ -34,9 +34,9 @@ class QmodnZ_Element(AdditiveGroupElement): INPUT: - - ``q`` -- a rational number. + - ``q`` -- a rational number - - ``parent`` -- the parent abelian group `\Q/n\Z`. + - ``parent`` -- the parent abelian group `\Q/n\Z` OUTPUT: the element `q` of abelian group `\Q/n\Z`, in standard form diff --git a/src/sage/groups/affine_gps/affine_group.py b/src/sage/groups/affine_gps/affine_group.py index 38fa05058e0..f0e4b3d27f4 100644 --- a/src/sage/groups/affine_gps/affine_group.py +++ b/src/sage/groups/affine_gps/affine_group.py @@ -186,11 +186,11 @@ def __init__(self, degree, ring): INPUT: - - ``degree`` -- integer. The degree of the affine group, that + - ``degree`` -- integer; The degree of the affine group, that is, the dimension of the affine space the group is acting on - naturally. + naturally - - ``ring`` -- a ring. The base ring of the affine space. + - ``ring`` -- a ring; the base ring of the affine space EXAMPLES:: @@ -308,7 +308,7 @@ def degree(self): """ Return the dimension of the affine space. - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -435,7 +435,7 @@ def reflection(self, v): INPUT: - - ``v`` -- a vector, or something that determines a vector. + - ``v`` -- a vector, or something that determines a vector OUTPUT: diff --git a/src/sage/groups/affine_gps/euclidean_group.py b/src/sage/groups/affine_gps/euclidean_group.py index 3154eee7a01..000210ddeab 100644 --- a/src/sage/groups/affine_gps/euclidean_group.py +++ b/src/sage/groups/affine_gps/euclidean_group.py @@ -164,9 +164,9 @@ def _element_constructor_check(self, A, b): INPUT: - - ``A`` -- an element of :meth:`matrix_space`. + - ``A`` -- an element of :meth:`matrix_space` - - ``b`` -- an element of :meth:`vector_space`. + - ``b`` -- an element of :meth:`vector_space` OUTPUT: diff --git a/src/sage/groups/affine_gps/group_element.py b/src/sage/groups/affine_gps/group_element.py index 703137784e4..c4ffa997e94 100644 --- a/src/sage/groups/affine_gps/group_element.py +++ b/src/sage/groups/affine_gps/group_element.py @@ -53,20 +53,20 @@ class AffineGroupElement(MultiplicativeGroupElement): INPUT: - ``A`` -- an invertible matrix, or something defining a - matrix if ``convert==True``. + matrix if ``convert==True`` - ``b``-- a vector, or something defining a vector if ``convert==True`` (default: ``0``, defining the zero - vector). + vector) - - ``parent`` -- the parent affine group. + - ``parent`` -- the parent affine group - - ``convert`` - bool (default: ``True``). Whether to convert + - ``convert`` - bool (default: ``True``); whether to convert ``A`` into the correct matrix space and ``b`` into the - correct vector space. + correct vector space - - ``check`` - bool (default: ``True``). Whether to do some - checks or just accept the input as valid. + - ``check`` - bool (default: ``True``); whether to do some + checks or just accept the input as valid As a special case, ``A`` can be a matrix obtained from :meth:`matrix`, that is, one row and one column larger. In @@ -326,7 +326,7 @@ def _mul_(self, other): INPUT: - - ``other`` -- another element of the same affine group. + - ``other`` -- another element of the same affine group OUTPUT: the product of the affine group elements ``self`` and ``other`` defined by the composition of the two affine transformations @@ -354,7 +354,7 @@ def __call__(self, v): INPUT: - ``v`` -- a polynomial, a multivariate polynomial, a polyhedron, a - vector, or anything that can be converted into a vector. + vector, or anything that can be converted into a vector OUTPUT: the image of ``v`` under the affine group element diff --git a/src/sage/groups/artin.py b/src/sage/groups/artin.py index a198bccef69..306569e546b 100644 --- a/src/sage/groups/artin.py +++ b/src/sage/groups/artin.py @@ -77,7 +77,7 @@ def exponent_sum(self): """ Return the exponent sum of ``self``. - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -258,7 +258,7 @@ def _left_normal_form_coxeter(self): Return the left normal form of the element, in the `\Delta` exponent and Coxeter group element form. - OUTPUT: a tuple whose first element is the power of `\Delta`, and the + OUTPUT: tuple whose first element is the power of `\Delta`, and the rest are the Coxeter elements corresponding to the simple factors EXAMPLES:: @@ -596,7 +596,7 @@ def index_set(self): """ Return the index set of ``self``. - OUTPUT: a tuple + OUTPUT: tuple EXAMPLES:: @@ -654,7 +654,7 @@ def _standard_lift_Tietze(self, w): INPUT: - - ``w`` -- an element of the Coxeter group of ``self``. + - ``w`` -- an element of the Coxeter group of ``self`` EXAMPLES:: @@ -672,7 +672,7 @@ def _standard_lift(self, w): INPUT: - - ``w`` -- an element of the Coxeter group of ``self``. + - ``w`` -- an element of the Coxeter group of ``self`` EXAMPLES:: diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py index 71550739296..7721d3d602f 100644 --- a/src/sage/groups/braid.py +++ b/src/sage/groups/braid.py @@ -1523,7 +1523,7 @@ def _left_normal_form_coxeter(self): r""" Return the left normal form of the braid, in permutation form. - OUTPUT: a tuple whose first element is the power of `\Delta`, and the + OUTPUT: tuple whose first element is the power of `\Delta`, and the rest are the permutations corresponding to the simple factors EXAMPLES:: @@ -1626,7 +1626,7 @@ def centralizer(self): def super_summit_set(self): """ - Return a list with the super summit set of the braid + Return a list with the super summit set of the braid. EXAMPLES:: @@ -1864,7 +1864,7 @@ def pure_conjugating_braid(self, other): def ultra_summit_set(self): """ - Return a list with the orbits of the ultra summit set of ``self`` + Return a list with the orbits of the ultra summit set of ``self``. EXAMPLES:: @@ -2411,7 +2411,7 @@ def eps(self, N): INPUT: - - ``N`` -- an integer; the number of colors + - ``N`` -- integer; the number of colors EXAMPLES:: @@ -2637,7 +2637,7 @@ def strands(self): """ Return the number of strands. - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -2837,10 +2837,10 @@ def _LKB_matrix_(self, braid, variab): INPUT: - - ``braid`` -- tuple of integers. The Tietze list of the - braid. + - ``braid`` -- tuple of integers; the Tietze list of the + braid - - ``variab`` -- string. the names of the variables that will + - ``variab`` -- string. The names of the variables that will appear in the matrix. They must be given as a string, separated by a comma @@ -3452,7 +3452,7 @@ def epimorphisms(self, H): def BraidGroup(n=None, names='s'): """ - Construct a Braid Group + Construct a Braid Group. INPUT: @@ -3596,9 +3596,9 @@ def _act_(self, b, x): INPUT: - - ``b`` -- a braid. + - ``b`` -- a braid - - ``x`` -- a free group element. + - ``x`` -- a free group element OUTPUT: a new braid diff --git a/src/sage/groups/cactus_group.py b/src/sage/groups/cactus_group.py index a4a6fe629b0..c8d6ba7241f 100644 --- a/src/sage/groups/cactus_group.py +++ b/src/sage/groups/cactus_group.py @@ -43,7 +43,7 @@ class CactusGroup(UniqueRepresentation, Group): INPUT: - - ``n`` -- an integer + - ``n`` -- integer EXAMPLES: diff --git a/src/sage/groups/class_function.py b/src/sage/groups/class_function.py index 0af4d5ce646..c7978b4283e 100644 --- a/src/sage/groups/class_function.py +++ b/src/sage/groups/class_function.py @@ -50,10 +50,10 @@ def ClassFunction(group, values): INPUT: - - ``group`` -- a group. + - ``group`` -- a group - - ``values`` -- list/tuple/iterable of numbers. The values of the - class function on the conjugacy classes, in that order. + - ``values`` -- list/tuple/iterable of numbers; the values of the + class function on the conjugacy classes, in that order EXAMPLES:: @@ -168,10 +168,6 @@ def __repr__(self): r""" Return a string representation. - OUTPUT: - - A string. - EXAMPLES:: sage: G = SymmetricGroup(4) @@ -326,7 +322,7 @@ def __sub__(self, other): INPUT: - ``other`` -- a :class:`ClassFunction` of the same group as - ``self``. + ``self`` OUTPUT: a :class:`ClassFunction` @@ -353,9 +349,9 @@ def __mul__(self, other): INPUT: - ``other`` -- either a number or a :class:`ClassFunction` of - the same group as ``self``. A number can be anything that + the same group as ``self``; A number can be anything that can be converted into GAP: integers, rational, and elements - of certain number fields. + of certain number fields OUTPUT: a :class:`ClassFunction` @@ -468,12 +464,9 @@ def symmetric_power(self, n): INPUT: - - ``n`` -- a positive integer. + - ``n`` -- positive integer - OUTPUT: - - The ``n``-th symmetrized power of ``self`` as a - :class:`ClassFunction`. + OUTPUT: the ``n``-th symmetrized power of ``self`` as a :class:`ClassFunction` EXAMPLES:: @@ -495,10 +488,9 @@ def exterior_power(self, n): INPUT: - - ``n`` -- a positive integer. + - ``n`` -- positive integer. - OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a - :class:`ClassFunction` + OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a :class:`ClassFunction` EXAMPLES:: @@ -690,11 +682,9 @@ def restrict(self, H): INPUT: - - ``H`` -- a subgroup of the underlying group of ``self``. + - ``H`` -- a subgroup of the underlying group of ``self`` - OUTPUT: - - A :class:`ClassFunction` of ``H`` defined by restriction. + OUTPUT: a :class:`ClassFunction` of ``H`` defined by restriction EXAMPLES:: @@ -717,7 +707,7 @@ def induct(self, G): INPUT: - - ``G`` -- A supergroup of the underlying group of ``self``. + - ``G`` -- a supergroup of the underlying group of ``self`` OUTPUT: @@ -851,10 +841,6 @@ def _repr_(self): r""" Return a string representation. - OUTPUT: - - A string. - EXAMPLES:: sage: G = SymmetricGroup(4) @@ -941,9 +927,7 @@ def domain(self): r""" Return the domain of ``self``. - OUTPUT: - - The underlying group of the class function. + OUTPUT: the underlying group of the class function EXAMPLES:: @@ -990,8 +974,7 @@ def __add__(self, other): INPUT: - - ``other`` -- a :class:`ClassFunction` of the same group as - ``self``. + - ``other`` -- a :class:`ClassFunction` of the same group as ``self`` OUTPUT: a :class:`ClassFunction` @@ -1015,8 +998,7 @@ def __sub__(self, other): INPUT: - - ``other`` -- a :class:`ClassFunction` of the same group as - ``self``. + - ``other`` -- a :class:`ClassFunction` of the same group as ``self`` OUTPUT: a :class:`ClassFunction` @@ -1158,10 +1140,9 @@ def symmetric_power(self, n): INPUT: - - ``n`` -- a positive integer + - ``n`` -- positive integer - OUTPUT: the ``n``-th symmetrized power of ``self`` as a - :class:`ClassFunction` + OUTPUT: the ``n``-th symmetrized power of ``self`` as a :class:`ClassFunction` EXAMPLES:: @@ -1182,10 +1163,9 @@ def exterior_power(self, n): INPUT: - - ``n`` -- a positive integer + - ``n`` -- positive integer - OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a - :class:`ClassFunction` + OUTPUT: the ``n``-th antisymmetrized power of ``self`` as a :class:`ClassFunction` EXAMPLES:: @@ -1381,7 +1361,7 @@ def restrict(self, H): INPUT: - - ``H`` -- a subgroup of the underlying group of ``self``. + - ``H`` -- a subgroup of the underlying group of ``self`` OUTPUT: a :class:`ClassFunction` of ``H`` defined by restriction @@ -1411,7 +1391,7 @@ def induct(self, G): INPUT: - - ``G`` -- A supergroup of the underlying group of ``self``. + - ``G`` -- a supergroup of the underlying group of ``self`` OUTPUT: diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py index 17e543687a4..6f357c91b58 100644 --- a/src/sage/groups/cubic_braid.py +++ b/src/sage/groups/cubic_braid.py @@ -579,7 +579,7 @@ class CubicBraidGroup(FinitelyPresentedGroup): INPUT: - - ``names`` -- see the corresponding documentation of :class:`BraidGroup_class`. + - ``names`` -- see the corresponding documentation of :class:`BraidGroup_class` - ``cbg_type`` -- (default: ``CubicBraidGroup.type.Coxeter``; see explanation below) enum type :class:`CubicBraidGroup.type` @@ -1072,18 +1072,17 @@ def set_classical_realization(self, base_group, proj_group, centralizing_matrix, This is a local function of :meth:`_create_classical_realization`. - It handles the common part of symplectic and unitary version and creates conversion maps. + It handles the common part of symplectic and unitary version and + creates conversion maps. INPUT: - - ``base_group`` -- The symplectic or unitary groups Sp(m,3) resp. GU(m,2). - - ``proj_group`` -- The corresponding projective group of base_group. - - ``centralizing_matrix`` -- The centralizing matrix according to Assion. - - ``transvec_matrices`` -- List of transvection matrices according to Assion. + - ``base_group`` -- the symplectic or unitary groups Sp(m,3) resp. GU(m,2) + - ``proj_group`` -- the corresponding projective group of base_group + - ``centralizing_matrix`` -- the centralizing matrix according to Assion + - ``transvec_matrices`` -- list of transvection matrices according to Assion - OUTPUT: - - No output, but the function sets the attributes of ``self`` described above. + OUTPUT: no output, but the function sets the attributes of ``self`` described above """ centralizing_element = None @@ -1151,10 +1150,12 @@ def create_sympl_realization(self, m): INPUT: - - ``m`` -- Integer, the dimension of the classical groups vector-space of operation. + - ``m`` -- integer; the dimension of the classical groups + vector-space of operation - The function calculates the centralizing matrix and the transvections as given by Assion - and then uses set_classical_realization to complete the construction. + The function calculates the centralizing matrix and the + transvections as given by Assion and then uses + ``set_classical_realization`` to complete the construction. """ # ----------------------------------------------------------- # getting the invariant bilinear form of the group @@ -1222,10 +1223,12 @@ def create_unitary_realization(self, m): INPUT: - - ``m`` -- Integer, the dimension of the classical groups vector-space of operation. + - ``m`` -- integer; the dimension of the classical groups + vector-space of operation - The function calculates the centralizing_matrix and the transvections as given by Assion - and then uses set_classical_realization to complete the construction. + The function calculates the centralizing_matrix and the + transvections as given by Assion and then uses + ``set_classical_realization`` to complete the construction. """ # --------------------------------------------------------------------- # getting the invariant bilinear form of the group @@ -1459,7 +1462,7 @@ def braid_group(self): @cached_method def as_matrix_group(self, root_bur=None, domain=None, characteristic=None, var='t', reduced=False): r""" - Creates an epimorphic image of ``self`` as a matrix group by use of + Create an epimorphic image of ``self`` as a matrix group by use of the burau representation. INPUT: diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index adb166093cd..69bc261a17c 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -296,7 +296,7 @@ def Tietze(self): the letter corresponding to the `i`-th generator of the group. Negative integers represent the inverses of generators. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -320,11 +320,11 @@ def __call__(self, *values, **kwds): INPUT: - ``*values`` -- a list/tuple/iterable of the same length as - the number of generators. + the number of generators - - ``check=True`` -- boolean keyword (default: - ``True``). Whether to verify that ``values`` satisfy the - relations in the finitely presented group. + - ``check=True`` -- boolean keyword (default: ``True``); whether to + verify that ``values`` satisfy the relations in the finitely + presented group OUTPUT: the product of ``values`` in the order and with exponents specified by ``self`` @@ -553,7 +553,7 @@ def finitely_presented_group(self): def reduce(self, element): """ - Applies the rules in the rewriting system to the element, to obtain + Apply the rules in the rewriting system to the element, to obtain a reduced form. If the rewriting system is confluent, this reduced form is unique @@ -683,7 +683,7 @@ def is_confluent(self): def make_confluent(self): """ - Applies Knuth-Bendix algorithm to try to transform the rewriting + Apply the Knuth-Bendix algorithm to try to transform the rewriting system into a confluent one. Note that this method does not return any object, just changes the @@ -818,9 +818,9 @@ def _repr_(self): def _latex_(self): """ - Return a LaTeX representation + Return a LaTeX representation. - OUTPUT: a string; a valid LaTeX math command sequence + OUTPUT: string; a valid LaTeX math command sequence TESTS:: @@ -887,8 +887,8 @@ def cardinality(self, limit=4096000): INPUT: - - ``limit`` -- integer (default: 4096000). The maximal number - of cosets before the computation is aborted. + - ``limit`` -- integer (default: 4096000); the maximal number + of cosets before the computation is aborted OUTPUT: integer or ``Infinity``; the number of elements in the group @@ -937,8 +937,8 @@ def as_permutation_group(self, limit=4096000): INPUT: - - ``limit`` -- integer (default: 4096000). The maximal number - of cosets before the computation is aborted. + - ``limit`` -- integer (default: 4096000); the maximal number + of cosets before the computation is aborted OUTPUT: @@ -1536,7 +1536,7 @@ def epimorphisms(self, H): INPUT: - - `H` -- Another group + - `H` -- another group EXAMPLES:: @@ -1654,8 +1654,9 @@ def abelian_alexander_matrix(self, ring=QQ, simplified=True): OUTPUT: - ``A`` -- a matrix with coefficients in ``R`` - - ``ideal`` -- an list of generators of an ideal ``I`` of ``R = A.base_ring()`` such that ``R/I`` is - the group algebra of the abelianization of ``self`` + - ``ideal`` -- an list of generators of an ideal ``I`` of + ``R = A.base_ring()`` such that ``R/I`` is the group algebra of the + abelianization of ``self`` EXAMPLES:: @@ -1720,10 +1721,11 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False): r""" Return the characteristic varieties of the group ``self``. - There are several definitions of the characteristic varieties of a group `G`, see e.g. [CS1999a]_. Let `\Lambda` be the - group algebra of `G/G'` and `\mathbb{T}` its associated algebraic variety (a torus). Each - element `\xi\in\mathbb{T}` defines a local system of coefficients and the `k` th-characteristic - variety is + There are several definitions of the characteristic varieties of a + group `G`, see e.g. [CS1999a]_. Let `\Lambda` be the group algebra of + `G/G'` and `\mathbb{T}` its associated algebraic variety (a torus). + Each element `\xi\in\mathbb{T}` defines a local system of coefficients + and the `k` th-characteristic variety is .. MATH:: diff --git a/src/sage/groups/finitely_presented_named.py b/src/sage/groups/finitely_presented_named.py index 256ad33404f..8b07c5af7df 100644 --- a/src/sage/groups/finitely_presented_named.py +++ b/src/sage/groups/finitely_presented_named.py @@ -77,7 +77,7 @@ def CyclicPresentation(n): INPUT: - - ``n`` -- The order of the cyclic presentation to be returned. + - ``n`` -- the order of the cyclic presentation to be returned OUTPUT: the cyclic group of order `n` as finite presentation @@ -110,9 +110,9 @@ def FinitelyGeneratedAbelianPresentation(int_list): INPUT: - - ``int_list`` -- List of integers defining the group to be returned, the defining list + - ``int_list`` -- list of integers defining the group to be returned, the defining list is reduced to the invariants of the input list before generating the corresponding - group. + group OUTPUT: @@ -298,7 +298,7 @@ def DihedralPresentation(n): INPUT: - - ``n`` -- The size of the set that `D_n` is acting on. + - ``n`` -- the size of the set that `D_n` is acting on OUTPUT: Dihedral group of order `2n` @@ -335,7 +335,7 @@ def DiCyclicPresentation(n): INPUT: - ``n`` -- positive integer, 2 or greater, determining the order of - the group (`4n`). + the group (`4n`) OUTPUT: the dicyclic group of order `4n` is defined by the presentation @@ -384,8 +384,8 @@ def SymmetricPresentation(n): INPUT: - - ``n`` -- The size of the underlying set of arbitrary symbols being acted - on by the Symmetric group of order `n!`. + - ``n`` -- the size of the underlying set of arbitrary symbols being acted + on by the Symmetric group of order `n!` OUTPUT: @@ -461,8 +461,8 @@ def AlternatingPresentation(n): INPUT: - - ``n`` -- The size of the underlying set of arbitrary symbols being acted - on by the Alternating group of order `n!/2`. + - ``n`` -- the size of the underlying set of arbitrary symbols being acted + on by the Alternating group of order `n!/2` OUTPUT: diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py index f810e8dccb3..47dac17281b 100644 --- a/src/sage/groups/fqf_orthogonal.py +++ b/src/sage/groups/fqf_orthogonal.py @@ -124,7 +124,7 @@ class FqfOrthogonalGroup(AbelianGroupAutomorphismGroup_subgroup): INPUT: - - ``T`` -- a non degenerate torsion quadratic module. + - ``T`` -- a non degenerate torsion quadratic module EXAMPLES:: diff --git a/src/sage/groups/free_group.py b/src/sage/groups/free_group.py index 1da411b3036..09eb12d6a1c 100644 --- a/src/sage/groups/free_group.py +++ b/src/sage/groups/free_group.py @@ -80,7 +80,7 @@ def is_FreeGroup(x): INPUT: - - ``x`` -- anything. + - ``x`` -- anything OUTPUT: boolean @@ -107,9 +107,9 @@ def _lexi_gen(zeroes=False): INPUT: - - ``zeroes`` -- Boolean defaulting as ``False``. If ``True``, the + - ``zeroes`` -- boolean (default: ``False``); if ``True``, the integers appended to the output string begin at zero at the - first iteration through the alphabet. + first iteration through the alphabet OUTPUT: @@ -162,11 +162,11 @@ class FreeGroupElement(ElementLibGAP): INPUT: - - ``x`` -- something that determines the group element. Either a + - ``x`` -- something that determines the group element; either a :class:`~sage.libs.gap.element.GapElement` or the Tietze list - (see :meth:`Tietze`) of the group element. + (see :meth:`Tietze`) of the group element - - ``parent`` -- the parent :class:`FreeGroup`. + - ``parent`` -- the parent :class:`FreeGroup` EXAMPLES:: @@ -241,7 +241,7 @@ def __hash__(self): def _latex_(self): r""" - Return a LaTeX representation + Return a LaTeX representation. OUTPUT: a string; a valid LaTeX math command sequence @@ -301,7 +301,7 @@ def Tietze(self): the letter corresponding to the `i`-th generator of the group. Negative integers represent the inverses of generators. - OUTPUT: a tuple of integers + OUTPUT: tuple of integers EXAMPLES:: @@ -519,7 +519,7 @@ def __call__(self, *values): - ``*values`` -- a sequence of values, or a list/tuple/iterable of the same length as the number of - generators of the free group. + generators of the free group OUTPUT: the product of ``values`` in the order and with exponents specified by ``self`` @@ -597,11 +597,11 @@ def FreeGroup(n=None, names='x', index_set=None, abelian=False, **kwds): INPUT: - - ``n`` -- integer or ``None`` (default). The number of - generators. If not specified the ``names`` are counted. + - ``n`` -- integer (default: ``None``); the number of + generators (if not specified the ``names`` are counted) - ``names`` -- string or list/tuple/iterable of strings (default: - ``'x'``). The generator names or name prefix. + ``'x'``); the generator names or name prefix - ``index_set`` -- (optional) an index set for the generators; if specified then the optional keyword ``abelian`` can be used @@ -690,7 +690,7 @@ def wrap_FreeGroup(libgap_free_group): INPUT: - - ``libgap_free_group`` -- a LibGAP free group. + - ``libgap_free_group`` -- a LibGAP free group OUTPUT: a Sage :class:`FreeGroup_class` @@ -743,12 +743,12 @@ def __init__(self, generator_names, libgap_free_group=None): INPUT: - - ``generator_names`` -- a tuple of strings. The names of the - generators. + - ``generator_names`` -- a tuple of strings; the names of the + generators - - ``libgap_free_group`` -- a LibGAP free group or ``None`` - (default). The LibGAP free group to wrap. If ``None``, a - suitable group will be constructed. + - ``libgap_free_group`` -- a LibGAP free group (default: ``None``); + the LibGAP free group to wrap (if ``None``, a suitable group will be + constructed) TESTS:: @@ -786,7 +786,7 @@ def rank(self): Alias for :meth:`ngens`. - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -907,10 +907,10 @@ def quotient(self, relations, **kwds): INPUT: - - ``relations`` -- A list/tuple/iterable with the elements of - the free group. + - ``relations`` -- a list/tuple/iterable with the elements of + the free group - further named arguments, that are passed to the constructor - of a finitely presented group. + of a finitely presented group OUTPUT: diff --git a/src/sage/groups/galois_group.py b/src/sage/groups/galois_group.py index a7439d18ab3..b3460f32be8 100644 --- a/src/sage/groups/galois_group.py +++ b/src/sage/groups/galois_group.py @@ -25,9 +25,11 @@ def _alg_key(self, algorithm=None, recompute=False): r""" Return a key for use in cached_method calls. - If recompute is false, will cache using ``None`` as the key, so no recomputation will be done. + If recompute is false, will cache using ``None`` as the key, so no + recomputation will be done. - If recompute is true, will cache by algorithm, yielding a recomputation for each different algorithm. + If recompute is true, will cache by algorithm, yielding a recomputation + for each different algorithm. EXAMPLES:: @@ -45,10 +47,11 @@ def _alg_key(self, algorithm=None, recompute=False): class _GMixin: r""" - This class provides some methods for Galois groups to be used for both permutation groups - and abelian groups, subgroups and full Galois groups. + This class provides some methods for Galois groups to be used for both + permutation groups and abelian groups, subgroups and full Galois groups. - It is just intended to provide common functionality between various different Galois group classes. + It is just intended to provide common functionality between various + different Galois group classes. """ @lazy_attribute def _default_algorithm(self): @@ -90,7 +93,7 @@ def _gcdata(self): def _get_algorithm(self, algorithm): r""" - Allows overriding the default algorithm specified at object creation. + Allow overriding the default algorithm specified at object creation. EXAMPLES:: @@ -177,7 +180,7 @@ def _field(self): def _repr_(self): """ - String representation of this Galois group + String representation of this Galois group. EXAMPLES:: @@ -309,13 +312,14 @@ def fixed_field(self, name=None, polred=None, threshold=None): INPUT: - - ``name`` -- a variable name for the new field. + - ``name`` -- a variable name for the new field - ``polred`` -- whether to optimize the generator of the newly created field - for a simpler polynomial, using pari's polredbest. - Defaults to ``True`` when the degree of the fixed field is at most 8. + for a simpler polynomial, using pari's polredbest; + defaults to ``True`` when the degree of the fixed field is at most 8 - - ``threshold`` -- positive number; polred only performed if the cost is at most this threshold + - ``threshold`` -- positive number; polred only performed if the cost + is at most this threshold EXAMPLES:: @@ -377,7 +381,7 @@ def is_galois(self): @lazy_attribute def _gcdata(self): r""" - Return the Galois closure (ie, the finite field itself) together with the identity + Return the Galois closure (ie, the finite field itself) together with the identity. EXAMPLES:: diff --git a/src/sage/groups/galois_group_perm.py b/src/sage/groups/galois_group_perm.py index 7a640bcfe29..3b81e0d5908 100644 --- a/src/sage/groups/galois_group_perm.py +++ b/src/sage/groups/galois_group_perm.py @@ -17,11 +17,13 @@ class GaloisGroup_perm(_GaloisMixin, PermutationGroup_generic): - ``field`` -- a field, separable over its base - - ``names`` -- a string or tuple of length 1, giving a variable name for the splitting field + - ``names`` -- a string or tuple of length 1, giving a variable name for + the splitting field - - ``gc_numbering`` -- boolean, whether to express permutations in terms of the - roots of the defining polynomial of the splitting field (versus the defining polynomial - of the original extension). The default value may vary based on the type of field. + - ``gc_numbering`` -- boolean, whether to express permutations in terms of + the roots of the defining polynomial of the splitting field (versus the + defining polynomial of the original extension); the default value may + vary based on the type of field """ @abstract_method def transitive_number(self, algorithm=None, recompute=False): diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index 5a540088d2c..86aebc74709 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -534,7 +534,7 @@ def discrete_log_rho(a, base, ord=None, operation='*', identity=None, inverse=No - ``hash_function`` -- having an efficient hash function is critical for this algorithm (see examples) - OUTPUT: an integer `n` such that `a = base^n` (or `a = n*base`) + OUTPUT: integer `n` such that `a = base^n` (or `a = n*base`) ALGORITHM: Pollard rho for discrete logarithm, adapted from the article of Edlyn Teske, 'A space efficient algorithm for group @@ -600,7 +600,6 @@ def discrete_log_rho(a, base, ord=None, operation='*', identity=None, inverse=No AUTHOR: - Yann Laigle-Chapuy (2009-09-05) - """ from sage.rings.integer import Integer from sage.rings.finite_rings.integer_mod_ring import IntegerModRing @@ -701,7 +700,8 @@ def discrete_log(a, base, ord=None, bounds=None, operation='*', identity=None, i - ``identity`` -- the group's identity - ``inverse()`` - function of 1 argument ``x``, returning inverse of ``x`` - ``op()`` - function of 2 arguments ``x``, ``y``, returning ``x*y`` in the group - - ``algorithm`` -- string denoting what algorithm to use for prime-order logarithms: ``'bsgs'``, ``'rho'``, ``'lambda'`` + - ``algorithm`` -- string denoting what algorithm to use for prime-order + logarithms: ``'bsgs'``, ``'rho'``, ``'lambda'`` ``a`` and ``base`` must be elements of some group with identity given by ``identity``, inverse of ``x`` by ``inverse(x)``, and group @@ -719,7 +719,7 @@ def discrete_log(a, base, ord=None, bounds=None, operation='*', identity=None, i If no such `n` exists, this function raises a :class:`ValueError` exception. - .. warning:: + .. WARNING:: If ``x`` has a ``log`` method, it is likely to be vastly faster than using this function. E.g., if ``x`` is an integer modulo @@ -993,7 +993,7 @@ def discrete_log_lambda(a, base, bounds, operation='*', identity=None, inverse=N - op() -- function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group - hash_function -- having an efficient hash function is critical for this algorithm - OUTPUT: an integer `n` such that `a=base^n` (or `a=n*base`) + OUTPUT: integer `n` such that `a=base^n` (or `a=n*base`) ALGORITHM: Pollard Lambda, if bounds are (lb,ub) it has time complexity O(sqrt(ub-lb)) and space complexity O(log(ub-lb)) @@ -1200,19 +1200,19 @@ def order_from_multiple(P, m, plist=None, factorization=None, check=True, INPUT: - - ``P`` -- a Sage object which is a group element; + - ``P`` -- a Sage object which is a group element - ``m`` -- a Sage integer which is a multiple of the order of ``P``, - i.e. we require that ``m*P=0`` (or ``P**m=1``); + i.e. we require that ``m*P=0`` (or ``P**m=1``) - ``check`` -- a Boolean (default: ``True``), indicating whether we check if ``m`` - really is a multiple of the order; + really is a multiple of the order - ``factorization`` -- the factorization of ``m``, or ``None`` in which - case this function will need to factor ``m``; + case this function will need to factor ``m`` - ``plist`` -- a list of the prime factors of ``m``, or ``None``. Kept for compatibility only, - prefer the use of ``factorization``; - - ``operation`` -- string: ``'+'`` (default), ``'*'`` or ``None``; - - ``identity`` -- the identity element of the group; - - ``inverse()`` -- function of 1 argument ``x``, returning inverse of ``x``; - - ``op()`` - function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group. + prefer the use of ``factorization`` + - ``operation`` -- string: ``'+'`` (default), ``'*'`` or ``None`` + - ``identity`` -- the identity element of the group + - ``inverse()`` -- function of 1 argument ``x``, returning inverse of ``x`` + - ``op()`` - function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group .. NOTE:: @@ -1298,7 +1298,7 @@ def _multiple(A, B): # we use an internal recursive function to avoid unnecessary computations. def _order_from_multiple_helper(Q, L, S): """ - internal use, to minimize the number of group operations. + For internal use, to minimize the number of group operations. """ l = len(L) if l == 1: @@ -1349,10 +1349,10 @@ def order_from_bounds(P, bounds, d=None, operation='+', - ``P`` -- a Sage object which is a group element - ``bounds`` -- a 2-tuple ``(lb,ub)`` such that ``m*P=0`` (or - ``P**m=1``) for some ``m`` with ``lb<=m<=ub``. + ``P**m=1``) for some ``m`` with ``lb<=m<=ub`` - ``d`` -- (optional) a positive integer; only ``m`` which are - multiples of this will be considered. + multiples of this will be considered - ``operation`` -- string: ``'+'`` (default ) or ``'*'`` or other. If other, the following must be supplied: @@ -1626,10 +1626,10 @@ def structure_description(G, latex=False): INPUT: - - ``latex`` -- a boolean (default: ``False``). If ``True``, return a - LaTeX formatted string. + - ``latex`` -- a boolean (default: ``False``); if ``True``, return a + LaTeX formatted string - OUTPUT: a string + OUTPUT: string .. WARNING:: diff --git a/src/sage/groups/group.pyx b/src/sage/groups/group.pyx index 2f1a6cc1846..32fe6d13941 100644 --- a/src/sage/groups/group.pyx +++ b/src/sage/groups/group.pyx @@ -27,7 +27,7 @@ def is_Group(x): INPUT: - - ``x`` -- anything. + - ``x`` -- anything OUTPUT: boolean @@ -48,7 +48,7 @@ def is_Group(x): cdef class Group(Parent): """ - Base class for all groups + Base class for all groups. TESTS:: @@ -76,7 +76,7 @@ cdef class Group(Parent): """ def __init__(self, base=None, category=None): """ - The Python constructor + The Python constructor. TESTS:: diff --git a/src/sage/groups/group_exp.py b/src/sage/groups/group_exp.py index 58d9ba4b512..ccf6d62f147 100644 --- a/src/sage/groups/group_exp.py +++ b/src/sage/groups/group_exp.py @@ -140,7 +140,7 @@ def _apply_functor_to_morphism(self, f): INPUT: - - A homomorphism `f` of commutative additive groups. + - A homomorphism `f` of commutative additive groups OUTPUT: the above homomorphism, but between the corresponding multiplicative groups @@ -180,7 +180,7 @@ class GroupExpElement(ElementWrapper, MultiplicativeGroupElement): - ``self`` -- the exponentiated group element being created - ``parent`` -- the exponential group (parent of ``self``) - - ``x`` -- the commutative additive group element being wrapped to form ``self``. + - ``x`` -- the commutative additive group element being wrapped to form ``self`` EXAMPLES:: diff --git a/src/sage/groups/group_semidirect_product.py b/src/sage/groups/group_semidirect_product.py index 0c8ba8a96aa..7adc1868f8d 100644 --- a/src/sage/groups/group_semidirect_product.py +++ b/src/sage/groups/group_semidirect_product.py @@ -136,7 +136,8 @@ def to_opposite(self): class GroupSemidirectProduct(CartesianProduct): r""" - Return the semidirect product of the groups ``G`` and ``H`` using the homomorphism ``twist``. + Return the semidirect product of the groups ``G`` and ``H`` using the + homomorphism ``twist``. INPUT: diff --git a/src/sage/groups/indexed_free_group.py b/src/sage/groups/indexed_free_group.py index 79be1df663d..02a4838d77c 100644 --- a/src/sage/groups/indexed_free_group.py +++ b/src/sage/groups/indexed_free_group.py @@ -24,7 +24,8 @@ from sage.categories.poor_man_map import PoorManMap from sage.groups.group import Group, AbelianGroup from sage.monoids.indexed_free_monoid import (IndexedMonoid, - IndexedFreeMonoidElement, IndexedFreeAbelianMonoidElement) + IndexedFreeMonoidElement, + IndexedFreeAbelianMonoidElement) from sage.misc.cachefunc import cached_method import sage.data_structures.blas_dict as blas from sage.rings.integer import Integer @@ -165,7 +166,7 @@ def __init__(self, indices, prefix, category=None, **kwds): def _repr_(self): """ - Return a string representation of ``self`` + Return a string representation of ``self``. TESTS:: diff --git a/src/sage/groups/libgap_mixin.py b/src/sage/groups/libgap_mixin.py index aeb100f2ca2..931d22ccdc5 100644 --- a/src/sage/groups/libgap_mixin.py +++ b/src/sage/groups/libgap_mixin.py @@ -196,7 +196,7 @@ def is_finite(self): def cardinality(self): """ - Implements :meth:`EnumeratedSets.ParentMethods.cardinality`. + Implement :meth:`EnumeratedSets.ParentMethods.cardinality`. EXAMPLES:: @@ -329,8 +329,8 @@ def class_function(self, values): INPUT: - - ``values`` -- list/tuple/iterable of numbers. The values of the - class function on the conjugacy classes, in that order. + - ``values`` -- list/tuple/iterable of numbers; the values of the + class function on the conjugacy classes, in that order EXAMPLES:: @@ -647,7 +647,7 @@ def irreducible_characters(self): """ Return the irreducible characters of the group. - OUTPUT: a tuple containing all irreducible characters + OUTPUT: tuple containing all irreducible characters EXAMPLES:: @@ -853,7 +853,7 @@ def list(self): """ List all elements of this group. - OUTPUT: a tuple containing all group elements in a random but fixed + OUTPUT: tuple containing all group elements in a random but fixed order EXAMPLES:: @@ -926,7 +926,7 @@ def is_isomorphic(self, H): INPUT: - - ``H`` -- a group. + - ``H`` -- a group OUTPUT: boolean diff --git a/src/sage/groups/libgap_morphism.py b/src/sage/groups/libgap_morphism.py index 5b780ceb922..ec48dda3776 100644 --- a/src/sage/groups/libgap_morphism.py +++ b/src/sage/groups/libgap_morphism.py @@ -46,7 +46,8 @@ class GroupMorphism_libgap(Morphism): INPUT: - ``homset`` -- the parent - - ``gap_hom`` -- a :class:`sage.libs.gap.element.GapElement` consisting of a group homomorphism + - ``gap_hom`` -- a :class:`sage.libs.gap.element.GapElement` consisting of + a group homomorphism - ``check`` -- (default: ``True``) check if the ``gap_hom`` is a group homomorphism; this can be expensive @@ -283,7 +284,7 @@ def __init__(self, homset, gap_hom, check=True): def __reduce__(self): r""" - Implements pickling. + Implement pickling. We have to work around the fact that GAP does not provide pickling. diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index 0834a304c66..abaf17f11d9 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -86,11 +86,11 @@ class ParentLibGAP(SageObject): INPUT: - ``libgap_parent`` -- the libgap element that is the parent in - GAP. + GAP - ``ambient`` -- A derived class of :class:`ParentLibGAP` or - ``None`` (default). The ambient class if ``libgap_parent`` has - been defined as a subgroup. + ``None`` (default); the ambient class if ``libgap_parent`` has + been defined as a subgroup EXAMPLES:: @@ -300,7 +300,7 @@ class ParentLibGAP(SageObject): """ Return the number of generators of ``self``. - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -392,7 +392,7 @@ class ParentLibGAP(SageObject): """ Return the `i`-th generator of ``self``. - .. warning:: + .. WARNING:: Indexing starts at `0` as usual in Sage/Python. Not as in GAP, where indexing starts at `1`. @@ -400,7 +400,7 @@ class ParentLibGAP(SageObject): INPUT: - ``i`` -- integer between `0` (inclusive) and :meth:`ngens` - (exclusive). The index of the generator. + (exclusive); The index of the generator OUTPUT: the `i`-th generator of the group @@ -453,7 +453,7 @@ class ParentLibGAP(SageObject): cdef class ElementLibGAP(MultiplicativeGroupElement): """ - A class for LibGAP-based Sage group elements + A class for LibGAP-based Sage group elements. INPUT: @@ -593,7 +593,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): def _latex_(self): r""" - Return a LaTeX representation + Return a LaTeX representation. OUTPUT: a string; a valid LaTeX math command sequence @@ -613,7 +613,7 @@ cdef class ElementLibGAP(MultiplicativeGroupElement): cpdef _mul_(left, right): """ - Multiplication of group elements + Multiplication of group elements. TESTS:: diff --git a/src/sage/groups/matrix_gps/finitely_generated.py b/src/sage/groups/matrix_gps/finitely_generated.py index 3ad8719a5dd..1df22e6c3a6 100644 --- a/src/sage/groups/matrix_gps/finitely_generated.py +++ b/src/sage/groups/matrix_gps/finitely_generated.py @@ -211,10 +211,10 @@ def MatrixGroup(*gens, **kwds): INPUT: - ``*gens`` -- matrices, or a single list/tuple/iterable of - matrices, or a matrix group. + matrices, or a matrix group - - ``check`` -- boolean keyword argument (optional, default: - ``True``). Whether to check that each matrix is invertible. + - ``check`` -- boolean keyword argument (default: ``True``); + whether to check that each matrix is invertible EXAMPLES:: @@ -410,7 +410,7 @@ def gens(self) -> tuple: def gen(self, i): """ - Return the `i`-th generator + Return the `i`-th generator. OUTPUT: the `i`-th generator of the group @@ -430,9 +430,9 @@ def gen(self, i): def ngens(self): """ - Return the number of generators + Return the number of generators. - OUTPUT: an integer; the number of generators + OUTPUT: integer; the number of generators EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/finitely_generated_gap.py b/src/sage/groups/matrix_gps/finitely_generated_gap.py index b1623f543f9..70c45d59162 100644 --- a/src/sage/groups/matrix_gps/finitely_generated_gap.py +++ b/src/sage/groups/matrix_gps/finitely_generated_gap.py @@ -85,13 +85,13 @@ def as_permutation_group(self, algorithm=None, seed=None): INPUT: - - ``algorithm`` -- ``None`` or ``'smaller'``. In the latter + - ``algorithm`` -- ``None`` or ``'smaller'``; in the latter case, try harder to find a permutation representation of - small degree. + small degree - ``seed`` -- ``None`` or an integer specifying the seed - to fix results depending on pseudo-random-numbers. Here + to fix results depending on pseudo-random-numbers; here it makes sense to be used with respect to the ``'smaller'`` - option, since GAP produces random output in that context. + option, since GAP produces random output in that context OUTPUT: diff --git a/src/sage/groups/matrix_gps/group_element.pyx b/src/sage/groups/matrix_gps/group_element.pyx index 2e6428fc714..99c21b2589a 100644 --- a/src/sage/groups/matrix_gps/group_element.pyx +++ b/src/sage/groups/matrix_gps/group_element.pyx @@ -91,11 +91,11 @@ except ImportError: cpdef is_MatrixGroupElement(x): """ - Test whether ``x`` is a matrix group element + Test whether ``x`` is a matrix group element. INPUT: - - ``x`` -- anything. + - ``x`` -- anything OUTPUT: boolean @@ -370,7 +370,7 @@ cdef class MatrixGroupElement_generic(MultiplicativeGroupElement): def __invert__(self): """ - Return the inverse group element + Return the inverse group element. OUTPUT: a matrix group element diff --git a/src/sage/groups/matrix_gps/group_element_gap.pyx b/src/sage/groups/matrix_gps/group_element_gap.pyx index 2f7eb82cb8d..2b363f7c303 100644 --- a/src/sage/groups/matrix_gps/group_element_gap.pyx +++ b/src/sage/groups/matrix_gps/group_element_gap.pyx @@ -312,8 +312,8 @@ cdef class MatrixGroupElement_gap(ElementLibGAP): - ``gens`` -- a list/tuple/iterable of elements (or objects that can be converted to group elements), or ``None`` - (default). By default, the generators of the parent group - are used. + (default); by default, the generators of the parent group + are used OUTPUT: diff --git a/src/sage/groups/matrix_gps/isometries.py b/src/sage/groups/matrix_gps/isometries.py index 424e5a0edf0..baf0925d706 100644 --- a/src/sage/groups/matrix_gps/isometries.py +++ b/src/sage/groups/matrix_gps/isometries.py @@ -46,8 +46,9 @@ class GroupOfIsometries(FinitelyGeneratedMatrixGroup_gap): r""" A base class for Orthogonal matrix groups with a gap backend. - Main difference to :class:`~sage.groups.matrix_gps.orthogonal.OrthogonalMatrixGroup_gap` is that we can - specify generators and a bilinear form. Following gap the group action is from the right. + Main difference to :class:`~sage.groups.matrix_gps.orthogonal.OrthogonalMatrixGroup_gap` + is that we can specify generators and a bilinear form. Following gap the group action is + from the right. INPUT: @@ -59,10 +60,10 @@ class GroupOfIsometries(FinitelyGeneratedMatrixGroup_gap): - ``check`` -- bool (default: ``True``) check if the generators preserve the bilinear form - ``invariant_submodule`` -- a submodule preserved by the group action - (default: ``None``) registers an action on this submodule. + (default: ``None``) registers an action on this submodule - ``invariant_quotient_module`` -- a quotient module preserved by the group action (default: ``None``) - registers an action on this quotient module. + registers an action on this quotient module EXAMPLES:: @@ -134,7 +135,7 @@ def _repr_(self): r""" Return the string representation of this matrix group. - OUTPUT: a string + OUTPUT: string EXAMPLES:: @@ -159,7 +160,7 @@ def _repr_(self): def __reduce__(self): r""" - Implements pickling. + Implement pickling. EXAMPLES:: @@ -358,7 +359,7 @@ class GroupActionOnQuotientModule(Action): - ``MatrixGroup`` -- the group acting :class:`GroupOfIsometries` - ``submodule`` -- an invariant quotient module - - ``is_left`` -- bool (default: ``False``) + - ``is_left`` -- boolean (default: ``False``) EXAMPLES:: @@ -376,7 +377,7 @@ class GroupActionOnQuotientModule(Action): """ def __init__(self, MatrixGroup, quotient_module, is_left=False): r""" - Initialize the action + Initialize the action. TESTS:: diff --git a/src/sage/groups/matrix_gps/linear.py b/src/sage/groups/matrix_gps/linear.py index 759faf2db18..e8c7ddd08a3 100644 --- a/src/sage/groups/matrix_gps/linear.py +++ b/src/sage/groups/matrix_gps/linear.py @@ -207,13 +207,13 @@ def SL(n, R, var='a'): INPUT: - - ``n`` -- a positive integer. + - ``n`` -- positive integer - - ``R`` -- ring or an integer. If an integer is specified, the - corresponding finite field is used. + - ``R`` -- ring or integer; if an integer is specified, the + corresponding finite field is used - ``var`` -- variable used to represent generator of the finite - field, if needed. + field, if needed EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/matrix_group.py b/src/sage/groups/matrix_gps/matrix_group.py index e7ad5183e45..709a88a6d8e 100644 --- a/src/sage/groups/matrix_gps/matrix_group.py +++ b/src/sage/groups/matrix_gps/matrix_group.py @@ -126,10 +126,10 @@ def _check_matrix(self, x, *args): INPUT: - ``x`` -- a Sage matrix in the correct matrix space (degree - and base ring). + and base ring) - ``*args`` -- optional other representations of ``x``, - depending on the group implementation. Ignored by default. + depending on the group implementation. Ignored by default OUTPUT: a :class:`TypeError` must be raised if ``x`` is invalid @@ -184,8 +184,8 @@ def subgroup(self, generators, check=True): INPUT: - ``generators`` -- a list/tuple/iterable of group elements of ``self`` - - ``check`` -- boolean (optional, default: ``True``). Whether to check - that each matrix is invertible. + - ``check`` -- boolean (default: ``True``); whether to check that each + matrix is invertible OUTPUT: the subgroup generated by ``generators`` as an instance of :class:`FinitelyGeneratedMatrixGroup_gap` @@ -345,7 +345,8 @@ def sign_representation(self, base_ring=None, side="twosided"): .. WARNING:: - Assumes ``self`` is a matrix group over a field which has embedding over real numbers. + Assumes ``self`` is a matrix group over a field which has + embedding over real numbers. INPUT: @@ -390,17 +391,17 @@ class MatrixGroup_generic(MatrixGroup_base): def __init__(self, degree, base_ring, category=None): """ - Base class for matrix groups over generic base rings + Base class for matrix groups over generic base rings. You should not use this class directly. Instead, use one of the more specialized derived classes. INPUT: - - ``degree`` -- integer. The degree (matrix size) of the - matrix group. + - ``degree`` -- integer; the degree (matrix size) of the + matrix group - - ``base_ring`` -- ring. The base ring of the matrices. + - ``base_ring`` -- ring; the base ring of the matrices TESTS:: @@ -425,7 +426,7 @@ def degree(self): """ Return the degree of this matrix group. - OUTPUT: an integer; the size (number of rows equals number of columns) + OUTPUT: integer; the size (number of rows equals number of columns) of the matrices EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/matrix_group_gap.py b/src/sage/groups/matrix_gps/matrix_group_gap.py index f413c87bdde..d7de4c75f6e 100644 --- a/src/sage/groups/matrix_gps/matrix_group_gap.py +++ b/src/sage/groups/matrix_gps/matrix_group_gap.py @@ -37,16 +37,16 @@ def __init__(self, degree, base_ring, libgap_group, ambient=None, category=None) INPUT: - - ``degree`` -- integer. The degree (matrix size) of the - matrix group. + - ``degree`` -- integer; the degree (matrix size) of the + matrix group - - ``base_ring`` -- ring. The base ring of the matrices. + - ``base_ring`` -- ring; the base ring of the matrices - - ``libgap_group`` -- the defining libgap group. + - ``libgap_group`` -- the defining libgap group - - ``ambient`` -- A derived class of :class:`ParentLibGAP` or - ``None`` (default). The ambient class if ``libgap_group`` - has been defined as a subgroup. + - ``ambient`` -- a derived class of :class:`ParentLibGAP` or + ``None`` (default); the ambient class if ``libgap_group`` + has been defined as a subgroup TESTS: @@ -197,9 +197,9 @@ def _check_matrix(self, x_sage, x_gap): INPUT: - ``x_sage`` -- a Sage matrix in the correct matrix space (degree - and base ring). + and base ring) - - ``x_gap`` -- the corresponding LibGAP matrix. + - ``x_gap`` -- the corresponding LibGAP matrix OUTPUT: a :class:`TypeError` must be raised if ``x`` is invalid @@ -229,8 +229,8 @@ def subgroup(self, generators, check=True): INPUT: - ``generators`` -- a list/tuple/iterable of group elements of ``self`` - - ``check`` -- boolean (optional, default: ``True``). Whether to check - that each matrix is invertible. + - ``check`` -- boolean (default: ``True``). Whether to check that each + matrix is invertible OUTPUT: The subgroup generated by ``generators`` as an instance of :class:`FinitelyGeneratedMatrixGroup_gap` diff --git a/src/sage/groups/matrix_gps/named_group.py b/src/sage/groups/matrix_gps/named_group.py index 1aae7019e3c..142ea68ddfb 100644 --- a/src/sage/groups/matrix_gps/named_group.py +++ b/src/sage/groups/matrix_gps/named_group.py @@ -188,7 +188,7 @@ class NamedMatrixGroup_generic(CachedRepresentation, MatrixGroup_generic): def __init__(self, degree, base_ring, special, sage_name, latex_string, category=None, invariant_form=None): """ - Base class for "named" matrix groups + Base class for "named" matrix groups. INPUT: @@ -260,7 +260,7 @@ def _latex_(self): """ Return a LaTeX representation. - OUTPUT: a string + OUTPUT: string EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/named_group_gap.py b/src/sage/groups/matrix_gps/named_group_gap.py index b8b1f54722c..699e351f06d 100644 --- a/src/sage/groups/matrix_gps/named_group_gap.py +++ b/src/sage/groups/matrix_gps/named_group_gap.py @@ -23,22 +23,22 @@ class NamedMatrixGroup_gap(NamedMatrixGroup_generic, MatrixGroup_gap): def __init__(self, degree, base_ring, special, sage_name, latex_string, gap_command_string, category=None): """ - Base class for "named" matrix groups using LibGAP + Base class for "named" matrix groups using LibGAP. INPUT: - - ``degree`` -- integer. The degree (number of rows/columns of - matrices). + - ``degree`` -- integer; the degree (number of rows/columns of + matrices) - - ``base_ring`` -- ring. The base ring of the matrices. + - ``base_ring`` -- ring; the base ring of the matrices - - ``special`` -- boolean. Whether the matrix group is special, - that is, elements have determinant one. + - ``special`` -- boolean; whether the matrix group is special, + that is, elements have determinant one - - ``latex_string`` -- string. The latex representation. + - ``latex_string`` -- string; the latex representation - - ``gap_command_string`` -- string. The GAP command to construct - the matrix group. + - ``gap_command_string`` -- string; the GAP command to construct + the matrix group EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/orthogonal.py b/src/sage/groups/matrix_gps/orthogonal.py index ab1b770e4cf..adfa3248204 100644 --- a/src/sage/groups/matrix_gps/orthogonal.py +++ b/src/sage/groups/matrix_gps/orthogonal.py @@ -21,7 +21,7 @@ of `SO(e,d,q)` in `GO(e,d,q)` is `2` if `q` is odd, but `SO(e,d,q) = GO(e,d,q)` if `q` is even.) -.. warning:: +.. WARNING:: GAP and Sage use different notations: @@ -107,10 +107,10 @@ def normalize_args_e(degree, ring, e): INPUT: - - ``degree`` -- integer. The degree of the affine group, that is, - the dimension of the affine space the group is acting on. + - ``degree`` -- integer; the degree of the affine group, that is, + the dimension of the affine space the group is acting on - - ``ring`` -- a ring. The base ring of the affine space. + - ``ring`` -- a ring; the base ring of the affine space - ``e`` -- integer, one of `+1`, `0`, `-1`. Only relevant for finite fields and if the degree is even. A parameter that diff --git a/src/sage/groups/matrix_gps/unitary.py b/src/sage/groups/matrix_gps/unitary.py index 37a9cb826ee..e706abcfda7 100644 --- a/src/sage/groups/matrix_gps/unitary.py +++ b/src/sage/groups/matrix_gps/unitary.py @@ -68,7 +68,7 @@ def finite_field_sqrt(ring): """ Helper function. - OUTPUT: an integer `q` such that ``ring`` is the finite field with `q^2` elements + OUTPUT: integer `q` such that ``ring`` is the finite field with `q^2` elements EXAMPLES:: diff --git a/src/sage/groups/misc_gps/argument_groups.py b/src/sage/groups/misc_gps/argument_groups.py index 5cf9ead8c7d..edbdb7b7bad 100644 --- a/src/sage/groups/misc_gps/argument_groups.py +++ b/src/sage/groups/misc_gps/argument_groups.py @@ -281,7 +281,7 @@ def _act_on_(self, other, is_left): def __abs__(self): r""" - Return the absolute value of this argument which equals `1` + Return the absolute value of this argument which equals `1`. TESTS:: @@ -782,7 +782,7 @@ def _create_element_in_extension_(self, exponent): INPUT: - - ``exponent`` -- the element data. + - ``exponent`` -- the element data OUTPUT: an element @@ -812,7 +812,7 @@ def _coerce_map_from_(self, R): INPUT: - - ``R`` -- a parent. + - ``R`` -- a parent OUTPUT: boolean @@ -1321,7 +1321,7 @@ def _create_element_in_extension_(self, element): INPUT: - - ``element`` -- the element data. + - ``element`` -- the element data OUTPUT: an element @@ -1353,7 +1353,7 @@ def _coerce_map_from_(self, R): INPUT: - - ``R`` -- a parent. + - ``R`` -- a parent OUTPUT: boolean diff --git a/src/sage/groups/old.pyx b/src/sage/groups/old.pyx index 08df0405ffa..564dbd75c23 100644 --- a/src/sage/groups/old.pyx +++ b/src/sage/groups/old.pyx @@ -26,7 +26,7 @@ from sage.misc.superseded import deprecation cdef class Group(sage.structure.parent.Parent): """ - Generic group class + Generic group class. """ def __init__(self, category=None): """ @@ -165,8 +165,7 @@ cdef class Group(sage.structure.parent.Parent): def quotient(self, H, **kwds): """ - Return the quotient of this group by the normal subgroup - `H`. + Return the quotient of this group by the normal subgroup `H`. EXAMPLES:: diff --git a/src/sage/groups/pari_group.py b/src/sage/groups/pari_group.py index 62dc75cb821..fb460e5b902 100644 --- a/src/sage/groups/pari_group.py +++ b/src/sage/groups/pari_group.py @@ -29,7 +29,7 @@ def __init__(self, x, degree): def __repr__(self): """ - String representation of this group + String representation of this group. EXAMPLES:: @@ -159,7 +159,7 @@ def order(self): def permutation_group(self): """ - Return the corresponding GAP transitive group + Return the corresponding GAP transitive group. EXAMPLES:: diff --git a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx index e7a3e8c55f8..6f4d9b2b430 100644 --- a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx +++ b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx @@ -42,7 +42,7 @@ from sage.arith.misc import is_prime as n_is_prime cdef inline OrbitPartition *OP_new(int n) noexcept: """ - Allocate and return a pointer to a new OrbitPartition of degree n. Returns a + Allocate and return a pointer to a new OrbitPartition of degree n. Return a null pointer in the case of an allocation failure. """ cdef OrbitPartition *OP = \ @@ -181,7 +181,7 @@ def OP_represent(int n, merges, perm): cdef inline PartitionStack *PS_new(int n, bint unit_partition) noexcept: """ - Allocate and return a pointer to a new PartitionStack of degree n. Returns a + Allocate and return a pointer to a new PartitionStack of degree n. Return a null pointer in the case of an allocation failure. """ cdef PartitionStack *PS = \ @@ -213,7 +213,7 @@ cdef void PS_unit_partition(PartitionStack *PS) noexcept: cdef inline PartitionStack *PS_copy(PartitionStack *PS) noexcept: """ - Allocate and return a pointer to a copy of PartitionStack PS. Returns a null + Allocate and return a pointer to a copy of PartitionStack PS. Return a null pointer in the case of an allocation failure. """ cdef int n = PS.degree @@ -237,7 +237,7 @@ cdef inline void PS_dealloc(PartitionStack *PS) noexcept: cdef PartitionStack *PS_from_list(list L) noexcept: """ - Allocate and return a pointer to a PartitionStack representing L. Returns a + Allocate and return a pointer to a PartitionStack representing L. Return a null pointer in the case of an allocation failure. """ cdef int cell, i, num_cells = len(L), cur_start = 0, cur_len, n = 0 @@ -286,7 +286,7 @@ cdef int PS_first_smallest(PartitionStack *PS, bitset_t b, int *second_pos=NULL) """ Find the first occurrence of the smallest cell of size greater than one, which is admissible (checked by the function ``test_allowance``). - Its entries are stored to b and its minimum element is returned. + Its entries are stored to `b` and its minimum element is returned. """ cdef int i = 0, j = 0, location = 0, n = PS.degree bitset_zero(b) @@ -383,7 +383,7 @@ cdef int PS_find_element(PartitionStack *PS, bitset_t b, int x) except -1: cdef list PS_singletons(PartitionStack * part): """ - Return the list of all singletons in the PartitionStack. + Return the list of all singletons in the ``PartitionStack``. """ cdef list l = [] cdef int i @@ -552,7 +552,7 @@ cdef enum: cdef StabilizerChain *SC_new(int n, bint init_gens=True) noexcept: """ - Allocate and return a pointer to a new StabilizerChain of degree n. Returns + Allocate and return a pointer to a new StabilizerChain of degree n. Return a null pointer in the case of an allocation failure. """ cdef int i @@ -624,7 +624,7 @@ cdef inline int SC_realloc_gens(StabilizerChain *SC, int level, int size) noexce """ Reallocate generator array at level `level` to size `size`. - Returns 1 in case of an allocation failure. + Return 1 in case of an allocation failure. """ cdef int *temp cdef int n = SC.degree @@ -661,7 +661,7 @@ cdef StabilizerChain *SC_symmetric_group(int n) noexcept: """ Return a stabilizer chain for the symmetric group on {0, 1, ..., n-1}. - Returns NULL in the case of an allocation failure. + Return ``NULL`` in the case of an allocation failure. """ cdef int i, j, b cdef StabilizerChain *SC = SC_new(n, False) @@ -702,7 +702,7 @@ cdef StabilizerChain *SC_alternating_group(int n) noexcept: """ Return a stabilizer chain for the alternating group on {0, 1, ..., n-1}. - Returns NULL in the case of an allocation failure. + Return ``NULL`` in the case of an allocation failure. """ cdef int i, j, b cdef StabilizerChain *SC = SC_new(n, False) @@ -747,7 +747,7 @@ cdef int SC_realloc_bitsets(StabilizerChain *SC, unsigned long size) noexcept: If size is larger than current allocation, double the size of the bitsets until it is not. - Returns 1 in case of an allocation failure. + Return 1 in case of an allocation failure. """ cdef unsigned long size_old = SC.gen_used.size if size <= size_old: @@ -780,7 +780,7 @@ cdef StabilizerChain *SC_copy(StabilizerChain *SC, int level) noexcept: """ Creates a copy of the first `level` levels of SC. Must have 0 < level. - Returns a null pointer in case of allocation failure. + Return a null pointer in case of allocation failure. """ cdef int i, n = SC.degree cdef StabilizerChain *SCC = SC_new(n, False) @@ -847,7 +847,7 @@ cdef StabilizerChain *SC_new_base(StabilizerChain *SC, int *base, int base_len) Use SC_cleanup to remove redundant base points. - Returns a null pointer in case of an allocation failure. + Return a null pointer in case of an allocation failure. """ cdef StabilizerChain *NEW = SC_new(SC.degree) if NEW is NULL: @@ -908,7 +908,7 @@ cdef StabilizerChain *SC_insert_base_point(StabilizerChain *SC, int level, int p Use SC_cleanup to remove redundant base points. - Returns a null pointer in case of an allocation failure. + Return a null pointer in case of an allocation failure. """ cdef int i, b, n = SC.degree cdef StabilizerChain *NEW @@ -994,7 +994,7 @@ cdef int SC_sift(StabilizerChain *SC, int level, int x, int *gens, int num_gens, num_gens - how many of these there are new_gens - space of size at least num_gens*n for the sifted perms to go - Returns 1 in case of an allocation failure. + Return 1 in case of an allocation failure. """ cdef int n = SC.degree if num_gens == 0: @@ -1619,10 +1619,11 @@ cdef int sort_by_function(PartitionStack *PS, int start, int *degrees) noexcept: A simple counting sort, given the degrees of vertices to a certain cell. INPUT: - PS -- the partition stack to be checked - start -- beginning index of the cell to be sorted - degrees -- the values to be sorted by, must have extra scratch space for a - total of 3*n+1 + + - PS -- the partition stack to be checked + - start -- beginning index of the cell to be sorted + - degrees -- the values to be sorted by, must have extra scratch space for a + total of `3*n+1` """ cdef int n = PS.degree diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx index c01634e1772..41891938e7a 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx @@ -117,8 +117,9 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): storing results to ``self``. INPUT: - partition -- an optional list of lists partition of the columns. - default is the unit partition. + + - partition -- an optional list of lists partition of the columns; + default is the unit partition EXAMPLES:: @@ -253,7 +254,7 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): def automorphism_group(self): """ - Returns a list of generators of the automorphism group, along with its + Return a list of generators of the automorphism group, along with its order and a base for which the list of generators is a strong generating set. @@ -280,7 +281,7 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): def canonical_relabeling(self): """ - Returns a canonical relabeling (in list permutation format). + Return a canonical relabeling (in list permutation format). EXAMPLES: (For more examples, see self.run()):: @@ -528,7 +529,7 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): def automorphism_group(self): """ - Returns a list of generators of the automorphism group, along with its + Return a list of generators of the automorphism group, along with its order and a base for which the list of generators is a strong generating set. @@ -561,7 +562,7 @@ cdef class NonlinearBinaryCodeStruct(BinaryCodeStruct): def canonical_relabeling(self): """ - Returns a canonical relabeling (in list permutation format). + Return a canonical relabeling (in list permutation format). EXAMPLES: (For more examples, see self.run()):: @@ -625,17 +626,17 @@ cdef int ith_word_nonlinear(BinaryCodeStruct self, int i, bitset_s *word) noexce cdef int refine_by_bip_degree(PartitionStack *col_ps, void *S, int *cells_to_refine_by, int ctrb_len) noexcept: r""" - Refines the input partition by checking degrees of vertices to the given + Refine the input partition by checking degrees of vertices to the given cells in the associated bipartite graph (vertices split into columns and words). INPUT: - col_ps -- a partition stack, whose finest partition is the partition to be - refined. - S -- a binary code struct object - cells_to_refine_by -- a list of pointers to cells to check degrees against - in refining the other cells (updated in place) - ctrb_len -- how many cells in cells_to_refine_by + + - col_ps -- a partition stack, whose finest partition is the partition to be refined + - S -- a binary code struct object + - cells_to_refine_by -- a list of pointers to cells to check degrees against + in refining the other cells (updated in place) + - ctrb_len -- how many cells in cells_to_refine_by OUTPUT: @@ -960,12 +961,12 @@ cdef inline int word_degree(PartitionStack *word_ps, BinaryCodeStruct BCS, int e vertices in the cell corresponding to cell_index. INPUT: - word_ps -- the partition stack to be checked - col_ps -- corresponding partition stack on columns - BCS -- a binary code struct object - entry -- the position of the vertex in question in the entries of word_ps - cell_index -- the starting position of the cell in question in the entries - of PS + + - word_ps -- the partition stack to be checked + - col_ps -- corresponding partition stack on columns + - BCS -- a binary code struct object + - entry -- the position of the vertex in question in the entries of word_ps + - cell_index -- the starting position of the cell in question in the entries of PS """ cdef bitset_t cell, word cdef int h @@ -990,12 +991,12 @@ cdef inline int col_degree(PartitionStack *col_ps, BinaryCodeStruct BCS, int ent vertices in the cell corresponding to cell_index. INPUT: - col_ps -- the partition stack to be checked - word_ps -- corresponding partition stack on words - BCS -- a binary code struct object - entry -- the position of the vertex in question in the entries of word_ps - cell_index -- the starting position of the cell in question in the entries - of PS + + - col_ps -- the partition stack to be checked + - word_ps -- corresponding partition stack on words + - BCS -- a binary code struct object + - entry -- the position of the vertex in question in the entries of word_ps + - cell_index -- the starting position of the cell in question in the entries of PS """ cdef bitset_t word bitset_init(word, BCS.degree) @@ -1054,14 +1055,15 @@ cdef inline int sort_by_function_codes(PartitionStack *PS, int start, int *degre def random_tests(num=50, n_max=50, k_max=6, nwords_max=200, perms_per_code=10, density_range=(.1,.9)): """ - Tests to make sure that C(gamma(B)) == C(B) for random permutations gamma + Test to make sure that C(gamma(B)) == C(B) for random permutations gamma and random codes B, and that is_isomorphic returns an isomorphism. INPUT: - num -- run tests for this many codes - n_max -- test codes with at most this many columns - k_max -- test codes with at most this for dimension - perms_per_code -- test each code with this many random permutations + + - num -- run tests for this many codes + - n_max -- test codes with at most this many columns + - k_max -- test codes with at most this for dimension + - perms_per_code -- test each code with this many random permutations DISCUSSION: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx index 2ebf9e08b56..5cad4cb0a0b 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx @@ -1163,7 +1163,7 @@ cdef void *apply_dg_edge_aug(void *parent, void *aug, void *child, int *degree, cdef void *allocate_dg_edge(int n, bint loops) noexcept: r""" - Allocates an object for this augmentation scheme. + Allocate an object for this augmentation scheme. """ cdef GraphStruct GS cdef DenseGraph G @@ -1187,7 +1187,7 @@ cdef void *allocate_dg_edge(int n, bint loops) noexcept: cdef void free_dg_edge(void *child) noexcept: r""" - Deallocates an object for this augmentation scheme. + Deallocate an object for this augmentation scheme. """ cdef GraphStruct GS = child sig_free(GS.scratch) @@ -1196,9 +1196,9 @@ cdef void free_dg_edge(void *child) noexcept: cdef void *canonical_dg_edge_parent(void *child, void *parent, int *permutation, int *degree, bint *mem_err) noexcept: r""" - Applies ``permutation`` to ``child``, determines an arbitrary parent by - deleting the lexicographically largest edge, applies the inverse of - ``permutation`` to the result and stores the result in ``parent``. + Apply ``permutation`` to ``child``, determine an arbitrary parent by + deleting the lexicographically largest edge, apply the inverse of + ``permutation`` to the result and store the result in ``parent``. """ cdef GraphStruct GS_par = parent, GS = child cdef DenseGraph DG_par = GS_par.G, DG = GS.G @@ -1226,7 +1226,7 @@ cdef void *canonical_dg_edge_parent(void *child, void *parent, int *permutation, cdef iterator *allocate_dg_edge_gen(int degree, int depth, bint loops) noexcept: r""" - Allocates the iterator for generating graphs. + Allocate the iterator for generating graphs. """ cdef iterator *dg_edge_gen = sig_malloc(sizeof(iterator)) cdef canonical_generator_data *cgd = allocate_cgd(depth, degree) @@ -1256,7 +1256,7 @@ cdef iterator *allocate_dg_edge_gen(int degree, int depth, bint loops) noexcept: cdef void free_dg_edge_gen(iterator *dg_edge_gen) noexcept: r""" - Deallocates the iterator for generating graphs. + Deallocate the iterator for generating graphs. """ cdef canonical_generator_data *cgd = dg_edge_gen.data deallocate_cgd(cgd) @@ -1431,7 +1431,7 @@ cdef void *apply_dg_vert_aug(void *parent, void *aug, void *child, int *degree, cdef void *allocate_dg_vert(int n, int depth) noexcept: r""" - Allocates an object for this augmentation scheme. + Allocate an object for this augmentation scheme. """ cdef GraphStruct GS cdef DenseGraph G @@ -1457,7 +1457,7 @@ cdef void *allocate_dg_vert(int n, int depth) noexcept: cdef void free_dg_vert(void *child) noexcept: r""" - Deallocates an object for this augmentation scheme. + Deallocate an object for this augmentation scheme. """ cdef GraphStruct GS = child sig_free(GS.scratch) @@ -1466,9 +1466,9 @@ cdef void free_dg_vert(void *child) noexcept: cdef void *canonical_dg_vert_parent(void *child, void *parent, int *permutation, int *degree, bint *mem_err) noexcept: r""" - Applies ``permutation`` to ``child``, determines an arbitrary parent by - deleting the lexicographically largest vertex, applies the inverse of - ``permutation`` to the result and stores the result in ``parent``. + Apply ``permutation`` to ``child``, determines an arbitrary parent by + deleting the lexicographically largest vertex, apply the inverse of + ``permutation`` to the result and store the result in ``parent``. """ cdef GraphStruct GS_par = parent, GS = child cdef DenseGraph DG_par = GS_par.G, DG = GS.G @@ -1488,7 +1488,7 @@ cdef void *canonical_dg_vert_parent(void *child, void *parent, int *permutation, cdef iterator *allocate_dg_vert_gen(int degree, int depth) noexcept: r""" - Allocates the iterator for generating graphs. + Allocate the iterator for generating graphs. """ cdef iterator *dg_vert_gen = sig_malloc(sizeof(iterator)) cdef canonical_generator_data *cgd = allocate_cgd(depth, degree) @@ -1529,7 +1529,7 @@ cdef iterator *allocate_dg_vert_gen(int degree, int depth) noexcept: cdef void free_dg_vert_gen(iterator *dg_vert_gen) noexcept: r""" - Deallocates the iterator for generating graphs. + Deallocate the iterator for generating graphs. """ cdef canonical_generator_data *cgd = dg_vert_gen.data deallocate_cgd(cgd) diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx index 1366fa8ceee..9fb97741746 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx @@ -130,9 +130,8 @@ cdef class MatrixStruct: INPUT: - partition -- an optional list of lists partition of the columns. - - Default is the unit partition. + - partition -- an optional list of lists partition of the columns; + default is the unit partition. EXAMPLES:: @@ -174,7 +173,7 @@ cdef class MatrixStruct: def automorphism_group(self): """ - Returns a list of generators of the automorphism group, along with its + Return a list of generators of the automorphism group, along with its order and a base for which the list of generators is a strong generating set. @@ -203,7 +202,7 @@ cdef class MatrixStruct: def canonical_relabeling(self): """ - Returns a canonical relabeling (in list permutation format). + Return a canonical relabeling (in list permutation format). For more examples, see self.run(). @@ -299,7 +298,7 @@ cdef bint all_matrix_children_are_equivalent(PartitionStack *PS, void *S) noexce def random_tests(n=10, nrows_max=50, ncols_max=50, nsymbols_max=10, perms_per_matrix=5, density_range=(.1,.9)): """ - Tests to make sure that C(gamma(M)) == C(M) for random permutations gamma + Test to make sure that C(gamma(M)) == C(M) for random permutations gamma and random matrices M, and that M.is_isomorphic(gamma(M)) returns an isomorphism. diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx index b73406b13a7..0dd869c1c95 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx @@ -69,7 +69,7 @@ cdef class PythonPartitionStack: def __repr__(self): """ - Returns a string representing the stack. + Return a string representing the stack. EXAMPLES:: @@ -82,7 +82,7 @@ cdef class PythonPartitionStack: def display(self): """ - Prints a representation of the stack. + Print a representation of the stack. EXAMPLES:: @@ -99,7 +99,7 @@ cdef class PythonPartitionStack: def is_discrete(self): """ - Returns whether the deepest partition consists only of singleton cells. + Return whether the deepest partition consists only of singleton cells. EXAMPLES:: @@ -116,7 +116,7 @@ cdef class PythonPartitionStack: def num_cells(self): """ - Returns the number of cells in the deepest partition. + Return the number of cells in the deepest partition. EXAMPLES:: @@ -129,7 +129,7 @@ cdef class PythonPartitionStack: def move_min_to_front(self, int start, int end): """ - Makes sure that the first element of the segment of entries i with + Make sure that the first element of the segment of entries i with start <= i <= end is minimal. EXAMPLES:: @@ -166,7 +166,7 @@ cdef class PythonPartitionStack: def clear(self): """ - Sets the current partition to the first shallower one, i.e. forgets about + Set the current partition to the first shallower one, i.e. forget about boundaries between cells that are new to the current level. EXAMPLES:: @@ -188,7 +188,7 @@ cdef class PythonPartitionStack: def entries(self): """ - Returns the entries array as a Python list of ints. + Return the entries array as a Python list of ints. EXAMPLES:: @@ -204,7 +204,7 @@ cdef class PythonPartitionStack: def set_entry(self, int i, int entry): """ - Sets the ith entry of the entries array to entry. + Set the ith entry of the entries array to entry. EXAMPLES:: @@ -219,7 +219,7 @@ cdef class PythonPartitionStack: def get_entry(self, int i): """ - Gets the ith entry of the entries array. + Get the ith entry of the entries array. EXAMPLES:: @@ -247,7 +247,7 @@ cdef class PythonPartitionStack: def set_level(self, int i, int level): """ - Sets the ith entry of the levels array to entry. + Set the ith entry of the levels array to entry. EXAMPLES:: @@ -264,7 +264,7 @@ cdef class PythonPartitionStack: def get_level(self, int i): """ - Gets the ith entry of the levels array. + Get the ith entry of the levels array. EXAMPLES:: @@ -277,7 +277,7 @@ cdef class PythonPartitionStack: def depth(self, new=None): """ - Returns the depth of the deepest partition in the stack, setting it to + Return the depth of the deepest partition in the stack, setting it to new if new is not None. EXAMPLES:: @@ -293,7 +293,7 @@ cdef class PythonPartitionStack: def degree(self, new=None): """ - Returns the degree of the partition stack, setting it to + Return the degree of the partition stack, setting it to new if new is not None. EXAMPLES:: @@ -404,13 +404,13 @@ def aut_gp_and_can_lab_python(S, partition, n, compare_structures, canonical_label, base, order): """ - Calls the automorphism group and canonical label function. + Call the automorphism group and canonical label function. INPUT: - S -- the object to examine - partition -- an ordered partition, as a list of lists - n -- the degree of the automorphism group to be computed + - S -- the object to examine + - partition -- an ordered partition, as a list of lists + - n -- the degree of the automorphism group to be computed :: @@ -493,11 +493,10 @@ def double_coset_python(S1, S2, partition1, ordering2, n, INPUT: - S1, S2 -- the objects to examine - partition1 -- an ordered partition, as a list of lists - ordering2 -- represents a partition of the points of S2, - as a relabeling of partition1 - n -- the degree + - S1, S2 -- the objects to examine + - partition1 -- an ordered partition, as a list of lists + - ordering2 -- represents a partition of the points of S2, as a relabeling of partition1 + - n -- the degree :: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx index c3a42da04d8..a613b7b9c4a 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx @@ -183,9 +183,9 @@ def set_stab_py(generators, sett, relab=False): cdef aut_gp_and_can_lab *set_stab(StabilizerChain *supergroup, subset *sett, bint relab) noexcept: r""" - Computes the set stabilizer of ``sett`` within ``supergroup``. (Note that + Compute the set stabilizer of ``sett`` within ``supergroup``. (Note that ``set`` is a reserved Python keyword.) If ``relab`` is specified then - computes the canonical label of the set under the action of the group. + compute the canonical label of the set under the action of the group. """ cdef aut_gp_and_can_lab *output cdef int n = supergroup.degree @@ -202,7 +202,7 @@ cdef aut_gp_and_can_lab *set_stab(StabilizerChain *supergroup, subset *sett, bin def sets_isom_py(generators, set1, set2): r""" - Computes whether ``set1`` and ``set2`` are isomorphic under the action of + Compute whether ``set1`` and ``set2`` are isomorphic under the action of the group generated by the generators given in list form. EXAMPLES:: @@ -486,7 +486,7 @@ cdef int compare_sets(int *gamma_1, int *gamma_2, void *S1, void *S2, int degree cdef void *allocate_subset(int n) noexcept: r""" - Allocates a subset struct of degree n. + Allocate a subset struct of degree n. """ cdef subset *set1 = sig_malloc(sizeof(subset)) cdef int *scratch = sig_malloc((3*n+1) * sizeof(int)) @@ -505,7 +505,7 @@ cdef void *allocate_subset(int n) noexcept: cdef void free_subset(void *child) noexcept: r""" - Deallocates a subset struct. + Deallocate a subset struct. """ cdef subset *set1 = child if set1 is not NULL: @@ -515,7 +515,7 @@ cdef void free_subset(void *child) noexcept: cdef void *allocate_sgd(int degree) noexcept: r""" - Allocates the data part of an iterator which generates augmentations, i.e., + Allocate the data part of an iterator which generates augmentations, i.e., elements to add to the set. """ cdef subset_generator_data *sgd = sig_malloc(sizeof(subset_generator_data)) @@ -527,7 +527,7 @@ cdef void *allocate_sgd(int degree) noexcept: cdef void deallocate_sgd(void *data) noexcept: r""" - Deallocates the data part of the augmentation iterator. + Deallocate the data part of the augmentation iterator. """ cdef subset_generator_data *sgd = data if sgd is not NULL: @@ -552,7 +552,7 @@ cdef void *subset_generator_next(void *data, int *degree, bint *mem_err) noexcep cdef int generate_child_subsets(void *S, aut_gp_and_can_lab *group, iterator *child_iterator) noexcept: r""" - Sets up an iterator of augmentations, i.e., elements to add to the given set. + Set up an iterator of augmentations, i.e., elements to add to the given set. """ cdef subset *subset1 = S cdef int i, j, n = group.group.degree @@ -572,7 +572,7 @@ cdef int generate_child_subsets(void *S, aut_gp_and_can_lab *group, iterator *ch cdef void *apply_subset_aug(void *parent, void *aug, void *child, int *degree, bint *mem_err) noexcept: r""" - Adds the element represented by ``aug`` to ``parent``, storing the result to + Add the element represented by ``aug`` to ``parent``, storing the result to ``child``. """ cdef subset *set1 = child @@ -589,7 +589,7 @@ cdef void free_subset_aug(void *aug) noexcept: cdef void *canonical_set_parent(void *child, void *parent, int *permutation, int *degree, bint *mem_err) noexcept: r""" - Determines the canonical parent of the set ``child`` by applying + Determine the canonical parent of the set ``child`` by applying ``permutation``, deleting the largest element in lexicographic order, and storing the result to ``parent``. """ @@ -619,7 +619,7 @@ cdef void *canonical_set_parent(void *child, void *parent, int *permutation, int cdef iterator *allocate_subset_gen(int degree, int max_size) noexcept: r""" - Allocates the generator of subsets. + Allocate the generator of subsets. """ cdef iterator *subset_gen = sig_malloc(sizeof(iterator)) if subset_gen is not NULL: @@ -630,7 +630,7 @@ cdef iterator *allocate_subset_gen(int degree, int max_size) noexcept: cdef int allocate_subset_gen_2(int degree, int max_size, iterator *it) noexcept: r""" - Given an already allocated iterator, allocates the generator of subsets. + Given an already allocated iterator, allocate the generator of subsets. """ cdef canonical_generator_data *cgd = allocate_cgd(max_size + 1, degree) if cgd is NULL: @@ -656,7 +656,7 @@ cdef int allocate_subset_gen_2(int degree, int max_size, iterator *it) noexcept: cdef void free_subset_gen(iterator *subset_gen) noexcept: r""" - Frees the iterator of subsets. + Free the iterator of subsets. """ if subset_gen is NULL: return @@ -666,7 +666,7 @@ cdef void free_subset_gen(iterator *subset_gen) noexcept: cdef iterator *setup_set_gen(iterator *subset_gen, int degree, int max_size) noexcept: r""" - Initiates the iterator of subsets. + Initiate the iterator of subsets. """ cdef subset *empty_set cdef iterator *subset_iterator = setup_canonical_generator(degree, diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx index 89529f4e8ce..ff54ecdb023 100644 --- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx +++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx @@ -1,5 +1,5 @@ r""" -Automorphism groups and canonical labels. +Automorphism groups and canonical labels For details see section 3 of [Feu2013]_. @@ -454,7 +454,7 @@ cdef class LabelledBranching: cdef class PartitionRefinement_generic: r""" - Implements the partition and refinement framework for + Implement the partition and refinement framework for group actions `G \rtimes S_n` on `X^n` as described in :mod:`sage.groups.perm_gps.partn_ref2.refinement_generic`. """ @@ -592,7 +592,7 @@ cdef class PartitionRefinement_generic: def get_autom_order_permutation(self): r""" - Return the order of the automorphism group we have computes + Return the order of the automorphism group we have computed. EXAMPLES:: @@ -869,7 +869,7 @@ cdef class PartitionRefinement_generic: cdef void _latex_act_node(self, str comment="", int printlvl=0) noexcept: r""" Append the actual node as a string of latex-commands to - ``self._latex_debug_string`` + ``self._latex_debug_string``. """ raise NotImplementedError # must be implemented by derived classes diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index 09c6f8ceab5..5b76232e336 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -1481,7 +1481,7 @@ def largest_moved_point(self): sage: G.largest_moved_point() 'e' - .. warning:: + .. WARNING:: The name of this function is not good; this function should be deprecated in term of degree:: diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index 514b676efbf..cfc38b639de 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -157,7 +157,7 @@ def __classcall__(cls, domain): INPUT: - - ``n`` -- an integer or list or tuple thereof + - ``n`` -- integer or list or tuple thereof Calls the constructor with a tuple representing the set. @@ -1077,7 +1077,7 @@ def __init__(self, n): INPUT: - - ``n`` -- an integer among `\{1,2,3\}`. + - ``n`` -- integer among `\{1,2,3\}`. EXAMPLES:: @@ -1841,7 +1841,7 @@ def __init__(self, d, n): sage: G.category() Category of finite enumerated permutation groups - .. warning:: this follows GAP's naming convention of indexing + .. WARNING:: this follows GAP's naming convention of indexing the transitive groups starting from ``1``:: sage: TransitiveGroup(5,0) @@ -1849,7 +1849,7 @@ def __init__(self, d, n): ... ValueError: index n must be in {1,..,5} - .. warning:: only transitive groups of "small" degree are + .. WARNING:: only transitive groups of "small" degree are available in GAP's database:: sage: TransitiveGroup(32,1) @@ -1922,7 +1922,7 @@ def TransitiveGroups(d=None): """ INPUT: - - ``d`` -- an integer (optional) + - ``d`` -- integer (optional) Return the set of all transitive groups of a given degree ``d`` up to isomorphisms. If ``d`` is not specified, it returns the set of all @@ -1940,7 +1940,7 @@ def TransitiveGroups(d=None): sage: TransitiveGroups() Transitive Groups - .. warning:: in practice, the database currently only contains + .. WARNING:: in practice, the database currently only contains transitive groups up to degree 31:: sage: TransitiveGroups(32).cardinality() @@ -2229,7 +2229,7 @@ class PrimitiveGroup(PermutationGroup_unique): sage: G.category() Category of finite enumerated permutation groups - .. warning:: + .. WARNING:: this follows GAP's naming convention of indexing the primitive groups starting from ``1``:: @@ -2316,7 +2316,7 @@ def PrimitiveGroups(d=None): INPUT: - - ``d`` -- an integer (optional) + - ``d`` -- integer (optional) OUTPUT: @@ -2398,7 +2398,7 @@ def _repr_(self): """ Return a string representation. - OUTPUT: a string + OUTPUT: string TESTS:: @@ -2471,7 +2471,7 @@ def _repr_(self): """ Return a string representation. - OUTPUT: a string + OUTPUT: string TESTS:: @@ -2514,7 +2514,7 @@ def __getitem__(self, n): sage: PrimitiveGroups(5)[3] AGL(1, 5) - .. warning:: + .. WARNING:: this follows GAP's naming convention of indexing the primitive groups starting from ``1``:: @@ -2541,7 +2541,7 @@ def cardinality(self): r""" Return the cardinality of ``self``. - OUTPUT: an integer; the number of primitive groups of a given degree + OUTPUT: integer; the number of primitive groups of a given degree up to isomorphism EXAMPLES:: diff --git a/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx b/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx index c1fc37fda84..b59facdd3ce 100644 --- a/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx +++ b/src/sage/groups/semimonomial_transformations/semimonomial_transformation.pyx @@ -265,8 +265,8 @@ cdef class SemimonomialTransformation(MultiplicativeGroupElement): def __reduce__(self): """ - Returns a function and its arguments needed to create this - semimonomial group element. This is used in pickling. + Return a function and its arguments needed to create this + semimonomial group element. This is used in pickling. EXAMPLES:: @@ -279,7 +279,7 @@ cdef class SemimonomialTransformation(MultiplicativeGroupElement): def get_v(self): """ - Returns the component corresponding to `{R^{\times}}^n` of ``self``. + Return the component corresponding to `{R^{\times}}^n` of ``self``. EXAMPLES:: @@ -291,7 +291,7 @@ cdef class SemimonomialTransformation(MultiplicativeGroupElement): def get_v_inverse(self): """ - Returns the (elementwise) inverse of the component corresponding to + Return the (elementwise) inverse of the component corresponding to `{R^{\times}}^n` of ``self``. EXAMPLES:: @@ -304,7 +304,7 @@ cdef class SemimonomialTransformation(MultiplicativeGroupElement): def get_perm(self): """ - Returns the component corresponding to `S_n` of ``self``. + Return the component corresponding to `S_n` of ``self``. EXAMPLES:: @@ -316,7 +316,7 @@ cdef class SemimonomialTransformation(MultiplicativeGroupElement): def get_autom(self): """ - Returns the component corresponding to `Aut(R)` of ``self``. + Return the component corresponding to `Aut(R)` of ``self``. EXAMPLES:: From 9a95ad4a2a465c7150e638a7912808ada5364de5 Mon Sep 17 00:00:00 2001 From: gmou3 <32706872+gmou3@users.noreply.github.com> Date: Fri, 12 Apr 2024 09:33:35 +0300 Subject: [PATCH 3/4] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matthias Köppe --- .../groups/abelian_gps/abelian_group_element.py | 4 ++-- src/sage/groups/affine_gps/affine_group.py | 2 +- src/sage/groups/class_function.py | 2 +- src/sage/groups/finitely_presented.py | 2 +- src/sage/groups/galois_group.py | 4 ++-- src/sage/groups/generic.py | 8 ++++---- src/sage/groups/group.pyx | 2 +- src/sage/groups/group_exp.py | 2 +- src/sage/groups/libgap_morphism.py | 3 ++- src/sage/groups/libgap_wrapper.pyx | 4 ++-- src/sage/groups/matrix_gps/isometries.py | 2 +- .../perm_gps/partn_ref/refinement_binary.pyx | 14 +++++++------- .../perm_gps/partn_ref/refinement_matrices.pyx | 6 +++--- .../perm_gps/partn_ref/refinement_python.pyx | 14 +++++++------- .../groups/perm_gps/partn_ref/refinement_sets.pyx | 2 +- src/sage/groups/perm_gps/permgroup_element.pyx | 2 +- src/sage/groups/perm_gps/permgroup_named.py | 6 +++--- 17 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/sage/groups/abelian_gps/abelian_group_element.py b/src/sage/groups/abelian_gps/abelian_group_element.py index 3dc764dd7d0..ac279f71011 100644 --- a/src/sage/groups/abelian_gps/abelian_group_element.py +++ b/src/sage/groups/abelian_gps/abelian_group_element.py @@ -49,8 +49,8 @@ def is_AbelianGroupElement(x): """ - Return ``True`` if x is an abelian group element, i.e., an element of - type ``AbelianGroupElement``. + Return ``True`` if ``x`` is an abelian group element, i.e., an element of + type :class:`AbelianGroupElement`. EXAMPLES: Though the integer 3 is in the integers, and the integers have an abelian group structure, 3 is not an AbelianGroupElement:: diff --git a/src/sage/groups/affine_gps/affine_group.py b/src/sage/groups/affine_gps/affine_group.py index f0e4b3d27f4..7d27488ec59 100644 --- a/src/sage/groups/affine_gps/affine_group.py +++ b/src/sage/groups/affine_gps/affine_group.py @@ -186,7 +186,7 @@ def __init__(self, degree, ring): INPUT: - - ``degree`` -- integer; The degree of the affine group, that + - ``degree`` -- integer; the degree of the affine group, that is, the dimension of the affine space the group is acting on naturally diff --git a/src/sage/groups/class_function.py b/src/sage/groups/class_function.py index c7978b4283e..5d4dc0c1505 100644 --- a/src/sage/groups/class_function.py +++ b/src/sage/groups/class_function.py @@ -349,7 +349,7 @@ def __mul__(self, other): INPUT: - ``other`` -- either a number or a :class:`ClassFunction` of - the same group as ``self``; A number can be anything that + the same group as ``self``; a number can be anything that can be converted into GAP: integers, rational, and elements of certain number fields diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index 69bc261a17c..75a33a190f6 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -1536,7 +1536,7 @@ def epimorphisms(self, H): INPUT: - - `H` -- another group + - ``H`` -- another group EXAMPLES:: diff --git a/src/sage/groups/galois_group.py b/src/sage/groups/galois_group.py index b3460f32be8..36495c846ad 100644 --- a/src/sage/groups/galois_group.py +++ b/src/sage/groups/galois_group.py @@ -315,7 +315,7 @@ def fixed_field(self, name=None, polred=None, threshold=None): - ``name`` -- a variable name for the new field - ``polred`` -- whether to optimize the generator of the newly created field - for a simpler polynomial, using pari's polredbest; + for a simpler polynomial, using Pari's :pari:`polredbest`; defaults to ``True`` when the degree of the fixed field is at most 8 - ``threshold`` -- positive number; polred only performed if the cost @@ -381,7 +381,7 @@ def is_galois(self): @lazy_attribute def _gcdata(self): r""" - Return the Galois closure (ie, the finite field itself) together with the identity. + Return the Galois closure (i.e., the finite field itself) together with the identity. EXAMPLES:: diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index 86aebc74709..e69462ecc6b 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -698,8 +698,8 @@ def discrete_log(a, base, ord=None, bounds=None, operation='*', identity=None, i - ``bounds`` -- a priori bounds on the log - ``operation`` -- string: ``'*'``, ``'+'``, other - ``identity`` -- the group's identity - - ``inverse()`` - function of 1 argument ``x``, returning inverse of ``x`` - - ``op()`` - function of 2 arguments ``x``, ``y``, returning ``x*y`` in the group + - ``inverse`` -- function of 1 argument ``x``, returning inverse of ``x`` + - ``op`` -- function of 2 arguments ``x``, ``y``, returning ``x*y`` in the group - ``algorithm`` -- string denoting what algorithm to use for prime-order logarithms: ``'bsgs'``, ``'rho'``, ``'lambda'`` @@ -1211,8 +1211,8 @@ def order_from_multiple(P, m, plist=None, factorization=None, check=True, prefer the use of ``factorization`` - ``operation`` -- string: ``'+'`` (default), ``'*'`` or ``None`` - ``identity`` -- the identity element of the group - - ``inverse()`` -- function of 1 argument ``x``, returning inverse of ``x`` - - ``op()`` - function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group + - ``inverse`` -- function of 1 argument ``x``, returning inverse of ``x`` + - ``op`` -- function of 2 arguments ``x``, ``y`` returning ``x*y`` in the group .. NOTE:: diff --git a/src/sage/groups/group.pyx b/src/sage/groups/group.pyx index 32fe6d13941..3f1fb92e756 100644 --- a/src/sage/groups/group.pyx +++ b/src/sage/groups/group.pyx @@ -221,7 +221,7 @@ cdef class Group(Parent): def is_multiplicative(self): r""" - Return ``True`` if the group operation is given by \* (rather than +). + Return ``True`` if the group operation is given by ``*`` (rather than ``+``). Override for additive groups. diff --git a/src/sage/groups/group_exp.py b/src/sage/groups/group_exp.py index ccf6d62f147..49f2315eae3 100644 --- a/src/sage/groups/group_exp.py +++ b/src/sage/groups/group_exp.py @@ -147,7 +147,7 @@ def _apply_functor_to_morphism(self, f): - The above homomorphism, but between the corresponding multiplicative groups. - In the following example, ``self`` is the functor `GroupExp()` and `f` + In the following example, ``self`` is the functor :class:`GroupExp` and `f` is an endomorphism of the additive group of integers. EXAMPLES:: diff --git a/src/sage/groups/libgap_morphism.py b/src/sage/groups/libgap_morphism.py index ec48dda3776..e0f75e7bd4f 100644 --- a/src/sage/groups/libgap_morphism.py +++ b/src/sage/groups/libgap_morphism.py @@ -557,7 +557,8 @@ def preimage(self, S): def section(self): r""" - This method returns a section map of ``self`` by use of :meth:`lift`. + Return a section map of ``self`` by use of :meth:`lift`. + See :meth:`section` of :class:`sage.categories.map.Map`, as well. OUTPUT: an instance of :class:`sage.categories.morphism.SetMorphism` diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index abaf17f11d9..0cf0e8bfb31 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -260,7 +260,7 @@ class ParentLibGAP(SageObject): def gap(self): """ - Return the gap representation of ``self``. + Return the GAP representation of ``self``. OUTPUT: a :class:`~sage.libs.gap.element.GapElement` @@ -400,7 +400,7 @@ class ParentLibGAP(SageObject): INPUT: - ``i`` -- integer between `0` (inclusive) and :meth:`ngens` - (exclusive); The index of the generator + (exclusive); the index of the generator OUTPUT: the `i`-th generator of the group diff --git a/src/sage/groups/matrix_gps/isometries.py b/src/sage/groups/matrix_gps/isometries.py index baf0925d706..4763b13721a 100644 --- a/src/sage/groups/matrix_gps/isometries.py +++ b/src/sage/groups/matrix_gps/isometries.py @@ -47,7 +47,7 @@ class GroupOfIsometries(FinitelyGeneratedMatrixGroup_gap): A base class for Orthogonal matrix groups with a gap backend. Main difference to :class:`~sage.groups.matrix_gps.orthogonal.OrthogonalMatrixGroup_gap` - is that we can specify generators and a bilinear form. Following gap the group action is + is that we can specify generators and a bilinear form. Following GAP, the group action is from the right. INPUT: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx index 41891938e7a..1abbf635d9c 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_binary.pyx @@ -118,7 +118,7 @@ cdef class LinearBinaryCodeStruct(BinaryCodeStruct): INPUT: - - partition -- an optional list of lists partition of the columns; + - ``partition`` -- an optional list of lists partition of the columns; default is the unit partition EXAMPLES:: @@ -1055,15 +1055,15 @@ cdef inline int sort_by_function_codes(PartitionStack *PS, int start, int *degre def random_tests(num=50, n_max=50, k_max=6, nwords_max=200, perms_per_code=10, density_range=(.1,.9)): """ - Test to make sure that C(gamma(B)) == C(B) for random permutations gamma - and random codes B, and that is_isomorphic returns an isomorphism. + Test to make sure that ``C(gamma(B)) == C(B)`` for random permutations ``gamma`` + and random codes ``B``, and that :meth:`is_isomorphic` returns an isomorphism. INPUT: - - num -- run tests for this many codes - - n_max -- test codes with at most this many columns - - k_max -- test codes with at most this for dimension - - perms_per_code -- test each code with this many random permutations + - ``num`` -- run tests for this many codes + - ``n_max`` -- test codes with at most this many columns + - ``k_max`` -- test codes with at most this for dimension + - ``perms_per_code`` -- test each code with this many random permutations DISCUSSION: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx index 9fb97741746..7fa11c28343 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx @@ -130,7 +130,7 @@ cdef class MatrixStruct: INPUT: - - partition -- an optional list of lists partition of the columns; + - ``partition`` -- an optional list of lists partition of the columns; default is the unit partition. EXAMPLES:: @@ -298,8 +298,8 @@ cdef bint all_matrix_children_are_equivalent(PartitionStack *PS, void *S) noexce def random_tests(n=10, nrows_max=50, ncols_max=50, nsymbols_max=10, perms_per_matrix=5, density_range=(.1,.9)): """ - Test to make sure that C(gamma(M)) == C(M) for random permutations gamma - and random matrices M, and that M.is_isomorphic(gamma(M)) returns an + Test to make sure that ``C(gamma(M)) == C(M)`` for random permutations ``gamma`` + and random matrices ``M``, and that ``M.is_isomorphic(gamma(M))`` returns an isomorphism. INPUT: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx index 0dd869c1c95..96e3497fe42 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_python.pyx @@ -408,9 +408,9 @@ def aut_gp_and_can_lab_python(S, partition, n, INPUT: - - S -- the object to examine - - partition -- an ordered partition, as a list of lists - - n -- the degree of the automorphism group to be computed + - ``S`` -- the object to examine + - ``partition`` -- an ordered partition, as a list of lists + - ``n`` -- the degree of the automorphism group to be computed :: @@ -493,10 +493,10 @@ def double_coset_python(S1, S2, partition1, ordering2, n, INPUT: - - S1, S2 -- the objects to examine - - partition1 -- an ordered partition, as a list of lists - - ordering2 -- represents a partition of the points of S2, as a relabeling of partition1 - - n -- the degree + - ``S1``, ``S2`` -- the objects to examine + - ``partition1`` -- an ordered partition, as a list of lists + - ``ordering2`` -- represents a partition of the points of ``S2``, as a relabeling of ``partition1`` + - ``n`` -- the degree :: diff --git a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx index a613b7b9c4a..0f951e7e097 100644 --- a/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx +++ b/src/sage/groups/perm_gps/partn_ref/refinement_sets.pyx @@ -697,7 +697,7 @@ def sets_modulo_perm_group(list generators, int max_size, - ``generators`` -- (list of lists) list of generators in list form - ``max_size`` -- (int) maximum size of subsets to be generated - ``indicate_mem_err`` -- (bool) whether to raise an error - if we run out of memory, or simply append a MemoryError + if we run out of memory, or simply append a :class:`MemoryError` instance to the end of the output EXAMPLES:: diff --git a/src/sage/groups/perm_gps/permgroup_element.pyx b/src/sage/groups/perm_gps/permgroup_element.pyx index 4c52b386294..c2a462d9727 100644 --- a/src/sage/groups/perm_gps/permgroup_element.pyx +++ b/src/sage/groups/perm_gps/permgroup_element.pyx @@ -1119,7 +1119,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement): cpdef ClonableIntArray _act_on_array_on_position(self, ClonableIntArray x): r""" - Return the right action of ``self`` on the ClonableIntArray + Return the right action of ``self`` on the :class:`ClonableIntArray` ``x``. This is the action on positions. EXAMPLES:: diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index cfc38b639de..c000d2cf105 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -1394,8 +1394,8 @@ def __init__(self, factors): gens.append([tuple(range(jumppoint, jumppoint + a))]) # make contribution to the generator that dihedralizes the # abelian group - genx.extend((jumppoint+i, jumppoint+a-i) - for i in range(1, (a//2)+1) if i != a-i) + genx.extend((jumppoint + i, jumppoint + a - i) + for i in range(1, (a//2) + 1) if i != a - i) jumppoint += a # If all of the direct factors are C2, then the action turning # each element into its inverse is trivial, and the @@ -2214,7 +2214,7 @@ class PrimitiveGroup(PermutationGroup_unique): - ``n`` -- positive integer. the index of the group in the GAP database, starting at 1 - OUTPUT: Tthe ``n``-th primitive group of degree ``d`` + OUTPUT: the ``n``-th primitive group of degree ``d`` EXAMPLES:: From 19f157ea4f57cd226f1cb30bd2e164abfd2cbb0a Mon Sep 17 00:00:00 2001 From: Giorgos Mousa Date: Fri, 12 Apr 2024 09:44:50 +0300 Subject: [PATCH 4/4] Revert abelian_gps/all.py and move a dash --- src/sage/groups/abelian_gps/all.py | 7 +++---- src/sage/groups/finitely_presented.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sage/groups/abelian_gps/all.py b/src/sage/groups/abelian_gps/all.py index fa418e36c0c..2bb91f85f3b 100644 --- a/src/sage/groups/abelian_gps/all.py +++ b/src/sage/groups/abelian_gps/all.py @@ -20,11 +20,10 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -# from dual_abelian_group import DualAbelianGroup +#from dual_abelian_group import DualAbelianGroup from .abelian_group import AbelianGroup, word_problem from .values import AbelianGroupWithValues -# .. TODO:: - -# Implement group homset, conversion of generator images to morphism +# TODO: +# Implement group homset, conversion of generator images to morphism from .abelian_group_morphism import AbelianGroupMorphism diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index 75a33a190f6..a6ef6bb7395 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -1725,7 +1725,7 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False): group `G`, see e.g. [CS1999a]_. Let `\Lambda` be the group algebra of `G/G'` and `\mathbb{T}` its associated algebraic variety (a torus). Each element `\xi\in\mathbb{T}` defines a local system of coefficients - and the `k` th-characteristic variety is + and the `k`-th characteristic variety is .. MATH::