From 5f652ff9ff8946058830c150e2fca407effc6a17 Mon Sep 17 00:00:00 2001 From: gmou3 Date: Tue, 11 Jun 2024 14:23:13 +0300 Subject: [PATCH] Docstring edits Remove indefinite articles, change initial docstring verb to prescriptive form, etc. --- .../algebras/affine_nil_temperley_lieb.py | 2 +- src/sage/algebras/askey_wilson.py | 2 +- src/sage/algebras/commutative_dga.py | 2 +- .../lie_algebras/nilpotent_lie_algebra.py | 4 +- .../graded_lie_conformal_algebra.py | 2 +- .../lie_conformal_algebra_element.py | 4 +- ..._conformal_algebra_with_structure_coefs.py | 14 +- .../algebras/quatalg/quaternion_algebra.py | 12 +- src/sage/arith/misc.py | 14 +- src/sage/calculus/desolvers.py | 2 +- src/sage/calculus/interpolators.pyx | 4 +- src/sage/calculus/riemann.pyx | 4 +- src/sage/categories/category.py | 4 +- src/sage/categories/commutative_rings.py | 2 +- src/sage/categories/coxeter_groups.py | 2 +- src/sage/categories/crystals.py | 4 +- src/sage/categories/enumerated_sets.py | 4 +- .../examples/filtered_algebras_with_basis.py | 2 +- .../examples/filtered_modules_with_basis.py | 2 +- .../examples/graded_modules_with_basis.py | 2 +- src/sage/categories/examples/sets_cat.py | 2 +- .../finite_complex_reflection_groups.py | 6 +- .../finite_dimensional_algebras_with_basis.py | 6 +- ...ensional_semisimple_algebras_with_basis.py | 2 +- src/sage/categories/finite_enumerated_sets.py | 2 +- src/sage/categories/finite_semigroups.py | 2 +- src/sage/categories/function_fields.py | 4 +- .../categories/highest_weight_crystals.py | 6 +- .../categories/lambda_bracket_algebras.py | 2 +- src/sage/categories/semigroups.py | 2 +- src/sage/categories/super_modules.py | 2 +- src/sage/coding/abstract_code.py | 10 +- src/sage/coding/binary_code.pyx | 2 +- src/sage/coding/channel.py | 4 +- src/sage/coding/code_constructions.py | 4 +- .../coding/codecan/autgroup_can_label.pyx | 4 +- src/sage/coding/codecan/codecan.pyx | 4 +- src/sage/coding/cyclic_code.py | 4 +- src/sage/coding/decoder.py | 2 +- src/sage/coding/encoder.py | 6 +- src/sage/coding/grs_code.py | 6 +- .../coding/guruswami_sudan/interpolation.py | 4 +- src/sage/coding/information_set_decoder.py | 2 +- src/sage/coding/kasami_codes.pyx | 2 +- src/sage/coding/linear_code.py | 12 +- src/sage/coding/linear_code_no_metric.py | 2 +- src/sage/coding/punctured_code.py | 2 +- src/sage/coding/reed_muller_code.py | 8 +- src/sage/coding/source_coding/huffman.py | 4 +- src/sage/coding/subfield_subcode.py | 2 +- .../cluster_algebra_quiver/cluster_seed.py | 9 +- .../combinat/cluster_algebra_quiver/quiver.py | 6 +- .../quiver_mutation_type.py | 16 +- src/sage/combinat/crystals/affine.py | 2 +- .../combinat/crystals/kirillov_reshetikhin.py | 6 +- src/sage/combinat/designs/bibd.py | 2 +- src/sage/combinat/designs/block_design.py | 4 +- src/sage/combinat/designs/covering_design.py | 2 +- src/sage/combinat/designs/designs_pyx.pyx | 4 +- .../combinat/designs/difference_matrices.py | 8 +- .../designs/group_divisible_designs.py | 4 +- src/sage/combinat/designs/latin_squares.py | 2 +- .../combinat/designs/orthogonal_arrays.py | 8 +- .../orthogonal_arrays_build_recursive.py | 4 +- src/sage/combinat/designs/resolvable_bibd.py | 2 +- .../combinat/designs/subhypergraph_search.pyx | 2 +- .../combinat/ncsf_qsym/generic_basis_code.py | 4 +- src/sage/combinat/posets/elements.py | 16 +- src/sage/combinat/posets/hasse_diagram.py | 14 +- src/sage/combinat/posets/linear_extensions.py | 17 +- src/sage/combinat/posets/mobile.py | 2 +- src/sage/combinat/posets/poset_examples.py | 84 ++-- src/sage/combinat/posets/posets.py | 144 +++--- .../bij_abstract_class.py | 28 +- .../rigged_configurations/bij_type_B.py | 10 +- .../rigged_configurations/bij_type_D.py | 12 +- .../bij_type_D_twisted.py | 10 +- .../rigged_configurations/kleber_tree.py | 36 +- .../rigged_configurations/kr_tableaux.py | 28 +- .../rigged_configuration_element.py | 22 +- .../rigged_configurations.py | 10 +- .../rigged_partition.pyx | 18 +- .../tensor_product_kr_tableaux_element.py | 8 +- .../combinat/root_system/ambient_space.py | 12 +- .../combinat/root_system/associahedron.py | 4 +- .../root_system/braid_move_calculator.py | 2 +- .../combinat/root_system/branching_rules.py | 424 +++++++++--------- .../combinat/root_system/cartan_matrix.py | 2 +- src/sage/combinat/root_system/cartan_type.py | 26 +- .../combinat/root_system/coxeter_group.py | 20 +- src/sage/combinat/root_system/coxeter_type.py | 6 +- .../combinat/root_system/dynkin_diagram.py | 20 +- .../root_system/extended_affine_weyl_group.py | 82 ++-- .../combinat/root_system/fundamental_group.py | 24 +- .../hecke_algebra_representation.py | 26 +- .../root_system/integrable_representations.py | 16 +- .../non_symmetric_macdonald_polynomials.py | 21 +- .../combinat/root_system/pieri_factors.py | 6 +- src/sage/combinat/root_system/plot.py | 54 +-- .../root_system/reflection_group_c.pyx | 22 +- 100 files changed, 749 insertions(+), 770 deletions(-) diff --git a/src/sage/algebras/affine_nil_temperley_lieb.py b/src/sage/algebras/affine_nil_temperley_lieb.py index 2fa99851410..f71417c6093 100644 --- a/src/sage/algebras/affine_nil_temperley_lieb.py +++ b/src/sage/algebras/affine_nil_temperley_lieb.py @@ -67,7 +67,7 @@ def __init__(self, n, R=ZZ, prefix='a'): def _element_constructor_(self, w): """ - Constructs a basis element from an element of the Weyl group. + Construct a basis element from an element of the Weyl group. If `w = w_1 ... w_k` is a reduced word for `w`, then `A(w)` returns zero if `w` contains braid relations. diff --git a/src/sage/algebras/askey_wilson.py b/src/sage/algebras/askey_wilson.py index db0bca83696..baf2e20a53f 100644 --- a/src/sage/algebras/askey_wilson.py +++ b/src/sage/algebras/askey_wilson.py @@ -845,7 +845,7 @@ def __eq__(self, other): def _on_basis(self, c): r""" - Computes the image of this morphism on the basis element + Compute the image of this morphism on the basis element indexed by ``c``. INPUT: diff --git a/src/sage/algebras/commutative_dga.py b/src/sage/algebras/commutative_dga.py index ebac5161a40..6fc50a611a1 100644 --- a/src/sage/algebras/commutative_dga.py +++ b/src/sage/algebras/commutative_dga.py @@ -1669,7 +1669,7 @@ def basis_coefficients(self, total=False): ``True``, it returns the coefficients with respect to the basis for the total degree of this element - OUTPUT: a list of elements of the base field + OUTPUT: list of elements of the base field EXAMPLES:: diff --git a/src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py b/src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py index 6a8b8f0002e..7468443e907 100644 --- a/src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py @@ -30,10 +30,10 @@ class NilpotentLieAlgebra_dense(LieAlgebraWithStructureCoefficients): - ``R`` -- the base ring - ``s_coeff`` -- a dictionary of structural coefficients - - ``names`` -- (default:``None``) list of strings to use as names of basis + - ``names`` -- (default: ``None``) list of strings to use as names of basis elements; if ``None``, the names will be inferred from the structural coefficients - - ``index_set`` -- (default:``None``) list of hashable and comparable + - ``index_set`` -- (default: ``None``) list of hashable and comparable elements to use for indexing - ``step`` -- integer (optional); the nilpotency step of the Lie algebra if known; otherwise it will be computed when needed diff --git a/src/sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py b/src/sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py index b13f949f39c..e923a04561a 100644 --- a/src/sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +++ b/src/sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py @@ -84,7 +84,7 @@ class GradedLieConformalAlgebra(LieConformalAlgebraWithStructureCoefficients): - ``category`` The category that this Lie conformal algebra belongs to. - - ``parity`` -- tuple of ``0`` or ``1`` (Default: tuple of + - ``parity`` -- tuple of ``0`` or ``1`` (default: tuple of ``0``); a tuple specifying the parity of each non-central generator. diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py index a9d621da7fc..794c1a7ca82 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py @@ -33,8 +33,8 @@ def T(self, n=1): INPUT: - - ``n`` -- nonnegative integer (default:``1``); how many - times to apply `T` to this element. + - ``n`` -- nonnegative integer (default: `1`); how many + times to apply `T` to this element We use the *divided powers* notation `T^{(j)} = \frac{T^j}{j!}`. diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py index 70d4395e067..35fae142549 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py @@ -35,11 +35,11 @@ class LieConformalAlgebraWithStructureCoefficients( INPUT: - - ``R`` -- a ring (Default: ``None``); The base ring of this Lie + - ``R`` -- a ring (default: ``None``); The base ring of this Lie conformal algebra. Behaviour is undefined if it is not a field of characteristic zero. - - ``s_coeff`` -- dictionary (Default: ``None``); + - ``s_coeff`` -- dictionary (default: ``None``); a dictionary containing the `\lambda` brackets of the generators of this Lie conformal algebra. The family encodes a dictionary whose keys @@ -66,20 +66,20 @@ class LieConformalAlgebraWithStructureCoefficients( defined by skew-symmetry) is assumed to have vanishing `\lambda`-bracket. - - ``names`` -- tuple of ``str`` (Default: ``None``); The list of + - ``names`` -- tuple of ``str`` (default: ``None``); The list of names for generators of this Lie conformal algebra. Do not include central elements in this list. - - ``central_elements`` -- tuple of ``str`` (Default: ``None``); + - ``central_elements`` -- tuple of ``str`` (default: ``None``); A list of names for central elements of this Lie conformal algebra. - - ``index_set`` -- enumerated set (Default: ``None``); + - ``index_set`` -- enumerated set (default: ``None``); an indexing set for the generators of this Lie conformal algebra. Do not include central elements in this list. - - ``parity`` -- tuple of `0` or `1` (Default: tuple of `0`); + - ``parity`` -- tuple of `0` or `1` (default: tuple of `0`); a tuple specifying the parity of each non-central generator. EXAMPLES: @@ -127,7 +127,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None): generators (not counting the central elements). - ``ce`` -- a tuple of ``str``; a list of names for the central generators of this Lie conformal algebra - - ``parity`` -- a tuple of `0` or `1` (Default: tuple of `0`); + - ``parity`` -- a tuple of `0` or `1` (default: tuple of `0`); this tuple specifies the parity of each non-central generator. OUTPUT: diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index ffd86abd9a2..376280250c9 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -1048,7 +1048,7 @@ def invariants(self): def is_definite(self): """ - Checks whether the quaternion algebra ``self`` is definite, i.e. whether it ramifies at the + Check whether the quaternion algebra ``self`` is definite, i.e. whether it ramifies at the unique Archimedean place of its base field QQ. This is the case if and only if both invariants of ``self`` are negative. @@ -2007,7 +2007,7 @@ def _left_ideal_basis(self, gens): - ``gens`` -- list of elements of ``self`` - OUTPUT: a list of four elements of ``self`` + OUTPUT: list of four elements of ``self`` EXAMPLES:: @@ -3561,7 +3561,7 @@ def pullback(self, J, side=None): def is_equivalent(self, J, B=10, certificate=False, side=None): r""" - Checks whether ``self`` and ``J`` are equivalent as ideals. + Check whether ``self`` and ``J`` are equivalent as ideals. Tests equivalence as right ideals by default. Requires the underlying rational quaternion algebra to be definite. @@ -3603,7 +3603,7 @@ def is_equivalent(self, J, B=10, certificate=False, side=None): def is_left_equivalent(self, J, B=10, certificate=False): r""" - Checks whether ``self`` and ``J`` are equivalent as left ideals. + Check whether ``self`` and ``J`` are equivalent as left ideals. Requires the underlying rational quaternion algebra to be definite. INPUT: @@ -3626,7 +3626,7 @@ def is_left_equivalent(self, J, B=10, certificate=False): def is_right_equivalent(self, J, B=10, certificate=False): r""" - Checks whether ``self`` and ``J`` are equivalent as right ideals. + Check whether ``self`` and ``J`` are equivalent as right ideals. Requires the underlying rational quaternion algebra to be definite. INPUT: @@ -3698,7 +3698,7 @@ def is_right_equivalent(self, J, B=10, certificate=False): def is_principal(self, certificate=False): r""" - Checks whether ``self`` is principal as a full rank quaternion ideal. + Check whether ``self`` is principal as a full rank quaternion ideal. Requires the underlying quaternion algebra to be definite. Independent of whether ``self`` is a left or a right ideal. diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py index 8b4145639da..bd331083caf 100644 --- a/src/sage/arith/misc.py +++ b/src/sage/arith/misc.py @@ -970,7 +970,7 @@ def eratosthenes(n): - ``n`` -- a positive integer - OUTPUT: a list of primes less than or equal to n + OUTPUT: list of primes less than or equal to n EXAMPLES:: @@ -1660,7 +1660,7 @@ def __repr__(self): def __call__(self, n, k=1): """ - Computes the sum of (the k-th powers of) the divisors of n. + Compute the sum of (the `k`-th powers of) the divisors of `n`. EXAMPLES:: @@ -4141,7 +4141,7 @@ def kronecker_symbol(x,y): - ``y`` -- integer - OUTPUT: an integer + OUTPUT: integer EXAMPLES:: @@ -4754,14 +4754,14 @@ def continuant(v, n=None): def number_of_divisors(n): - """ - Return the number of divisors of the integer n. + r""" + Return the number of divisors of the integer `n`. INPUT: - ``n`` -- a nonzero integer - OUTPUT: an integer, the number of divisors of n + OUTPUT: integer; the number of divisors of `n` EXAMPLES:: @@ -6013,7 +6013,7 @@ def fundamental_discriminant(D): - ``D`` -- integer - OUTPUT: an integer, the fundamental discriminant + OUTPUT: integer; the fundamental discriminant EXAMPLES:: diff --git a/src/sage/calculus/desolvers.py b/src/sage/calculus/desolvers.py index 2b8d5bf4689..1604d1ec4be 100644 --- a/src/sage/calculus/desolvers.py +++ b/src/sage/calculus/desolvers.py @@ -1262,7 +1262,7 @@ def desolve_rk4(de, dvar, ics=None, ivar=None, end_points=None, step=0.1, output - if end_points is [a,b] we integrate between ``min(ics[0], a)`` and ``max(ics[0], b)`` - - ``step`` -- (default:0.1) the length of the step (positive number) + - ``step`` -- (default: 0.1) the length of the step (positive number) - ``output`` -- (default: ``'list'``) one of ``'list'``, ``'plot'``, ``'slope_field'`` (graph of the solution with slope field) diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx index b07de7e3dbc..26bdf740910 100644 --- a/src/sage/calculus/interpolators.pyx +++ b/src/sage/calculus/interpolators.pyx @@ -33,7 +33,7 @@ cdef double TWOPI = 2*pi def polygon_spline(pts): """ - Creates a polygon from a set of complex or `(x,y)` points. The polygon + Create a polygon from a set of complex or `(x,y)` points. The polygon will be a parametric curve from 0 to 2*pi. The returned values will be complex, not `(x,y)`. @@ -168,7 +168,7 @@ cdef class PSpline: def complex_cubic_spline(pts): """ - Creates a cubic spline interpolated figure from a set of complex or + Create a cubic spline interpolated figure from a set of complex or `(x,y)` points. The figure will be a parametric curve from 0 to 2*pi. The returned values will be complex, not `(x,y)`. diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx index 805db24248f..a41460d2347 100644 --- a/src/sage/calculus/riemann.pyx +++ b/src/sage/calculus/riemann.pyx @@ -204,7 +204,7 @@ cdef class Riemann_Map: opp=False, exterior = False): """ - Initializes the ``Riemann_Map`` class. See the class :class:`Riemann_Map` + Initialize the ``Riemann_Map`` class. See the class :class:`Riemann_Map` for full documentation on the input of this initialization method. TESTS:: @@ -1094,7 +1094,7 @@ cdef comp_pt(clist, loop=True): cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values, FLOAT_T xstep, FLOAT_T ystep): """ - Computes the r*e^(I*theta) form of derivatives from the grid of points. The + Compute the r*e^(I*theta) form of derivatives from the grid of points. The derivatives are computed using quick-and-dirty taylor expansion and assuming analyticity. As such ``get_derivatives`` is primarily intended to be used for comparisons in ``plot_spiderweb`` and not for diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py index b4048666511..fee35ce71b1 100644 --- a/src/sage/categories/category.py +++ b/src/sage/categories/category.py @@ -701,7 +701,7 @@ def __contains__(self, x): @staticmethod def __classcontains__(cls, x): """ - Membership testing, without arguments + Membership testing, without arguments. INPUT: @@ -2940,7 +2940,7 @@ class JoinCategory(CategoryWithParameters): def __init__(self, super_categories, **kwds): """ - Initializes this JoinCategory. + Initialize this JoinCategory. INPUT: diff --git a/src/sage/categories/commutative_rings.py b/src/sage/categories/commutative_rings.py index 224c2bf39be..c95a487ee8b 100644 --- a/src/sage/categories/commutative_rings.py +++ b/src/sage/categories/commutative_rings.py @@ -534,7 +534,7 @@ def cyclotomic_cosets(self, q, cosets=None): provided, the function only return the list of cosets that contain some element from ``cosets``. - OUTPUT: a list of lists + OUTPUT: list of lists EXAMPLES:: diff --git a/src/sage/categories/coxeter_groups.py b/src/sage/categories/coxeter_groups.py index 0c465abc2c7..25d859cd308 100644 --- a/src/sage/categories/coxeter_groups.py +++ b/src/sage/categories/coxeter_groups.py @@ -1287,7 +1287,7 @@ def random_element_of_length(self, n): def _test_simple_projections(self, **options): """ - Runs sanity checks on :meth:`.simple_projections` + Run sanity checks on :meth:`.simple_projections` and :meth:`CoxeterGroups.ElementMethods.apply_simple_projection` EXAMPLES:: diff --git a/src/sage/categories/crystals.py b/src/sage/categories/crystals.py index 019cf661c64..e0d5659238f 100644 --- a/src/sage/categories/crystals.py +++ b/src/sage/categories/crystals.py @@ -351,10 +351,10 @@ def __iter__(self, index_set=None, max_depth=float('inf')): INPUT: - - ``index_set`` -- (Default: ``None``) the index set; if ``None`` + - ``index_set`` -- (default: ``None``) the index set; if ``None`` then use the index set of the crystal - - ``max_depth`` -- (Default: infinity) the maximum depth to build + - ``max_depth`` -- (default: infinity) the maximum depth to build The iteration order is not specified except that, if ``max_depth`` is finite, then the iteration goes depth by diff --git a/src/sage/categories/enumerated_sets.py b/src/sage/categories/enumerated_sets.py index 91932fa9a15..6e518773b50 100644 --- a/src/sage/categories/enumerated_sets.py +++ b/src/sage/categories/enumerated_sets.py @@ -1003,7 +1003,7 @@ def map(self, f, name=None, *, is_injective=True): # def _test_enumerated_set_contains(self, **options): """ - Checks that the methods :meth:`.__contains__` and :meth:`.__iter__` are consistent. + Check that the methods :meth:`.__contains__` and :meth:`.__iter__` are consistent. See also :class:`TestSuite`. @@ -1039,7 +1039,7 @@ def _test_enumerated_set_contains(self, **options): def _test_enumerated_set_iter_list(self, **options): """ - Checks that the methods :meth:`.list` and :meth:`.__iter__` are consistent. + Check that the methods :meth:`.list` and :meth:`.__iter__` are consistent. See also: :class:`TestSuite`. diff --git a/src/sage/categories/examples/filtered_algebras_with_basis.py b/src/sage/categories/examples/filtered_algebras_with_basis.py index 9b982e7123f..42713f71aac 100644 --- a/src/sage/categories/examples/filtered_algebras_with_basis.py +++ b/src/sage/categories/examples/filtered_algebras_with_basis.py @@ -127,7 +127,7 @@ def degree_on_basis(self, m): - ``m`` -- an element of the free abelian monoid - OUTPUT: an integer, the degree of the corresponding basis element + OUTPUT: integer; the degree of the corresponding basis element EXAMPLES:: diff --git a/src/sage/categories/examples/filtered_modules_with_basis.py b/src/sage/categories/examples/filtered_modules_with_basis.py index d62c3d906ff..4dbe78dc5eb 100644 --- a/src/sage/categories/examples/filtered_modules_with_basis.py +++ b/src/sage/categories/examples/filtered_modules_with_basis.py @@ -108,7 +108,7 @@ def degree_on_basis(self, t): - ``t`` -- the index of an element of the basis of this module, i.e. a partition - OUTPUT: an integer, the degree of the corresponding basis element + OUTPUT: integer; the degree of the corresponding basis element EXAMPLES:: diff --git a/src/sage/categories/examples/graded_modules_with_basis.py b/src/sage/categories/examples/graded_modules_with_basis.py index cc18187a7fb..7443a48a7af 100644 --- a/src/sage/categories/examples/graded_modules_with_basis.py +++ b/src/sage/categories/examples/graded_modules_with_basis.py @@ -122,7 +122,7 @@ def degree_on_basis(self, t): - ``t`` -- the index of an element of the basis of this module, i.e. a partition - OUTPUT: an integer, the degree of the corresponding basis element + OUTPUT: integer, the degree of the corresponding basis element EXAMPLES:: diff --git a/src/sage/categories/examples/sets_cat.py b/src/sage/categories/examples/sets_cat.py index 30d63ec9c73..203ccd62999 100644 --- a/src/sage/categories/examples/sets_cat.py +++ b/src/sage/categories/examples/sets_cat.py @@ -200,7 +200,7 @@ def an_element(self): def _element_constructor_(self, i): """ - Constructs an element of self from an integer, testing that + Construct an element of self from an integer, testing that this integer is indeed prime. EXAMPLES:: diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index 46a64a068f5..80a87ea9310 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -838,14 +838,14 @@ def absolute_order_ideal(self, gens=None, Otherwise, the standard Coxeter element is used as unique maximal element. - - ``in_unitary_group`` (default:``True``) determines the + - ``in_unitary_group`` -- (default: ``True``) determines the length function used to compute the order. For real groups, both possible orders coincide, and for complex non-real groups, the order in the unitary group is much faster to compute. - - ``return_lengths`` (default:``False``) whether or not - to also return the lengths of the elements. + - ``return_lengths`` -- (default: ``False``) whether or not + to also return the lengths of the elements EXAMPLES:: diff --git a/src/sage/categories/finite_dimensional_algebras_with_basis.py b/src/sage/categories/finite_dimensional_algebras_with_basis.py index 0f8b531e37a..314b65a5956 100644 --- a/src/sage/categories/finite_dimensional_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_algebras_with_basis.py @@ -74,7 +74,7 @@ def radical_basis(self): characteristic `p` in which we can compute `x^{1/p}` [FR1985]_, [Eb1989]_. - OUTPUT: a list of elements of ``self`` + OUTPUT: list of elements of ``self`` .. SEEALSO:: :meth:`radical`, :class:`Algebras.Semisimple` @@ -346,7 +346,7 @@ def center_basis(self): r""" Return a basis of the center of ``self``. - OUTPUT: a list of elements of ``self`` + OUTPUT: list of elements of ``self`` .. SEEALSO:: :meth:`center` @@ -849,7 +849,7 @@ def isotypic_projective_modules(self, side='left'): - ``side`` -- 'left' or 'right' (default: ``'left'``) - OUTPUT: a list of subspaces of ``self`` + OUTPUT: list of subspaces of ``self`` EXAMPLES:: diff --git a/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py b/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py index f799ae4cf91..2093e263f14 100644 --- a/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py @@ -217,7 +217,7 @@ def central_orthogonal_idempotents(self): of the identity into primitive orthogonal idempotents. - OUTPUT: a list of orthogonal idempotents of ``self`` + OUTPUT: list of orthogonal idempotents of ``self`` EXAMPLES:: diff --git a/src/sage/categories/finite_enumerated_sets.py b/src/sage/categories/finite_enumerated_sets.py index 5423fcd1260..82267cf5699 100644 --- a/src/sage/categories/finite_enumerated_sets.py +++ b/src/sage/categories/finite_enumerated_sets.py @@ -528,7 +528,7 @@ def _last_from_unrank(self): def _test_enumerated_set_iter_cardinality(self, **options): """ - Checks that the methods :meth:`.cardinality` and + Check that the methods :meth:`.cardinality` and :meth:`.__iter__` are consistent. Also checks that :meth:`.cardinality` returns an ``Integer``. diff --git a/src/sage/categories/finite_semigroups.py b/src/sage/categories/finite_semigroups.py index 2e2fc5d7602..831da9308bc 100644 --- a/src/sage/categories/finite_semigroups.py +++ b/src/sage/categories/finite_semigroups.py @@ -99,7 +99,7 @@ def j_classes_of_idempotents(self): r""" Return all the idempotents of self, grouped by J-class. - OUTPUT: a list of lists + OUTPUT: list of lists EXAMPLES:: diff --git a/src/sage/categories/function_fields.py b/src/sage/categories/function_fields.py index a1375e2ef9b..8d089a881c2 100644 --- a/src/sage/categories/function_fields.py +++ b/src/sage/categories/function_fields.py @@ -48,8 +48,8 @@ def super_categories(self): def _call_(self, x): r""" - Constructs an object in this category from the data in ``x``, - or throws a TypeError. + Construct an object in this category from the data in ``x``, + or throw a ``TypeError``. EXAMPLES:: diff --git a/src/sage/categories/highest_weight_crystals.py b/src/sage/categories/highest_weight_crystals.py index 799e245dac8..904b09f88c6 100644 --- a/src/sage/categories/highest_weight_crystals.py +++ b/src/sage/categories/highest_weight_crystals.py @@ -191,10 +191,10 @@ def __iter__(self, index_set=None, max_depth=float("inf")): INPUT: - - ``index_set`` -- (Default: ``None``) The index set; if ``None`` + - ``index_set`` -- (default: ``None``) the index set; if ``None`` then use the index set of the crystal - - ``max_depth`` -- (Default: infinity) The maximum depth to build + - ``max_depth`` -- (default: infinity) The maximum depth to build EXAMPLES:: @@ -254,7 +254,7 @@ def q_dimension(self, q=None, prec=None, use_product=False): - ``q`` -- the (generic) parameter `q` - - ``prec`` -- (default: ``None``) The precision of the power + - ``prec`` -- (default: ``None``) the precision of the power series ring to use if the crystal is not known to be finite (i.e. the number of terms returned). If ``None``, then the result is returned as a lazy power series. diff --git a/src/sage/categories/lambda_bracket_algebras.py b/src/sage/categories/lambda_bracket_algebras.py index 637f5ae6ee5..440704e5c4b 100644 --- a/src/sage/categories/lambda_bracket_algebras.py +++ b/src/sage/categories/lambda_bracket_algebras.py @@ -251,7 +251,7 @@ def T(self, n=1): INPUT: - - ``n`` -- integer (default:``1``); how many times + - ``n`` -- integer (default: `1`); how many times to apply `T` to this element OUTPUT: diff --git a/src/sage/categories/semigroups.py b/src/sage/categories/semigroups.py index d953a8cec22..8858f6f7013 100644 --- a/src/sage/categories/semigroups.py +++ b/src/sage/categories/semigroups.py @@ -181,7 +181,7 @@ def cayley_graph(self, side='right', simple=False, elements=None, INPUT: - ``side`` -- "left", "right", or "twosided": - the side on which the generators act (default:"right") + the side on which the generators act (default: "right") - ``simple`` -- boolean (default: ``False``): if ``True``, returns a simple graph (no loops, no labels, no multiple edges) diff --git a/src/sage/categories/super_modules.py b/src/sage/categories/super_modules.py index 59214d5e021..4e02ccbae30 100644 --- a/src/sage/categories/super_modules.py +++ b/src/sage/categories/super_modules.py @@ -132,7 +132,7 @@ def super_categories(self): def extra_super_categories(self): r""" - Adds :class:`VectorSpaces` to the super categories of ``self`` if + Add :class:`VectorSpaces` to the super categories of ``self`` if the base ring is a field. EXAMPLES:: diff --git a/src/sage/coding/abstract_code.py b/src/sage/coding/abstract_code.py index e114a552849..de6b40f2ab4 100644 --- a/src/sage/coding/abstract_code.py +++ b/src/sage/coding/abstract_code.py @@ -205,7 +205,7 @@ class AbstractCode(Parent): def __init__(self, length, default_encoder_name=None, default_decoder_name=None, metric='Hamming'): r""" - Initializes mandatory parameters that any code shares. + Initialize mandatory parameters that any code shares. This method only exists for inheritance purposes as it initializes parameters that need to be known by every code. The class @@ -542,7 +542,7 @@ def metric(self): def add_decoder(self, name, decoder): r""" - Adds an decoder to the list of registered decoders of ``self``. + Add an decoder to the list of registered decoders of ``self``. .. NOTE:: @@ -604,7 +604,7 @@ def add_decoder(self, name, decoder): def add_encoder(self, name, encoder): r""" - Adds an encoder to the list of registered encoders of ``self``. + Add an encoder to the list of registered encoders of ``self``. .. NOTE:: @@ -834,7 +834,7 @@ def decoders_available(self, classes=False): ``True``, return instead a :class:`dict` mapping available decoder name to the associated decoder class - OUTPUT: a list of strings, or a :class:`dict` mapping strings to classes + OUTPUT: list of strings, or a :class:`dict` mapping strings to classes EXAMPLES:: @@ -1009,7 +1009,7 @@ def encoders_available(self, classes=False): ``True``, return instead a :class:`dict` mapping available encoder name to the associated encoder class - OUTPUT: a list of strings, or a :class:`dict` mapping strings to classes + OUTPUT: list of strings, or a :class:`dict` mapping strings to classes EXAMPLES:: diff --git a/src/sage/coding/binary_code.pyx b/src/sage/coding/binary_code.pyx index ed47ef6ec91..dfd7d805eee 100644 --- a/src/sage/coding/binary_code.pyx +++ b/src/sage/coding/binary_code.pyx @@ -88,7 +88,7 @@ cdef int *hamming_weights() noexcept: def weight_dist(M): """ - Computes the weight distribution of the row space of `M`. + Compute the weight distribution of the row space of `M`. EXAMPLES:: diff --git a/src/sage/coding/channel.py b/src/sage/coding/channel.py index f6f6f40e40f..b4570e0f429 100644 --- a/src/sage/coding/channel.py +++ b/src/sage/coding/channel.py @@ -109,7 +109,7 @@ def format_interval(t): - ``t`` -- list or a tuple - OUTPUT: a string + OUTPUT: string TESTS:: @@ -151,7 +151,7 @@ class Channel(SageObject): def __init__(self, input_space, output_space): r""" - Initializes parameters for a Channel object. + Initialize parameters for a Channel object. This is a private method, which should be called by the constructor of every encoder, as it automatically initializes the mandatory diff --git a/src/sage/coding/code_constructions.py b/src/sage/coding/code_constructions.py index 600ac339a7a..f10c7ca87b6 100644 --- a/src/sage/coding/code_constructions.py +++ b/src/sage/coding/code_constructions.py @@ -327,7 +327,7 @@ def walsh_matrix(m0): def DuadicCodeEvenPair(F,S1,S2): r""" - Constructs the "even pair" of duadic codes associated to the + Construct the "even pair" of duadic codes associated to the "splitting" (see the docstring for ``_is_a_splitting`` for the definition) S1, S2 of n. @@ -376,7 +376,7 @@ def DuadicCodeEvenPair(F,S1,S2): def DuadicCodeOddPair(F,S1,S2): """ - Constructs the "odd pair" of duadic codes associated to the + Construct the "odd pair" of duadic codes associated to the "splitting" S1, S2 of n. .. warning:: diff --git a/src/sage/coding/codecan/autgroup_can_label.pyx b/src/sage/coding/codecan/autgroup_can_label.pyx index f31154a6244..8e39693ca27 100644 --- a/src/sage/coding/codecan/autgroup_can_label.pyx +++ b/src/sage/coding/codecan/autgroup_can_label.pyx @@ -415,7 +415,9 @@ class LinearCodeAutGroupCanLabel: - ``zero_column_case`` -- boolean; set to ``True`` iff we are dealing with the zero column - OUTPUT: a list of generators in `S` + OUTPUT: + + - list of generators in `S` - the order of this group diff --git a/src/sage/coding/codecan/codecan.pyx b/src/sage/coding/codecan/codecan.pyx index e17b80b17c3..1bd60addc99 100644 --- a/src/sage/coding/codecan/codecan.pyx +++ b/src/sage/coding/codecan/codecan.pyx @@ -186,7 +186,7 @@ cdef class InnerGroup: def __dealloc__(self): r""" - Deallocates ``self``. + Deallocate ``self``. """ OP_dealloc(self.row_partition) @@ -552,7 +552,7 @@ cdef class PartitionRefinementLinearCode(PartitionRefinement_generic): def __dealloc__(self): r""" - Deallocates ``self``. + Deallocate ``self``. """ cdef int i if self._points2hyp is not NULL: diff --git a/src/sage/coding/cyclic_code.py b/src/sage/coding/cyclic_code.py index 8866ff79c8d..2123e668fcf 100644 --- a/src/sage/coding/cyclic_code.py +++ b/src/sage/coding/cyclic_code.py @@ -906,7 +906,7 @@ def _latex_(self): def encode(self, p): r""" - Transforms ``p`` into an element of the associated code of ``self``. + Transform `p` into an element of the associated code of ``self``. INPUT: @@ -1076,7 +1076,7 @@ def _latex_(self): def encode(self, m): r""" - Transforms ``m`` into an element of the associated code of ``self``. + Transform `m` into an element of the associated code of ``self``. INPUT: diff --git a/src/sage/coding/decoder.py b/src/sage/coding/decoder.py index d4285d21f6f..9b326e3d79d 100644 --- a/src/sage/coding/decoder.py +++ b/src/sage/coding/decoder.py @@ -134,7 +134,7 @@ def _instance_decoder_type(self): def __init__(self, code, input_space, connected_encoder_name): r""" - Initializes mandatory parameters for :class:`Decoder` objects. + Initialize mandatory parameters for :class:`Decoder` objects. This method only exists for inheritance purposes as it initializes parameters that need to be known by every decoder. An abstract diff --git a/src/sage/coding/encoder.py b/src/sage/coding/encoder.py index 04e8e758d0e..edb09a966dd 100644 --- a/src/sage/coding/encoder.py +++ b/src/sage/coding/encoder.py @@ -61,7 +61,7 @@ class Encoder(SageObject): def __init__(self, code): r""" - Initializes mandatory parameters for an :class:`Encoder` object. + Initialize mandatory parameters for an :class:`Encoder` object. This method only exists for inheritance purposes as it initializes parameters that need to be known by every linear code. An abstract @@ -115,7 +115,7 @@ def __ne__(self, other): def encode(self, word): r""" - Transforms an element of the message space into a codeword. + Transform an element of the message space into a codeword. This is a default implementation which assumes that the message space of the encoder is `F^{k}`, where `F` is @@ -165,7 +165,7 @@ def encode(self, word): def __call__(self, m): r""" - Transforms an element of the message space into a codeword. + Transform an element of the message space into a codeword. This behaves the same as `self.encode`. See `sage.coding.encoder.Encoder.encode` for details. diff --git a/src/sage/coding/grs_code.py b/src/sage/coding/grs_code.py index d8a0d95d809..3019af9f080 100644 --- a/src/sage/coding/grs_code.py +++ b/src/sage/coding/grs_code.py @@ -1533,7 +1533,7 @@ def _polynomial_vanishing_at_alphas(self, PolRing): def _partial_xgcd(self, a, b, PolRing): r""" - Performs an Euclidean algorithm on ``a`` and ``b`` until a remainder + Perform an Euclidean algorithm on ``a`` and ``b`` until a remainder has degree less than `\frac{n+k}{2}`, `n` being the dimension of the code, `k` its dimension, and returns `(r, s)` such that in the step just before termination, `r = a s + b t`. @@ -2114,7 +2114,7 @@ def _latex_(self): def _partial_xgcd(self, a, b, PolRing): r""" - Performs an Euclidean algorithm on ``a`` and ``b`` until a remainder + Perform a Euclidean algorithm on ``a`` and ``b`` until a remainder has degree less than `\frac{n+k}{2}`, `n` being the dimension of the code, `k` its dimension, and returns `(r, t)` such that in the step just before termination, `r = a s + b t`. @@ -2161,7 +2161,7 @@ def _syndrome(self, r): - ``r`` -- a vector of the ambient space of ``self.code()`` - OUTPUT: a list + OUTPUT: list EXAMPLES:: diff --git a/src/sage/coding/guruswami_sudan/interpolation.py b/src/sage/coding/guruswami_sudan/interpolation.py index bb6e180dc8f..34b1c822665 100644 --- a/src/sage/coding/guruswami_sudan/interpolation.py +++ b/src/sage/coding/guruswami_sudan/interpolation.py @@ -59,9 +59,9 @@ def _monomial_list(maxdeg, l, wy): INPUT: - - ``maxdeg``, ``l``, ``wy`` -- integers. + - ``maxdeg``, ``l``, ``wy`` -- integers - OUTPUT: a list of pairs of integers + OUTPUT: list of pairs of integers EXAMPLES:: diff --git a/src/sage/coding/information_set_decoder.py b/src/sage/coding/information_set_decoder.py index a1325fe1c27..1fc8c8544bf 100644 --- a/src/sage/coding/information_set_decoder.py +++ b/src/sage/coding/information_set_decoder.py @@ -881,7 +881,7 @@ def known_algorithms(dictionary=False): - ``dictionary`` -- optional; if set to ``True``, return a ``dict`` mapping decoding algorithm name to its class - OUTPUT: a list of strings or a ``dict`` from string to ISD algorithm class + OUTPUT: list of strings or a ``dict`` from string to ISD algorithm class EXAMPLES:: diff --git a/src/sage/coding/kasami_codes.pyx b/src/sage/coding/kasami_codes.pyx index 920c19b16f8..835806fd808 100644 --- a/src/sage/coding/kasami_codes.pyx +++ b/src/sage/coding/kasami_codes.pyx @@ -90,7 +90,7 @@ class KasamiCode(AbstractLinearCode): INPUT: - - ``s``, ``t`` -- (integer) the parameters of the Kasami code + - ``s``, ``t`` -- integer; the parameters of the Kasami code - ``extended`` -- boolean (default: ``True``); if set to ``True``, creates an extended Kasami code diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py index 83ac425d47d..ebe55bd66fe 100644 --- a/src/sage/coding/linear_code.py +++ b/src/sage/coding/linear_code.py @@ -351,7 +351,7 @@ class AbstractLinearCode(AbstractLinearCodeNoMetric): def __init__(self, base_field, length, default_encoder_name, default_decoder_name): """ - Initializes mandatory parameters that any linear code shares. + Initialize mandatory parameters that any linear code shares. This method only exists for inheritance purposes as it initializes parameters that need to be known by every linear code. The class @@ -1316,7 +1316,7 @@ def is_permutation_equivalent(self,other,algorithm=None): def is_galois_closed(self): r""" - Checks if ``self`` is equal to its Galois closure. + Check if ``self`` is equal to its Galois closure. EXAMPLES:: @@ -1812,7 +1812,7 @@ def weight_distribution(self, algorithm=None): ``'binary'``, use an algorithm optimized for binary codes. The default is to use ``'binary'`` for binary codes and ``'gap'`` otherwise. - OUTPUT: a list of nonnegative integers; the weight distribution + OUTPUT: list of nonnegative integers; the weight distribution .. WARNING:: @@ -1929,7 +1929,7 @@ def weight_enumerator(self, names=None, bivariate=True): INPUT: - - ``names`` -- (default: ``'xy'``) The names of the variables in the + - ``names`` -- (default: ``'xy'``) the names of the variables in the homogeneous polynomial. Can be given as a single string of length 2, or a single string with a comma, or as a tuple or list of two strings. @@ -2517,7 +2517,7 @@ def generator_matrix(self): class LinearCodeSyndromeDecoder(Decoder): r""" - Constructs a decoder for Linear Codes based on syndrome lookup table. + Construct a decoder for Linear Codes based on syndrome lookup table. The decoding algorithm works as follows: @@ -2744,7 +2744,7 @@ def _latex_(self): @cached_method def _build_lookup_table(self): r""" - Builds lookup table for all possible error patterns of weight up to :meth:`maximum_error_weight`. + Build lookup table for all possible error patterns of weight up to :meth:`maximum_error_weight`. EXAMPLES:: diff --git a/src/sage/coding/linear_code_no_metric.py b/src/sage/coding/linear_code_no_metric.py index 8ecdebcbe0c..6ba189b751a 100644 --- a/src/sage/coding/linear_code_no_metric.py +++ b/src/sage/coding/linear_code_no_metric.py @@ -140,7 +140,7 @@ class AbstractLinearCodeNoMetric(AbstractCode, Module): def __init__(self, base_field, length, default_encoder_name, default_decoder_name, metric='Hamming'): """ - Initializes mandatory parameters that any linear code shares. + Initialize mandatory parameters that any linear code shares. This method only exists for inheritance purposes as it initializes parameters that need to be known by every linear code. The class diff --git a/src/sage/coding/punctured_code.py b/src/sage/coding/punctured_code.py index 1d9b8b3ff12..7edf1068cd0 100644 --- a/src/sage/coding/punctured_code.py +++ b/src/sage/coding/punctured_code.py @@ -263,7 +263,7 @@ def random_element(self, *args, **kwds): def encode(self, m, original_encode=False, encoder_name=None, **kwargs): r""" - Transforms an element of the message space into an element of the code. + Transform an element of the message space into an element of the code. INPUT: diff --git a/src/sage/coding/reed_muller_code.py b/src/sage/coding/reed_muller_code.py index 8b889aae965..514a2cc1826 100644 --- a/src/sage/coding/reed_muller_code.py +++ b/src/sage/coding/reed_muller_code.py @@ -719,9 +719,9 @@ class ReedMullerPolynomialEncoder(Encoder): - ``code`` -- the associated code of this encoder - - ``polynomial_ring`` -- (default:``None``) The polynomial ring from which - the message is chosen. If this is set to ``None``, a polynomial ring in - `x` will be built from the code parameters. + - ``polynomial_ring`` -- (default: ``None``) the polynomial ring from which + the message is chosen; if this is set to ``None``, a polynomial ring in + `x` will be built from the code parameters EXAMPLES:: @@ -840,7 +840,7 @@ def __eq__(self, other): def encode(self, p): r""" - Transforms the polynomial ``p`` into a codeword of :meth:`code`. + Transform the polynomial ``p`` into a codeword of :meth:`code`. INPUT: diff --git a/src/sage/coding/source_coding/huffman.py b/src/sage/coding/source_coding/huffman.py index 023b0f8a7c1..f722e63f7f3 100644 --- a/src/sage/coding/source_coding/huffman.py +++ b/src/sage/coding/source_coding/huffman.py @@ -258,7 +258,7 @@ def __init__(self, source): def _build_code_from_tree(self, tree, d, prefix): r""" - Builds the Huffman code corresponding to a given tree and prefix. + Build the Huffman code corresponding to a given tree and prefix. INPUT: @@ -292,7 +292,7 @@ def _build_code_from_tree(self, tree, d, prefix): def _build_code(self, dic): r""" - Constructs a Huffman code corresponding to an alphabet with the given + Construct a Huffman code corresponding to an alphabet with the given weight table. INPUT: diff --git a/src/sage/coding/subfield_subcode.py b/src/sage/coding/subfield_subcode.py index 9a619e22fd1..a388bf1fec1 100644 --- a/src/sage/coding/subfield_subcode.py +++ b/src/sage/coding/subfield_subcode.py @@ -268,7 +268,7 @@ class SubfieldSubcodeOriginalCodeDecoder(Decoder): - ``code`` -- the associated code of this decoder - - ``original_decoder`` -- (default: ``None``) The decoder that will be used + - ``original_decoder`` -- (default: ``None``) the decoder that will be used over the original code. It has to be a decoder object over the original code. If it is set to ``None``, the default decoder over the original code will be used. diff --git a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py index 22da448fdec..7e341fad9f2 100644 --- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py +++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py @@ -810,7 +810,7 @@ def _sanitize_init_vars(self, user_labels, user_labels_prefix='x'): INPUT: - ``user_labels`` -- the labels that need sanitizing - - ``user_labels_prefix`` -- (default: ``'x'``) The prefix to use + - ``user_labels_prefix`` -- (default: ``'x'``) the prefix to use for labels if integers given for labels EXAMPLES:: @@ -2682,7 +2682,7 @@ def cluster_index(self, cluster_str): - ``cluster_str`` -- the string to look for in the cluster - OUTPUT: an integer or ``None`` if the string is not a cluster variable + OUTPUT: integer or ``None`` if the string is not a cluster variable EXAMPLES:: @@ -2771,7 +2771,8 @@ def mutation_sequence(self, sequence, show_sequence=False, def mutation_analysis(self, options=['all'], filter=None): r""" - Runs an analysis of all potential mutation options. Note that this might take a long time on large seeds. + Run an analysis of all potential mutation options. Note that this might + take a long time on large seeds. .. note:: @@ -3787,7 +3788,7 @@ def b_matrix_class_iter(self, depth=infinity, up_to_equivalence=True): INPUT: - - ``depth`` -- (default:infinity) integer or infinity, only seeds + - ``depth`` -- (default: infinity) integer or infinity, only seeds with distance at most ``depth`` from ``self`` are returned - ``up_to_equivalence`` -- boolean (default: ``True``); if ``True``, only `B`-matrices up to equivalence are considered diff --git a/src/sage/combinat/cluster_algebra_quiver/quiver.py b/src/sage/combinat/cluster_algebra_quiver/quiver.py index abd741873ec..9aad441a3f0 100644 --- a/src/sage/combinat/cluster_algebra_quiver/quiver.py +++ b/src/sage/combinat/cluster_algebra_quiver/quiver.py @@ -78,7 +78,7 @@ class ClusterQuiver(SageObject): - ``frozen`` -- (default: ``None``) sets the list of frozen variables if the input type is a :class:`DiGraph`, it is ignored otherwise - - ``user_labels`` -- (default:``None``) sets the names of the labels for + - ``user_labels`` -- (default: ``None``) sets the names of the labels for the vertices of the quiver if the input type is not a :class:`DiGraph`; otherwise it is ignored @@ -536,7 +536,7 @@ def plot(self, circular=True, center=(0, 0), directed=True, mark=None, - ``circular`` -- boolean (default: ``True``); if ``True``, the circular plot is chosen, otherwise >>spring<< is used - - ``center`` -- (default:(0,0)) sets the center of the circular plot, + - ``center`` -- (default: (0,0)) sets the center of the circular plot, otherwise it is ignored - ``directed`` -- boolean (default: ``True``); if ``True``, the directed version is shown, otherwise the undirected @@ -1973,7 +1973,7 @@ def number_of_edges(self): Note: This only works with non-valued quivers. If used on a non-valued quiver then the positive value is taken to be the number of edges added - OUTPUT: an integer of the number of edges + OUTPUT: integer of the number of edges EXAMPLES:: diff --git a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py index 443ce5ab865..c95ae46dac5 100644 --- a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +++ b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py @@ -700,7 +700,7 @@ def show(self, circular=False, directed=True): INPUT: - - ``circular`` -- (default:``False``) if ``True``, the + - ``circular`` -- (default: ``False``) if ``True``, the circular plot is chosen, otherwise >>spring<< is used. - ``directed`` -- boolean (default: ``True``); if ``True``, the @@ -708,7 +708,7 @@ def show(self, circular=False, directed=True): TESTS:: - sage: QMT = QuiverMutationType(['A',5]) + sage: QMT = QuiverMutationType(['A', 5]) sage: QMT.show() # long time # needs sage.plot sage.symbolic """ self.plot(circular=circular, directed=directed).show() @@ -2297,14 +2297,14 @@ def save_quiver_data(n, up_to=True, types='ClassicalExceptional', verbose=True): - ``n`` -- the rank (or the upper limit on the rank) of the mutation classes that are being saved. - - ``up_to`` -- (default:``True``) if ``True``, saves data for - ranks smaller than or equal to ``n``. If ``False``, saves data - for rank exactly ``n``. + - ``up_to`` -- (default: ``True``) if ``True``, saves data for + ranks smaller than or equal to ``n``; if ``False``, saves data + for rank exactly ``n`` - - ``types`` -- (default:'ClassicalExceptional') if all, saves data + - ``types`` -- (default: ``'ClassicalExceptional'``) if all, saves data for both exceptional mutation-finite quivers and for classical - quiver. The input 'Exceptional' or 'Classical' is also allowed - to save only part of this data. + quiver; the input 'Exceptional' or 'Classical' is also allowed + to save only part of this data TESTS:: diff --git a/src/sage/combinat/crystals/affine.py b/src/sage/combinat/crystals/affine.py index c9ae0f4bb21..01548722ad8 100644 --- a/src/sage/combinat/crystals/affine.py +++ b/src/sage/combinat/crystals/affine.py @@ -233,7 +233,7 @@ def _element_constructor_(self, *value, **options): def __contains__(self, x): r""" - Checks whether ``x`` is an element of ``self``. + Check whether `x` is an element of ``self``. EXAMPLES:: diff --git a/src/sage/combinat/crystals/kirillov_reshetikhin.py b/src/sage/combinat/crystals/kirillov_reshetikhin.py index 434da67ccf6..29e92fdd931 100644 --- a/src/sage/combinat/crystals/kirillov_reshetikhin.py +++ b/src/sage/combinat/crystals/kirillov_reshetikhin.py @@ -434,7 +434,7 @@ class KirillovReshetikhinGenericCrystal(AffineCrystalFromClassical): def __init__(self, cartan_type, r, s, dual=None): r""" - Initializes a generic Kirillov-Reshetikhin crystal. + Initialize a generic Kirillov-Reshetikhin crystal. TESTS:: @@ -931,7 +931,7 @@ def dynkin_diagram_automorphism(self, i): def promotion_on_highest_weight_vector(self, b): """ - Calculates promotion on a `{2,3,...,n}` highest weight vector ``b``. + Calculate promotion on a `{2, 3, \ldots, n}` highest weight vector `b`. EXAMPLES:: @@ -1885,7 +1885,7 @@ class KR_type_box(KirillovReshetikhinGenericCrystal, AffineCrystalFromClassical) def __init__(self, cartan_type, r, s): r""" - Initializes a Kirillov-Reshetikhin crystal ``self``. + Initialize a Kirillov-Reshetikhin crystal ``self``. TESTS:: diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index dca2abae89f..6114a395789 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -71,7 +71,7 @@ def biplane(n, existence=False): INPUT: - - ``n`` -- (integer) order of the biplane + - ``n`` -- integer; order of the biplane - ``existence`` -- boolean; instead of building the design, return: diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index 33c19b33bdf..96668f92dab 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -310,7 +310,7 @@ def DesarguesianProjectivePlaneDesign(n, point_coordinates=True, check=True): - ``point_coordinates`` -- (boolean) whether to label the points with their homogeneous coordinates (default) or with integers. - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. @@ -522,7 +522,7 @@ def HughesPlane(q2, check=True): - ``q2`` -- an even power of an odd prime number - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/covering_design.py b/src/sage/combinat/designs/covering_design.py index 3c31293ccf2..8368209fe7f 100644 --- a/src/sage/combinat/designs/covering_design.py +++ b/src/sage/combinat/designs/covering_design.py @@ -335,7 +335,7 @@ def v(self): def k(self): """ - Return `k`, the size of blocks of the covering design + Return `k`, the size of blocks of the covering design. EXAMPLES:: diff --git a/src/sage/combinat/designs/designs_pyx.pyx b/src/sage/combinat/designs/designs_pyx.pyx index 7dc59e48d59..f4f18664d81 100644 --- a/src/sage/combinat/designs/designs_pyx.pyx +++ b/src/sage/combinat/designs/designs_pyx.pyx @@ -353,7 +353,7 @@ def is_orthogonal_array(OA, int k, int n, int t=2, verbose=False, terminology='O def is_group_divisible_design(groups,blocks,v,G=None,K=None,lambd=1,verbose=False): r""" - Checks that input is a Group Divisible Design on `\{0,...,v-1\}` + Check that input is a Group Divisible Design on `\{0, \ldots, v-1\}` For more information on Group Divisible Designs, see :class:`~sage.combinat.designs.group_divisible_designs.GroupDivisibleDesign`. @@ -537,7 +537,7 @@ def is_group_divisible_design(groups,blocks,v,G=None,K=None,lambd=1,verbose=Fals def is_pairwise_balanced_design(blocks,v,K=None,lambd=1,verbose=False): r""" - Checks that input is a Pairwise Balanced Design (PBD) on `\{0,...,v-1\}` + Check that input is a Pairwise Balanced Design (PBD) on `\{0, \ldots, v-1\}`. For more information on Pairwise Balanced Designs (PBD), see :class:`~sage.combinat.designs.bibd.PairwiseBalancedDesign`. diff --git a/src/sage/combinat/designs/difference_matrices.py b/src/sage/combinat/designs/difference_matrices.py index b52a5145496..397a6e7c56c 100644 --- a/src/sage/combinat/designs/difference_matrices.py +++ b/src/sage/combinat/designs/difference_matrices.py @@ -132,15 +132,15 @@ def difference_matrix(g,k,lmbda=1,existence=False,check=True): INPUT: - - ``k`` -- (integer) number of columns. If ``k=None`` it is set to the + - ``k`` -- integer; number of columns. If ``k=None`` it is set to the largest value available. - - ``g`` -- (integer) cardinality of the group `G` + - ``g`` -- integer; cardinality of the group `G` - - ``lmbda`` -- (integer; default: 1) -- number of times each element of `G` + - ``lmbda`` -- integer (default: 1); number of times each element of `G` appears as a difference. - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/group_divisible_designs.py b/src/sage/combinat/designs/group_divisible_designs.py index 524409c9ba8..83ecfc67b78 100644 --- a/src/sage/combinat/designs/group_divisible_designs.py +++ b/src/sage/combinat/designs/group_divisible_designs.py @@ -70,7 +70,7 @@ def group_divisible_design(v, K, G, existence=False, check=False): - ``False`` -- meaning that the design does not exist - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. @@ -150,7 +150,7 @@ def GDD_4_2(q, existence=False, check=True): - ``False`` -- meaning that the design does not exist - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/latin_squares.py b/src/sage/combinat/designs/latin_squares.py index 9f9bb8de2d3..1435111de2f 100644 --- a/src/sage/combinat/designs/latin_squares.py +++ b/src/sage/combinat/designs/latin_squares.py @@ -231,7 +231,7 @@ def mutually_orthogonal_latin_squares(k, n, partitions=False, check=True): partitions satisfying this intersection property instead of the `k+2` MOLS (though the data is exactly the same in both cases). - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/orthogonal_arrays.py b/src/sage/combinat/designs/orthogonal_arrays.py index 2b297220fb2..63127d8af14 100644 --- a/src/sage/combinat/designs/orthogonal_arrays.py +++ b/src/sage/combinat/designs/orthogonal_arrays.py @@ -90,7 +90,7 @@ def transversal_design(k, n, resolvable=False, check=True, existence=False): `n` classes of the resolvable design are obtained as the first `n` blocks, then the next `n` blocks, etc ... Set to ``False`` by default. - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. @@ -748,10 +748,10 @@ def orthogonal_array(k,n,t=2,resolvable=False, check=True,existence=False,explai INPUT: - - ``k`` -- (integer) number of columns. If ``k=None`` it is set to the + - ``k`` -- integer; number of columns. If ``k=None`` it is set to the largest value available. - - ``n`` -- (integer) number of symbols + - ``n`` -- integer; number of symbols - ``t`` -- (integer; default: 2) -- strength of the array @@ -1625,7 +1625,7 @@ def OA_n_times_2_pow_c_from_matrix(k,c,G,A,Y,check=True): - ``Y`` -- a vector with entries in `GF(2^c)` - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py index 2168f1aece8..1d7d13c3789 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py @@ -482,7 +482,7 @@ def construction_q_x(k, q, x, check=True, explain_construction=False): - `OA(k,q)-q.OA(k,1)` - `OA(k,x+2)` - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. @@ -951,7 +951,7 @@ def three_factor_product(k,n1,n2,n3,check=False,explain_construction=False): - ``k``, ``n1``, ``n2``, ``n3`` -- integers - - ``check`` -- (boolean) Whether to check that everything is going smoothly + - ``check`` -- boolean; whether to check that everything is going smoothly while the design is being built. It is disabled by default, as the constructor of orthogonal arrays checks the final design anyway. diff --git a/src/sage/combinat/designs/resolvable_bibd.py b/src/sage/combinat/designs/resolvable_bibd.py index e04e19b4d62..026df06ef53 100644 --- a/src/sage/combinat/designs/resolvable_bibd.py +++ b/src/sage/combinat/designs/resolvable_bibd.py @@ -706,7 +706,7 @@ def PBD_4_7_from_Y(gdd,check=True): - ``gdd`` -- a `(v,\{4,5,7\},Y)`-GDD where `Y=\NN-\{3,6,10\}`. - - ``check`` -- (boolean) Whether to check that output is correct before + - ``check`` -- boolean; whether to check that output is correct before returning it. As this is expected to be useless (but we are cautious guys), you may want to disable it whenever you want speed. Set to ``True`` by default. diff --git a/src/sage/combinat/designs/subhypergraph_search.pyx b/src/sage/combinat/designs/subhypergraph_search.pyx index 968159b9012..fa99dd66f07 100644 --- a/src/sage/combinat/designs/subhypergraph_search.pyx +++ b/src/sage/combinat/designs/subhypergraph_search.pyx @@ -249,7 +249,7 @@ cdef induced_hypergraph(hypergraph * h, int n, hypergraph * tmp): cdef void trace_hypergraph64(hypergraph * h, int n, hypergraph * tmp) noexcept: r""" - Stores in `tmp` the trace of the sets on {0,...,n-1} in h1. + Store in `tmp` the trace of the sets on `\{0, \ldots, n-1\}` in h1. Note that the size of the sets are kept as they are, i.e. the size of a set stored in tmp is what it was in h. This is useful information we use to cut diff --git a/src/sage/combinat/ncsf_qsym/generic_basis_code.py b/src/sage/combinat/ncsf_qsym/generic_basis_code.py index 2e0ff32549a..44bce3d44f0 100644 --- a/src/sage/combinat/ncsf_qsym/generic_basis_code.py +++ b/src/sage/combinat/ncsf_qsym/generic_basis_code.py @@ -1124,7 +1124,7 @@ def __ne__(self, other): def _on_basis(self, c): r""" - Computes the image of this morphism on the basis element indexed by + Compute the image of this morphism on the basis element indexed by ``c``. INPUT: @@ -1151,7 +1151,7 @@ def _on_basis(self, c): class GradedModulesWithInternalProduct(Category_over_base_ring): r""" - Constructs the class of modules with internal product. This is used to give an internal + Construct the class of modules with internal product. This is used to give an internal product structure to the non-commutative symmetric functions. EXAMPLES:: diff --git a/src/sage/combinat/posets/elements.py b/src/sage/combinat/posets/elements.py index 5d033c5c26a..c4e55dbe385 100644 --- a/src/sage/combinat/posets/elements.py +++ b/src/sage/combinat/posets/elements.py @@ -168,9 +168,7 @@ def _cmp(self, other): def __lt__(self, other): """ - TESTS - - :: + TESTS:: sage: dag = DiGraph({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) sage: P = Poset(dag, facade = False) @@ -185,9 +183,7 @@ def __lt__(self, other): def __le__(self, other): """ - TESTS - - :: + TESTS:: sage: dag = DiGraph({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) sage: P = Poset(dag, facade = False) @@ -204,9 +200,7 @@ def __le__(self, other): def __gt__(self, other): """ - TESTS - - :: + TESTS:: sage: dag = DiGraph({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) sage: P = Poset(dag) @@ -221,9 +215,7 @@ def __gt__(self, other): def __ge__(self, other): """ - TESTS - - :: + TESTS:: sage: dag = DiGraph({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) sage: P = Poset(dag) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index a27c13f43bf..32ee603ff55 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -103,7 +103,7 @@ def _repr_(self): def linear_extension(self): r""" - Return a linear extension + Return a linear extension. EXAMPLES:: @@ -1662,7 +1662,7 @@ def is_meet_semilattice(self) -> bool: @lazy_attribute def _join(self): r""" - Computes a matrix whose ``(x,y)``-entry is the join of ``x`` + Compute a matrix whose ``(x,y)``-entry is the join of ``x`` and ``y`` in ``self`` if the join exists; and `-1` otherwise. EXAMPLES:: @@ -2260,7 +2260,7 @@ def antichains_iterator(self): def are_incomparable(self, i, j): """ - Return whether ``i`` and ``j`` are incomparable in the poset + Return whether ``i`` and ``j`` are incomparable in the poset. INPUT: @@ -2286,11 +2286,11 @@ def are_incomparable(self, i, j): def are_comparable(self, i, j): """ - Return whether ``i`` and ``j`` are comparable in the poset + Return whether ``i`` and ``j`` are comparable in the poset. INPUT: - - ``i``, ``j`` -- vertices of this Hasse diagram + - ``i``, ``j`` -- vertices of this Hasse diagram EXAMPLES:: @@ -2314,11 +2314,11 @@ def are_comparable(self, i, j): def antichains(self, element_class=list): """ - Return all antichains of ``self``, organized as a prefix tree + Return all antichains of ``self``, organized as a prefix tree. INPUT: - - ``element_class`` -- (default:list) an iterable type + - ``element_class`` -- (default: ``list``) an iterable type EXAMPLES:: diff --git a/src/sage/combinat/posets/linear_extensions.py b/src/sage/combinat/posets/linear_extensions.py index 8a2c12ed72a..3a428eceb19 100644 --- a/src/sage/combinat/posets/linear_extensions.py +++ b/src/sage/combinat/posets/linear_extensions.py @@ -131,7 +131,7 @@ def __classcall_private__(cls, linear_extension, poset): def check(self): r""" - Checks whether ``self`` is indeed a linear extension of the underlying poset. + Check whether ``self`` is indeed a linear extension of the underlying poset. TESTS:: @@ -711,7 +711,7 @@ def __contains__(self, obj) -> bool: def markov_chain_digraph(self, action='promotion', labeling='identity'): r""" - Return the digraph of the action of generalized promotion or tau on ``self`` + Return the digraph of the action of generalized promotion or tau on ``self``. INPUT: @@ -811,17 +811,20 @@ def markov_chain_digraph(self, action='promotion', labeling='identity'): def markov_chain_transition_matrix(self, action='promotion', labeling='identity'): r""" - Return the transition matrix of the Markov chain for the action of generalized promotion or tau on ``self`` + Return the transition matrix of the Markov chain for the action of + generalized promotion or tau on ``self``. INPUT: - ``action`` -- ``'promotion'`` or ``'tau'`` (default: ``'promotion'``) - ``labeling`` -- ``'identity'`` or ``'source'`` (default: ``'identity'``) - This method yields the transition matrix of the Markov chain defined by the action of the generalized - promotion operator `\partial_i` (resp. `\tau_i`) on the set of linear extensions of a finite poset. - Here the transition from the linear extension `\pi` to `\pi'`, where `\pi' = \pi \partial_i` - (resp. `\pi'= \pi \tau_i`) is counted with weight `x_i` (resp. `x_{\pi_i}` if ``labeling`` is set to ``source``). + This method yields the transition matrix of the Markov chain defined by + the action of the generalized promotion operator `\partial_i` (resp. + `\tau_i`) on the set of linear extensions of a finite poset. Here the + transition from the linear extension `\pi` to `\pi'`, where + `\pi' = \pi \partial_i` (resp. `\pi'= \pi \tau_i`) is counted with + weight `x_i` (resp. `x_{\pi_i}` if ``labeling`` is set to ``source``). EXAMPLES:: diff --git a/src/sage/combinat/posets/mobile.py b/src/sage/combinat/posets/mobile.py index 79d22aa1749..f529f6b664c 100644 --- a/src/sage/combinat/posets/mobile.py +++ b/src/sage/combinat/posets/mobile.py @@ -91,7 +91,7 @@ def _is_valid_ribbon(self, ribbon): INPUT: - - ``ribbon`` -- a list of elements that form a ribbon in your poset + - ``ribbon`` -- list of elements that form a ribbon in your poset TESTS:: diff --git a/src/sage/combinat/posets/poset_examples.py b/src/sage/combinat/posets/poset_examples.py index d74565ea170..b5a1896ac74 100644 --- a/src/sage/combinat/posets/poset_examples.py +++ b/src/sage/combinat/posets/poset_examples.py @@ -133,7 +133,7 @@ def check_int(n, minimum=0): sage: check_int(-1) Traceback (most recent call last): ... - ValueError: number of elements must be a non-negative integer, not -1 + ValueError: number of elements must be a nonnegative integer, not -1 sage: check_int(1, 3) Traceback (most recent call last): @@ -143,10 +143,10 @@ def check_int(n, minimum=0): sage: check_int('junk') Traceback (most recent call last): ... - ValueError: number of elements must be a non-negative integer, not junk + ValueError: number of elements must be a nonnegative integer, not junk """ if minimum == 0: - msg = "a non-negative integer" + msg = "a nonnegative integer" else: msg = f"an integer at least {minimum}" if n not in NonNegativeIntegers() or n < minimum: @@ -282,11 +282,11 @@ def BooleanLattice(n, facade=None, use_subsets=False): @staticmethod def ChainPoset(n, facade=None): - """ - Return a chain (a totally ordered poset) containing ``n`` elements. + r""" + Return a chain (a totally ordered poset) containing `n` elements. - - ``n`` (an integer) -- number of elements. - - ``facade`` (boolean) -- whether to make the returned poset a + - ``n`` -- integer; number of elements + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -333,8 +333,8 @@ def AntichainPoset(n, facade=None): INPUT: - - ``n`` (an integer) -- number of elements - - ``facade`` (boolean) -- whether to make the returned poset a + - ``n`` -- integer; number of elements + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -376,7 +376,7 @@ def PentagonPoset(facade=None): INPUT: - - ``facade`` (boolean) -- whether to make the returned poset a + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -414,7 +414,7 @@ def DiamondPoset(n, facade=None): - ``n`` -- number of elements, an integer at least 3 - - ``facade`` (boolean) -- whether to make the returned poset a + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -446,7 +446,7 @@ def Crown(n, facade=None): - ``n`` -- number of elements, an integer at least 2 - - ``facade`` (boolean) -- whether to make the returned poset a + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -472,8 +472,8 @@ def DivisorLattice(n, facade=None): INPUT: - - ``n`` -- an integer - - ``facade`` (boolean) -- whether to make the returned poset a + - ``n`` -- integer + - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the default behaviour is the same as the default behaviour of the :func:`~sage.combinat.posets.posets.Poset` constructor @@ -688,8 +688,8 @@ def ProductOfChains(chain_lengths, facade=None): """ Return a product of chains. - - ``chain_lengths`` -- A list of nonnegative integers; number of - elements in each chain. + - ``chain_lengths`` -- list of nonnegative integers; number of + elements in each chain - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the @@ -741,7 +741,7 @@ def RandomPoset(n, p): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer - ``p`` -- a probability, a real number between 0 and 1 (inclusive) @@ -801,11 +801,11 @@ def RandomLattice(n, p, properties=None): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer - ``p`` -- a probability, a positive real number less than one - - ``properties`` -- a list of properties for the lattice. Currently + - ``properties`` -- list of properties for the lattice. Currently implemented: * ``None``, no restrictions for lattices to create @@ -1019,7 +1019,7 @@ def StandardExample(n, facade=None): INPUT: - - ``n`` -- an integer `\ge 2`, dimension of the constructed poset + - ``n`` -- integer `\ge 2`; dimension of the constructed poset - ``facade`` -- boolean; whether to make the returned poset a facade poset (see :mod:`sage.categories.facade_sets`); the @@ -1118,15 +1118,15 @@ def SymmetricGroupBruhatIntervalPoset(start, end): return Poset(nodes) @staticmethod - def SymmetricGroupWeakOrderPoset(n, labels="permutations", side="right"): + def SymmetricGroupWeakOrderPoset(n, labels='permutations', side='right'): r""" The poset of permutations of `\{ 1, 2, \ldots, n \}` with respect to the weak order (also known as the permutohedron order, cf. :meth:`~sage.combinat.permutation.Permutation.permutohedron_lequal`). - The optional variable ``labels`` (default: ``"permutations"``) + The optional variable ``labels`` (default: ``'permutations'``) determines the labelling of the elements if `n < 10`. The optional - variable ``side`` (default: ``"right"``) determines whether the + variable ``side`` (default: ``'right'``) determines whether the right or the left permutohedron order is to be used. EXAMPLES:: @@ -1181,13 +1181,13 @@ def TetrahedralPoset(n, *colors, **labels): INPUT: - - ``n`` -- Defines the number (n-1) of layers in the poset. + - ``n`` -- defines the number (n-1) of layers in the poset - - ``colors`` -- The colors that define the covering relations of the - poset. Colors used are 'green', 'red', 'yellow', 'orange', 'silver', - and 'blue'. + - ``colors`` -- the colors that define the covering relations of the + poset; colors used are 'green', 'red', 'yellow', 'orange', 'silver', + and 'blue' - - ``labels`` -- Keyword variable used to determine whether the poset + - ``labels`` -- keyword variable used to determine whether the poset is labeled with integers or tuples. To label with integers, the method should be called with ``labels='integers'``. Otherwise, the labeling will default to tuples. @@ -1310,7 +1310,7 @@ def NoncrossingPartitions(W): return W.noncrossing_partition_lattice() @staticmethod - def SymmetricGroupAbsoluteOrderPoset(n, labels="permutations"): + def SymmetricGroupAbsoluteOrderPoset(n, labels='permutations'): r""" Return the poset of permutations with respect to absolute order. @@ -1332,9 +1332,9 @@ def SymmetricGroupAbsoluteOrderPoset(n, labels="permutations"): sage: posets.SymmetricGroupAbsoluteOrderPoset(4) # needs sage.groups Finite poset containing 24 elements - sage: posets.SymmetricGroupAbsoluteOrderPoset(3, labels="cycles") # needs sage.groups + sage: posets.SymmetricGroupAbsoluteOrderPoset(3, labels='cycles') # needs sage.groups Finite poset containing 6 elements - sage: posets.SymmetricGroupAbsoluteOrderPoset(3, labels="reduced_words") # needs sage.groups + sage: posets.SymmetricGroupAbsoluteOrderPoset(3, labels='reduced_words') # needs sage.groups Finite poset containing 6 elements """ from sage.groups.perm_gps.permgroup_named import SymmetricGroup @@ -1360,8 +1360,8 @@ def UpDownPoset(n, m=1): INPUT: - - ``n`` -- nonnegative integer, number of elements in the poset - - ``m`` -- nonnegative integer (default 1), how frequently down + - ``n`` -- nonnegative integer; number of elements in the poset + - ``m`` -- nonnegative integer (default: 1); how frequently down steps occur OUTPUT: @@ -1407,9 +1407,9 @@ def YoungDiagramPoset(lam, dual=False): INPUT: - ``lam`` -- a partition - - ``dual`` -- (default: ``False``) determines the orientation - of the poset; if ``True``, then it is a join semilattice, - otherwise it is a meet semilattice + - ``dual`` -- boolean (default: ``False``); determines the orientation + of the poset. If ``True``, then it is a join semilattice, + otherwise it is a meet semilattice. EXAMPLES:: @@ -1719,7 +1719,7 @@ def PermutationPatternOccurrenceInterval(bottom, top, pos): - ``bottom``, ``top`` -- permutations where ``top`` contains ``bottom`` as a pattern - - ``pos`` -- a list of indices indicating a distinguished copy of + - ``pos`` -- list of indices indicating a distinguished copy of ``bottom`` inside ``top`` (indexed starting at 0) For further information (and picture illustrating included example), @@ -1861,7 +1861,7 @@ def _random_lattice(n, p): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer - ``p`` -- a number at least zero and less than one; higher number means more covering relations @@ -1933,7 +1933,7 @@ def _random_dismantlable_lattice(n): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer OUTPUT: @@ -1976,7 +1976,7 @@ def _random_planar_lattice(n): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer OUTPUT: @@ -2027,7 +2027,7 @@ def _random_distributive_lattice(n): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer OUTPUT: @@ -2084,7 +2084,7 @@ def _random_stone_lattice(n): INPUT: - - ``n`` -- number of elements, a non-negative integer + - ``n`` -- number of elements, a nonnegative integer OUTPUT: diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py index 48565391fa7..647fd0dc66a 100644 --- a/src/sage/combinat/posets/posets.py +++ b/src/sage/combinat/posets/posets.py @@ -366,18 +366,18 @@ def Poset(data=None, element_labels=None, cover_relations=False, linear_extensio - ``element_labels`` -- (default: ``None``); an optional list or dictionary of objects that label the poset elements. - - ``cover_relations`` -- a boolean (default: ``False``); whether the + - ``cover_relations`` -- boolean (default: ``False``); whether the data can be assumed to describe a directed acyclic graph whose - arrows are cover relations; otherwise, the cover relations are + arrows are cover relations. Otherwise, the cover relations are first computed. - - ``linear_extension`` -- a boolean (default: ``False``); whether to + - ``linear_extension`` -- boolean (default: ``False``); whether to use the provided list of elements as default linear extension - for the poset; otherwise a linear extension is computed. If the data + for the poset. Otherwise a linear extension is computed. If the data is given as the pair ``(E, f)``, then ``E`` is taken to be the linear extension. - - ``facade`` -- a boolean or ``None`` (default); whether the + - ``facade`` -- boolean or ``None`` (default); whether the :meth:`Poset`'s elements should be wrapped to make them aware of the Poset they belong to. @@ -713,7 +713,7 @@ def Poset(data=None, element_labels=None, cover_relations=False, linear_extensio elif isinstance(data, DiGraph): # type 4 D = data.copy(immutable=True) elif isinstance(data, dict): # type 3: dictionary of upper covers - D = DiGraph(data, format="dict_of_lists") + D = DiGraph(data, format='dict_of_lists') elif isinstance(data, (list, tuple)): # types 1, 2, 3 (list/tuple) if len(data) == 2: # types 1 or 2 if callable(data[1]): # type 2 @@ -736,7 +736,7 @@ def Poset(data=None, element_labels=None, cover_relations=False, linear_extensio vertices = range(len(data)) D = DiGraph({v: [u for u in cov if u != v] for v, cov in zip(vertices, data)}, - format="dict_of_lists") + format='dict_of_lists') else: raise ValueError("not valid poset data") @@ -796,9 +796,9 @@ class FinitePoset(UniqueRepresentation, Parent): then ``elements`` is considered as a specified linear extension of the poset and the `linear_extension` attribute is set. - - ``category`` -- :class:`FinitePosets`, or a subcategory thereof. + - ``category`` -- :class:`FinitePosets`, or a subcategory thereof - - ``facade`` -- a boolean or ``None`` (default); whether the + - ``facade`` -- boolean or ``None`` (default); whether the :class:`~sage.combinat.posets.posets.FinitePoset`'s elements should be wrapped to make them aware of the Poset they belong to. @@ -998,7 +998,7 @@ def __classcall__(cls, hasse_diagram, elements=None, category=None, facade=None, hasse_diagram = poset._hasse_diagram.relabel(relabel, inplace=False) hasse_diagram = hasse_diagram.copy(immutable=True) else: - hasse_diagram = HasseDiagram(hasse_diagram, data_structure="static_sparse") + hasse_diagram = HasseDiagram(hasse_diagram, data_structure='static_sparse') if facade is None: facade = True if elements is not None: @@ -1081,7 +1081,7 @@ def __init__(self, hasse_diagram, elements, category, facade, key) -> None: # So range(len(D)) becomes a linear extension of the poset. rdict = {element: i for i, element in enumerate(self._elements)} self._hasse_diagram = HasseDiagram(hasse_diagram.relabel(rdict, inplace=False), - data_structure="static_sparse") + data_structure='static_sparse') self._element_to_vertex_dict = rdict self._is_facade = facade @@ -1279,7 +1279,7 @@ def __contains__(self, x) -> bool: def _element_constructor_(self, element): """ - Constructs an element of ``self`` + Construct an element of ``self``. EXAMPLES:: @@ -1316,7 +1316,7 @@ def _element_constructor_(self, element): def __call__(self, element): """ - Creates elements of this poset + Create elements of this poset. This overrides the generic call method for all parents :meth:`Parent.__call__`, as a work around to allow for facade @@ -1370,7 +1370,7 @@ def hasse_diagram(self): [1, 3, 5, 15] sage: H.edges(sort=True) [(1, 3, None), (1, 5, None), (3, 15, None), (5, 15, None)] - sage: H.set_latex_options(format="dot2tex") # needs sage.plot + sage: H.set_latex_options(format='dot2tex') # needs sage.plot sage: view(H) # optional - dot2tex, not tested (opens external window) """ G = DiGraph(self._hasse_diagram).relabel(self._list, inplace=False) @@ -1427,7 +1427,7 @@ def _repr_(self): def _rich_repr_(self, display_manager, **kwds): """ - Rich Output Magic Method + Rich Output Magic Method. See :mod:`sage.repl.rich_output` for details. @@ -1488,12 +1488,12 @@ def sorted(self, l, allow_incomparable=True, remove_duplicates=False): INPUT: - - ``l`` -- a list of elements of the poset - - ``allow_incomparable`` -- a Boolean. If ``True`` (the default), - return incomparable elements in some order; if ``False``, raise + - ``l`` -- list of elements of the poset + - ``allow_incomparable`` -- boolean (default: ``True``); if ``True``, + return incomparable elements in some order. If ``False``, raise an error if ``l`` is not a chain of the poset. - - ``remove_duplicates`` -- a Boolean. If ``True``, remove duplicates - from the output list. + - ``remove_duplicates`` -- boolean (default: ``False``); if ``True``, + remove duplicates from the output list EXAMPLES:: @@ -1553,9 +1553,8 @@ def linear_extension(self, linear_extension=None, check=True): - ``linear_extension`` -- (default: ``None``) a list of the elements of ``self`` - - ``check`` -- a boolean (default: ``True``); - whether to check that ``linear_extension`` is indeed a - linear extension of ``self``. + - ``check`` -- boolean (default: ``True``); whether to check that + ``linear_extension`` is indeed a linear extension of ``self`` EXAMPLES:: @@ -1610,10 +1609,10 @@ def linear_extensions(self, facade=False): INPUT: - - ``facade`` -- a boolean (default: ``False``); - whether to return the linear extensions as plain lists + - ``facade`` -- boolean (default: ``False``); whether to return the + linear extensions as plain lists - .. warning:: + .. WARNING:: The ``facade`` option is not yet fully functional:: @@ -1830,7 +1829,7 @@ def is_linear_extension(self, l) -> bool: INPUT: - - ``l`` -- a list (or iterable) containing all of the elements of ``self`` exactly once + - ``l`` -- list (or iterable) containing all of the elements of ``self`` exactly once EXAMPLES:: @@ -1915,9 +1914,9 @@ def plot(self, label_elements=True, element_labels=None, * ``element_shape`` -- the shape of elements, like ``'s'`` for square; see https://matplotlib.org/api/markers_api.html for the list * ``element_size`` (default: 200) - the size of elements - * ``label_elements`` (default: ``True``) - whether to display + * ``label_elements`` boolean (default: ``True``); whether to display element labels - * ``element_labels`` (default: ``None``) - a dictionary where keys + * ``element_labels`` (default: ``None``); a dictionary where keys are elements and values are labels to show - Options to change cover relation look: @@ -1937,11 +1936,11 @@ def plot(self, label_elements=True, element_labels=None, - Options to change overall look: - * ``figsize`` (default: 8) - size of the whole plot + * ``figsize`` -- (default: 8) size of the whole plot * ``title`` -- a title for the plot * ``fontsize`` -- fontsize for the title - * ``border`` (default: ``False``) - whether to draw a border over the - plot + * ``border`` -- (default: ``False``) whether to draw a border over + the plot .. NOTE:: @@ -2111,15 +2110,15 @@ def show(self, label_elements=True, element_labels=None, INPUT: - - ``label_elements`` (default: ``True``) -- whether to display + - ``label_elements`` -- boolean (default: ``True``); whether to display element labels - - ``element_labels`` (default: ``None``) -- a dictionary of + - ``element_labels`` -- (default: ``None``) a dictionary of element labels - ``cover_labels`` -- a dictionary, list or function representing labels - of the covers of ``self``. When set to ``None`` (default) no label is - displayed on the edges of the Hasse Diagram. + of the covers of ``self``; when set to ``None`` (default) no label is + displayed on the edges of the Hasse Diagram .. NOTE:: @@ -2202,7 +2201,7 @@ def cover_relations(self): """ return list(self.cover_relations_iterator()) - @combinatorial_map(name="cover_relations_graph") + @combinatorial_map(name='cover_relations_graph') def cover_relations_graph(self): """ Return the (undirected) graph of cover relations. @@ -2595,7 +2594,7 @@ def intervals_poset(self): covers.extend([[(a, b), (aa, b)] for aa in self.upper_covers(a) if self.le(aa, b)]) - dg = DiGraph([ints, covers], format="vertices_and_edges") + dg = DiGraph([ints, covers], format='vertices_and_edges') return constructor(dg, cover_relations=True) def relations_iterator(self, strict=False): @@ -2607,9 +2606,8 @@ def relations_iterator(self, strict=False): INPUT: - - ``strict`` -- a boolean (default ``False``) if ``True``, returns - an iterator over relations `x < y`, excluding all - relations `x \leq x`. + - ``strict`` -- boolean (default: ``False``); if ``True``, return + an iterator over relations `x < y`, excluding all relations `x \leq x` OUTPUT: @@ -3149,7 +3147,7 @@ def height(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -3292,7 +3290,7 @@ def is_chain_of_poset(self, elms, ordered=False) -> bool: INPUT: - - ``elms`` -- a list or other iterable containing some elements + - ``elms`` -- list or other iterable containing some elements of the poset - ``ordered`` -- a Boolean. If ``True``, then return ``True`` @@ -3527,9 +3525,9 @@ def dimension(self, certificate=False, *, solver=None, integrality_tolerance=1e- INPUT: - - ``certificate`` (boolean; default:``False``) -- whether to return an + - ``certificate`` -- boolean (default: ``False``); whether to return an integer (the dimension) or a certificate, i.e. a smallest set of - linear extensions. + linear extensions - ``solver`` -- (default: ``None``) Specify a Mixed Integer Linear Programming (MILP) solver to be used. If set to ``None``, the default one is used. For @@ -3540,7 +3538,7 @@ def dimension(self, certificate=False, *, solver=None, integrality_tolerance=1e- :class:`MixedIntegerLinearProgram `. - ``integrality_tolerance`` -- parameter for use with MILP solvers over an - inexact base ring; see :meth:`MixedIntegerLinearProgram.get_values`. + inexact base ring; see :meth:`MixedIntegerLinearProgram.get_values` .. NOTE:: @@ -3771,7 +3769,7 @@ def jump_number(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) Whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -3869,7 +3867,7 @@ def is_jump_critical(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -4371,7 +4369,7 @@ def coxeter_smith_form(self, algorithm='singular'): INPUT: - - ``algorithm`` -- optional (default ``'singular'``), possible + - ``algorithm`` -- (default: ``'singular'``), possible values are ``'singular'``, ``'sage'``, ``'gap'``, ``'pari'``, ``'maple'``, ``'magma'``, ``'fricas'`` @@ -4379,9 +4377,7 @@ def coxeter_smith_form(self, algorithm='singular'): algorithm. Sage is rather slow, Singular is faster and Pari is fast at least for small sizes. - OUTPUT: - - - list of polynomials in one variable, each one dividing the next one + OUTPUT: list of polynomials in one variable, each one dividing the next one The output list is a refinement of the characteristic polynomial of the Coxeter transformation, which is its product. This list @@ -4474,7 +4470,7 @@ def is_meet_semilattice(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -4547,7 +4543,7 @@ def is_join_semilattice(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -4813,7 +4809,7 @@ def width(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -5250,7 +5246,7 @@ def factor(self): Cartesian products) is unique up to reordering and isomorphism. - OUTPUT: a list of posets + OUTPUT: list of posets EXAMPLES:: @@ -5636,9 +5632,9 @@ def star_product(self, other, labels='pairs'): INPUT: - - ``other`` -- a poset. + - ``other`` -- a poset - - ``labels`` -- (defaults to 'pairs') If set to 'pairs', each + - ``labels`` -- string (default: 'pairs'); if set to 'pairs', each element ``v`` in this poset will be named ``(0, v)`` and each element ``u`` in ``other`` will be named ``(1, u)`` in the result. If set to 'integers', the elements of the result @@ -5867,7 +5863,7 @@ def with_bounds(self, labels=('bottom', 'top')): INPUT: - - ``labels`` -- A pair of elements to use as a bottom and top + - ``labels`` -- a pair of elements to use as a bottom and top element of the poset. Default is strings ``'bottom'`` and ``'top'``. Either of them can be ``None``, and then a new bottom or top element will not be added. @@ -6330,7 +6326,7 @@ def with_linear_extension(self, linear_extension): category=self.category(), facade=self._is_facade) - def graphviz_string(self, graph_string="graph", edge_string="--"): + def graphviz_string(self, graph_string='graph', edge_string='--'): r""" Return a representation in the DOT language, ready to render in graphviz. @@ -7095,7 +7091,7 @@ def order_complex(self, on_ints=False): INPUT: - - ``on_ints`` -- a boolean (default: ``False``) + - ``on_ints`` -- boolean (default: ``False``) OUTPUT: an order complex of type :class:`SimplicialComplex` @@ -7771,11 +7767,9 @@ def promotion(self, i=1): INPUT: - - ``i`` -- an integer between `1` and `n` (default: `1`) - - OUTPUT: + - ``i`` -- integer between `1` and `n` (default: `1`) - - an isomorphic poset, with the same default linear extension + OUTPUT: an isomorphic poset, with the same default linear extension The extended promotion is defined on a poset ``self`` of size `n` by applying the promotion operator `\tau_i \tau_{i+1} @@ -7857,9 +7851,7 @@ def evacuation(self): Compute evacuation on the linear extension associated to the poset ``self``. - OUTPUT: - - - an isomorphic poset, with the same default linear extension + OUTPUT: an isomorphic poset, with the same default linear extension Evacuation is defined on a poset ``self`` of size `n` by applying the evacuation operator @@ -7974,7 +7966,7 @@ def is_slender(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -8089,9 +8081,9 @@ def is_eulerian(self, k=None, certificate=False): INPUT: - - ``k``, an integer -- only check if the poset is `k`-eulerian. + - ``k`` -- integer; only check if the poset is `k`-eulerian. If ``None`` (the default), check if the poset is Eulerian. - - ``certificate``, a Boolean -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -8201,7 +8193,7 @@ def is_greedy(self, certificate=False): INPUT: - - ``certificate`` -- (default: ``False``) whether to return + - ``certificate`` -- boolean (default: ``False``); whether to return a certificate OUTPUT: @@ -8379,7 +8371,7 @@ def frank_network(self): for i in self: pdict[(0, i)] = [(1, j) for j in self if self.ge(i, j)] pdict[(1, i)] = [(2, 0)] - G = DiGraph(pdict, format="dict_of_lists") + G = DiGraph(pdict, format='dict_of_lists') a = {e: 0 for e in G.edge_iterator(labels=False)} for i in self: a[((0, i), (1, i))] = 1 @@ -8593,7 +8585,7 @@ def cuts(self): from sage.graphs.graph import Graph from sage.graphs.independent_sets import IndependentSets auxg = Graph({(u, 0): [(v, 1) for v in self if not self.ge(u, v)] - for u in self}, format="dict_of_lists") + for u in self}, format='dict_of_lists') auxg.add_vertices([(v, 1) for v in self]) return [frozenset([xa for xa, xb in c if xb == 0]) for c in IndependentSets(auxg, maximal=True)] @@ -8607,9 +8599,7 @@ def completion_by_cuts(self): See the :wikipedia:`Dedekind-MacNeille completion`. - OUTPUT: - - - a finite lattice + OUTPUT: a finite lattice EXAMPLES:: diff --git a/src/sage/combinat/rigged_configurations/bij_abstract_class.py b/src/sage/combinat/rigged_configurations/bij_abstract_class.py index 520ce241d57..e22c657d672 100644 --- a/src/sage/combinat/rigged_configurations/bij_abstract_class.py +++ b/src/sage/combinat/rigged_configurations/bij_abstract_class.py @@ -52,7 +52,7 @@ def __init__(self, tp_krt): INPUT: - - ``parent`` -- The parent of tensor product of KR tableaux + - ``parent`` -- the parent of tensor product of KR tableaux EXAMPLES:: @@ -99,9 +99,9 @@ def run(self, verbose=False): INPUT: - - ``tp_krt`` -- A tensor product of KR tableaux + - ``tp_krt`` -- a tensor product of KR tableaux - - ``verbose`` -- (Default: ``False``) Display each step in the + - ``verbose`` -- (default: ``False``) display each step in the bijection EXAMPLES:: @@ -177,7 +177,7 @@ def next_state(self, val): INPUT: - - ``val`` -- The value we are adding + - ``val`` -- the value we are adding TESTS:: @@ -210,7 +210,7 @@ def _update_vacancy_nums(self, a): INPUT: - - ``a`` -- The index of the partition to update + - ``a`` -- the index of the partition to update TESTS:: @@ -250,7 +250,7 @@ def _update_partition_values(self, a): INPUT: - - ``a`` -- The index of the partition to update + - ``a`` -- the index of the partition to update TESTS:: @@ -308,7 +308,7 @@ def __init__(self, RC_element): INPUT: - - ``RC_element`` -- The rigged configuration + - ``RC_element`` -- the rigged configuration EXAMPLES:: @@ -361,9 +361,9 @@ def run(self, verbose=False, build_graph=False): INPUT: - - ``verbose`` -- (default: ``False``) display each step in the + - ``verbose`` -- boolean (default: ``False``); display each step in the bijection - - ``build_graph`` -- (default: ``False``) build the graph of each + - ``build_graph`` -- boolean (default: ``False``); build the graph of each step of the bijection EXAMPLES:: @@ -440,9 +440,9 @@ def run(self, verbose=False, build_graph=False): self._graph.pop(0) # Remove the dummy at the start from sage.graphs.digraph import DiGraph from sage.graphs.dot2tex_utils import have_dot2tex - self._graph = DiGraph(self._graph, format="list_of_edges") + self._graph = DiGraph(self._graph, format='list_of_edges') if have_dot2tex(): - self._graph.set_latex_options(format="dot2tex", edge_labels=True) + self._graph.set_latex_options(format='dot2tex', edge_labels=True) return self.KRT(pathlist=ret_crystal_path) @abstract_method @@ -471,7 +471,7 @@ def _update_vacancy_numbers(self, a): INPUT: - - ``a`` -- The index of the partition to update + - ``a`` -- the index of the partition to update TESTS:: @@ -513,9 +513,9 @@ def _find_singular_string(self, partition, last_size): INPUT: - - ``partition`` -- The partition to look in + - ``partition`` -- the partition to look in - - ``last_size`` -- The last size found + - ``last_size`` -- the last size found TESTS:: diff --git a/src/sage/combinat/rigged_configurations/bij_type_B.py b/src/sage/combinat/rigged_configurations/bij_type_B.py index 51fd8f198bc..d511ae76a2e 100644 --- a/src/sage/combinat/rigged_configurations/bij_type_B.py +++ b/src/sage/combinat/rigged_configurations/bij_type_B.py @@ -54,9 +54,9 @@ def run(self, verbose=False): INPUT: - - ``tp_krt`` -- A tensor product of KR tableaux + - ``tp_krt`` -- a tensor product of KR tableaux - - ``verbose`` -- (Default: ``False``) Display each step in the + - ``verbose`` -- (default: ``False``) display each step in the bijection EXAMPLES:: @@ -553,9 +553,9 @@ def run(self, verbose=False, build_graph=False): INPUT: - - ``verbose`` -- (default: ``False``) display each step in the + - ``verbose`` -- boolean (default: ``False``); display each step in the bijection - - ``build_graph`` -- (default: ``False``) build the graph of each + - ``build_graph`` -- boolean (default: ``False``); build the graph of each step of the bijection EXAMPLES:: @@ -739,7 +739,7 @@ def run(self, verbose=False, build_graph=False): from sage.graphs.dot2tex_utils import have_dot2tex self._graph = DiGraph(self._graph) if have_dot2tex(): - self._graph.set_latex_options(format="dot2tex", edge_labels=True) + self._graph.set_latex_options(format='dot2tex', edge_labels=True) return self.KRT(pathlist=ret_crystal_path) diff --git a/src/sage/combinat/rigged_configurations/bij_type_D.py b/src/sage/combinat/rigged_configurations/bij_type_D.py index ab9b41b89bd..e1d84d29e4b 100644 --- a/src/sage/combinat/rigged_configurations/bij_type_D.py +++ b/src/sage/combinat/rigged_configurations/bij_type_D.py @@ -56,9 +56,9 @@ def run(self, verbose=False): INPUT: - - ``tp_krt`` -- A tensor product of KR tableaux + - ``tp_krt`` -- a tensor product of KR tableaux - - ``verbose`` -- (Default: ``False``) Display each step in the + - ``verbose`` -- (default: ``False``) display each step in the bijection EXAMPLES:: @@ -425,9 +425,9 @@ def run(self, verbose=False, build_graph=False): INPUT: - - ``verbose`` -- (default: ``False``) display each step in the + - ``verbose`` -- boolean (default: ``False``); display each step in the bijection - - ``build_graph`` -- (default: ``False``) build the graph of each + - ``build_graph`` -- boolean (default: ``False``); build the graph of each step of the bijection EXAMPLES:: @@ -546,9 +546,9 @@ def run(self, verbose=False, build_graph=False): self._graph.pop(0) # Remove the dummy at the start from sage.graphs.digraph import DiGraph from sage.graphs.dot2tex_utils import have_dot2tex - self._graph = DiGraph(self._graph, format="list_of_edges") + self._graph = DiGraph(self._graph, format='list_of_edges') if have_dot2tex(): - self._graph.set_latex_options(format="dot2tex", edge_labels=True) + self._graph.set_latex_options(format='dot2tex', edge_labels=True) return self.KRT(pathlist=ret_crystal_path) diff --git a/src/sage/combinat/rigged_configurations/bij_type_D_twisted.py b/src/sage/combinat/rigged_configurations/bij_type_D_twisted.py index ce177ffb468..7d1edfb278a 100644 --- a/src/sage/combinat/rigged_configurations/bij_type_D_twisted.py +++ b/src/sage/combinat/rigged_configurations/bij_type_D_twisted.py @@ -59,9 +59,9 @@ def run(self, verbose=False): INPUT: - - ``tp_krt`` -- A tensor product of KR tableaux + - ``tp_krt`` -- a tensor product of KR tableaux - - ``verbose`` -- (Default: ``False``) Display each step in the + - ``verbose`` -- (default: ``False``) display each step in the bijection EXAMPLES:: @@ -322,9 +322,9 @@ def run(self, verbose=False, build_graph=False): INPUT: - - ``verbose`` -- (default: ``False``) display each step in the + - ``verbose`` -- boolean (default: ``False``); display each step in the bijection - - ``build_graph`` -- (default: ``False``) build the graph of each + - ``build_graph`` -- boolean (default: ``False``); build the graph of each step of the bijection EXAMPLES:: @@ -424,7 +424,7 @@ def run(self, verbose=False, build_graph=False): from sage.graphs.dot2tex_utils import have_dot2tex self._graph = DiGraph(self._graph) if have_dot2tex(): - self._graph.set_latex_options(format="dot2tex", edge_labels=True) + self._graph.set_latex_options(format='dot2tex', edge_labels=True) return self.KRT(pathlist=ret_crystal_path) diff --git a/src/sage/combinat/rigged_configurations/kleber_tree.py b/src/sage/combinat/rigged_configurations/kleber_tree.py index c3a2bbeaf0a..db6a1176495 100644 --- a/src/sage/combinat/rigged_configurations/kleber_tree.py +++ b/src/sage/combinat/rigged_configurations/kleber_tree.py @@ -4,7 +4,7 @@ A Kleber tree is a tree of weights generated by Kleber's algorithm [Kleber1]_. The nodes correspond to the weights in the positive Weyl chamber -obtained by subtracting a (non-zero) positive root. The edges are labeled by +obtained by subtracting a (nonzero) positive root. The edges are labeled by the coefficients of the roots of the difference. AUTHORS: @@ -216,10 +216,10 @@ class KleberTreeNode(Element): INPUT: - - ``parent_obj`` -- The parent object of this element - - ``node_weight`` -- The weight of this node - - ``dominant_root`` -- The dominating root - - ``parent_node`` -- (default:None) The parent node of this node + - ``parent_obj`` -- the parent object of this element + - ``node_weight`` -- the weight of this node + - ``dominant_root`` -- the dominating root + - ``parent_node`` -- (default: ``None``) the parent node of this node """ def __init__(self, parent_obj, node_weight, dominant_root, parent_node=None): @@ -515,7 +515,7 @@ class KleberTree(UniqueRepresentation, Parent): :class:`VirtualKleberTree`. The nodes correspond to the weights in the positive Weyl chamber obtained - by subtracting a (non-zero) positive root. The edges are labeled by the + by subtracting a (nonzero) positive root. The edges are labeled by the coefficients of the roots, and `X` is a child of `Y` if `Y` is the root else if the edge label of `Y` to its parent `Z` is greater (in every component) than the label from `X` to `Y`. @@ -529,7 +529,7 @@ class KleberTree(UniqueRepresentation, Parent): - ``cartan_type`` -- an affine simply-laced Cartan type - - ``B`` -- a list of dimensions of rectangles by `[r, c]` + - ``B`` -- list of dimensions of rectangles by `[r, c]` where `r` is the number of rows and `c` is the number of columns REFERENCES: @@ -623,7 +623,7 @@ def __init__(self, cartan_type, B, classical_ct): sage: from sage.combinat.rigged_configurations.kleber_tree import KleberTree sage: KT = KleberTree(['D', 3, 1], [[1,1], [1,1]]); KT Kleber tree of Cartan type ['D', 3, 1] and B = ((1, 1), (1, 1)) - sage: TestSuite(KT).run(skip="_test_elements") + sage: TestSuite(KT).run(skip='_test_elements') """ Parent.__init__(self, category=FiniteEnumeratedSets()) @@ -650,8 +650,8 @@ def latex_options(self, **options): - ``vspace`` -- (default: ``x``) the vertical spacing of the tree nodes, here ``x`` is the minimum of `-2.5` or `-.75n` where `n` is the rank of the classical type - - ``edge_labels`` -- (default: ``True``) display edge labels - - ``use_vector_notation`` -- (default: ``False``) display edge labels + - ``edge_labels`` -- boolean (default: ``True``); display edge labels + - ``use_vector_notation`` -- boolean (default: ``False``); display edge labels using vector notation instead of a linear combination EXAMPLES:: @@ -1033,7 +1033,7 @@ def digraph(self): G = DiGraph(d) if have_dot2tex(): - G.set_latex_options(format="dot2tex", edge_labels=True) + G.set_latex_options(format='dot2tex', edge_labels=True) return G def plot(self, **options): @@ -1115,7 +1115,7 @@ class VirtualKleberTree(KleberTree): - ``cartan_type`` -- an affine non-simply-laced Cartan type - - ``B`` -- a list of dimensions of rectangles by `[r, c]` + - ``B`` -- list of dimensions of rectangles by `[r, c]` where `r` is the number of rows and `c` is the number of columns EXAMPLES:: @@ -1168,7 +1168,7 @@ def __init__(self, cartan_type, B): sage: from sage.combinat.rigged_configurations.kleber_tree import VirtualKleberTree sage: KT = VirtualKleberTree(['C',4,1], [[2,2]]) - sage: TestSuite(KT).run(skip="_test_elements") + sage: TestSuite(KT).run(skip='_test_elements') """ self._folded_ct = cartan_type.as_folding() virtual_dims = [] @@ -1240,7 +1240,7 @@ def breadth_first_iter(self, all_nodes=False): INPUT: - - ``all_nodes`` -- (default: ``False``) if ``True``, output all + - ``all_nodes`` -- boolean (default: ``False``); if ``True``, output all nodes in the tree EXAMPLES:: @@ -1276,7 +1276,7 @@ def depth_first_iter(self, all_nodes=False): INPUT: - - ``all_nodes`` -- (default: ``False``) if ``True``, output all + - ``all_nodes`` -- boolean (default: ``False``); if ``True``, output all nodes in the tree EXAMPLES:: @@ -1363,7 +1363,7 @@ def __init__(self, cartan_type, B): sage: from sage.combinat.rigged_configurations.kleber_tree import VirtualKleberTree sage: KT = VirtualKleberTree(['A',6,2], [[2,2]]); KT Virtual Kleber tree of Cartan type ['BC', 3, 2] and B = ((2, 2),) - sage: TestSuite(KT).run(skip="_test_elements") + sage: TestSuite(KT).run(skip='_test_elements') """ self._folded_ct = cartan_type.as_folding() virtual_dims = [] @@ -1432,7 +1432,7 @@ def breadth_first_iter(self, all_nodes=False): INPUT: - - ``all_nodes`` -- (default: ``False``) if ``True``, output all + - ``all_nodes`` -- boolean (default: ``False``); if ``True``, output all nodes in the tree EXAMPLES:: @@ -1457,7 +1457,7 @@ def depth_first_iter(self, all_nodes=False): INPUT: - - ``all_nodes`` -- (default: ``False``) if ``True``, output all + - ``all_nodes`` -- boolean (default: ``False``); if ``True``, output all nodes in the tree EXAMPLES:: diff --git a/src/sage/combinat/rigged_configurations/kr_tableaux.py b/src/sage/combinat/rigged_configurations/kr_tableaux.py index 8bdc1d275b9..6f72d02be3e 100644 --- a/src/sage/combinat/rigged_configurations/kr_tableaux.py +++ b/src/sage/combinat/rigged_configurations/kr_tableaux.py @@ -653,12 +653,10 @@ def _fill(self, weight): INPUT: - - ``weight`` -- The weight of the highest weight KR tableau (the + - ``weight`` -- the weight of the highest weight KR tableau (the conjugate of the shape of the KR crystal's tableau) - OUTPUT: - - - A `r \times s` tableau + OUTPUT: a `r \times s` tableau EXAMPLES:: @@ -781,11 +779,9 @@ def _fill(self, shape): INPUT: - - ``shape`` -- The shape of the KR crystal's tableau - - OUTPUT: + - ``shape`` -- the shape of the KR crystal's tableau - - A `r \times s` tableau + OUTPUT: a `r \times s` tableau EXAMPLES:: @@ -879,12 +875,10 @@ def _fill(self, weight): INPUT: - - ``weight`` -- The weight of the highest weight KR tableau (the + - ``weight`` -- the weight of the highest weight KR tableau (the conjugate of the shape of the KR crystal's tableau) - OUTPUT: - - - A `r \times s` tableau + OUTPUT: a `r \times s` tableau EXAMPLES:: @@ -1219,7 +1213,7 @@ def to_array(self, rows=True): INPUT: - - ``rows`` -- (Default: ``True``) Set to ``True`` if the resulting + - ``rows`` -- (default: ``True``) set to ``True`` if the resulting array is by row, otherwise it is by column. EXAMPLES:: @@ -1287,9 +1281,9 @@ def to_classical_highest_weight(self, index_set=None): INPUT: - - ``index_set`` -- (Default: ``None``) Return the highest weight - with respect to the index set. If ``None`` is passed in, then this - uses the classical index set. + - ``index_set`` -- (default: ``None``) return the highest weight + with respect to the index set; if ``None`` is passed in, then this + uses the classical index set OUTPUT: @@ -1589,7 +1583,7 @@ def to_array(self, rows=True): INPUT: - - ``rows`` -- (Default: ``True``) Set to ``True`` if the resulting + - ``rows`` -- (default: ``True``) set to ``True`` if the resulting array is by row, otherwise it is by column. EXAMPLES:: diff --git a/src/sage/combinat/rigged_configurations/rigged_configuration_element.py b/src/sage/combinat/rigged_configurations/rigged_configuration_element.py index 925b9f6d874..4fe967a5c6c 100644 --- a/src/sage/combinat/rigged_configurations/rigged_configuration_element.py +++ b/src/sage/combinat/rigged_configurations/rigged_configuration_element.py @@ -55,7 +55,7 @@ class RiggedConfigurationElement(ClonableArray): - ``parent`` -- the parent of this element - - ``rigged_partitions`` -- a list of rigged partitions + - ``rigged_partitions`` -- list of rigged partitions There are two optional arguments to explicitly construct a rigged configuration. The first is ``partition_list`` which gives a list of @@ -1557,10 +1557,10 @@ def to_tensor_product_of_kirillov_reshetikhin_tableaux(self, display_steps=False INPUT: - - ``display_steps`` -- (default: ``False``) boolean which indicates - if we want to print each step in the algorithm - - ``build_graph`` -- (default: ``False``) boolean which indicates - if we want to construct and return a graph of the bijection whose + - ``display_steps`` -- boolean (default: ``False``); indicates whether + to print each step in the algorithm + - ``build_graph`` -- boolean (default: ``False``); indicates whether + to construct and return a graph of the bijection whose vertices are rigged configurations obtained at each step and edges are labeled by either the return value of `\delta` or the doubling/halving map @@ -1643,10 +1643,10 @@ def to_tensor_product_of_kirillov_reshetikhin_crystals(self, display_steps=False INPUT: - - ``display_steps`` -- (default: ``False``) boolean which indicates - if we want to print each step in the algorithm - - ``build_graph`` -- (default: ``False``) boolean which indicates - if we want to construct and return a graph of the bijection whose + - ``display_steps`` -- boolean (default: ``False``); indicates whether + to print each step in the algorithm + - ``build_graph`` -- boolean (default: ``False``); indicates whether + to construct and return a graph of the bijection whose vertices are rigged configurations obtained at each step and edges are labeled by either the return value of `\delta` or the doubling/halving map @@ -1786,7 +1786,7 @@ def left_box(self, return_b=False): INPUT: - - ``return_b`` -- (default: ``False``) whether to return the + - ``return_b`` -- boolean (default: ``False``); whether to return the resulting letter from `\delta` OUTPUT: @@ -1974,7 +1974,7 @@ def complement_rigging(self, reverse_factors=False): INPUT: - - ``reverse_factors`` -- (default: ``False``) if ``True``, then this + - ``reverse_factors`` -- boolean (default: ``False``); if ``True``, then this returns an element in `RC(B')` where `B'` is the tensor factors of ``self`` in reverse order diff --git a/src/sage/combinat/rigged_configurations/rigged_configurations.py b/src/sage/combinat/rigged_configurations/rigged_configurations.py index 535787875b5..d18c40b52f2 100644 --- a/src/sage/combinat/rigged_configurations/rigged_configurations.py +++ b/src/sage/combinat/rigged_configurations/rigged_configurations.py @@ -123,7 +123,7 @@ class RiggedConfigurations(UniqueRepresentation, Parent): :class:`~sage.combinat.rigged_configurations.tensor_product_kr_tableaux.TensorProductOfKirillovReshetikhinTableaux` of non-exceptional affine types where the list `B` corresponds to the tensor factors `B^{r,s}`. The bijection has been proven in types `A_n^{(1)}` - and `D_n^{(1)}` and when the only non-zero entries of `L_i^{(a)}` are either + and `D_n^{(1)}` and when the only nonzero entries of `L_i^{(a)}` are either only `L_1^{(a)}` or only `L_i^{(1)}` (corresponding to single columns or rows respectively) [RigConBijection]_, [BijectionLRT]_, [BijectionDn]_. @@ -146,7 +146,7 @@ class RiggedConfigurations(UniqueRepresentation, Parent): - ``cartan_type`` -- a Cartan type - - ``B`` -- a list of positive integer tuples `(r,s)` corresponding to the + - ``B`` -- list of positive integer tuples `(r,s)` corresponding to the tensor factors in the bijection with tensor product of Kirillov-Reshetikhin tableaux or equivalently the sequence of width `s` and height `r` rectangles @@ -414,7 +414,7 @@ class options(GlobalOptions): -1[ ]-1 - sage: RiggedConfigurations.options(display="horizontal", convention="french") + sage: RiggedConfigurations.options(display='horizontal', convention='french') sage: elt -1[ ]-1 1[ ][ ][ ]1 -1[ ]-1 -3[ ][ ][ ]-3 @@ -612,7 +612,7 @@ def _block_iterator(self, container): INPUT: - - ``container`` -- a list of widths of the rows of the container + - ``container`` -- list of widths of the rows of the container TESTS:: @@ -1806,7 +1806,7 @@ def _block_iterator_n_odd(self, container): INPUT: - - ``container`` -- a list the widths of the rows of the container + - ``container`` -- list the widths of the rows of the container TESTS:: diff --git a/src/sage/combinat/rigged_configurations/rigged_partition.pyx b/src/sage/combinat/rigged_configurations/rigged_partition.pyx index 97ff48d7918..84d98c90f3e 100644 --- a/src/sage/combinat/rigged_configurations/rigged_partition.pyx +++ b/src/sage/combinat/rigged_configurations/rigged_partition.pyx @@ -360,13 +360,11 @@ cdef class RiggedPartition(SageObject): INPUT: - - ``end_column`` -- The index of the column to end at + - ``end_column`` -- the index of the column to end at - - ``t`` -- The scaling factor + - ``t`` -- the scaling factor - OUTPUT: - - - The number of cells + OUTPUT: the number of cells EXAMPLES:: @@ -405,12 +403,10 @@ cdef class RiggedPartition(SageObject): INPUT: - - ``max_width`` -- The maximum width (i.e. row length) that we can + - ``max_width`` -- the maximum width (i.e. row length) that we can insert the cell at - OUTPUT: - - - The width of the row we inserted at. + OUTPUT: the width of the row we inserted at EXAMPLES:: @@ -562,7 +558,7 @@ cdef class RiggedPartitionTypeB(RiggedPartition): INPUT: - - ``half_width_boxes`` -- (Default: ``True``) Display the partition + - ``half_width_boxes`` -- (default: ``True``) display the partition using half width boxes EXAMPLES:: @@ -611,7 +607,7 @@ cdef class RiggedPartitionTypeB(RiggedPartition): INPUT: - - ``half_width_boxes`` -- (default: ``True``) display the partition + - ``half_width_boxes`` -- boolean (default: ``True``); display the partition using half width boxes EXAMPLES:: diff --git a/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py b/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py index f353f76375b..40eb5927809 100644 --- a/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +++ b/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py @@ -118,9 +118,9 @@ def __init__(self, parent, list=[[]], **options): INPUT: - - ``parent`` -- Parent for this element + - ``parent`` -- parent for this element - - ``list`` -- The list of KR tableaux elements + - ``list`` -- the list of KR tableaux elements EXAMPLES:: @@ -324,8 +324,8 @@ def to_rigged_configuration(self, display_steps=False): INPUT: - - ``display_steps`` -- (default: ``False``) Boolean which indicates - if we want to output each step in the algorithm. + - ``display_steps`` -- boolean (default: ``False``); whether to output + each step in the algorithm OUTPUT: the rigged configuration corresponding to ``self`` diff --git a/src/sage/combinat/root_system/ambient_space.py b/src/sage/combinat/root_system/ambient_space.py index e52a8504edd..35259abc9d9 100644 --- a/src/sage/combinat/root_system/ambient_space.py +++ b/src/sage/combinat/root_system/ambient_space.py @@ -18,7 +18,7 @@ class AmbientSpace(CombinatorialFreeModule): r""" - Abstract class for ambient spaces + Abstract class for ambient spaces. All subclasses should implement a class method ``smallest_base_ring`` taking a Cartan type as input, and a method @@ -230,7 +230,7 @@ def coroot_lattice(self): def simple_coroot(self, i): r""" - Returns the i-th simple coroot, as an element of this space + Return the `i`-th simple coroot, as an element of this space. EXAMPLES:: @@ -266,7 +266,7 @@ def reflection(self, root, coroot=None): @cached_method def fundamental_weight(self, i): r""" - Returns the fundamental weight `\Lambda_i` in ``self`` + Return the fundamental weight `\Lambda_i` in ``self``. In several of the ambient spaces, it is more convenient to construct all fundamental weights at once. To support this, we @@ -291,7 +291,7 @@ def fundamental_weight(self, i): """ return self.fundamental_weights()[i] - def from_vector_notation(self, weight, style="lattice"): + def from_vector_notation(self, weight, style='lattice'): """ INPUT: @@ -307,7 +307,7 @@ def from_vector_notation(self, weight, style="lattice"): If style="coroots" and the data is a tuple of integers, it is assumed that the data represent a linear combination of - fundamental weights. If style="coroots", and the root lattice + fundamental weights. If style='coroots', and the root lattice is not of full rank in the ambient space, it is projected into the subspace corresponding to the semisimple derived group. This arises with Cartan type A, E6 and E7. @@ -318,7 +318,7 @@ def from_vector_notation(self, weight, style="lattice"): (1, 0, 0) sage: RootSystem("A2").ambient_space().from_vector_notation([1,0,0]) (1, 0, 0) - sage: RootSystem("A2").ambient_space().from_vector_notation((1,0),style="coroots") + sage: RootSystem("A2").ambient_space().from_vector_notation((1,0),style='coroots') (2/3, -1/3, -1/3) """ if style == "coroots" and isinstance(weight, tuple) and all(xv in ZZ for xv in weight): diff --git a/src/sage/combinat/root_system/associahedron.py b/src/sage/combinat/root_system/associahedron.py index 8d6a3e39a93..da44903b9d9 100644 --- a/src/sage/combinat/root_system/associahedron.py +++ b/src/sage/combinat/root_system/associahedron.py @@ -387,11 +387,11 @@ def _element_constructor_(self, cartan_type, **kwds): def _coerce_map_from_(self, X): r""" - Return whether there is a coercion from ``X`` + Return whether there is a coercion from ``X``. INPUT: - - ``X`` -- anything. + - ``X`` -- anything OUTPUT: boolean diff --git a/src/sage/combinat/root_system/braid_move_calculator.py b/src/sage/combinat/root_system/braid_move_calculator.py index 38931a00229..8fcdc26f24b 100644 --- a/src/sage/combinat/root_system/braid_move_calculator.py +++ b/src/sage/combinat/root_system/braid_move_calculator.py @@ -33,7 +33,7 @@ def __init__(self, coxeter_group): sage: from sage.combinat.root_system.braid_move_calculator import BraidMoveCalculator sage: W = CoxeterGroup(['C',3]) sage: B = BraidMoveCalculator(W) - sage: TestSuite(B).run(skip="_test_pickling") + sage: TestSuite(B).run(skip='_test_pickling') """ self.coxeter_matrix = coxeter_group.coxeter_matrix() diff --git a/src/sage/combinat/root_system/branching_rules.py b/src/sage/combinat/root_system/branching_rules.py index 4877b972438..60648da2db5 100644 --- a/src/sage/combinat/root_system/branching_rules.py +++ b/src/sage/combinat/root_system/branching_rules.py @@ -20,7 +20,7 @@ from sage.misc.functional import is_even, is_odd -def branch_weyl_character(chi, R, S, rule="default"): +def branch_weyl_character(chi, R, S, rule='default'): r""" A branching rule describes the restriction of representations from a Lie group or algebra `G` to a subgroup `H`. See for example, R. C. @@ -46,14 +46,14 @@ def branch_weyl_character(chi, R, S, rule="default"): - ``rule`` -- an element of the ``BranchingRule`` class or one (most usually) a keyword such as: - * ``"levi"`` - * ``"automorphic"`` - * ``"symmetric"`` - * ``"extended"`` - * ``"orthogonal_sum"`` - * ``"tensor"`` - * ``"triality"`` - * ``"miscellaneous"`` + * ``'levi'`` + * ``'automorphic'`` + * ``'symmetric'`` + * ``'extended'`` + * ``'orthogonal_sum'`` + * ``'tensor'`` + * ``'triality'`` + * ``'miscellaneous'`` The :class:`BranchingRule` class is a wrapper for functions from the weight lattice of `G` to the weight lattice of `H`. @@ -79,9 +79,9 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A3=WeylCharacterRing("A3",style="coroots") - sage: A2=WeylCharacterRing("A2",style="coroots") - sage: [A3(fw).branch(A2,rule="levi") for fw in A3.fundamental_weights()] + sage: A3=WeylCharacterRing("A3",style='coroots') + sage: A2=WeylCharacterRing("A2",style='coroots') + sage: [A3(fw).branch(A2,rule='levi') for fw in A3.fundamental_weights()] [A2(0,0) + A2(1,0), A2(0,1) + A2(1,0), A2(0,0) + A2(0,1)] In this case the Levi branching rule is the default branching rule @@ -94,8 +94,8 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A4=WeylCharacterRing("A4",style="coroots") - sage: A2=WeylCharacterRing("A2",style="coroots") + sage: A4=WeylCharacterRing("A4",style='coroots') + sage: A2=WeylCharacterRing("A2",style='coroots') sage: br=branching_rule("A4","A3")*branching_rule("A3","A2") sage: A4(1,0,0,0).branch(A2,rule=br) 2*A2(0,0) + A2(1,0) @@ -129,13 +129,13 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A1 = WeylCharacterRing("A1", style="coroots") - sage: A2 = WeylCharacterRing("A2", style="coroots") - sage: D4 = WeylCharacterRing("D4", style="coroots") - sage: B3 = WeylCharacterRing("B3", style="coroots") - sage: B4 = WeylCharacterRing("B4", style="coroots") - sage: A6 = WeylCharacterRing("A6", style="coroots") - sage: A7 = WeylCharacterRing("A7", style="coroots") + sage: A1 = WeylCharacterRing("A1", style='coroots') + sage: A2 = WeylCharacterRing("A2", style='coroots') + sage: D4 = WeylCharacterRing("D4", style='coroots') + sage: B3 = WeylCharacterRing("B3", style='coroots') + sage: B4 = WeylCharacterRing("B4", style='coroots') + sage: A6 = WeylCharacterRing("A6", style='coroots') + sage: A7 = WeylCharacterRing("A7", style='coroots') sage: def try_default_rule(R,S): return [R(f).branch(S) for f in R.fundamental_weights()] sage: try_default_rule(A2,A1) [A1(0) + A1(1), A1(0) + A1(1)] @@ -214,12 +214,12 @@ def branch_weyl_character(chi, R, S, rule="default"): sage: D3 = WeylCharacterRing("D3") sage: D4 = WeylCharacterRing("D4") sage: G2 = WeylCharacterRing("G2") - sage: F4 = WeylCharacterRing("F4",style="coroots") - sage: E6=WeylCharacterRing("E6",style="coroots") - sage: E7=WeylCharacterRing("E7",style="coroots") - sage: D5=WeylCharacterRing("D5",style="coroots") - sage: D6=WeylCharacterRing("D6",style="coroots") - sage: [B3(w).branch(A2,rule="levi") for w in B3.fundamental_weights()] + sage: F4 = WeylCharacterRing("F4",style='coroots') + sage: E6=WeylCharacterRing("E6",style='coroots') + sage: E7=WeylCharacterRing("E7",style='coroots') + sage: D5=WeylCharacterRing("D5",style='coroots') + sage: D6=WeylCharacterRing("D6",style='coroots') + sage: [B3(w).branch(A2,rule='levi') for w in B3.fundamental_weights()] [A2(0,0,0) + A2(1,0,0) + A2(0,0,-1), A2(0,0,0) + A2(1,0,0) + A2(1,1,0) + A2(1,0,-1) + A2(0,-1,-1) + A2(0,0,-1), A2(-1/2,-1/2,-1/2) + A2(1/2,-1/2,-1/2) + A2(1/2,1/2,-1/2) + A2(1/2,1/2,1/2)] @@ -235,73 +235,73 @@ def branch_weyl_character(chi, R, S, rule="default"): :: - sage: [C3(w).branch(A2,rule="levi") for w in C3.fundamental_weights()] + sage: [C3(w).branch(A2,rule='levi') for w in C3.fundamental_weights()] [A2(1,0,0) + A2(0,0,-1), A2(1,1,0) + A2(1,0,-1) + A2(0,-1,-1), A2(-1,-1,-1) + A2(1,-1,-1) + A2(1,1,-1) + A2(1,1,1)] - sage: [D4(w).branch(A3,rule="levi") for w in D4.fundamental_weights()] + sage: [D4(w).branch(A3,rule='levi') for w in D4.fundamental_weights()] [A3(1,0,0,0) + A3(0,0,0,-1), A3(0,0,0,0) + A3(1,1,0,0) + A3(1,0,0,-1) + A3(0,0,-1,-1), A3(1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,-1/2), A3(-1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,1/2)] - sage: [B3(w).branch(B2,rule="levi") for w in B3.fundamental_weights()] + sage: [B3(w).branch(B2,rule='levi') for w in B3.fundamental_weights()] [2*B2(0,0) + B2(1,0), B2(0,0) + 2*B2(1,0) + B2(1,1), 2*B2(1/2,1/2)] sage: C3 = WeylCharacterRing(['C',3]) - sage: [C3(w).branch(C2,rule="levi") for w in C3.fundamental_weights()] + sage: [C3(w).branch(C2,rule='levi') for w in C3.fundamental_weights()] [2*C2(0,0) + C2(1,0), C2(0,0) + 2*C2(1,0) + C2(1,1), C2(1,0) + 2*C2(1,1)] - sage: [D5(w).branch(D4,rule="levi") for w in D5.fundamental_weights()] + sage: [D5(w).branch(D4,rule='levi') for w in D5.fundamental_weights()] [2*D4(0,0,0,0) + D4(1,0,0,0), D4(0,0,0,0) + 2*D4(1,0,0,0) + D4(1,1,0,0), D4(1,0,0,0) + 2*D4(1,1,0,0) + D4(1,1,1,0), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2)] - sage: G2(1,0,-1).branch(A1,rule="levi") + sage: G2(1,0,-1).branch(A1,rule='levi') A1(1,0) + A1(1,-1) + A1(0,-1) - sage: E6=WeylCharacterRing("E6",style="coroots") - sage: D5=WeylCharacterRing("D5",style="coroots") + sage: E6=WeylCharacterRing("E6",style='coroots') + sage: D5=WeylCharacterRing("D5",style='coroots') sage: fw = E6.fundamental_weights() - sage: [E6(fw[i]).branch(D5,rule="levi") for i in [1,2,6]] + sage: [E6(fw[i]).branch(D5,rule='levi') for i in [1,2,6]] [D5(0,0,0,0,0) + D5(0,0,0,0,1) + D5(1,0,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(0,0,0,0,1) + D5(0,1,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(1,0,0,0,0)] - sage: E7=WeylCharacterRing("E7",style="coroots") - sage: A3xA3xA1=WeylCharacterRing("A3xA3xA1",style="coroots") - sage: E7(1,0,0,0,0,0,0).branch(A3xA3xA1,rule="extended") # long time (0.7s) + sage: E7=WeylCharacterRing("E7",style='coroots') + sage: A3xA3xA1=WeylCharacterRing("A3xA3xA1",style='coroots') + sage: E7(1,0,0,0,0,0,0).branch(A3xA3xA1,rule='extended') # long time (0.7s) A3xA3xA1(0,0,1,0,0,1,1) + A3xA3xA1(0,1,0,0,1,0,0) + A3xA3xA1(1,0,0,1,0,0,1) + A3xA3xA1(1,0,1,0,0,0,0) + A3xA3xA1(0,0,0,1,0,1,0) + A3xA3xA1(0,0,0,0,0,0,2) sage: fw = E7.fundamental_weights() - sage: [E7(fw[i]).branch(D6,rule="levi") for i in [1,2,7]] # long time (0.3s) + sage: [E7(fw[i]).branch(D6,rule='levi') for i in [1,2,7]] # long time (0.3s) [3*D6(0,0,0,0,0,0) + 2*D6(0,0,0,0,1,0) + D6(0,1,0,0,0,0), 3*D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0) + 2*D6(0,0,1,0,0,0) + D6(1,0,0,0,1,0), D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0)] - sage: D7=WeylCharacterRing("D7",style="coroots") - sage: E8=WeylCharacterRing("E8",style="coroots") - sage: D7=WeylCharacterRing("D7",style="coroots") - sage: E8(1,0,0,0,0,0,0,0).branch(D7,rule="levi") # long time (7s) + sage: D7=WeylCharacterRing("D7",style='coroots') + sage: E8=WeylCharacterRing("E8",style='coroots') + sage: D7=WeylCharacterRing("D7",style='coroots') + sage: E8(1,0,0,0,0,0,0,0).branch(D7,rule='levi') # long time (7s) 3*D7(0,0,0,0,0,0,0) + 2*D7(0,0,0,0,0,1,0) + 2*D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) + 2*D7(0,0,1,0,0,0,0) + D7(0,0,0,1,0,0,0) + D7(1,0,0,0,0,1,0) + D7(1,0,0,0,0,0,1) + D7(2,0,0,0,0,0,0) - sage: E8(0,0,0,0,0,0,0,1).branch(D7,rule="levi") # long time (0.6s) + sage: E8(0,0,0,0,0,0,0,1).branch(D7,rule='levi') # long time (0.6s) D7(0,0,0,0,0,0,0) + D7(0,0,0,0,0,1,0) + D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) - sage: [F4(fw).branch(B3,rule="levi") for fw in F4.fundamental_weights()] # long time (1s) + sage: [F4(fw).branch(B3,rule='levi') for fw in F4.fundamental_weights()] # long time (1s) [B3(0,0,0) + 2*B3(1/2,1/2,1/2) + 2*B3(1,0,0) + B3(1,1,0), B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 5*B3(1,0,0) + 7*B3(1,1,0) + 3*B3(1,1,1) + 6*B3(3/2,1/2,1/2) + 2*B3(3/2,3/2,1/2) + B3(2,0,0) + 2*B3(2,1,0) + B3(2,1,1), 3*B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 4*B3(1,0,0) + 3*B3(1,1,0) + B3(1,1,1) + 2*B3(3/2,1/2,1/2), 3*B3(0,0,0) + 2*B3(1/2,1/2,1/2) + B3(1,0,0)] - sage: [F4(fw).branch(C3,rule="levi") for fw in F4.fundamental_weights()] # long time (1s) + sage: [F4(fw).branch(C3,rule='levi') for fw in F4.fundamental_weights()] # long time (1s) [3*C3(0,0,0) + 2*C3(1,1,1) + C3(2,0,0), 3*C3(0,0,0) + 6*C3(1,1,1) + 4*C3(2,0,0) + 2*C3(2,1,0) + 3*C3(2,2,0) + C3(2,2,2) + C3(3,1,0) + 2*C3(3,1,1), 2*C3(1,0,0) + 3*C3(1,1,0) + C3(2,0,0) + 2*C3(2,1,0) + C3(2,1,1), 2*C3(1,0,0) + C3(1,1,0)] sage: A1xA1 = WeylCharacterRing("A1xA1") - sage: [A3(hwv).branch(A1xA1,rule="levi") for hwv in A3.fundamental_weights()] + sage: [A3(hwv).branch(A1xA1,rule='levi') for hwv in A3.fundamental_weights()] [A1xA1(1,0,0,0) + A1xA1(0,0,1,0), A1xA1(1,1,0,0) + A1xA1(1,0,1,0) + A1xA1(0,0,1,1), A1xA1(1,1,1,0) + A1xA1(1,0,1,1)] - sage: A1xB1=WeylCharacterRing("A1xB1",style="coroots") - sage: [B3(x).branch(A1xB1,rule="levi") for x in B3.fundamental_weights()] + sage: A1xB1=WeylCharacterRing("A1xB1",style='coroots') + sage: [B3(x).branch(A1xB1,rule='levi') for x in B3.fundamental_weights()] [2*A1xB1(1,0) + A1xB1(0,2), 3*A1xB1(0,0) + 2*A1xB1(1,2) + A1xB1(2,0) + A1xB1(0,2), A1xB1(1,1) + 2*A1xB1(0,1)] @@ -323,14 +323,14 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: [A3(chi).branch(A3,rule="automorphic") for chi in A3.fundamental_weights()] + sage: [A3(chi).branch(A3,rule='automorphic') for chi in A3.fundamental_weights()] [A3(0,0,0,-1), A3(0,0,-1,-1), A3(0,-1,-1,-1)] - sage: [D4(chi).branch(D4,rule="automorphic") for chi in D4.fundamental_weights()] + sage: [D4(chi).branch(D4,rule='automorphic') for chi in D4.fundamental_weights()] [D4(1,0,0,0), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2)] Here is an example with `D_4` triality:: - sage: [D4(chi).branch(D4,rule="triality") for chi in D4.fundamental_weights()] + sage: [D4(chi).branch(D4,rule='triality') for chi in D4.fundamental_weights()] [D4(1/2,1/2,1/2,-1/2), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1,0,0,0)] .. RUBRIC:: Symmetric Type @@ -371,28 +371,28 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: [w.branch(B2,rule="symmetric") for w in [A4(1,0,0,0,0),A4(1,1,0,0,0),A4(1,1,1,0,0),A4(2,0,0,0,0)]] + sage: [w.branch(B2,rule='symmetric') for w in [A4(1,0,0,0,0),A4(1,1,0,0,0),A4(1,1,1,0,0),A4(2,0,0,0,0)]] [B2(1,0), B2(1,1), B2(1,1), B2(0,0) + B2(2,0)] - sage: [A5(w).branch(C3,rule="symmetric") for w in A5.fundamental_weights()] + sage: [A5(w).branch(C3,rule='symmetric') for w in A5.fundamental_weights()] [C3(1,0,0), C3(0,0,0) + C3(1,1,0), C3(1,0,0) + C3(1,1,1), C3(0,0,0) + C3(1,1,0), C3(1,0,0)] - sage: [A5(w).branch(D3,rule="symmetric") for w in A5.fundamental_weights()] + sage: [A5(w).branch(D3,rule='symmetric') for w in A5.fundamental_weights()] [D3(1,0,0), D3(1,1,0), D3(1,1,-1) + D3(1,1,1), D3(1,1,0), D3(1,0,0)] - sage: [D4(x).branch(B3,rule="symmetric") for x in D4.fundamental_weights()] + sage: [D4(x).branch(B3,rule='symmetric') for x in D4.fundamental_weights()] [B3(0,0,0) + B3(1,0,0), B3(1,0,0) + B3(1,1,0), B3(1/2,1/2,1/2), B3(1/2,1/2,1/2)] - sage: [D4(x).branch(G2,rule="symmetric") for x in D4.fundamental_weights()] + sage: [D4(x).branch(G2,rule='symmetric') for x in D4.fundamental_weights()] [G2(0,0,0) + G2(1,0,-1), 2*G2(1,0,-1) + G2(2,-1,-1), G2(0,0,0) + G2(1,0,-1), G2(0,0,0) + G2(1,0,-1)] - sage: [E6(fw).branch(F4,rule="symmetric") for fw in E6.fundamental_weights()] # long time (4s) + sage: [E6(fw).branch(F4,rule='symmetric') for fw in E6.fundamental_weights()] # long time (4s) [F4(0,0,0,0) + F4(0,0,0,1), F4(0,0,0,1) + F4(1,0,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(1,0,0,0) + 2*F4(0,0,1,0) + F4(1,0,0,1) + F4(0,1,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(0,0,0,0) + F4(0,0,0,1)] - sage: E6=WeylCharacterRing("E6",style="coroots") - sage: C4=WeylCharacterRing("C4",style="coroots") + sage: E6=WeylCharacterRing("E6",style='coroots') + sage: C4=WeylCharacterRing("C4",style='coroots') sage: chi = E6(1,0,0,0,0,0); chi.degree() 27 - sage: chi.branch(C4,rule="symmetric") + sage: chi.branch(C4,rule='symmetric') C4(0,1,0,0) .. RUBRIC:: Extended Type @@ -437,60 +437,60 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: [B3(x).branch(D3,rule="extended") for x in B3.fundamental_weights()] + sage: [B3(x).branch(D3,rule='extended') for x in B3.fundamental_weights()] [D3(0,0,0) + D3(1,0,0), D3(1,0,0) + D3(1,1,0), D3(1/2,1/2,-1/2) + D3(1/2,1/2,1/2)] - sage: [G2(w).branch(A2, rule="extended") for w in G2.fundamental_weights()] + sage: [G2(w).branch(A2, rule='extended') for w in G2.fundamental_weights()] [A2(0,0,0) + A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3), A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3) + A2(1,0,-1)] - sage: [F4(fw).branch(B4,rule="extended") for fw in F4.fundamental_weights()] # long time (2s) + sage: [F4(fw).branch(B4,rule='extended') for fw in F4.fundamental_weights()] # long time (2s) [B4(1/2,1/2,1/2,1/2) + B4(1,1,0,0), B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2) + B4(3/2,3/2,1/2,1/2) + B4(2,1,1,0), B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0) + B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2), B4(0,0,0,0) + B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0)] - sage: E6 = WeylCharacterRing("E6", style="coroots") - sage: A2xA2xA2 = WeylCharacterRing("A2xA2xA2",style="coroots") - sage: A5xA1 = WeylCharacterRing("A5xA1",style="coroots") - sage: G2 = WeylCharacterRing("G2", style="coroots") - sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") - sage: F4 = WeylCharacterRing("F4",style="coroots") - sage: A3xA1 = WeylCharacterRing("A3xA1", style="coroots") - sage: A2xA2 = WeylCharacterRing("A2xA2", style="coroots") - sage: A1xC3 = WeylCharacterRing("A1xC3",style="coroots") - sage: E6(1,0,0,0,0,0).branch(A5xA1,rule="extended") # (0.7s) + sage: E6 = WeylCharacterRing("E6", style='coroots') + sage: A2xA2xA2 = WeylCharacterRing("A2xA2xA2",style='coroots') + sage: A5xA1 = WeylCharacterRing("A5xA1",style='coroots') + sage: G2 = WeylCharacterRing("G2", style='coroots') + sage: A1xA1 = WeylCharacterRing("A1xA1", style='coroots') + sage: F4 = WeylCharacterRing("F4",style='coroots') + sage: A3xA1 = WeylCharacterRing("A3xA1", style='coroots') + sage: A2xA2 = WeylCharacterRing("A2xA2", style='coroots') + sage: A1xC3 = WeylCharacterRing("A1xC3",style='coroots') + sage: E6(1,0,0,0,0,0).branch(A5xA1,rule='extended') # (0.7s) A5xA1(0,0,0,1,0,0) + A5xA1(1,0,0,0,0,1) - sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule="extended") # (0.7s) + sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule='extended') # (0.7s) A2xA2xA2(0,1,1,0,0,0) + A2xA2xA2(1,0,0,0,0,1) + A2xA2xA2(0,0,0,1,1,0) - sage: E7 = WeylCharacterRing("E7",style="coroots") - sage: A7 = WeylCharacterRing("A7",style="coroots") - sage: E7(1,0,0,0,0,0,0).branch(A7,rule="extended") + sage: E7 = WeylCharacterRing("E7",style='coroots') + sage: A7 = WeylCharacterRing("A7",style='coroots') + sage: E7(1,0,0,0,0,0,0).branch(A7,rule='extended') A7(0,0,0,1,0,0,0) + A7(1,0,0,0,0,0,1) - sage: D6xA1 = WeylCharacterRing("D6xA1",style="coroots") - sage: E7(1,0,0,0,0,0,0).branch(D6xA1,rule="extended") + sage: D6xA1 = WeylCharacterRing("D6xA1",style='coroots') + sage: E7(1,0,0,0,0,0,0).branch(D6xA1,rule='extended') D6xA1(0,0,0,0,1,0,1) + D6xA1(0,1,0,0,0,0,0) + D6xA1(0,0,0,0,0,0,2) - sage: A5xA2 = WeylCharacterRing("A5xA2",style="coroots") - sage: E7(1,0,0,0,0,0,0).branch(A5xA2,rule="extended") + sage: A5xA2 = WeylCharacterRing("A5xA2",style='coroots') + sage: E7(1,0,0,0,0,0,0).branch(A5xA2,rule='extended') A5xA2(0,0,0,1,0,1,0) + A5xA2(0,1,0,0,0,0,1) + A5xA2(1,0,0,0,1,0,0) + A5xA2(0,0,0,0,0,1,1) - sage: E8 = WeylCharacterRing("E8",style="coroots") - sage: D8 = WeylCharacterRing("D8",style="coroots") - sage: A8 = WeylCharacterRing("A8",style="coroots") - sage: E8(0,0,0,0,0,0,0,1).branch(D8,rule="extended") # long time (0.56s) + sage: E8 = WeylCharacterRing("E8",style='coroots') + sage: D8 = WeylCharacterRing("D8",style='coroots') + sage: A8 = WeylCharacterRing("A8",style='coroots') + sage: E8(0,0,0,0,0,0,0,1).branch(D8,rule='extended') # long time (0.56s) D8(0,0,0,0,0,0,1,0) + D8(0,1,0,0,0,0,0,0) - sage: E8(0,0,0,0,0,0,0,1).branch(A8,rule="extended") # long time (0.73s) + sage: E8(0,0,0,0,0,0,0,1).branch(A8,rule='extended') # long time (0.73s) A8(0,0,0,0,0,1,0,0) + A8(0,0,1,0,0,0,0,0) + A8(1,0,0,0,0,0,0,1) - sage: F4(1,0,0,0).branch(A1xC3,rule="extended") # (0.05s) + sage: F4(1,0,0,0).branch(A1xC3,rule='extended') # (0.05s) A1xC3(1,0,0,1) + A1xC3(2,0,0,0) + A1xC3(0,2,0,0) - sage: G2(0,1).branch(A1xA1, rule="extended") + sage: G2(0,1).branch(A1xA1, rule='extended') A1xA1(2,0) + A1xA1(3,1) + A1xA1(0,2) - sage: F4(0,0,0,1).branch(A2xA2, rule="extended") # (0.4s) + sage: F4(0,0,0,1).branch(A2xA2, rule='extended') # (0.4s) A2xA2(0,1,0,1) + A2xA2(1,0,1,0) + A2xA2(0,0,1,1) - sage: F4(0,0,0,1).branch(A3xA1,rule="extended") # (0.34s) + sage: F4(0,0,0,1).branch(A3xA1,rule='extended') # (0.34s) A3xA1(0,0,0,0) + A3xA1(0,0,1,1) + A3xA1(0,1,0,0) + A3xA1(1,0,0,1) + A3xA1(0,0,0,2) - sage: D4=WeylCharacterRing("D4",style="coroots") - sage: D2xD2=WeylCharacterRing("D2xD2",style="coroots") # We get D4 => A1xA1xA1xA1 by remembering that A1xA1 = D2. - sage: [D4(fw).branch(D2xD2, rule="extended") for fw in D4.fundamental_weights()] + sage: D4=WeylCharacterRing("D4",style='coroots') + sage: D2xD2=WeylCharacterRing("D2xD2",style='coroots') # We get D4 => A1xA1xA1xA1 by remembering that A1xA1 = D2. + sage: [D4(fw).branch(D2xD2, rule='extended') for fw in D4.fundamental_weights()] [D2xD2(1,1,0,0) + D2xD2(0,0,1,1), D2xD2(2,0,0,0) + D2xD2(0,2,0,0) + D2xD2(1,1,1,1) + D2xD2(0,0,2,0) + D2xD2(0,0,0,2), D2xD2(1,0,0,1) + D2xD2(0,1,1,0), @@ -543,31 +543,31 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A5=WeylCharacterRing("A5", style="coroots") - sage: A2xA1=WeylCharacterRing("A2xA1", style="coroots") - sage: [A5(hwv).branch(A2xA1, rule="tensor") for hwv in A5.fundamental_weights()] + sage: A5=WeylCharacterRing("A5", style='coroots') + sage: A2xA1=WeylCharacterRing("A2xA1", style='coroots') + sage: [A5(hwv).branch(A2xA1, rule='tensor') for hwv in A5.fundamental_weights()] [A2xA1(1,0,1), A2xA1(0,1,2) + A2xA1(2,0,0), A2xA1(1,1,1) + A2xA1(0,0,3), A2xA1(1,0,2) + A2xA1(0,2,0), A2xA1(0,1,1)] - sage: B4=WeylCharacterRing("B4",style="coroots") - sage: B1xB1=WeylCharacterRing("B1xB1",style="coroots") - sage: [B4(f).branch(B1xB1,rule="tensor") for f in B4.fundamental_weights()] + sage: B4=WeylCharacterRing("B4",style='coroots') + sage: B1xB1=WeylCharacterRing("B1xB1",style='coroots') + sage: [B4(f).branch(B1xB1,rule='tensor') for f in B4.fundamental_weights()] [B1xB1(2,2), B1xB1(2,0) + B1xB1(2,4) + B1xB1(4,2) + B1xB1(0,2), B1xB1(2,0) + B1xB1(2,2) + B1xB1(2,4) + B1xB1(4,2) + B1xB1(4,4) + B1xB1(6,0) + B1xB1(0,2) + B1xB1(0,6), B1xB1(1,3) + B1xB1(3,1)] - sage: D4=WeylCharacterRing("D4",style="coroots") - sage: C2xC1=WeylCharacterRing("C2xC1",style="coroots") - sage: [D4(f).branch(C2xC1,rule="tensor") for f in D4.fundamental_weights()] + sage: D4=WeylCharacterRing("D4",style='coroots') + sage: C2xC1=WeylCharacterRing("C2xC1",style='coroots') + sage: [D4(f).branch(C2xC1,rule='tensor') for f in D4.fundamental_weights()] [C2xC1(1,0,1), C2xC1(0,1,2) + C2xC1(2,0,0) + C2xC1(0,0,2), C2xC1(1,0,1), C2xC1(0,1,0) + C2xC1(0,0,2)] - sage: C3=WeylCharacterRing("C3",style="coroots") - sage: B1xC1=WeylCharacterRing("B1xC1",style="coroots") - sage: [C3(f).branch(B1xC1,rule="tensor") for f in C3.fundamental_weights()] + sage: C3=WeylCharacterRing("C3",style='coroots') + sage: B1xC1=WeylCharacterRing("B1xC1",style='coroots') + sage: [C3(f).branch(B1xC1,rule='tensor') for f in C3.fundamental_weights()] [B1xC1(2,1), B1xC1(2,2) + B1xC1(4,0), B1xC1(4,1) + B1xC1(0,3)] .. RUBRIC:: Symmetric Power @@ -595,12 +595,12 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A1=WeylCharacterRing("A1",style="coroots") - sage: B3=WeylCharacterRing("B3",style="coroots") - sage: C3=WeylCharacterRing("C3",style="coroots") - sage: [B3(fw).branch(A1,rule="symmetric_power") for fw in B3.fundamental_weights()] + sage: A1=WeylCharacterRing("A1",style='coroots') + sage: B3=WeylCharacterRing("B3",style='coroots') + sage: C3=WeylCharacterRing("C3",style='coroots') + sage: [B3(fw).branch(A1,rule='symmetric_power') for fw in B3.fundamental_weights()] [A1(6), A1(2) + A1(6) + A1(10), A1(0) + A1(6)] - sage: [C3(fw).branch(A1,rule="symmetric_power") for fw in C3.fundamental_weights()] + sage: [C3(fw).branch(A1,rule='symmetric_power') for fw in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] .. RUBRIC:: Miscellaneous @@ -651,53 +651,53 @@ def branch_weyl_character(chi, R, S, rule="default"): sage: G2 = WeylCharacterRing("G2") sage: [fw1, fw2, fw3] = B3.fundamental_weights() - sage: B3(fw1+fw3).branch(G2, rule="miscellaneous") + sage: B3(fw1+fw3).branch(G2, rule='miscellaneous') G2(1,0,-1) + G2(2,-1,-1) + G2(2,0,-2) - sage: E6 = WeylCharacterRing("E6",style="coroots") - sage: G2 = WeylCharacterRing("G2",style="coroots") + sage: E6 = WeylCharacterRing("E6",style='coroots') + sage: G2 = WeylCharacterRing("G2",style='coroots') sage: E6(1,0,0,0,0,0).branch(G2,"miscellaneous") G2(2,0) - sage: A2=WeylCharacterRing("A2",style="coroots") - sage: E6(1,0,0,0,0,0).branch(A2,rule="miscellaneous") + sage: A2=WeylCharacterRing("A2",style='coroots') + sage: E6(1,0,0,0,0,0).branch(A2,rule='miscellaneous') A2(2,2) - sage: E6(0,1,0,0,0,0).branch(A2,rule="miscellaneous") + sage: E6(0,1,0,0,0,0).branch(A2,rule='miscellaneous') A2(1,1) + A2(1,4) + A2(4,1) sage: E6(0,0,0,0,0,2).branch(G2,"miscellaneous") # long time (0.59s) G2(0,0) + G2(2,0) + G2(1,1) + G2(0,2) + G2(4,0) - sage: F4=WeylCharacterRing("F4",style="coroots") - sage: G2xA1=WeylCharacterRing("G2xA1",style="coroots") - sage: F4(0,0,1,0).branch(G2xA1,rule="miscellaneous") + sage: F4=WeylCharacterRing("F4",style='coroots') + sage: G2xA1=WeylCharacterRing("G2xA1",style='coroots') + sage: F4(0,0,1,0).branch(G2xA1,rule='miscellaneous') G2xA1(1,0,0) + G2xA1(1,0,2) + G2xA1(1,0,4) + G2xA1(1,0,6) + G2xA1(0,1,4) + G2xA1(2,0,2) + G2xA1(0,0,2) + G2xA1(0,0,6) - sage: E6 = WeylCharacterRing("E6",style="coroots") - sage: A2xG2 = WeylCharacterRing("A2xG2",style="coroots") - sage: E6(1,0,0,0,0,0).branch(A2xG2,rule="miscellaneous") + sage: E6 = WeylCharacterRing("E6",style='coroots') + sage: A2xG2 = WeylCharacterRing("A2xG2",style='coroots') + sage: E6(1,0,0,0,0,0).branch(A2xG2,rule='miscellaneous') A2xG2(0,1,1,0) + A2xG2(2,0,0,0) - sage: E7=WeylCharacterRing("E7",style="coroots") - sage: G2xC3=WeylCharacterRing("G2xC3",style="coroots") - sage: E7(0,1,0,0,0,0,0).branch(G2xC3,rule="miscellaneous") # long time (1.84s) + sage: E7=WeylCharacterRing("E7",style='coroots') + sage: G2xC3=WeylCharacterRing("G2xC3",style='coroots') + sage: E7(0,1,0,0,0,0,0).branch(G2xC3,rule='miscellaneous') # long time (1.84s) G2xC3(1,0,1,0,0) + G2xC3(1,0,1,1,0) + G2xC3(0,1,0,0,1) + G2xC3(2,0,1,0,0) + G2xC3(0,0,1,1,0) - sage: F4xA1=WeylCharacterRing("F4xA1",style="coroots") + sage: F4xA1=WeylCharacterRing("F4xA1",style='coroots') sage: E7(0,0,0,0,0,0,1).branch(F4xA1,"miscellaneous") F4xA1(0,0,0,1,1) + F4xA1(0,0,0,0,3) - sage: A1xA1=WeylCharacterRing("A1xA1",style="coroots") - sage: E7(0,0,0,0,0,0,1).branch(A1xA1,rule="miscellaneous") + sage: A1xA1=WeylCharacterRing("A1xA1",style='coroots') + sage: E7(0,0,0,0,0,0,1).branch(A1xA1,rule='miscellaneous') A1xA1(2,5) + A1xA1(4,1) + A1xA1(6,3) - sage: A2=WeylCharacterRing("A2",style="coroots") - sage: E7(0,0,0,0,0,0,1).branch(A2,rule="miscellaneous") + sage: A2=WeylCharacterRing("A2",style='coroots') + sage: E7(0,0,0,0,0,0,1).branch(A2,rule='miscellaneous') A2(0,6) + A2(6,0) - sage: G2xA1=WeylCharacterRing("G2xA1",style="coroots") - sage: E7(1,0,0,0,0,0,0).branch(G2xA1,rule="miscellaneous") + sage: G2xA1=WeylCharacterRing("G2xA1",style='coroots') + sage: E7(1,0,0,0,0,0,0).branch(G2xA1,rule='miscellaneous') G2xA1(1,0,4) + G2xA1(0,1,0) + G2xA1(2,0,2) + G2xA1(0,0,2) - sage: E8 = WeylCharacterRing("E8",style="coroots") - sage: G2xF4 = WeylCharacterRing("G2xF4",style="coroots") - sage: E8(0,0,0,0,0,0,0,1).branch(G2xF4,rule="miscellaneous") # long time (0.76s) + sage: E8 = WeylCharacterRing("E8",style='coroots') + sage: G2xF4 = WeylCharacterRing("G2xF4",style='coroots') + sage: E8(0,0,0,0,0,0,0,1).branch(G2xF4,rule='miscellaneous') # long time (0.76s) G2xF4(1,0,0,0,0,1) + G2xF4(0,1,0,0,0,0) + G2xF4(0,0,1,0,0,0) - sage: E8=WeylCharacterRing("E8",style="coroots") - sage: A1xA2=WeylCharacterRing("A1xA2",style="coroots") - sage: E8(0,0,0,0,0,0,0,1).branch(A1xA2,rule="miscellaneous") # long time (0.76s) + sage: E8=WeylCharacterRing("E8",style='coroots') + sage: A1xA2=WeylCharacterRing("A1xA2",style='coroots') + sage: E8(0,0,0,0,0,0,0,1).branch(A1xA2,rule='miscellaneous') # long time (0.76s) A1xA2(2,0,0) + A1xA2(2,2,2) + A1xA2(4,0,3) + A1xA2(4,3,0) + A1xA2(6,1,1) + A1xA2(0,1,1) - sage: B2=WeylCharacterRing("B2",style="coroots") - sage: E8(0,0,0,0,0,0,0,1).branch(B2,rule="miscellaneous") # long time (0.53s) + sage: B2=WeylCharacterRing("B2",style='coroots') + sage: E8(0,0,0,0,0,0,0,1).branch(B2,rule='miscellaneous') # long time (0.53s) B2(0,2) + B2(0,6) + B2(3,2) .. RUBRIC:: A1 maximal subgroups of exceptional groups @@ -713,24 +713,24 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A1=WeylCharacterRing("A1",style="coroots") - sage: G2=WeylCharacterRing("G2",style="coroots") - sage: F4=WeylCharacterRing("F4",style="coroots") - sage: E7=WeylCharacterRing("E7",style="coroots") - sage: E8=WeylCharacterRing("E8",style="coroots") - sage: [G2(f).branch(A1,rule="i") for f in G2.fundamental_weights()] + sage: A1=WeylCharacterRing("A1",style='coroots') + sage: G2=WeylCharacterRing("G2",style='coroots') + sage: F4=WeylCharacterRing("F4",style='coroots') + sage: E7=WeylCharacterRing("E7",style='coroots') + sage: E8=WeylCharacterRing("E8",style='coroots') + sage: [G2(f).branch(A1,rule='i') for f in G2.fundamental_weights()] [A1(6), A1(2) + A1(10)] - sage: F4(1,0,0,0).branch(A1,rule="ii") + sage: F4(1,0,0,0).branch(A1,rule='ii') A1(2) + A1(10) + A1(14) + A1(22) - sage: E7(0,0,0,0,0,0,1).branch(A1,rule="iii") + sage: E7(0,0,0,0,0,0,1).branch(A1,rule='iii') A1(9) + A1(17) + A1(27) - sage: E7(0,0,0,0,0,0,1).branch(A1,rule="iv") + sage: E7(0,0,0,0,0,0,1).branch(A1,rule='iv') A1(5) + A1(11) + A1(15) + A1(21) - sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule="v") # long time (0.6s) + sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule='v') # long time (0.6s) A1(2) + A1(14) + A1(22) + A1(26) + A1(34) + A1(38) + A1(46) + A1(58) - sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule="vi") # long time (0.6s) + sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule='vi') # long time (0.6s) A1(2) + A1(10) + A1(14) + A1(18) + A1(22) + A1(26) + A1(28) + A1(34) + A1(38) + A1(46) - sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule="vii") # long time (0.6s) + sage: E8(0,0,0,0,0,0,0,1).branch(A1,rule='vii') # long time (0.6s) A1(2) + A1(6) + A1(10) + A1(14) + A1(16) + A1(18) + 2*A1(22) + A1(26) + A1(28) + A1(34) + A1(38) .. RUBRIC:: Branching Rules From Plethysms @@ -760,7 +760,7 @@ def branch_weyl_character(chi, R, S, rule="default"): :: - sage: A1=WeylCharacterRing("A1",style="coroots") + sage: A1=WeylCharacterRing("A1",style='coroots') sage: chi=A1([5]) sage: chi.degree() 6 @@ -774,7 +774,7 @@ def branch_weyl_character(chi, R, S, rule="default"): :: - sage: C3 = WeylCharacterRing("C3",style="coroots") + sage: C3 = WeylCharacterRing("C3",style='coroots') sage: sym5rule = branching_rule_from_plethysm(chi,"C3") sage: [C3(hwv).branch(A1,rule=sym5rule) for hwv in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] @@ -785,8 +785,8 @@ def branch_weyl_character(chi, R, S, rule="default"): :: - sage: G2 = WeylCharacterRing("G2",style="coroots") - sage: D7 = WeylCharacterRing("D7",style="coroots") + sage: G2 = WeylCharacterRing("G2",style='coroots') + sage: D7 = WeylCharacterRing("D7",style='coroots') sage: ad=G2(0,1); ad.degree(); ad.frobenius_schur_indicator() 14 1 @@ -829,15 +829,15 @@ def branch_weyl_character(chi, R, S, rule="default"): sage: B2 = WeylCharacterRing("B2") sage: C2 = WeylCharacterRing("C2") - sage: [B2(x).branch(C2, rule="isomorphic") for x in B2.fundamental_weights()] + sage: [B2(x).branch(C2, rule='isomorphic') for x in B2.fundamental_weights()] [C2(1,1), C2(1,0)] - sage: [C2(x).branch(B2, rule="isomorphic") for x in C2.fundamental_weights()] + sage: [C2(x).branch(B2, rule='isomorphic') for x in C2.fundamental_weights()] [B2(1/2,1/2), B2(1,0)] sage: D3 = WeylCharacterRing("D3") sage: A3 = WeylCharacterRing("A3") - sage: [A3(x).branch(D3,rule="isomorphic") for x in A3.fundamental_weights()] + sage: [A3(x).branch(D3,rule='isomorphic') for x in A3.fundamental_weights()] [D3(1/2,1/2,1/2), D3(1,0,0), D3(1/2,1/2,-1/2)] - sage: [D3(x).branch(A3,rule="isomorphic") for x in D3.fundamental_weights()] + sage: [D3(x).branch(A3,rule='isomorphic') for x in D3.fundamental_weights()] [A3(1/2,1/2,-1/2,-1/2), A3(1/4,1/4,1/4,-3/4), A3(3/4,-1/4,-1/4,-1/4)] Here `A_3(x,y,z,w)` can be understood as a representation of `SL(4)`. @@ -853,36 +853,36 @@ def branch_weyl_character(chi, R, S, rule="default"): In cases like this you might prefer ``style="coroots"``:: - sage: A3 = WeylCharacterRing("A3",style="coroots") - sage: D3 = WeylCharacterRing("D3",style="coroots") + sage: A3 = WeylCharacterRing("A3",style='coroots') + sage: D3 = WeylCharacterRing("D3",style='coroots') sage: [D3(fw) for fw in D3.fundamental_weights()] [D3(1,0,0), D3(0,1,0), D3(0,0,1)] - sage: [D3(fw).branch(A3,rule="isomorphic") for fw in D3.fundamental_weights()] + sage: [D3(fw).branch(A3,rule='isomorphic') for fw in D3.fundamental_weights()] [A3(0,1,0), A3(0,0,1), A3(1,0,0)] - sage: D2 = WeylCharacterRing("D2", style="coroots") - sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") - sage: [D2(fw).branch(A1xA1,rule="isomorphic") for fw in D2.fundamental_weights()] + sage: D2 = WeylCharacterRing("D2", style='coroots') + sage: A1xA1 = WeylCharacterRing("A1xA1", style='coroots') + sage: [D2(fw).branch(A1xA1,rule='isomorphic') for fw in D2.fundamental_weights()] [A1xA1(1,0), A1xA1(0,1)] .. RUBRIC:: Branching From a Reducible WeylCharacterRing If the Cartan Type of R is reducible, we may project a character onto any of the components, or any combination of components. The rule to - project on the first component is specified by the string ``"proj1"``, + project on the first component is specified by the string ``'proj1'``, the rule to project on the second component is ``"proj2". To - project on the first and third components, use ``"proj13"`` and so on. + project on the first and third components, use ``'proj13'`` and so on. EXAMPLES:: - sage: A2xG2=WeylCharacterRing("A2xG2",style="coroots") - sage: A2=WeylCharacterRing("A2",style="coroots") - sage: G2=WeylCharacterRing("G2",style="coroots") - sage: A2xG2(1,0,1,0).branch(A2,rule="proj1") + sage: A2xG2=WeylCharacterRing("A2xG2",style='coroots') + sage: A2=WeylCharacterRing("A2",style='coroots') + sage: G2=WeylCharacterRing("G2",style='coroots') + sage: A2xG2(1,0,1,0).branch(A2,rule='proj1') 7*A2(1,0) - sage: A2xG2(1,0,1,0).branch(G2,rule="proj2") + sage: A2xG2(1,0,1,0).branch(G2,rule='proj2') 3*G2(1,0) - sage: A2xA2xG2=WeylCharacterRing("A2xA2xG2",style="coroots") - sage: A2xA2xG2(0,1,1,1,0,1).branch(A2xG2,rule="proj13") + sage: A2xA2xG2=WeylCharacterRing("A2xA2xG2",style='coroots') + sage: A2xA2xG2(0,1,1,1,0,1).branch(A2xG2,rule='proj13') 8*A2xG2(0,1,0,1) A more general way of specifying a branching rule from a reducible type is @@ -895,8 +895,8 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: D4 = WeylCharacterRing("D4",style="coroots") - sage: A1xA1xA1xA1 = WeylCharacterRing("A1xA1xA1xA1",style="coroots") + sage: D4 = WeylCharacterRing("D4",style='coroots') + sage: A1xA1xA1xA1 = WeylCharacterRing("A1xA1xA1xA1",style='coroots') sage: b = branching_rule("D2","A1xA1","isomorphic") sage: br = branching_rule("D4","D2xD2","extended")*branching_rule("D2xD2","A1xA1xA1xA1",[b,b]) sage: [D4(fw).branch(A1xA1xA1xA1,rule=br) for fw in D4.fundamental_weights()] @@ -917,12 +917,12 @@ def branch_weyl_character(chi, R, S, rule="default"): EXAMPLES:: - sage: A3xA2=WeylCharacterRing("A3xA2",style="coroots") - sage: A3=WeylCharacterRing("A3",style="coroots") + sage: A3xA2=WeylCharacterRing("A3xA2",style='coroots') + sage: A3=WeylCharacterRing("A3",style='coroots') sage: chi = A3xA2(0,1,0,1,0) sage: chi.branch(A3,rule=["identity","omit"]) 3*A3(0,1,0) - sage: A2=WeylCharacterRing("A2",style="coroots") + sage: A2=WeylCharacterRing("A2",style='coroots') sage: chi.branch(A2,rule=["omit","identity"]) 6*A2(1,0) @@ -931,12 +931,12 @@ def branch_weyl_character(chi, R, S, rule="default"): branching rule is equivalent to the tensor product, as the example shows:: - sage: G2=WeylCharacterRing("G2",style="coroots") - sage: G2xG2=WeylCharacterRing("G2xG2",style="coroots") - sage: G2=WeylCharacterRing("G2",style="coroots") - sage: G2xG2(1,0,0,1).branch(G2,rule="diagonal") + sage: G2=WeylCharacterRing("G2",style='coroots') + sage: G2xG2=WeylCharacterRing("G2xG2",style='coroots') + sage: G2=WeylCharacterRing("G2",style='coroots') + sage: G2xG2(1,0,0,1).branch(G2,rule='diagonal') G2(1,0) + G2(2,0) + G2(1,1) - sage: G2xG2(1,0,0,1).branch(G2,rule="diagonal") == G2(1,0)*G2(0,1) + sage: G2xG2(1,0,0,1).branch(G2,rule='diagonal') == G2(1,0)*G2(0,1) True .. RUBRIC:: Writing Your Own (Branching) Rules @@ -976,7 +976,7 @@ def rule(x): sage: br = BranchingRule("A3", "C2", lambda x: [x[0]-x[3],x[1]-x[2]], "homemade"); br homemade branching rule A3 => C2 - sage: [A3,C2]=[WeylCharacterRing(x,style="coroots") for x in ["A3","C2"]] + sage: [A3,C2]=[WeylCharacterRing(x,style='coroots') for x in ["A3","C2"]] sage: A3(0,1,0).branch(C2,rule=br) C2(0,0) + C2(0,1) """ @@ -1011,7 +1011,7 @@ class BranchingRule(SageObject): A class for branching rules. """ - def __init__(self, R, S, f, name="default", intermediate_types=[], + def __init__(self, R, S, f, name='default', intermediate_types=[], intermediate_names=[]): """ INPUT: @@ -1035,7 +1035,7 @@ def _repr_(self): sage: branching_rule("E6","F4","symmetric") symmetric branching rule E6 => F4 - sage: b=branching_rule("F4","B3",rule="levi")*branching_rule("B3","G2",rule="miscellaneous"); b + sage: b=branching_rule("F4","B3",rule='levi')*branching_rule("B3","G2",rule='miscellaneous'); b composite branching rule F4 => (levi) B3 => (miscellaneous) G2 """ R_repr = self._R._repr_(compact=True) @@ -1091,7 +1091,7 @@ def __eq__(self, other): sage: b2 = BranchingRule("A2","A2",lambda x: x, "identity map") sage: b1 == b2 False - sage: A2 = WeylCharacterRing("A2",style="coroots") + sage: A2 = WeylCharacterRing("A2",style='coroots') sage: [A2(f).branch(A2,rule=b1) == A2(f).branch(A2,rule=b2) for f in A2.fundamental_weights()] [True, True] """ @@ -1116,7 +1116,7 @@ def __eq__(self, other): def __ne__(self, other): """ - Test inequality + Test inequality. EXAMPLES:: @@ -1131,9 +1131,9 @@ def __mul__(self, other): """ EXAMPLES:: - sage: E6 = WeylCharacterRing("E6",style="coroots") - sage: A5 = WeylCharacterRing("A5",style="coroots") - sage: br = branching_rule("E6","A5xA1",rule="extended")*branching_rule("A5xA1","A5",rule="proj1"); br + sage: E6 = WeylCharacterRing("E6",style='coroots') + sage: A5 = WeylCharacterRing("A5",style='coroots') + sage: br = branching_rule("E6","A5xA1",rule='extended')*branching_rule("A5xA1","A5",rule='proj1'); br composite branching rule E6 => (extended) A5xA1 => (proj1) A5 sage: E6(1,0,0,0,0,0).branch(A5,rule=br) A5(0,0,0,1,0) + 2*A5(1,0,0,0,0) @@ -1269,20 +1269,20 @@ def branch(self, chi, style=None): """ INPUT: - - ``chi`` -- A character of the WeylCharacterRing with Cartan type self.Rtype(). + - ``chi`` -- a character of the WeylCharacterRing with Cartan type self.Rtype() Returns the branched character. EXAMPLES:: - sage: G2=WeylCharacterRing("G2",style="coroots") + sage: G2=WeylCharacterRing("G2",style='coroots') sage: chi=G2(1,1); chi.degree() 64 sage: b=G2.maximal_subgroup("A2"); b extended branching rule G2 => A2 sage: b.branch(chi) A2(0,1) + A2(1,0) + A2(0,2) + 2*A2(1,1) + A2(2,0) + A2(1,2) + A2(2,1) - sage: A2=WeylCharacterRing("A2",style="coroots"); A2 + sage: A2=WeylCharacterRing("A2",style='coroots'); A2 The Weyl Character Ring of Type A2 with Integer Ring coefficients sage: chi.branch(A2,rule=b) A2(0,1) + A2(1,0) + A2(0,2) + 2*A2(1,1) + A2(2,0) + A2(1,2) + A2(2,1) @@ -1295,9 +1295,9 @@ def branch(self, chi, style=None): return chi.branch(S, rule=self) -def branching_rule(Rtype, Stype, rule="default"): +def branching_rule(Rtype, Stype, rule='default'): """ - Creates a branching rule. + Create a branching rule. INPUT: @@ -1306,7 +1306,7 @@ def branching_rule(Rtype, Stype, rule="default"): - ``S`` -- the Weyl Character Ring of `H` - ``rule`` -- a string describing the branching rule as a map from - the weight space of `S` to the weight space of `R`. + the weight space of `S` to the weight space of `R` If the rule parameter is omitted, in some cases, a default rule is supplied. See :func:`~sage.combinat.root_system.branching_rules.branch_weyl_character`. @@ -1319,10 +1319,10 @@ def branching_rule(Rtype, Stype, rule="default"): """ if rule == "plethysm": try: - S = sage.combinat.root_system.weyl_characters.WeylCharacterRing(Stype.split("(")[0], style="coroots") + S = sage.combinat.root_system.weyl_characters.WeylCharacterRing(Stype.split("(")[0], style='coroots') chi = S(eval("("+Stype.split("(")[1])) except Exception: - S = sage.combinat.root_system.weyl_characters.WeylCharacterRing(Stype.split(".")[0], style="coroots") + S = sage.combinat.root_system.weyl_characters.WeylCharacterRing(Stype.split(".")[0], style='coroots') chi = eval("S." + Stype.split(".")[1]) return branching_rule_from_plethysm(chi, Rtype) Rtype = CartanType(Rtype) @@ -1385,24 +1385,24 @@ def br(x): if not Rtype.is_compound(): if Stype.is_compound() and s == r-1: try: - return branching_rule(Rtype, Stype, rule="levi") + return branching_rule(Rtype, Stype, rule='levi') except Exception: pass if Rtype[0] == "A": if Stype[0] == "B" and r == 2*s: - return branching_rule(Rtype, Stype, rule="symmetric") + return branching_rule(Rtype, Stype, rule='symmetric') elif Stype[0] == "C" and r == 2*s-1: - return branching_rule(Rtype, Stype, rule="symmetric") + return branching_rule(Rtype, Stype, rule='symmetric') elif Stype[0] == "D" and r == 2*s-1: - return branching_rule(Rtype, Stype, rule="symmetric") + return branching_rule(Rtype, Stype, rule='symmetric') elif Rtype[0] == "B" and Stype[0] == "D" and r == s: - return branching_rule(Rtype, Stype, rule="extended") + return branching_rule(Rtype, Stype, rule='extended') elif Rtype[0] == "D" and Stype[0] == "B" and r == s+1: - return branching_rule(Rtype, Stype, rule="symmetric") + return branching_rule(Rtype, Stype, rule='symmetric') if s == r-1: try: - return branching_rule(Rtype, Stype, rule="levi") + return branching_rule(Rtype, Stype, rule='levi') except Exception: pass raise ValueError("No default rule found (you must specify the rule)") @@ -1980,7 +1980,7 @@ def branching_rule_from_plethysm(chi, cartan_type, return_matrix=False): of `SL(3)`:: sage: A2 = WeylCharacterRing("A2") - sage: A2 = WeylCharacterRing("A2", style="coroots") + sage: A2 = WeylCharacterRing("A2", style='coroots') sage: ad = A2.adjoint_representation(); ad A2(1,1) sage: ad.degree() @@ -2043,7 +2043,7 @@ def branching_rule_from_plethysm(chi, cartan_type, return_matrix=False): return BranchingRule(ct, chi.parent().cartan_type(), lambda x: tuple(M*vector(x)), "plethysm (along %s)" % chi) -def maximal_subgroups(ct, mode="print_rules"): +def maximal_subgroups(ct, mode='print_rules'): """ Given a classical Cartan type (of rank less than or equal to 8) this prints the Cartan types of maximal subgroups, with a method diff --git a/src/sage/combinat/root_system/cartan_matrix.py b/src/sage/combinat/root_system/cartan_matrix.py index 25728c98345..c57b9c88310 100644 --- a/src/sage/combinat/root_system/cartan_matrix.py +++ b/src/sage/combinat/root_system/cartan_matrix.py @@ -455,7 +455,7 @@ def root_space(self): """ return self.root_system().root_space() - def reflection_group(self, type="matrix"): + def reflection_group(self, type='matrix'): """ Return the reflection group corresponding to ``self``. diff --git a/src/sage/combinat/root_system/cartan_type.py b/src/sage/combinat/root_system/cartan_type.py index e4526d5f079..e6c2b2456cf 100644 --- a/src/sage/combinat/root_system/cartan_type.py +++ b/src/sage/combinat/root_system/cartan_type.py @@ -503,7 +503,7 @@ class CartanTypeFactory(SageObject): def __call__(self, *args): """ - Constructs a Cartan type object. + Construct a Cartan type object. INPUT: @@ -750,11 +750,11 @@ def samples(self, finite=None, affine=None, crystallographic=None): INPUT: - - ``finite`` -- a boolean or ``None`` (default: ``None``) + - ``finite`` -- boolean or ``None`` (default: ``None``) - - ``affine`` -- a boolean or ``None`` (default: ``None``) + - ``affine`` -- boolean or ``None`` (default: ``None``) - - ``crystallographic`` -- a boolean or ``None`` (default: ``None``) + - ``crystallographic`` -- boolean or ``None`` (default: ``None``) The sample contains all the exceptional finite and affine Cartan types, as well as typical representatives of the @@ -943,7 +943,7 @@ class options(GlobalOptions): values=dict(Stembridge="use Stembridge's notation", Kac="use Kac's notation"), case_sensitive=False, - alias=dict(BC="Stembridge", tilde="Stembridge", twisted="Kac")) + alias=dict(BC='Stembridge', tilde='Stembridge', twisted='Kac')) dual_str = dict(default="*", description='The string used for dual Cartan types when printing', checker=lambda char: isinstance(char, str)) @@ -1048,7 +1048,7 @@ def _ascii_art_node(self, label): """ return "O" - def _latex_draw_node(self, x, y, label, position="below=4pt", fill='white'): + def _latex_draw_node(self, x, y, label, position='below=4pt', fill='white'): r""" Draw (possibly marked [crossed out]) circular node ``i`` at the position ``(x,y)`` with node label ``label`` . @@ -1261,7 +1261,7 @@ def marked_nodes(self, marked_nodes): INPUT: - - ``marked_nodes`` -- a list of nodes to mark + - ``marked_nodes`` -- list of nodes to mark EXAMPLES:: @@ -1889,7 +1889,7 @@ def _ascii_art_node(self, label): return self.options('special_node_str') return super()._ascii_art_node(label) - def _latex_draw_node(self, x, y, label, position="below=4pt"): + def _latex_draw_node(self, x, y, label, position='below=4pt'): r""" Draw (possibly marked [crossed out]) circular node ``i`` at the position ``(x,y)`` with node label ``label`` . @@ -1930,7 +1930,7 @@ def is_affine(self): def is_untwisted_affine(self): """ - Return whether ``self`` is untwisted affine + Return whether ``self`` is untwisted affine. A Cartan type is untwisted affine if it is the canonical affine extension of some finite type. Every affine type is @@ -2092,7 +2092,7 @@ def row_annihilator(self, m=None): combination of `\alpha_0, \alpha_1, \ldots, \alpha_n` with nonnegative coefficients (or alternatively, the unique minimal non trivial annihilating linear combination of the rows of the - Cartan matrix with non-negative coefficients). + Cartan matrix with nonnegative coefficients). Throw an error if the existence of uniqueness does not hold @@ -2140,7 +2140,7 @@ def col_annihilator(self): combination of `\alpha^\vee_0, \alpha^\vee, \ldots, \alpha^\vee` with nonnegative coefficients (or alternatively, the unique minimal non trivial annihilating linear combination of the columns of the - Cartan matrix with non-negative coefficients). + Cartan matrix with nonnegative coefficients). Throw an error if the existence or uniqueness does not hold @@ -2171,7 +2171,7 @@ def col_annihilator(self): def c(self): r""" - Returns the family (c_i)_i of integer coefficients defined by + Return the family (c_i)_i of integer coefficients defined by `c_i=max(1, a_i/a^vee_i)` (see e.g. [FSS07]_ p. 3) FIXME: the current implementation assumes that the Cartan @@ -2648,7 +2648,7 @@ def type(self): @cached_method def opposition_automorphism(self): r""" - Return the opposition automorphism + Return the opposition automorphism. The *opposition automorphism* is the automorphism `i \mapsto i^*` of the vertices Dynkin diagram such that, diff --git a/src/sage/combinat/root_system/coxeter_group.py b/src/sage/combinat/root_system/coxeter_group.py index 854e1625b64..0f8fd84fdea 100644 --- a/src/sage/combinat/root_system/coxeter_group.py +++ b/src/sage/combinat/root_system/coxeter_group.py @@ -16,7 +16,7 @@ lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup') -def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=None): +def CoxeterGroup(data, implementation='reflection', base_ring=None, index_set=None): """ Return an implementation of the Coxeter group given by ``data``. @@ -69,46 +69,46 @@ def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=No We now use the ``implementation`` option:: - sage: W = CoxeterGroup(["A",2], implementation="permutation"); W # optional - gap3 + sage: W = CoxeterGroup(["A",2], implementation='permutation'); W # optional - gap3 Permutation Group with generators [(1,4)(2,3)(5,6), (1,3)(2,5)(4,6)] sage: W.category() # optional - gap3 Join of Category of finite enumerated permutation groups and Category of finite Weyl groups and Category of well generated finite irreducible complex reflection groups - sage: W = CoxeterGroup(["A",2], implementation="matrix"); W # needs sage.libs.gap + sage: W = CoxeterGroup(["A",2], implementation='matrix'); W # needs sage.libs.gap Weyl Group of type ['A', 2] (as a matrix group acting on the ambient space) - sage: W = CoxeterGroup(["H",3], implementation="matrix"); W # needs sage.libs.gap sage.rings.number_field + sage: W = CoxeterGroup(["H",3], implementation='matrix'); W # needs sage.libs.gap sage.rings.number_field Finite Coxeter group over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? with Coxeter matrix: [1 3 2] [3 1 5] [2 5 1] - sage: W = CoxeterGroup(["H",3], implementation="reflection"); W # needs sage.libs.gap sage.rings.number_field + sage: W = CoxeterGroup(["H",3], implementation='reflection'); W # needs sage.libs.gap sage.rings.number_field Finite Coxeter group over Number Field in a with defining polynomial x^2 - 5 with a = 2.236067977499790? with Coxeter matrix: [1 3 2] [3 1 5] [2 5 1] - sage: W = CoxeterGroup(["A",4,1], implementation="permutation") # needs sage.libs.gap + sage: W = CoxeterGroup(["A",4,1], implementation='permutation') # needs sage.libs.gap Traceback (most recent call last): ... ValueError: the type must be finite - sage: W = CoxeterGroup(["A",4], implementation="chevie"); W # optional - gap3 + sage: W = CoxeterGroup(["A",4], implementation='chevie'); W # optional - gap3 Irreducible real reflection group of rank 4 and type A4 We use the different options for the "reflection" implementation:: - sage: W = CoxeterGroup(["H",3], implementation="reflection", base_ring=RR); W # needs sage.libs.gap + sage: W = CoxeterGroup(["H",3], implementation='reflection', base_ring=RR); W # needs sage.libs.gap Finite Coxeter group over Real Field with 53 bits of precision with Coxeter matrix: [1 3 2] [3 1 5] [2 5 1] - sage: W = CoxeterGroup([[1,10],[10,1]], implementation="reflection", # needs sage.symbolics + sage: W = CoxeterGroup([[1,10],[10,1]], implementation='reflection', # needs sage.symbolics ....: index_set=['a','b'], base_ring=SR); W Finite Coxeter group over Symbolic Ring with Coxeter matrix: [ 1 10] @@ -144,7 +144,7 @@ def CoxeterGroup(data, implementation="reflection", base_ring=None, index_set=No if not cartan_type.is_finite(): raise ValueError("the type must be finite") if cartan_type.is_crystallographic(): - return WeylGroup(cartan_type, implementation="permutation") + return WeylGroup(cartan_type, implementation='permutation') return ReflectionGroup(cartan_type, index_set=index_set) elif implementation == "matrix": if cartan_type.is_crystallographic(): diff --git a/src/sage/combinat/root_system/coxeter_type.py b/src/sage/combinat/root_system/coxeter_type.py index 88a53e4bd98..10312d7e59d 100644 --- a/src/sage/combinat/root_system/coxeter_type.py +++ b/src/sage/combinat/root_system/coxeter_type.py @@ -69,11 +69,11 @@ def samples(self, finite=None, affine=None, crystallographic=None): INPUT: - - ``finite`` -- a boolean or ``None`` (default: ``None``) + - ``finite`` -- boolean or ``None`` (default: ``None``) - - ``affine`` -- a boolean or ``None`` (default: ``None``) + - ``affine`` -- boolean or ``None`` (default: ``None``) - - ``crystallographic`` -- a boolean or ``None`` (default: ``None``) + - ``crystallographic`` -- boolean or ``None`` (default: ``None``) The sample contains all the exceptional finite and affine Coxeter types, as well as typical representatives of the diff --git a/src/sage/combinat/root_system/dynkin_diagram.py b/src/sage/combinat/root_system/dynkin_diagram.py index 0b815043999..09c6713832c 100644 --- a/src/sage/combinat/root_system/dynkin_diagram.py +++ b/src/sage/combinat/root_system/dynkin_diagram.py @@ -299,7 +299,7 @@ def _repr_(self, compact=False): def _rich_repr_(self, display_manager, **kwds): """ - Rich Output Magic Method + Rich Output Magic Method. Override rich output because :meth:`_repr_` outputs ascii art. The proper fix will be in :issue:`18328`. @@ -323,7 +323,7 @@ def _rich_repr_(self, display_manager, **kwds): def _latex_(self, scale=0.5): r""" - Return a latex representation of this Dynkin diagram + Return a latex representation of this Dynkin diagram. EXAMPLES:: @@ -403,7 +403,7 @@ def __hash__(self): @staticmethod def an_instance(): """ - Returns an example of Dynkin diagram + Return an example of Dynkin diagram. EXAMPLES:: @@ -451,7 +451,7 @@ def cartan_type(self): def rank(self): r""" - Returns the index set for this Dynkin diagram + Return the index set for this Dynkin diagram. EXAMPLES:: @@ -476,7 +476,7 @@ def dynkin_diagram(self): @cached_method def cartan_matrix(self): r""" - Returns the Cartan matrix for this Dynkin diagram + Return the Cartan matrix for this Dynkin diagram. EXAMPLES:: @@ -489,7 +489,7 @@ def cartan_matrix(self): def dual(self): r""" - Returns the dual Dynkin diagram, obtained by reversing all edges. + Return the dual Dynkin diagram, obtained by reversing all edges. EXAMPLES:: @@ -784,9 +784,9 @@ def __getitem__(self, i): def column(self, j): """ - Returns the `j^{th}` column `(a_{i,j})_i` of the + Return the `j^{th}` column `(a_{i,j})_i` of the Cartan matrix corresponding to this Dynkin diagram, as a container - (or iterator) of tuples `(i, a_{i,j})` + (or iterator) of tuples `(i, a_{i,j})`. EXAMPLES:: @@ -799,9 +799,9 @@ def column(self, j): def row(self, i): """ - Returns the `i^{th}` row `(a_{i,j})_j` of the + Return the `i^{th}` row `(a_{i,j})_j` of the Cartan matrix corresponding to this Dynkin diagram, as a container - (or iterator) of tuples `(j, a_{i,j})` + (or iterator) of tuples `(j, a_{i,j})`. EXAMPLES:: diff --git a/src/sage/combinat/root_system/extended_affine_weyl_group.py b/src/sage/combinat/root_system/extended_affine_weyl_group.py index b7c3ae15529..77d53a59418 100644 --- a/src/sage/combinat/root_system/extended_affine_weyl_group.py +++ b/src/sage/combinat/root_system/extended_affine_weyl_group.py @@ -54,11 +54,11 @@ def ExtendedAffineWeylGroup(cartan_type, general_linear=None, **print_options): INPUT: - - ``cartan_type`` -- An affine or finite Cartan type (a finite Cartan type is an + - ``cartan_type`` -- an affine or finite Cartan type (a finite Cartan type is an abbreviation for its untwisted affinization) - - ``general_linear`` -- (default: ``None``) If ``True`` and ``cartan_type`` indicates + - ``general_linear`` -- (default: ``None``) if ``True`` and ``cartan_type`` indicates untwisted type A, returns the universal central extension - - ``print_options`` -- Special instructions for printing elements (see below) + - ``print_options`` -- special instructions for printing elements (see below) .. RUBRIC:: Mnemonics @@ -78,10 +78,10 @@ def ExtendedAffineWeylGroup(cartan_type, general_linear=None, **print_options): - ``print_tuple`` -- ``True`` or ``False`` (default: ``False``) If ``True``, elements are printed `(a,b)`, otherwise as `a * b` - - ``affine`` -- Prefix for simple reflections in the affine Weyl group - - ``classical`` -- Prefix for simple reflections in the classical Weyl group - - ``translation`` -- Prefix for the translation elements - - ``fundamental`` -- Prefix for the elements of the fundamental group + - ``affine`` -- prefix for simple reflections in the affine Weyl group + - ``classical`` -- prefix for simple reflections in the classical Weyl group + - ``translation`` -- prefix for the translation elements + - ``fundamental`` -- prefix for the elements of the fundamental group These options are not mutable. @@ -101,20 +101,20 @@ def ExtendedAffineWeylGroup(cartan_type, general_linear=None, **print_options): .. RUBRIC:: Notation - - `R` -- An irreducible affine root system - - `I` -- Set of nodes of the Dynkin diagram of `R` - - `R_0` -- The classical subsystem of `R` - - `I_0` -- Set of nodes of the Dynkin diagram of `R_0` - - `E` -- Extended affine Weyl group of type `R` - - `W` -- Affine Weyl group of type `R` + - `R` -- an irreducible affine root system + - `I` -- set of nodes of the Dynkin diagram of `R` + - `R_0` -- the classical subsystem of `R` + - `I_0` -- set of nodes of the Dynkin diagram of `R_0` + - `E` -- extended affine Weyl group of type `R` + - `W` -- affine Weyl group of type `R` - `W_0` -- finite (classical) Weyl group (of type `R_0`) - `M` -- translation lattice for `W` - `L` -- translation lattice for `E` - - `F` -- Fundamental subgroup of `E` (the length zero elements) - - `P` -- Finite weight lattice - - `Q` -- Finite root lattice - - `P^\vee` -- Finite coweight lattice - - `Q^\vee` -- Finite coroot lattice + - `F` -- fundamental subgroup of `E` (the length zero elements) + - `P` -- finite weight lattice + - `Q` -- finite root lattice + - `P^\vee` -- finite coweight lattice + - `Q^\vee` -- finite coroot lattice .. RUBRIC:: Translation lattices @@ -345,8 +345,8 @@ def ExtendedAffineWeylGroup(cartan_type, general_linear=None, **print_options): Here is a demonstration of the printing options:: - sage: E = ExtendedAffineWeylGroup(["A",2,1], affine="sx", classical="Sx", - ....: translation="x", fundamental="pix") + sage: E = ExtendedAffineWeylGroup(["A",2,1], affine='sx', classical="Sx", + ....: translation='x', fundamental='pix') sage: PW0 = E.PW0() sage: y = PW0(E.lattice_basis()[1]); y x[Lambdacheck[1]] @@ -1203,7 +1203,7 @@ def simple_reflection(self, i): INPUT: - ``self`` -- a realization of the extended affine Weyl group - - ``i`` -- An affine Dynkin node + - ``i`` -- an affine Dynkin node EXAMPLES:: @@ -1417,11 +1417,11 @@ def apply_simple_projection(self, i, side='right', length_increasing=True): INPUT: - ``self`` -- an element of the extended affine Weyl group - - `i` -- a Dynkin node (index of a simple reflection `s_i`) + - ``i`` -- a Dynkin node (index of a simple reflection `s_i`) - ``side`` -- ``'right'`` or ``'left'`` (default: ``'right'``) according to which side of ``self`` the reflection `s_i` should be multiplied - - ``length_increasing`` -- ``True`` or ``False`` (default ``True``). + - ``length_increasing`` -- ``True`` or ``False`` (default: ``True``). If ``False``, do the above with the word "greater" replaced by "less". EXAMPLES:: @@ -1695,7 +1695,7 @@ def bruhat_le(self, x): INPUT: - ``self`` -- an element of the extended affine Weyl group - - `x` -- another element with the same parent as ``self`` + - ``x`` -- another element with the same parent as ``self`` EXAMPLES:: @@ -1756,14 +1756,14 @@ def action(self, la): EXAMPLES:: - sage: E = ExtendedAffineWeylGroup(['A',2,1], affine="s") + sage: E = ExtendedAffineWeylGroup(['A',2,1], affine='s') sage: x = E.FW().an_element(); x pi[2] * s0*s1*s2 sage: la = E.lattice().an_element(); la 2*Lambdacheck[1] + 2*Lambdacheck[2] sage: x.action(la) 5*Lambdacheck[1] - 3*Lambdacheck[2] - sage: E = ExtendedAffineWeylGroup(['C',2,1], affine="s") + sage: E = ExtendedAffineWeylGroup(['C',2,1], affine='s') sage: x = E.PW0().from_translation(E.lattice_basis()[1]) sage: x.action(E.lattice_basis()[2]) Lambdacheck[1] + Lambdacheck[2] @@ -1788,14 +1788,14 @@ def dual_action(self, la): EXAMPLES:: - sage: E = ExtendedAffineWeylGroup(['A',2,1], affine="s") + sage: E = ExtendedAffineWeylGroup(['A',2,1], affine='s') sage: x = E.FW().an_element(); x pi[2] * s0*s1*s2 sage: la = E.dual_lattice().an_element(); la 2*Lambda[1] + 2*Lambda[2] sage: x.dual_action(la) 5*Lambda[1] - 3*Lambda[2] - sage: E = ExtendedAffineWeylGroup(['C',2,1], affine="s") + sage: E = ExtendedAffineWeylGroup(['C',2,1], affine='s') sage: x = E.PvW0().from_dual_translation(E.dual_lattice_basis()[1]) sage: x.dual_action(E.dual_lattice_basis()[2]) Lambda[1] + Lambda[2] @@ -1835,7 +1835,7 @@ def face_data(self, i): INPUT: - - ``self`` -- An element of the extended affine Weyl group + - ``self`` -- an element of the extended affine Weyl group - ``i`` -- an affine Dynkin node OUTPUT: @@ -2013,7 +2013,7 @@ class ExtendedAffineWeylGroupPW0(GroupSemidirectProduct, BindableClass): INPUT: - - ``E`` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: @@ -2134,7 +2134,7 @@ def has_descent(self, i, side='right', positive=False): INPUT: - - ``i`` -- an index. + - ``i`` -- an index OPTIONAL: @@ -2203,7 +2203,7 @@ class ExtendedAffineWeylGroupW0P(GroupSemidirectProduct, BindableClass): INPUT: - - ``E`` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: @@ -2401,7 +2401,7 @@ class ExtendedAffineWeylGroupWF(GroupSemidirectProduct, BindableClass): INPUT: - - ``E`` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: @@ -2454,7 +2454,7 @@ def simple_reflections(self): EXAMPLES:: - sage: ExtendedAffineWeylGroup(["A",3,1], affine="r").WF().simple_reflections() + sage: ExtendedAffineWeylGroup(["A",3,1], affine='r').WF().simple_reflections() Finite family {0: r0, 1: r1, 2: r2, 3: r3} """ E = self.realization_of() @@ -2487,7 +2487,7 @@ def has_descent(self, i, side='right', positive=False): INPUT: - - `i` -- an affine Dynkin index. + - ``i`` -- an affine Dynkin index OPTIONAL: @@ -2542,7 +2542,7 @@ def action_on_affine_roots(self, beta): EXAMPLES:: - sage: E = ExtendedAffineWeylGroup(['A',2,1], affine="s") + sage: E = ExtendedAffineWeylGroup(['A',2,1], affine='s') sage: x = E.FW().an_element(); x pi[2] * s0*s1*s2 sage: v = RootSystem(['A',2,1]).root_lattice().an_element(); v @@ -2561,7 +2561,7 @@ class ExtendedAffineWeylGroupFW(GroupSemidirectProduct, BindableClass): INPUT: - - ``E`` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: @@ -2733,7 +2733,7 @@ class ExtendedAffineWeylGroupPvW0(GroupSemidirectProduct, BindableClass): INPUT: - - ``E`` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: @@ -2842,11 +2842,11 @@ def has_descent(self, i, side='right', positive=False): INPUT: - - `i` -- an affine Dynkin index + - ``i`` -- an affine Dynkin index OPTIONAL: - - ``side`` -- 'left' or 'right' (default: 'right') + - ``side`` -- 'left' or 'right' (default: ``'right'``) - ``positive`` -- boolean (default: ``False``) EXAMPLES:: @@ -2905,7 +2905,7 @@ class ExtendedAffineWeylGroupW0Pv(GroupSemidirectProduct, BindableClass): INPUT: - - `E` -- A parent with realization in :class:`ExtendedAffineWeylGroup_Class` + - ``E`` -- a parent with realization in :class:`ExtendedAffineWeylGroup_Class` EXAMPLES:: diff --git a/src/sage/combinat/root_system/fundamental_group.py b/src/sage/combinat/root_system/fundamental_group.py index fa8f3137a1e..1f9fc750d3d 100644 --- a/src/sage/combinat/root_system/fundamental_group.py +++ b/src/sage/combinat/root_system/fundamental_group.py @@ -39,7 +39,7 @@ def FundamentalGroupOfExtendedAffineWeylGroup(cartan_type, prefix='pi', - ``cartan_type`` -- a Cartan type that is either affine or finite, with the latter being a shorthand for the untwisted affinization - - ``prefix`` (default: ``'pi'``) -- string that labels the elements of the group + - ``prefix`` -- (default: ``'pi'``) string that labels the elements of the group - ``general_linear`` -- (default: ``None``, meaning ``False``) In untwisted type `A`, if ``True``, use the universal central extension @@ -185,7 +185,7 @@ def FundamentalGroupOfExtendedAffineWeylGroup(cartan_type, prefix='pi', (2, 2, 3) sage: x.act_on_classical_ambient(wt) (2, 3, 2) - sage: w = WeylGroup(F.cartan_type(),prefix="s").an_element(); w + sage: w = WeylGroup(F.cartan_type(),prefix='s').an_element(); w s0*s1*s2 sage: x.act_on_affine_weyl(w) s2*s0*s1 @@ -207,12 +207,12 @@ def FundamentalGroupOfExtendedAffineWeylGroup(cartan_type, prefix='pi', class FundamentalGroupElement(MultiplicativeGroupElement): def __init__(self, parent, x): r""" - This should not be called directly + This should not be called directly. EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: x = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix="f").an_element() + sage: x = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix='f').an_element() sage: TestSuite(x).run() """ if x not in parent.special_nodes(): @@ -227,7 +227,7 @@ def value(self): EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix="f") + sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix='f') sage: F.special_nodes() (0, 1, 2, 3, 4) sage: x = F(4); x @@ -244,7 +244,7 @@ def _repr_(self): EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix="f") + sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1], prefix='f') sage: F(2)^3 # indirect doctest f[1] """ @@ -260,7 +260,7 @@ def __invert__(self): sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',3,1]) sage: F(1).inverse() # indirect doctest pi[3] - sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1], prefix="f") + sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1], prefix='f') sage: F(1).inverse() f[6] """ @@ -295,7 +295,7 @@ def act_on_affine_weyl(self, w): sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['A',3,1]) - sage: W = WeylGroup(F.cartan_type(),prefix="s") + sage: W = WeylGroup(F.cartan_type(),prefix='s') sage: w = W.from_reduced_word([2,3,0]) sage: F(1).act_on_affine_weyl(w).reduced_word() [3, 0, 1] @@ -397,7 +397,7 @@ def leading_support(beta): Q = RootSystem(cartan_type_classical).root_lattice() alpha = Q.simple_roots() omega = RootSystem(cartan_type_classical).weight_lattice().fundamental_weights() - W = Q.weyl_group(prefix="s") + W = Q.weyl_group(prefix='s') for i in self._special_nodes: if i == special_node: continue @@ -514,7 +514,7 @@ def group_generators(self): EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1],prefix="f").group_generators() + sage: FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1],prefix='f').group_generators() Finite family {0: f[0], 1: f[1], 6: f[6]} """ return Family(self.special_nodes(), self) @@ -526,7 +526,7 @@ def __iter__(self): EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1],prefix="f") + sage: F = FundamentalGroupOfExtendedAffineWeylGroup(['E',6,1],prefix='f') sage: [x for x in F] # indirect doctest [f[0], f[1], f[6]] """ @@ -540,7 +540,7 @@ def an_element(self): EXAMPLES:: sage: from sage.combinat.root_system.fundamental_group import FundamentalGroupOfExtendedAffineWeylGroup - sage: FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1],prefix="f").an_element() + sage: FundamentalGroupOfExtendedAffineWeylGroup(['A',4,1],prefix='f').an_element() f[4] """ return self.last() diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py index 1c2e96fdbdc..e8e35e47824 100644 --- a/src/sage/combinat/root_system/hecke_algebra_representation.py +++ b/src/sage/combinat/root_system/hecke_algebra_representation.py @@ -42,9 +42,9 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject): - ``domain`` -- a vector space - ``f`` -- a function ``f(l,i)`` taking a basis element `l` of ``domain`` and an index `i`, and returning `F_i` - - ``cartan_type`` -- The Cartan type of the Hecke algebra - - ``q1``, ``q2`` -- The eigenvalues of the generators `T` of the Hecke algebra - - ``side`` -- "left" or "right" (default: "right") + - ``cartan_type`` -- the Cartan type of the Hecke algebra + - ``q1``, ``q2`` -- the eigenvalues of the generators `T` of the Hecke algebra + - ``side`` -- "left" or "right" (default: ``'right'``) whether this is a left or right representation EXAMPLES:: @@ -75,7 +75,7 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject): sage: from sage.combinat.root_system.hecke_algebra_representation import HeckeAlgebraRepresentation sage: W = SymmetricGroup(3) sage: domain = W.algebra(QQ) - sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side="right")) + sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side='right')) sage: r = HeckeAlgebraRepresentation(domain, action, CartanType(["A",2]), 1, -1) sage: hash(r) # random 3 @@ -85,14 +85,14 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject): - [HST2008]_ """ - def __init__(self, domain, on_basis, cartan_type, q1, q2, q=ZZ.one(), side="right"): + def __init__(self, domain, on_basis, cartan_type, q1, q2, q=ZZ.one(), side='right'): r""" TESTS:: sage: from sage.combinat.root_system.hecke_algebra_representation import HeckeAlgebraRepresentation sage: W = SymmetricGroup(3) sage: domain = W.algebra(QQ) - sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side="right")) + sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side='right')) sage: HeckeAlgebraRepresentation(domain, action, CartanType(["A",2]), 1, -1) A representation of the (1, -1)-Hecke algebra of type ['A', 2] on Symmetric group algebra of order 3 over Rational Field """ @@ -149,7 +149,7 @@ def cartan_type(self): sage: from sage.combinat.root_system.hecke_algebra_representation import HeckeAlgebraRepresentation sage: KW = SymmetricGroup(3).algebra(QQ) - sage: action = lambda x,i: KW.monomial(x.apply_simple_reflection(i, side="right")) + sage: action = lambda x,i: KW.monomial(x.apply_simple_reflection(i, side='right')) sage: H = HeckeAlgebraRepresentation(KW, action, CartanType(["A",2]), 1, -1) sage: H.cartan_type() ['A', 2] @@ -240,7 +240,7 @@ def on_basis(self, x, word, signs=None, scalar=None): sage: from sage.combinat.root_system.hecke_algebra_representation import HeckeAlgebraRepresentation sage: W = SymmetricGroup(3) sage: domain = W.algebra(QQ) - sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side="right")) + sage: action = lambda x,i: domain.monomial(x.apply_simple_reflection(i, side='right')) sage: rho = HeckeAlgebraRepresentation(domain, action, CartanType(["A",2]), 1, -1) sage: rho.on_basis(W.one(), (1,2,1)) @@ -323,10 +323,10 @@ def Tw(self, word, signs=None, scalar=None): INPUT: - - ``word`` -- a word `i_1,\dots,i_k` for some element `w` of the Weyl group. - See :meth:`straighten_word` for how this word can be specified. + - ``word`` -- a word `i_1,\dots,i_k` for some element `w` of the Weyl group + See :meth:`straighten_word` for how this word can be specified - - ``signs`` -- a list `\epsilon_1,\dots,\epsilon_k` of the + - ``signs`` -- list `\epsilon_1,\dots,\epsilon_k` of the same length as ``word`` with `\epsilon_i =\pm 1` or ``None`` for `1,\dots,1` (default: ``None``) @@ -442,7 +442,7 @@ def Tw_inverse(self, word): def _test_relations(self, **options): r""" - Test that this family of operators satisfies the Iwahori Hecke relations + Test that this family of operators satisfies the Iwahori Hecke relations. EXAMPLES:: @@ -827,7 +827,7 @@ def __init__(self, T, T_Y=None, normalized=True): of the generators of an affine Hecke algebra on ``self``. By default, this is ``T``. - - ``normalized`` -- boolean (default: ``True``) whether the + - ``normalized`` -- boolean (default: ``True``); whether the eigenvector `E_\mu` is normalized so that `\mu` has coefficient `1`. diff --git a/src/sage/combinat/root_system/integrable_representations.py b/src/sage/combinat/root_system/integrable_representations.py index a1cb764e19a..72c697192d8 100644 --- a/src/sage/combinat/root_system/integrable_representations.py +++ b/src/sage/combinat/root_system/integrable_representations.py @@ -228,7 +228,7 @@ def __init__(self, Lam): def highest_weight(self): """ - Returns the highest weight of ``self``. + Return the highest weight of ``self``. EXAMPLES:: @@ -821,7 +821,7 @@ def m(self, n): INPUT: - - ``n`` -- a tuple representing a weight `\mu`. + - ``n`` -- a tuple representing a weight `\mu` EXAMPLES:: @@ -864,7 +864,7 @@ def mult(self, mu): sage: L = RootSystem("B3~").weight_lattice(extended=True) sage: Lambda = L.fundamental_weights() sage: delta = L.null_root() - sage: W = L.weyl_group(prefix="s") + sage: W = L.weyl_group(prefix='s') sage: [s0,s1,s2,s3] = W.simple_reflections() sage: V = IntegrableRepresentation(Lambda[0]) sage: V.mult(Lambda[2] - 2*delta) @@ -1031,8 +1031,8 @@ def modular_characteristic(self, mu=None): OPTIONAL: - - ``mu`` -- a weight; or alternatively: - - ``n`` -- a tuple representing a weight `\mu`. + - ``mu`` -- a weight, or alternatively, + - ``n`` -- a tuple representing a weight `\mu` If no optional parameter is specified, this returns `m_\Lambda`. If ``mu`` is specified, it returns `m_{\Lambda,\mu}`. You may @@ -1126,7 +1126,7 @@ def branch(self, i=None, weyl_character_ring=None, sequence=None, depth=5): Thus we have a branching to `\mathfrak{sl}(2) \times \mathfrak{sl}(2) \times \mathfrak{sl}(2)`:: - sage: A1xA1xA1 = WeylCharacterRing("A1xA1xA1",style="coroots") # needs sage.libs.gap + sage: A1xA1xA1 = WeylCharacterRing("A1xA1xA1",style='coroots') # needs sage.libs.gap sage: V.branch(i=2,weyl_character_ring=A1xA1xA1) # needs sage.libs.gap [A1xA1xA1(1,0,0), A1xA1xA1(0,1,2), @@ -1147,7 +1147,7 @@ def branch(self, i=None, weyl_character_ring=None, sequence=None, depth=5): O---O---O=>=O---O 0 1 2 3 4 F4~ - sage: A1xC3=WeylCharacterRing("A1xC3",style="coroots") + sage: A1xC3=WeylCharacterRing("A1xC3",style='coroots') sage: A1xC3.dynkin_diagram() O 1 @@ -1182,7 +1182,7 @@ def branch(self, i=None, weyl_character_ring=None, sequence=None, depth=5): i = self._cartan_type.special_node() if i == self._cartan_type.special_node() or self._cartan_type.type() == 'A': if weyl_character_ring is None: - weyl_character_ring = WeylCharacterRing(self._cartan_type.classical(), style="coroots") + weyl_character_ring = WeylCharacterRing(self._cartan_type.classical(), style='coroots') if weyl_character_ring.cartan_type() != self._cartan_type.classical(): raise ValueError("Cartan type of WeylCharacterRing must be %s" % self.cartan_type().classical()) elif weyl_character_ring is None: diff --git a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py index 69ed9c8f8af..27fcbbf4621 100644 --- a/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +++ b/src/sage/combinat/root_system/non_symmetric_macdonald_polynomials.py @@ -32,15 +32,16 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): r""" - Nonsymmetric Macdonald polynomials + Nonsymmetric Macdonald polynomials. INPUT: - ``KL`` -- an affine Cartan type or the group algebra of a realization of the affine weight lattice - - ``q``, ``q1``, ``q2`` -- parameters in the base ring of the group algebra (default: ``q``, ``q1``, ``q2``) - - ``normalized`` -- a boolean (default: ``True``) - whether to normalize the result to have leading coefficient 1 + - ``q``, ``q1``, ``q2`` -- parameters in the base ring of the group algebra + (default: ``q``, ``q1``, ``q2``) + - ``normalized`` -- boolean (default: ``True``); whether to normalize the + result to have leading coefficient 1 This implementation covers all reduced affine root systems. The polynomials are constructed recursively by the application @@ -943,7 +944,7 @@ class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): Checking T0check:: - sage: T0check_on_basis = KL.T0_check_on_basis(q1,q2, convention="dominant") + sage: T0check_on_basis = KL.T0_check_on_basis(q1,q2, convention='dominant') sage: T0check_on_basis.phi # note: this is in fact a0 phi (2, 0) sage: T0check_on_basis.v # what to match it with? @@ -1314,13 +1315,13 @@ def __classcall__(cls, KL, q='q', q1='q1', q2='q2', normalized=True): def __init__(self, KL, q, q1, q2, normalized): r""" - Initializes the nonsymmetric Macdonald polynomial class. + Initialize the nonsymmetric Macdonald polynomial class. INPUT: - ``KL`` -- algebra over weight space - ``q``, ``q1``, ``q2`` -- parameters - - ``normalized`` -- a boolean (default: ``True``) + - ``normalized`` -- boolean (default: ``True``) whether to normalize the result to have leading coefficient 1 EXAMPLES:: @@ -1349,8 +1350,8 @@ def __init__(self, KL, q, q1, q2, normalized): self._q1 = q1 self._q2 = q2 assert self.L_prime().classical() is self.L().classical() - T = KL.twisted_demazure_lusztig_operators(q1, q2, convention="dominant") - T_Y = KL.demazure_lusztig_operators_on_classical(q, q1, q2, convention="dominant") + T = KL.twisted_demazure_lusztig_operators(q1, q2, convention='dominant') + T_Y = KL.demazure_lusztig_operators_on_classical(q, q1, q2, convention='dominant') CherednikOperatorsEigenvectors.__init__(self, T, T_Y, normalized=normalized) def _repr_(self): @@ -1726,7 +1727,7 @@ def eigenvalue_experimental(self, mu, l): INPUT: - ``mu`` -- the index `\mu` of an eigenvector - - `l` -- an index `\lambda^\vee` of some `Y` + - ``l`` -- an index `\lambda^\vee` of some `Y` .. NOTE:: diff --git a/src/sage/combinat/root_system/pieri_factors.py b/src/sage/combinat/root_system/pieri_factors.py index 28b26d8bf6f..daed26dbb68 100644 --- a/src/sage/combinat/root_system/pieri_factors.py +++ b/src/sage/combinat/root_system/pieri_factors.py @@ -604,7 +604,7 @@ def subset(self, length): INPUT: - - ``length`` -- a non-negative integer + - ``length`` -- a nonnegative integer EXAMPLES:: @@ -892,7 +892,7 @@ def stanley_symm_poly_weight(self, w): # The algorithm="delete" is a workaround when the set of # vertices is empty, in which case subgraph tries another # method which turns out to currently fail with Dynkin diagrams - return DiGraph(DynkinDiagram(w.parent().cartan_type())).subgraph(set(w.reduced_word()), algorithm="delete").connected_components_number() + return DiGraph(DynkinDiagram(w.parent().cartan_type())).subgraph(set(w.reduced_word()), algorithm='delete').connected_components_number() class PieriFactors_type_B_affine(PieriFactors_affine_type): @@ -1001,7 +1001,7 @@ def stanley_symm_poly_weight(self, w): support_complement = set(ct.index_set()).difference(support).difference(set([0, 1])) else: support_complement = set(ct.index_set()).difference(support).difference(set([0])) - return DiGraph(DynkinDiagram(ct)).subgraph(support_complement, algorithm="delete").connected_components_number() - 1 + return DiGraph(DynkinDiagram(ct)).subgraph(support_complement, algorithm='delete').connected_components_number() - 1 class PieriFactors_type_D_affine(PieriFactors_affine_type): diff --git a/src/sage/combinat/root_system/plot.py b/src/sage/combinat/root_system/plot.py index dd450e76da8..5e262b25181 100644 --- a/src/sage/combinat/root_system/plot.py +++ b/src/sage/combinat/root_system/plot.py @@ -73,14 +73,14 @@ `G_2`:: sage: L = RootSystem(["G",2]).ambient_space() - sage: L.plot(reflection_hyperplanes="all") + sage: L.plot(reflection_hyperplanes='all') Graphics object consisting of 21 graphics primitives .. PLOT:: :width: 300 px L = RootSystem(["G",2]).ambient_space() - sphinx_plot(L.plot(reflection_hyperplanes="all")) + sphinx_plot(L.plot(reflection_hyperplanes='all')) The group is now the dihedral group of order 12, generated by the two reflections `s_1` and `s_2`. The picture displays the hyperplanes for @@ -108,7 +108,7 @@ its corresponding reflection hyperplane:: sage: L = RootSystem(["A",2]).weight_space() - sage: L.plot(roots="all", reflection_hyperplanes="all").show(figsize=15) + sage: L.plot(roots='all', reflection_hyperplanes='all').show(figsize=15) .. NOTE:: @@ -120,7 +120,7 @@ :width: 300 px L = RootSystem(["A",2]).weight_space() - sphinx_plot(L.plot(roots="all", reflection_hyperplanes="all")) + sphinx_plot(L.plot(roots='all', reflection_hyperplanes='all')) One can further customize which roots to display, as in the following example showing the positive roots in the @@ -150,7 +150,7 @@ sage: L = RootSystem(["E",8]).ambient_space() sage: L.dimension() 8 - sage: L.plot(roots="all", reflection_hyperplanes=False, # long time + sage: L.plot(roots='all', reflection_hyperplanes=False, # long time ....: projection=lambda v: M*vector(v), labels=False) Graphics3d Object @@ -161,7 +161,7 @@ [0.180913155536, 0., 0.160212955043, 0.160212955043, 0., 0.0990170516545, 0.766360424875, 0.0990170516545], [0.338261212718, 0, 0, -0.338261212718, 0.672816364803, 0.171502564281, 0, -0.171502564281]]) L = RootSystem(["E",8]).ambient_space() - sphinx_plot(L.plot(roots="all", reflection_hyperplanes=False, projection=lambda v: M*vector(v), labels=False)) + sphinx_plot(L.plot(roots='all', reflection_hyperplanes=False, projection=lambda v: M*vector(v), labels=False)) The projection function should be linear or affine, and return a vector with rational coordinates. The rationale for the later @@ -292,14 +292,14 @@ `u = vs_i`; the color of that wall is given by `i`:: sage: L = RootSystem(["C",2,1]).ambient_space() - sage: L.plot(coroots="simple", alcove_labels=True) # long time + sage: L.plot(coroots='simple', alcove_labels=True) # long time Graphics object consisting of 216 graphics primitives .. PLOT:: :width: 300 px L = RootSystem(["C",2,1]).ambient_space() - sphinx_plot(L.plot(coroots="simple", alcove_labels=True)) + sphinx_plot(L.plot(coroots='simple', alcove_labels=True)) Even 2D pictures of the rank `1 + 1` cases can give some food for thought. Here, we draw the root lattice, with the positive roots of @@ -522,15 +522,15 @@ plot_options = L.plot_parse_options(bounding_box=[[-2,5],[-2,6]]) w2 = [2,1,2,0,2,0,2,1,2,0,1,2,1,2,1,0,1,2,0,2,0,1,2,0,2] sphinx_plot(L.plot_alcoves(plot_options=plot_options) - + L.plot_alcove_walk(w1, color="green", plot_options=plot_options) - + L.plot_alcove_walk(w2, color="orange", plot_options=plot_options)) + + L.plot_alcove_walk(w1, color='green', plot_options=plot_options) + + L.plot_alcove_walk(w2, color='orange', plot_options=plot_options)) And another with some foldings:: sage: p += L.plot_alcove_walk([0,1,2,0,2,0,1,2,0,1], ....: foldings=[False, False, True, False, False, ....: False, True, False, True, False], - ....: color="purple") + ....: color='purple') sage: p.axes(False) sage: p.show(figsize=20) @@ -542,11 +542,11 @@ plot_options = L.plot_parse_options(bounding_box=[[-2,5],[-2,6]]) w2 = [2,1,2,0,2,0,2,1,2,0,1,2,1,2,1,0,1,2,0,2,0,1,2,0,2] p = L.plot_alcoves(plot_options=plot_options) - p += L.plot_alcove_walk(w1, color="green", plot_options=plot_options) - p += L.plot_alcove_walk(w2, color="orange", plot_options=plot_options) + p += L.plot_alcove_walk(w1, color='green', plot_options=plot_options) + p += L.plot_alcove_walk(w2, color='orange', plot_options=plot_options) p += L.plot_alcove_walk([0,1,2,0,2,0,1,2,0,1], foldings=[False, False, True, False, False, False, True, False, True, False], - color="purple") + color='purple') p.axes(False) sphinx_plot(p) @@ -579,7 +579,7 @@ walk = L.reduced_word_of_translation(L(t)) plot_options = L.plot_parse_options(bounding_box=[[-2,5],[-2,5]]) p = L.plot(plot_options=plot_options) # long time - p += L.plot_alcove_walk(walk, color="green", plot_options=plot_options) + p += L.plot_alcove_walk(walk, color='green', plot_options=plot_options) p += plot_options.family_of_vectors({t: L(t)}) plot_options.finalize(p) sphinx_plot(p) @@ -649,7 +649,7 @@ sage: L = RootSystem(["C",2,1]).ambient_space() sage: p = L.plot(bounding_box=[[-8,9],[-5,7]], # long time (10 s) - ....: coroots="simple") + ....: coroots='simple') sage: p # long time Graphics object consisting of ... graphics primitives @@ -657,7 +657,7 @@ :width: 300 px L = RootSystem(["C",2,1]).ambient_space() - sphinx_plot(L.plot(bounding_box=[[-8,9],[-5,7]], coroots="simple")) + sphinx_plot(L.plot(bounding_box=[[-8,9],[-5,7]], coroots='simple')) By default Sage's plot are bitmap pictures which would come out ugly if printed on paper. Instead, we recommend saving the picture in @@ -688,7 +688,7 @@ sage: rho = L.rho() sage: plot_options = L.plot_parse_options() sage: W = L.weyl_group() - sage: g = W.cayley_graph(side="right") + sage: g = W.cayley_graph(side='right') sage: positions = {w: plot_options.projection(w.action(rho)) for w in W} sage: p = L.plot_alcoves() sage: p += g.plot(pos=positions, vertex_size=0, @@ -704,7 +704,7 @@ rho = L.rho() plot_options = L.plot_parse_options() W = L.weyl_group() - g = W.cayley_graph(side="right") + g = W.cayley_graph(side='right') positions = {w: plot_options.projection(w.action(rho)) for w in W} p = L.plot_alcoves() p += g.plot(pos = positions, vertex_size=0, color_by_label=plot_options.color) @@ -719,7 +719,7 @@ sage: rho = L.rho() sage: plot_options = L.plot_parse_options() sage: W = L.weyl_group() - sage: g = W.cayley_graph(side="right") + sage: g = W.cayley_graph(side='right') sage: positions = {w: plot_options.projection(w.action(rho)) for w in W} sage: p = L.plot_roots() sage: p += g.plot3d(pos3d=positions, color_by_label=plot_options.color) @@ -733,7 +733,7 @@ rho = L.rho() plot_options = L.plot_parse_options() W = L.weyl_group() - g = W.cayley_graph(side="right") + g = W.cayley_graph(side='right') positions = {w: plot_options.projection(w.action(rho)) for w in W} sphinx_plot(L.plot_roots() + g.plot3d(pos3d=positions, color_by_label=plot_options.color)) @@ -973,7 +973,7 @@ def in_bounding_box(self, x): def text(self, label, position, rgbcolor=(0,0,0)): r""" - Return text widget with label ``label`` at position ``position`` + Return text widget with label ``label`` at position ``position``. INPUT: @@ -1332,7 +1332,7 @@ def family_of_vectors(self, vectors): G += self.text(i, 1.05*head) return self.finalize(G) - def cone(self, rays=[], lines=[], color="black", thickness=1, alpha=1, wireframe=False, + def cone(self, rays=[], lines=[], color='black', thickness=1, alpha=1, wireframe=False, label=None, draw_degenerate=True, as_polyhedron=False): r""" Return the cone generated by the given rays and lines. @@ -1342,21 +1342,21 @@ def cone(self, rays=[], lines=[], color="black", thickness=1, alpha=1, wireframe - ``rays``, ``lines`` -- lists of elements of the root lattice realization (default: ``[]``) - - ``color`` -- a color (default: ``"black"``) + - ``color`` -- a color (default: ``'black'``) - ``alpha`` -- a number in the interval `[0, 1]` (default: `1`) the desired transparency - - ``label`` -- an object to be used as the label for this cone. + - ``label`` -- an object to be used as the label for this cone The label itself will be constructed by calling :func:`~sage.misc.latex.latex` or :func:`repr` on the object depending on the graphics backend. - - ``draw_degenerate`` -- a boolean (default: ``True``) + - ``draw_degenerate`` -- boolean (default: ``True``) whether to draw cones with a degenerate intersection with the bounding box - - ``as_polyhedron`` -- a boolean (default: ``False``) + - ``as_polyhedron`` -- boolean (default: ``False``) whether to return the result as a polyhedron, without clipping it to the bounding box, and without making a plot out of it (for testing purposes) diff --git a/src/sage/combinat/root_system/reflection_group_c.pyx b/src/sage/combinat/root_system/reflection_group_c.pyx index dbfc76282f8..2f2c1b43aaf 100644 --- a/src/sage/combinat/root_system/reflection_group_c.pyx +++ b/src/sage/combinat/root_system/reflection_group_c.pyx @@ -43,7 +43,7 @@ cdef class Iterator(): sage: from sage.combinat.root_system.reflection_group_c import Iterator sage: W = ReflectionGroup(["B", 4]) # optional - gap3 sage: I = Iterator(W, W.number_of_reflections()) # optional - gap3 - sage: TestSuite(I).run(skip="_test_pickling") # optional - gap3 + sage: TestSuite(I).run(skip='_test_pickling') # optional - gap3 """ cdef tuple S = self.S cdef int n = len(S) @@ -62,7 +62,7 @@ cdef class Iterator(): noncom.append(list(range(n))) return noncom - def __init__(self, W, int N, str algorithm="depth", bint tracking_words=True, + def __init__(self, W, int N, str algorithm='depth', bint tracking_words=True, order=None): """ Initialize ``self``. @@ -72,7 +72,7 @@ cdef class Iterator(): sage: from sage.combinat.root_system.reflection_group_c import Iterator sage: W = ReflectionGroup(["B", 4]) # optional - gap3 sage: I = Iterator(W, W.number_of_reflections()) # optional - gap3 - sage: TestSuite(I).run(skip="_test_pickling") # optional - gap3 + sage: TestSuite(I).run(skip='_test_pickling') # optional - gap3 """ self.S = tuple(W.simple_reflections()) self.n = len(W._index_set) @@ -189,7 +189,7 @@ cdef class Iterator(): EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import Iterator - sage: W = CoxeterGroup(['B',2], implementation="permutation") + sage: W = CoxeterGroup(['B',2], implementation='permutation') sage: I = Iterator(W, W.number_of_reflections()) sage: list(I.iter_depth()) [(), @@ -225,7 +225,7 @@ cdef class Iterator(): EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import Iterator - sage: W = CoxeterGroup(['B',2], implementation="permutation") + sage: W = CoxeterGroup(['B',2], implementation='permutation') sage: I = Iterator(W, W.number_of_reflections()) sage: for w in I.iter_words_depth(): w._reduced_word [] @@ -265,7 +265,7 @@ cdef class Iterator(): EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import Iterator - sage: W = CoxeterGroup(['B',2], implementation="permutation") + sage: W = CoxeterGroup(['B',2], implementation='permutation') sage: I = Iterator(W, W.number_of_reflections()) sage: list(I.iter_breadth()) [(), @@ -301,7 +301,7 @@ cdef class Iterator(): EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import Iterator - sage: W = CoxeterGroup(['B',2], implementation="permutation") + sage: W = CoxeterGroup(['B',2], implementation='permutation') sage: I = Iterator(W, W.number_of_reflections()) sage: for w in I.iter_words_breadth(): w._reduced_word [] @@ -344,7 +344,7 @@ cdef class Iterator(): EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import Iterator - sage: W = CoxeterGroup(['B',2], implementation="permutation") + sage: W = CoxeterGroup(['B',2], implementation='permutation') sage: I = Iterator(W, W.number_of_reflections()) sage: sorted(I.iter_parabolic()) [(), @@ -468,7 +468,7 @@ cpdef PermutationGroupElement reduce_in_coset(PermutationGroupElement w, tuple S EXAMPLES:: sage: from sage.combinat.root_system.reflection_group_c import reduce_in_coset - sage: W = CoxeterGroup(['B',3], implementation="permutation") + sage: W = CoxeterGroup(['B',3], implementation='permutation') sage: N = W.number_of_reflections() sage: s = W.simple_reflections() sage: w = s[2] * s[1] * s[3] @@ -545,7 +545,7 @@ def parabolic_iteration_application(W, f): EXAMPLES:: - sage: W = CoxeterGroup(['E',6], implementation="permutation") + sage: W = CoxeterGroup(['E',6], implementation='permutation') sage: from sage.combinat.root_system.reflection_group_c import parabolic_iteration_application sage: lst = [] sage: def f(x): @@ -564,7 +564,7 @@ def parabolic_iteration_application(W, f): cpdef list reduced_word_c(W, PermutationGroupElement w): r""" - Computes a reduced word for the element ``w`` in the + Compute a reduced word for the element ``w`` in the reflection group ``W`` in the positions ``range(n)``. EXAMPLES::