From 49ae09d68c23ecf4f94332187d2560144bcb6f50 Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Tue, 5 Aug 2014 17:27:14 +0200 Subject: [PATCH 1/6] trac #16766: Improve the doc of combinat/designs/ --- src/doc/en/reference/combinat/designs.rst | 26 ++++++--- src/sage/combinat/designs/bibd.py | 44 ++++++++------- src/sage/combinat/designs/block_design.py | 3 +- src/sage/combinat/designs/design_catalog.py | 22 ++++---- .../combinat/designs/difference_family.py | 19 +++++++ src/sage/combinat/designs/ext_rep.py | 16 ++++-- .../combinat/designs/incidence_structures.py | 34 +++++++++--- src/sage/combinat/designs/latin_squares.py | 26 ++++++--- .../combinat/designs/orthogonal_arrays.py | 54 +++++++++++++++---- .../designs/orthogonal_arrays_recursive.py | 8 ++- 10 files changed, 180 insertions(+), 72 deletions(-) diff --git a/src/doc/en/reference/combinat/designs.rst b/src/doc/en/reference/combinat/designs.rst index 9fbb579f291..eb2181fac16 100644 --- a/src/doc/en/reference/combinat/designs.rst +++ b/src/doc/en/reference/combinat/designs.rst @@ -1,26 +1,40 @@ Designs and Incidence Structures ================================ +All designs can be accessed by ``designs.`` and are listed in +the design catalog: + .. toctree:: :maxdepth: 1 - ../sage/combinat/designs/covering_design - ../sage/combinat/designs/ext_rep - ../sage/combinat/designs/incidence_structures ../sage/combinat/designs/design_catalog -Constructions -------------- +**Design-related classes** + +.. toctree:: + :maxdepth: 1 + + ../sage/combinat/designs/incidence_structures + ../sage/combinat/designs/covering_design + +**Constructions** .. toctree:: :maxdepth: 1 ../sage/combinat/designs/block_design ../sage/combinat/designs/bibd - ../sage/combinat/designs/steiner_quadruple_systems ../sage/combinat/designs/latin_squares ../sage/combinat/designs/orthogonal_arrays ../sage/combinat/designs/orthogonal_arrays_recursive ../sage/combinat/designs/difference_family + ../sage/combinat/designs/steiner_quadruple_systems ../sage/combinat/designs/database +**Technical things** + +.. toctree:: + :maxdepth: 1 + + ../sage/combinat/designs/ext_rep + ../sage/combinat/designs/designs_pyx diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index 238254209e1..0185dcd962f 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -1,27 +1,34 @@ r""" Balanced Incomplete Block Designs (BIBD) -This module implements two constructions of Balanced Incomplete Block Designs: +This module gathers everything related to Balanced Incomplete Block Designs. One can build a +BIBD (or check that it can be built) with :func:`balanced_incomplete_block_design`:: -* Steiner Triple Systems, i.e. `(v,3,1)`-BIBD. -* `K_4`-decompositions of `K_v`, i.e. `(v,4,1)`-BIBD. + sage: designs.balanced_incomplete_block_design(7,3) -These BIBD can be obtained through the :func:`balanced_incomplete_block_design` -method, available in Sage as ``designs.balanced_incomplete_block_design``. +In particular, Sage can build a `(v,k,1)`-BIBD when one exists for all `k\leq +5`. The following functions are available: -EXAMPLES:: +It defines the following functions: + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :func:`balanced_incomplete_block_design` | Returns a BIBD of parameters `v,k`. + :func:`BIBD_from_TD` | Returns a BIBD through TD-based constructions. + :func:`BIBD_from_difference_family` | Return the BIBD associated to the difference family ``D`` on the group ``G``. + :func:`BIBD_from_PBD` | Returns a `(v,k,1)`-BIBD from a `(r,K)`-PBD where `r=(v-1)/(k-1)`. + :func:`PBD_from_TD` | Returns a `(kt,\{k,t\})`-PBD if `u=0` and a `(kt+u,\{k,k+1,t,u\})`-PBD otherwise. + :func:`steiner_triple_system` | Returns a Steiner Triple System. + :func:`v_5_1_BIBD` | Returns a `(v,5,1)`-BIBD. + :func:`v_4_1_BIBD` | Returns a `(v,4,1)`-BIBD. + :func:`PBD_4_5_8_9_12` | Returns a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. + :func:`BIBD_5q_5_for_q_prime_power` | Returns a `(5q,5,1)`-BIBD with `q\equiv 1\pmod 4` a prime power. - sage: designs.balanced_incomplete_block_design(7,3) - Incidence structure with 7 points and 7 blocks - sage: designs.balanced_incomplete_block_design(7,3).blocks() - [[0, 1, 3], [0, 2, 4], [0, 5, 6], [1, 2, 6], [1, 4, 5], [2, 3, 5], [3, 4, 6]] - sage: designs.balanced_incomplete_block_design(13,4).blocks() - [[0, 1, 2, 12], [0, 3, 6, 9], [0, 4, 8, 10], [0, 5, 7, 11], [1, 3, 8, 11], - [1, 4, 7, 9], [1, 5, 6, 10], [2, 3, 7, 10], [2, 4, 6, 11], [2, 5, 8, 9], - [3, 4, 5, 12], [6, 7, 8, 12], [9, 10, 11, 12]] -`K_4`-decompositions of `K_v` ------------------------------ +**Construction of BIBD when** `k=4` Decompositions of `K_v` into `K_4` (i.e. `(v,4,1)`-BIBD) are built following Douglas Stinson's construction as presented in [Stinson2004]_ page 167. It is @@ -30,8 +37,7 @@ can always be transformed into a `((k-1)v+1,4,1)`-BIBD, which covers all possible cases of `(v,4,1)`-BIBD. -`K_5`-decompositions of `K_v` ------------------------------ +**Construction of BIBD when** `k=5` Decompositions of `K_v` into `K_4` (i.e. `(v,4,1)`-BIBD) are built following Clayton Smith's construction [ClaytonSmith]_. @@ -796,7 +802,7 @@ def _relabel_bibd(B,n,p=None): def PBD_4_5_8_9_12(v, check=True): """ - Returns a `(v,\{4,5,8,9,12\})-`PBD on `v` elements. + Returns a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. A `(v,\{4,5,8,9,12\})`-PBD exists if and only if `v\equiv 0,1 \pmod 4`. The construction implemented here appears page 168 in [Stinson2004]_. diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index b11b7e86ed5..da7356ef0d7 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -3,8 +3,7 @@ A *block design* is a set together with a family of subsets (repeated subsets are allowed) whose members are chosen to satisfy some set of properties that are -deemed useful for a particular application. See :wikipedia:`Block_design`. It is -an object equivalent to an incidence structure. +deemed useful for a particular application. See :wikipedia:`Block_design`. REFERENCES: diff --git a/src/sage/combinat/designs/design_catalog.py b/src/sage/combinat/designs/design_catalog.py index ffa0fdeecfa..e98f1a18a56 100644 --- a/src/sage/combinat/designs/design_catalog.py +++ b/src/sage/combinat/designs/design_catalog.py @@ -1,9 +1,8 @@ r""" Catalog of designs -This module gathers all designs that can be reached from a Sage sessions -through the ``designs`` objects. In order to create the Witt design on 24 points -it is sufficient to type:: +This module gathers all designs that can be reached through +``designs.``. Example with the the Witt design on 24 points:: sage: designs.WittDesign(24) # optional - gap_packages Incidence structure with 24 points and 759 blocks @@ -13,13 +12,11 @@ sage: designs.steiner_triple_system(19) Incidence structure with 19 points and 57 blocks -Online database -- Jolla Covering Repository (LJCR) : +**La Jolla Covering Repository** -There exists an online database of the best known covering designs, the La Jolla -Covering Repository (LJCR), available at [1]_. As it is over 60MB and changes -frequently that database is not included in Sage, but one can obtain individual -coverings and block designs from the LJCR using the method -:meth:`designs.best_known_covering_design_from_LJCR +The La Jolla Covering Repository (LJCR, see [1]_) is an online database of +covering designs. As it is frequently updated, it is not included in Sage, but +one can query it through :meth:`designs.best_known_covering_design_from_LJCR `:: sage: C = designs.best_known_covering_design_from_LJCR(7, 3, 2) # optional - internet @@ -31,7 +28,9 @@ sage: C.incidence_structure() # optional - internet Incidence structure with 7 points and 7 blocks -Currently, this module gathers the following designs : +**Design constructors** + +This module gathers the following designs : .. csv-table:: :class: contentstable @@ -40,7 +39,7 @@ :meth:`~sage.combinat.designs.block_design.ProjectiveGeometryDesign` :meth:`~sage.combinat.designs.block_design.DesarguesianProjectivePlaneDesign` - :meth:`~sage.combinat.designs.bibd.BalancedIncompleteBlockDesign` + :meth:`~sage.combinat.designs.bibd.balanced_incomplete_block_design` :meth:`~sage.combinat.designs.block_design.AffineGeometryDesign` :meth:`~sage.combinat.designs.block_design.WittDesign` :meth:`~sage.combinat.designs.block_design.HadamardDesign` @@ -48,6 +47,7 @@ :meth:`~sage.combinat.designs.latin_squares.mutually_orthogonal_latin_squares` :meth:`~sage.combinat.designs.orthogonal_arrays.transversal_design` :meth:`~sage.combinat.designs.orthogonal_arrays.orthogonal_array` + :meth:`~sage.combinat.designs.orthogonal_arrays.incomplete_orthogonal_array` :meth:`~sage.combinat.designs.bibd.steiner_triple_system` :meth:`~sage.combinat.designs.steiner_quadruple_systems.steiner_quadruple_system` :meth:`~sage.combinat.designs.block_design.projective_plane` diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index 17736d94a05..adbfa04e088 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -1,10 +1,29 @@ r""" Difference families +This module gathers everything related to difference families. One can build a +difference family (or check that it can be built) with :func:`difference_family`:: + + sage: OA = designs.difference_family(7,4,1) + +It defines the following functions: + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :func:`is_difference_family` | Return a (``k``, ``l``)-difference family on an Abelian group of size ``v``. + :func:`singer_difference_set` | Return a difference set associated to hyperplanes in a projective space. + :func:`difference_family` | Return a (``k``, ``l``)-difference family on an Abelian group of size ``v``. + REFERENCES: .. [Wi72] R. M. Wilson "Cyclotomy and difference families in elementary Abelian groups", J. of Num. Th., 4 (1972), pp. 17-47. + +Functions +--------- """ #***************************************************************************** # Copyright (C) 2014 Vincent Delecroix <20100.delecroix@gmail.com> diff --git a/src/sage/combinat/designs/ext_rep.py b/src/sage/combinat/designs/ext_rep.py index 1e0b1e75c8e..ba4ece869b2 100644 --- a/src/sage/combinat/designs/ext_rep.py +++ b/src/sage/combinat/designs/ext_rep.py @@ -1,4 +1,4 @@ -""" +r""" External Representations of Block Designs The "ext_rep" module is an API to the abstract tree represented by @@ -14,10 +14,16 @@ .. [D2009] P. Dobcsanyi et al. DesignTheory.org http://designtheory.org/database/ -TODO: The XML data from the designtheory.org database contains a wealth -of information about things like automorphism groups, transitivity, -cycle type representatives, etc, but none of this data is made -available through the current implementation. +.. TODO:: + + The XML data from the designtheory.org database contains a wealth of + information about things like automorphism groups, transitivity, cycle type + representatives, etc, but none of this data is made available through the + current implementation. + +Functions +--------- + """ ########################################################################### diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index 40f7033ac04..fa3fe0d35c9 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -1,8 +1,29 @@ -""" +r""" Incidence structures (i.e. hypergraphs, i.e. set systems) -An incidence structure is specified by a list of points, blocks, and -an incidence matrix ([1]_, [2]_). +An incidence structure is specified by a list of points, blocks, or an incidence +matrix ([1]_, [2]_). :class:`IncidenceStructure` instances have the following methods: + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`~IncidenceStructure.ground_set` | Return the ground set (i.e the list of points). + :meth:`~IncidenceStructure.num_points` | Returns the size of the ground set. + :meth:`~IncidenceStructure.num_blocks` | Returns the number of blocks. + :meth:`~IncidenceStructure.blocks` | Return the list of blocks. + :meth:`~IncidenceStructure.block_sizes` | Return the set of block sizes. + :meth:`~IncidenceStructure.degree` | Returns the degree of a point ``p`` + :meth:`~IncidenceStructure.is_connected` | Test whether the design is connected. + :meth:`~IncidenceStructure.is_simple` | Test whether this design is simple (i.e. no repeated block). + :meth:`~IncidenceStructure.incidence_matrix` | Return the incidence matrix `A` of the design + :meth:`~IncidenceStructure.incidence_graph` | Returns the incidence graph of the design + :meth:`~IncidenceStructure.packing` | Returns a maximum packing + :meth:`~IncidenceStructure.is_t_design` | Test whether ``self`` is a `t-(v,k,l)` design. + :meth:`~IncidenceStructure.dual` | Returns the dual design. + :meth:`~IncidenceStructure.automorphism_group` | Returns the automorphism group + :meth:`~IncidenceStructure.edge_coloring` | Returns an optimal edge coloring` REFERENCES: @@ -445,7 +466,7 @@ def ground_set(self, copy=True): def num_points(self): r""" - The number of points in that design. + Returns the size of the ground set. EXAMPLES:: @@ -459,7 +480,7 @@ def num_points(self): def num_blocks(self): r""" - The number of blocks. + Returns the number of blocks. EXAMPLES:: @@ -472,7 +493,8 @@ def num_blocks(self): return len(self._blocks) def blocks(self, copy=True): - """Return the list of blocks. + """ + Return the list of blocks. INPUT: diff --git a/src/sage/combinat/designs/latin_squares.py b/src/sage/combinat/designs/latin_squares.py index 4c06d6359e9..047b31d0721 100644 --- a/src/sage/combinat/designs/latin_squares.py +++ b/src/sage/combinat/designs/latin_squares.py @@ -2,9 +2,8 @@ r""" Mutually Orthogonal Latin Squares (MOLS) -This module gathers Sage's functions related to Mutually Orthogonal Latin -Squares. Its main function is :func:`mutually_orthogonal_latin_squares` which -can be used to generate MOLS:: +The main function of this module is :func:`mutually_orthogonal_latin_squares` +and can be can be used to generate MOLS (or check that they exist):: sage: MOLS = designs.mutually_orthogonal_latin_squares(4,8) @@ -12,10 +11,23 @@ `. If you are only interested by latin squares, see :mod:`~sage.combinat.matrices.latin`. -The following table prints the maximum number of MOLS that Sage can build for -every order `n<600`, similarly to the `table of MOLS -`_ -from the Handbook of Combinatorial Designs 2ed [DesignHandbook]_. +The functions defined here are + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`mutually_orthogonal_latin_squares` | Returns `k` Mutually Orthogonal `n\times n` Latin Squares. + :meth:`are_mutually_orthogonal_latin_squares` | Check that the list ``l`` of matrices in are MOLS. + :meth:`latin_square_product` | Returns the product of two (or more) latin squares. + :meth:`MOLS_table` | Prints the MOLS table. + +**Table of MOLS** + +Sage can produce a table of MOLS similar to the one from the Handbook of +Combinatorial Designs [DesignHandbook]_ (`available here +`_). :: diff --git a/src/sage/combinat/designs/orthogonal_arrays.py b/src/sage/combinat/designs/orthogonal_arrays.py index 94ca0323c7c..8d660df92cc 100644 --- a/src/sage/combinat/designs/orthogonal_arrays.py +++ b/src/sage/combinat/designs/orthogonal_arrays.py @@ -1,8 +1,39 @@ -""" +r""" Orthogonal arrays -This module gathers anything related to orthogonal arrays, and, incidentally, -to transversal designs. +This module gathers everything related to orthogonal arrays (or transversal +designs). One can build an `OA(k,n)` (or check that it can be built) with +:func:`orthogonal_array`:: + + sage: OA = designs.orthogonal_array(4,8) + +It defines the following functions: + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`orthogonal_array` | Return an orthogonal array of parameters `k,n,t`. + :meth:`transversal_design` | Return a transversal design of parameters `k,n`. + :meth:`incomplete_orthogonal_array` | Returns an `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)`. + + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`is_transversal_design` | Check that a given set of blocks ``B`` is a transversal design. + :meth:`~sage.combinat.designs.designs_pyx.is_orthogonal_array` | Check that the integer matrix `OA` is an `OA(k,n,t)`. + :meth:`wilson_construction` | Returns a `OA(k,rm+u)` from a truncated `OA(k+s,r)` by Wilson's construction. + :meth:`TD_product` | Returns the product of two transversal designs. + :meth:`OA_find_disjoint_blocks` | Returns `x` disjoint blocks contained in a given `OA(k,n)`. + :meth:`OA_relabel` | Returns a relabelled version of the OA. + :meth:`OA_from_quasi_difference_matrix` | Returns an Orthogonal Array from a Quasi-Difference matrix + :meth:`OA_from_Vmt` | Returns an Orthogonal Array from a `V(m,t)` + :meth:`OA_from_PBD` | Returns an `OA(k,n)` from a PBD + :meth:`OA_from_wider_OA` | Returns the first `k` columns of `OA`. .. TODO:: @@ -20,6 +51,7 @@ Functions --------- + """ from sage.misc.cachefunc import cached_function from sage.categories.sets_cat import EmptySetError @@ -162,7 +194,7 @@ def transversal_design(k,n,check=True,existence=False): Those two errors correspond respectively to the cases where Sage answer ``Unknown`` or ``False`` when the parameter ``existence`` is set to - ``True``: + ``True``:: sage: designs.transversal_design(47, 100, existence=True) Unknown @@ -170,8 +202,8 @@ def transversal_design(k,n,check=True,existence=False): False If for a given `n` you want to know the largest `k` for which Sage is able - to build a `TD(k,n)` just call the function with `k` set to `None` and - `existence` set to `True` as follows:: + to build a `TD(k,n)` just call the function with `k` set to ``None`` and + ``existence`` set to ``True`` as follows:: sage: designs.transversal_design(None, 6, existence=True) 3 @@ -705,8 +737,8 @@ def orthogonal_array(k,n,t=2,check=True,existence=False): 6 If you ask for an orthogonal array that does not exist, then the function - either raise an `EmptySetError` (if it knows that such an orthogonal array - does not exist) or a `NotImplementedError`:: + either raise an ``EmptySetError`` (if it knows that such an orthogonal array + does not exist) or a ``NotImplementedError``:: sage: designs.orthogonal_array(4,2) Traceback (most recent call last): @@ -1148,7 +1180,7 @@ def OA_relabel(OA,k,n,blocks=tuple(),matrix=None): True Making sure that ``[2,2,2,2]`` is a block of `OA(4,3)`. We do this - by relabelling block ``[0,0,0,0]`` which belongs to the design. + by relabelling block ``[0,0,0,0]`` which belongs to the design:: sage: designs.orthogonal_array(4,3) [[0, 0, 0, 0], [0, 1, 2, 1], [0, 2, 1, 2], [1, 0, 2, 2], [1, 1, 1, 0], [1, 2, 0, 1], [2, 0, 1, 1], [2, 1, 0, 2], [2, 2, 2, 0]] @@ -1356,12 +1388,12 @@ def OA_from_PBD(k,n,PBD, check=True): **Construction** - Let `\\mathcal B` be a `(n,K,1)`-PBD. If there exists for every `i\in K` a + Let `\mathcal B` be a `(n,K,1)`-PBD. If there exists for every `i\in K` a `TD(k,i)-i\times TD(k,1)` (i.e. if there exist `k` idempotent MOLS), then one can obtain a `OA(k,n)` by concatenating: - A `TD(k,i)-i\times TD(k,1)` defined over the elements of `B` for every `B - \in \\mathcal B`. + \in \mathcal B`. - The rows `(i,...,i)` of length `k` for every `i\in [n]`. diff --git a/src/sage/combinat/designs/orthogonal_arrays_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_recursive.py index 757ab5b82eb..62e2d03104e 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_recursive.py @@ -2,9 +2,7 @@ Orthogonal arrays (Recursive constructions) This module implements several functions to find recursive constructions of -:mod:`Orthogonal Arrays ` using -Wilson's construction. To this end, they compute and truncate OA in specific -ways. +:mod:`Orthogonal Arrays `. The main function of this module, i.e. :func:`find_recursive_construction`, queries all implemented recursive constructions of designs. It is used by @@ -131,7 +129,7 @@ def find_wilson_decomposition_with_one_truncated_group(k,n): OUTPUT: - A pair `f,args` such that `f(*args)` is an `OA(k,n)` or ``False`` if no + A pair ``f,args`` such that ``f(*args)`` is an `OA(k,n)` or ``False`` if no decomposition with one truncated block was found. EXAMPLES:: @@ -227,7 +225,7 @@ def find_wilson_decomposition_with_two_truncated_groups(k,n): def simple_wilson_construction(k,r,m,u): r""" - Return an `OA(k,r*m + \sum u_i)` from Wilson construction. + Return an `OA(k,rm + \sum u_i)` from Wilson construction. INPUT: From d626290b67e3d14ceafa817b6c8d0388f232157e Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Tue, 5 Aug 2014 17:34:24 +0200 Subject: [PATCH 2/6] trac #16766: we don t want designs.deprecated_function_alias --- src/sage/combinat/designs/design_catalog.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/combinat/designs/design_catalog.py b/src/sage/combinat/designs/design_catalog.py index e98f1a18a56..03cd1df9119 100644 --- a/src/sage/combinat/designs/design_catalog.py +++ b/src/sage/combinat/designs/design_catalog.py @@ -93,3 +93,6 @@ from sage.misc.superseded import deprecated_function_alias BalancedIncompleteBlockDesign = deprecated_function_alias(16446, balanced_incomplete_block_design) + +# We don't want this to appear in designs. +del deprecated_function_alias From 8f9ee773df53f5d60a2f4400b0aabacaf7a78975 Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Tue, 5 Aug 2014 17:41:50 +0200 Subject: [PATCH 3/6] trac #16766: Broken doctests --- src/sage/combinat/designs/bibd.py | 2 +- src/sage/combinat/designs/difference_family.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index 0185dcd962f..0532e8796a4 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -4,7 +4,7 @@ This module gathers everything related to Balanced Incomplete Block Designs. One can build a BIBD (or check that it can be built) with :func:`balanced_incomplete_block_design`:: - sage: designs.balanced_incomplete_block_design(7,3) + sage: BIBD = designs.balanced_incomplete_block_design(7,3) In particular, Sage can build a `(v,k,1)`-BIBD when one exists for all `k\leq 5`. The following functions are available: diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index adbfa04e088..a926686053a 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -4,7 +4,7 @@ This module gathers everything related to difference families. One can build a difference family (or check that it can be built) with :func:`difference_family`:: - sage: OA = designs.difference_family(7,4,1) + sage: G,F = designs.difference_family(13,4,1) It defines the following functions: From 47cebb3a009164cffd6dd84ee62c6e0544c02147 Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Tue, 5 Aug 2014 18:49:53 +0200 Subject: [PATCH 4/6] trac #16766: Broken doctest --- src/sage/combinat/designs/block_design.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index da7356ef0d7..b0b016d5c11 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -220,7 +220,7 @@ def ProjectiveGeometryDesign(n, d, F, algorithm=None, check=True): if algorithm == "gap": # Requires GAP's Design from sage.interfaces.gap import gap gap.load_package("design") - gap.eval("D := PGPointFlatBlockDesign( %s, %s, %d )"%(n,q,d)) + gap.eval("D := PGPointFlatBlockDesign( %s, %s, %d )"%(n,F.order(),d)) v = eval(gap.eval("D.v")) gblcks = eval(gap.eval("D.blocks")) gB = [] From 6cda4b63625f50133ceedfcd6709933f013ddfda Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Wed, 6 Aug 2014 10:35:20 +0200 Subject: [PATCH 5/6] trac #16766: Git 101: How to create a conflict with 10 others patches in needs_review --- src/sage/combinat/designs/bibd.py | 46 +++---- src/sage/combinat/designs/block_design.py | 6 +- src/sage/combinat/designs/database.py | 116 +++++++++--------- src/sage/combinat/designs/ext_rep.py | 8 +- .../combinat/designs/incidence_structures.py | 30 ++--- src/sage/combinat/designs/latin_squares.py | 10 +- .../combinat/designs/orthogonal_arrays.py | 42 +++---- .../designs/orthogonal_arrays_recursive.py | 14 +-- .../designs/steiner_quadruple_systems.py | 40 +++--- 9 files changed, 156 insertions(+), 156 deletions(-) diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index 0532e8796a4..8f34421ad11 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -16,16 +16,16 @@ :widths: 30, 70 :delim: | - :func:`balanced_incomplete_block_design` | Returns a BIBD of parameters `v,k`. - :func:`BIBD_from_TD` | Returns a BIBD through TD-based constructions. + :func:`balanced_incomplete_block_design` | Return a BIBD of parameters `v,k`. + :func:`BIBD_from_TD` | Return a BIBD through TD-based constructions. :func:`BIBD_from_difference_family` | Return the BIBD associated to the difference family ``D`` on the group ``G``. - :func:`BIBD_from_PBD` | Returns a `(v,k,1)`-BIBD from a `(r,K)`-PBD where `r=(v-1)/(k-1)`. - :func:`PBD_from_TD` | Returns a `(kt,\{k,t\})`-PBD if `u=0` and a `(kt+u,\{k,k+1,t,u\})`-PBD otherwise. - :func:`steiner_triple_system` | Returns a Steiner Triple System. - :func:`v_5_1_BIBD` | Returns a `(v,5,1)`-BIBD. - :func:`v_4_1_BIBD` | Returns a `(v,4,1)`-BIBD. - :func:`PBD_4_5_8_9_12` | Returns a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. - :func:`BIBD_5q_5_for_q_prime_power` | Returns a `(5q,5,1)`-BIBD with `q\equiv 1\pmod 4` a prime power. + :func:`BIBD_from_PBD` | Return a `(v,k,1)`-BIBD from a `(r,K)`-PBD where `r=(v-1)/(k-1)`. + :func:`PBD_from_TD` | Return a `(kt,\{k,t\})`-PBD if `u=0` and a `(kt+u,\{k,k+1,t,u\})`-PBD otherwise. + :func:`steiner_triple_system` | Return a Steiner Triple System. + :func:`v_5_1_BIBD` | Return a `(v,5,1)`-BIBD. + :func:`v_4_1_BIBD` | Return a `(v,4,1)`-BIBD. + :func:`PBD_4_5_8_9_12` | Return a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. + :func:`BIBD_5q_5_for_q_prime_power` | Return a `(5q,5,1)`-BIBD with `q\equiv 1\pmod 4` a prime power. **Construction of BIBD when** `k=4` @@ -60,7 +60,7 @@ def balanced_incomplete_block_design(v,k,existence=False,use_LJCR=False): r""" - Returns a BIBD of parameters `v,k`. + Return a BIBD of parameters `v,k`. A Balanced Incomplete Block Design of parameters `v,k` is a collection `\mathcal C` of `k`-subsets of `V=\{0,\dots,v-1\}` such that for any two @@ -77,7 +77,7 @@ def balanced_incomplete_block_design(v,k,existence=False,use_LJCR=False): - ``v,k`` (integers) - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -244,7 +244,7 @@ def balanced_incomplete_block_design(v,k,existence=False,use_LJCR=False): def steiner_triple_system(n): r""" - Returns a Steiner Triple System + Return a Steiner Triple System A Steiner Triple System (STS) of a set `\{0,...,n-1\}` is a family `S` of 3-sets such that for any `i \not = j` @@ -261,7 +261,7 @@ def steiner_triple_system(n): INPUT: - - ``n`` returns a Steiner Triple System of `\{0,...,n-1\}` + - ``n`` return a Steiner Triple System of `\{0,...,n-1\}` EXAMPLE: @@ -329,13 +329,13 @@ def steiner_triple_system(n): def BIBD_from_TD(v,k,existence=False): r""" - Returns a BIBD through TD-based constructions. + Return a BIBD through TD-based constructions. INPUT: - ``v,k`` (integers) -- computes a `(v,k,1)`-BIBD. - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -539,7 +539,7 @@ def BIBD_from_difference_family(G, D, check=True): def v_4_1_BIBD(v, check=True): r""" - Returns a `(v,4,1)`-BIBD. + Return a `(v,4,1)`-BIBD. A `(v,4,1)`-BIBD is an edge-decomposition of the complete graph `K_v` into copies of `K_4`. For more information, see @@ -627,7 +627,7 @@ def v_4_1_BIBD(v, check=True): def BIBD_from_PBD(PBD,v,k,check=True,base_cases={}): r""" - Returns a `(v,k,1)`-BIBD from a `(r,K)`-PBD where `r=(v-1)/(k-1)`. + Return a `(v,k,1)`-BIBD from a `(r,K)`-PBD where `r=(v-1)/(k-1)`. This is Theorem 7.20 from [Stinson2004]_. @@ -802,7 +802,7 @@ def _relabel_bibd(B,n,p=None): def PBD_4_5_8_9_12(v, check=True): """ - Returns a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. + Return a `(v,\{4,5,8,9,12\})`-PBD on `v` elements. A `(v,\{4,5,8,9,12\})`-PBD exists if and only if `v\equiv 0,1 \pmod 4`. The construction implemented here appears page 168 in [Stinson2004]_. @@ -943,7 +943,7 @@ def _PBD_4_5_8_9_12_closure(B): def _get_t_u(v): r""" - Returns the parameters of table 7.1 from [Stinson2004]_. + Return the parameters of table 7.1 from [Stinson2004]_. INPUT: @@ -973,7 +973,7 @@ def _get_t_u(v): def v_5_1_BIBD(v, check=True): r""" - Returns a `(v,5,1)`-BIBD. + Return a `(v,5,1)`-BIBD. This method follows the constuction from [ClaytonSmith]_. @@ -1049,7 +1049,7 @@ def _get_r_s_t_u(v): r""" Implements the table from [ClaytonSmith]_ - Returns the parameters ``r,s,t,u`` associated with an integer ``v``. + Return the parameters ``r,s,t,u`` associated with an integer ``v``. INPUT: @@ -1081,7 +1081,7 @@ def _get_r_s_t_u(v): def PBD_from_TD(k,t,u): r""" - Returns a `(kt,\{k,t\})`-PBD if `u=0` and a `(kt+u,\{k,k+1,t,u\})`-PBD otherwise. + Return a `(kt,\{k,t\})`-PBD if `u=0` and a `(kt+u,\{k,k+1,t,u\})`-PBD otherwise. This is theorem 23 from [ClaytonSmith]_. The PBD is obtained from the blocks a truncated `TD(k+1,t)`, to which are added the blocks corresponding to the @@ -1112,7 +1112,7 @@ def PBD_from_TD(k,t,u): def BIBD_5q_5_for_q_prime_power(q): r""" - Returns a `(5q,5,1)`-BIBD with `q\equiv 1\pmod 4` a prime power. + Return a `(5q,5,1)`-BIBD with `q\equiv 1\pmod 4` a prime power. See Theorem 24 [ClaytonSmith]_. diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index b0b016d5c11..3a846e6a7e9 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -159,7 +159,7 @@ def are_hyperplanes_in_projective_geometry_parameters(v, k, lmbda, return_parame def ProjectiveGeometryDesign(n, d, F, algorithm=None, check=True): """ - Returns a projective geometry design. + Return a projective geometry design. A projective geometry design of parameters `n,d,F` has for points the lines of `F^{n+1}`, and for blocks the `d+1`-dimensional subspaces of `F^{n+1}`, @@ -373,7 +373,7 @@ def projective_plane_to_OA(pplane, pt=None, check=True): def projective_plane(n, check=True, existence=False): r""" - Returns a projective plane of order ``n`` as a 2-design. + Return a projective plane of order ``n`` as a 2-design. A finite projective plane is a 2-design with `n^2+n+1` lines (or blocks) and `n^2+n+1` points. For more information on finite projective planes, see the @@ -459,7 +459,7 @@ def projective_plane(n, check=True, existence=False): def AffineGeometryDesign(n, d, F): r""" - Returns an Affine Geometry Design. + Return an Affine Geometry Design. INPUT: diff --git a/src/sage/combinat/designs/database.py b/src/sage/combinat/designs/database.py index 3522041e8fe..dd4bf6eb823 100644 --- a/src/sage/combinat/designs/database.py +++ b/src/sage/combinat/designs/database.py @@ -118,7 +118,7 @@ def TD_6_12(): r""" - Returns a `TD(6,12)` as built in [Hanani75]_. + Return a `TD(6,12)` as built in [Hanani75]_. This design is Lemma 3.21 from [Hanani75]_. @@ -165,7 +165,7 @@ def TD_6_12(): def _MOLS_from_string(s,k): r""" - Returns MOLS from a string + Return MOLS from a string INPUT: @@ -188,7 +188,7 @@ def _MOLS_from_string(s,k): def MOLS_10_2(): r""" - Returns a pair of MOLS of order 10 + Return a pair of MOLS of order 10 Data obtained from ``_ @@ -231,7 +231,7 @@ def MOLS_10_2(): def MOLS_12_5(): r""" - Returns 5 MOLS of order 12 + Return 5 MOLS of order 12 These MOLS have been found by Brendan McKay. @@ -262,7 +262,7 @@ def MOLS_12_5(): def MOLS_14_4(): r""" - Returns four MOLS of order 14 + Return four MOLS of order 14 These MOLS were shared by Ian Wanless. @@ -300,7 +300,7 @@ def MOLS_14_4(): def MOLS_15_4(): r""" - Returns 4 MOLS of order 15. + Return 4 MOLS of order 15. These MOLS were shared by Ian Wanless. @@ -339,7 +339,7 @@ def MOLS_15_4(): def MOLS_18_3(): r""" - Returns 3 MOLS of order 18. + Return 3 MOLS of order 18. These MOLS were shared by Ian Wanless. @@ -395,7 +395,7 @@ def MOLS_18_3(): def OA_7_18(): r""" - Returns an OA(7,18) + Return an OA(7,18) Proved in [JulianAbel13]_. @@ -449,7 +449,7 @@ def OA_7_18(): def OA_6_20(): r""" - Returns an OA(6,20) + Return an OA(6,20) As explained in the Handbook III.3.49 [DesignHandbook]_. @@ -495,7 +495,7 @@ def OA_6_20(): def OA_7_21(): r""" - Returns an OA(7,21) + Return an OA(7,21) As explained in the Handbook III.3.50 [DesignHandbook]_. @@ -537,7 +537,7 @@ def OA_7_21(): def OA_5_22(): r""" - Returns an OA(5,22) + Return an OA(5,22) As explained in the Handbook III.3.51 [DesignHandbook]_. @@ -589,7 +589,7 @@ def OA_5_22(): def OA_9_24(): r""" - Returns an OA(9,24) + Return an OA(9,24) As explained in the Handbook III.3.52 [DesignHandbook]_. @@ -640,7 +640,7 @@ def OA_9_24(): def OA_6_26(): r""" - Returns an OA(6,26) + Return an OA(6,26) As explained in the Handbook III.3.53 [DesignHandbook]_. @@ -688,7 +688,7 @@ def OA_6_26(): def OA_7_28(): r""" - Returns an OA(7,28) + Return an OA(7,28) As explained in the Handbook III.3.54 [DesignHandbook]_. @@ -740,7 +740,7 @@ def OA_7_28(): def OA_6_30(): r""" - Returns an OA(6,30) + Return an OA(6,30) As explained in the Handbook III.3.55 [DesignHandbook]_. @@ -792,7 +792,7 @@ def OA_6_30(): def OA_7_33(): r""" - Returns an OA(7,33) + Return an OA(7,33) As explained in the Handbook III.3.56 [DesignHandbook]_. @@ -843,7 +843,7 @@ def OA_7_33(): def OA_6_34(): r""" - Returns an OA(6,34) + Return an OA(6,34) As explained in the Handbook III.3.57 [DesignHandbook]_. @@ -895,7 +895,7 @@ def OA_6_34(): def OA_7_35(): r""" - Returns an OA(7,35) + Return an OA(7,35) As explained in the Handbook III.3.58 [DesignHandbook]_. @@ -933,7 +933,7 @@ def OA_7_35(): def OA_10_36(): r""" - Returns an OA(10,36) + Return an OA(10,36) As explained in the Handbook III.3.59 [DesignHandbook]_. @@ -991,7 +991,7 @@ def OA_10_36(): def OA_6_38(): r""" - Returns an OA(6,38) + Return an OA(6,38) As explained in the Handbook III.3.60 [DesignHandbook]_. @@ -1040,7 +1040,7 @@ def OA_6_38(): def OA_7_39(): r""" - Returns an OA(7,39) + Return an OA(7,39) As explained in the Handbook III.3.61 [DesignHandbook]_. @@ -1091,7 +1091,7 @@ def OA_7_39(): def OA_9_40(): r""" - Returns an OA(9,40) + Return an OA(9,40) As explained in the Handbook III.3.62 [DesignHandbook]_. @@ -1165,7 +1165,7 @@ def t(i,(x,y)): def OA_7_42(): r""" - Returns an OA(7,42) + Return an OA(7,42) As explained in the Handbook III.3.63 [DesignHandbook]_. @@ -1210,7 +1210,7 @@ def OA_7_42(): def OA_7_44(): r""" - Returns an OA(7,44) + Return an OA(7,44) As explained in the Handbook III.3.64 [DesignHandbook]_. @@ -1276,7 +1276,7 @@ def OA_7_44(): def OA_8_45(): r""" - Returns an OA(8,45) + Return an OA(8,45) As explained in the Handbook III.3.65 [DesignHandbook]_. @@ -1338,7 +1338,7 @@ def OA_8_45(): def OA_6_46(): r""" - Returns an OA(6,46) + Return an OA(6,46) As explained in the Handbook III.3.66 [DesignHandbook]_. @@ -1364,7 +1364,7 @@ def OA_6_46(): def OA_10_48(): r""" - Returns an OA(10,48) + Return an OA(10,48) As explained in the Handbook III.3.67 [DesignHandbook]_. @@ -1421,7 +1421,7 @@ def OA_10_48(): def OA_8_50(): r""" - Returns an OA(8,50) + Return an OA(8,50) As explained in the Handbook III.3.68 [DesignHandbook]_. @@ -1447,7 +1447,7 @@ def OA_8_50(): def OA_7_51(): r""" - Returns an OA(7,51) + Return an OA(7,51) As explained in the Handbook III.3.69 [DesignHandbook]_. @@ -1493,7 +1493,7 @@ def OA_7_51(): def OA_7_52(): r""" - Returns an OA(7,52) + Return an OA(7,52) As explained in the Handbook III.3.70 [DesignHandbook]_. @@ -1574,7 +1574,7 @@ def t2(i,R): def OA_7_54(): r""" - Returns an OA(7,54) + Return an OA(7,54) As explained in the Handbook III.3.71 [DesignHandbook]_. @@ -1620,7 +1620,7 @@ def OA_7_54(): def OA_8_55(): r""" - Returns an OA(8,55) + Return an OA(8,55) As explained in the Handbook III.3.72 [DesignHandbook]_. @@ -1666,7 +1666,7 @@ def OA_8_55(): def OA_9_56(): r""" - Returns an OA(9,56) + Return an OA(9,56) As explained in the Handbook III.3.73 [DesignHandbook]_. @@ -1720,7 +1720,7 @@ def OA_9_56(): def OA_9_57(): r""" - Returns an OA(9,57) + Return an OA(9,57) Given by Julian R. Abel. @@ -1751,7 +1751,7 @@ def OA_9_57(): def OA_7_60(): r""" - Returns an OA(7,60) + Return an OA(7,60) As explained in [JulianAbel13]_. @@ -1807,7 +1807,7 @@ def OA_7_60(): def OA_7_62(): r""" - Returns an OA(7,62) + Return an OA(7,62) As explained in the Handbook III.3.74 [DesignHandbook]_. @@ -1853,7 +1853,7 @@ def OA_7_62(): def OA_9_65(): r""" - Returns an OA(9,65) + Return an OA(9,65) Construction shared by Julian R. Abel @@ -1888,7 +1888,7 @@ def OA_9_65(): def OA_7_66(): r""" - Returns an OA(7,66) + Return an OA(7,66) Construction shared by Julian R. Abel. @@ -1928,7 +1928,7 @@ def OA_7_66(): def OA_7_68(): r""" - Returns an OA(7,68) + Return an OA(7,68) Construction shared by Julian R. Abel. @@ -1968,7 +1968,7 @@ def OA_7_68(): def OA_8_69(): r""" - Returns an OA(8,69) + Return an OA(8,69) Construction shared by Julian R. Abel. @@ -2041,7 +2041,7 @@ def OA_8_69(): def OA_7_74(): r""" - Returns an OA(7,74) + Return an OA(7,74) Construction shared by Julian R. Abel. @@ -2081,7 +2081,7 @@ def OA_7_74(): def OA_9_75(): r""" - Returns an OA(9,75) + Return an OA(9,75) As explained in the Handbook III.3.75 [DesignHandbook]_. @@ -2136,7 +2136,7 @@ def OA_9_75(): def OA_8_76(): r""" - Returns an OA(8,76) + Return an OA(8,76) Construction shared by Julian R. Abel. @@ -2203,7 +2203,7 @@ def OA_8_76(): def OA_11_80(): r""" - Returns an OA(11,80) + Return an OA(11,80) As explained in the Handbook III.3.76 [DesignHandbook]_. @@ -2272,7 +2272,7 @@ def t(i,(x,y)): def OA_10_82(): r""" - Returns an OA(10,82) + Return an OA(10,82) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2299,7 +2299,7 @@ def OA_10_82(): def OA_10_100(): r""" - Returns an OA(10,100) + Return an OA(10,100) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2326,7 +2326,7 @@ def OA_10_100(): def OA_9_120(): r""" - Returns an OA(9,120) + Return an OA(9,120) Construction shared by Julian R. Abel: @@ -2373,7 +2373,7 @@ def OA_9_120(): def OA_9_135(): r""" - Returns an OA(9,135) + Return an OA(9,135) Construction shared by Julian R. Abel: @@ -2460,7 +2460,7 @@ def OA_9_135(): def OA_12_144(): r""" - Returns an OA(12,144) + Return an OA(12,144) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2487,7 +2487,7 @@ def OA_12_144(): def OA_10_154(): r""" - Returns an OA(10,154) + Return an OA(10,154) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2514,7 +2514,7 @@ def OA_10_154(): def OA_12_210(): r""" - Returns an OA(12,210) + Return an OA(12,210) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2541,7 +2541,7 @@ def OA_12_210(): def OA_18_273(): r""" - Returns an OA(18,273) + Return an OA(18,273) Given by Julian R. Abel. @@ -2572,7 +2572,7 @@ def OA_18_273(): def OA_12_276(): r""" - Returns an OA(12,276) + Return an OA(12,276) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2599,7 +2599,7 @@ def OA_12_276(): def OA_12_298(): r""" - Returns an OA(12,298) + Return an OA(12,298) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2626,7 +2626,7 @@ def OA_12_298(): def OA_12_342(): r""" - Returns an OA(12,342) + Return an OA(12,342) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2653,7 +2653,7 @@ def OA_12_342(): def OA_12_474(): r""" - Returns an OA(12,474) + Return an OA(12,474) Given by Julian R. Abel, using a `V(m,t)` from the Handbook [DesignHandbook]_. @@ -2680,7 +2680,7 @@ def OA_12_474(): def OA_33_993(): r""" - Returns an OA(33,993) + Return an OA(33,993) Given by Julian R. Abel. @@ -3021,7 +3021,7 @@ def CDF_221_5_1(): def RBIBD_120_8_1(): r""" - Returns a resolvable `BIBD(120,8,1)` + Return a resolvable `BIBD(120,8,1)` This function output a list ``L`` of `17\times 15` blocks such that ``L[i*15:(i+1)*15]`` is a partition of `120`. diff --git a/src/sage/combinat/designs/ext_rep.py b/src/sage/combinat/designs/ext_rep.py index ba4ece869b2..05c030d4757 100644 --- a/src/sage/combinat/designs/ext_rep.py +++ b/src/sage/combinat/designs/ext_rep.py @@ -690,7 +690,7 @@ def __repr__(self): def __getattr__(self, attr): """ - Returns the data for the first attribute with name attr. + Return the data for the first attribute with name attr. EXAMPLES:: @@ -767,7 +767,7 @@ def __getitem__(self, i): def __len__(self): """ - Returns the length of the current node. + Return the length of the current node. EXAMPLES:: @@ -1003,7 +1003,7 @@ def parse(self, xml_source): def designs_from_XML(fname): """ - Returns a list of designs contained in an XML file fname. The list + Return a list of designs contained in an XML file fname. The list contains tuples of the form (v, bs) where v is the number of points of the design and bs is the list of blocks. @@ -1038,7 +1038,7 @@ def designs_from_XML(fname): def designs_from_XML_url(url): """ - Returns a list of designs contained in an XML file named by a URL. + Return a list of designs contained in an XML file named by a URL. The list contains tuples of the form (v, bs) where v is the number of points of the design and bs is the list of blocks. diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index fa3fe0d35c9..4d5748addea 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -10,20 +10,20 @@ :delim: | :meth:`~IncidenceStructure.ground_set` | Return the ground set (i.e the list of points). - :meth:`~IncidenceStructure.num_points` | Returns the size of the ground set. - :meth:`~IncidenceStructure.num_blocks` | Returns the number of blocks. + :meth:`~IncidenceStructure.num_points` | Return the size of the ground set. + :meth:`~IncidenceStructure.num_blocks` | Return the number of blocks. :meth:`~IncidenceStructure.blocks` | Return the list of blocks. :meth:`~IncidenceStructure.block_sizes` | Return the set of block sizes. - :meth:`~IncidenceStructure.degree` | Returns the degree of a point ``p`` + :meth:`~IncidenceStructure.degree` | Return the degree of a point ``p`` :meth:`~IncidenceStructure.is_connected` | Test whether the design is connected. :meth:`~IncidenceStructure.is_simple` | Test whether this design is simple (i.e. no repeated block). :meth:`~IncidenceStructure.incidence_matrix` | Return the incidence matrix `A` of the design - :meth:`~IncidenceStructure.incidence_graph` | Returns the incidence graph of the design - :meth:`~IncidenceStructure.packing` | Returns a maximum packing + :meth:`~IncidenceStructure.incidence_graph` | Return the incidence graph of the design + :meth:`~IncidenceStructure.packing` | Return a maximum packing :meth:`~IncidenceStructure.is_t_design` | Test whether ``self`` is a `t-(v,k,l)` design. - :meth:`~IncidenceStructure.dual` | Returns the dual design. - :meth:`~IncidenceStructure.automorphism_group` | Returns the automorphism group - :meth:`~IncidenceStructure.edge_coloring` | Returns an optimal edge coloring` + :meth:`~IncidenceStructure.dual` | Return the dual design. + :meth:`~IncidenceStructure.automorphism_group` | Return the automorphism group + :meth:`~IncidenceStructure.edge_coloring` | Return an optimal edge coloring` REFERENCES: @@ -466,7 +466,7 @@ def ground_set(self, copy=True): def num_points(self): r""" - Returns the size of the ground set. + Return the size of the ground set. EXAMPLES:: @@ -480,7 +480,7 @@ def num_points(self): def num_blocks(self): r""" - Returns the number of blocks. + Return the number of blocks. EXAMPLES:: @@ -542,7 +542,7 @@ def block_sizes(self): def degree(self, p=None): r""" - Returns the degree of a point ``p`` + Return the degree of a point ``p`` The degree of a point `p` is the number of blocks that contain it. @@ -655,7 +655,7 @@ def incidence_matrix(self): def incidence_graph(self): """ - Returns the incidence graph of the design, where the incidence + Return the incidence graph of the design, where the incidence matrix of the design is the adjacency matrix of the graph. EXAMPLE:: @@ -681,7 +681,7 @@ def incidence_graph(self): def packing(self, solver=None, verbose=0): r""" - Returns a maximum packing + Return a maximum packing A maximum packing in a hypergraph is collection of disjoint sets/blocks of maximal cardinality. This problem is NP-complete in general, and in @@ -930,7 +930,7 @@ def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False): def dual(self, algorithm=None): """ - Returns the dual of the incidence structure. + Return the dual of the incidence structure. INPUT: @@ -991,7 +991,7 @@ def dual(self, algorithm=None): def automorphism_group(self): r""" - Returns the subgroup of the automorphism group of the incidence graph + Return the subgroup of the automorphism group of the incidence graph which respects the P B partition. It is (isomorphic to) the automorphism group of the block design, although the degrees differ. diff --git a/src/sage/combinat/designs/latin_squares.py b/src/sage/combinat/designs/latin_squares.py index 047b31d0721..5e68876690e 100644 --- a/src/sage/combinat/designs/latin_squares.py +++ b/src/sage/combinat/designs/latin_squares.py @@ -18,9 +18,9 @@ :widths: 30, 70 :delim: | - :meth:`mutually_orthogonal_latin_squares` | Returns `k` Mutually Orthogonal `n\times n` Latin Squares. + :meth:`mutually_orthogonal_latin_squares` | Return `k` Mutually Orthogonal `n\times n` Latin Squares. :meth:`are_mutually_orthogonal_latin_squares` | Check that the list ``l`` of matrices in are MOLS. - :meth:`latin_square_product` | Returns the product of two (or more) latin squares. + :meth:`latin_square_product` | Return the product of two (or more) latin squares. :meth:`MOLS_table` | Prints the MOLS table. **Table of MOLS** @@ -201,7 +201,7 @@ def are_mutually_orthogonal_latin_squares(l, verbose=False): def mutually_orthogonal_latin_squares(k,n, partitions = False, check = True, existence=False): r""" - Returns `k` Mutually Orthogonal `n\times n` Latin Squares (MOLS). + Return `k` Mutually Orthogonal `n\times n` Latin Squares (MOLS). For more information on Mutually Orthogonal Latin Squares, see :mod:`~sage.combinat.designs.latin_squares`. @@ -228,7 +228,7 @@ def mutually_orthogonal_latin_squares(k,n, partitions = False, check = True, exi partitions satisfying this intersection property instead of the `k+2` MOLS (though the data is exactly the same in both cases). - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -434,7 +434,7 @@ def mutually_orthogonal_latin_squares(k,n, partitions = False, check = True, exi def latin_square_product(M,N,*others): r""" - Returns the product of two (or more) latin squares. + Return the product of two (or more) latin squares. Given two Latin Squares `M,N` of respective sizes `m,n`, the direct product `M\times N` of size `mn` is defined by `(M\times diff --git a/src/sage/combinat/designs/orthogonal_arrays.py b/src/sage/combinat/designs/orthogonal_arrays.py index 8d660df92cc..c9ed6472187 100644 --- a/src/sage/combinat/designs/orthogonal_arrays.py +++ b/src/sage/combinat/designs/orthogonal_arrays.py @@ -16,7 +16,7 @@ :meth:`orthogonal_array` | Return an orthogonal array of parameters `k,n,t`. :meth:`transversal_design` | Return a transversal design of parameters `k,n`. - :meth:`incomplete_orthogonal_array` | Returns an `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)`. + :meth:`incomplete_orthogonal_array` | Return an `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)`. .. csv-table:: @@ -26,14 +26,14 @@ :meth:`is_transversal_design` | Check that a given set of blocks ``B`` is a transversal design. :meth:`~sage.combinat.designs.designs_pyx.is_orthogonal_array` | Check that the integer matrix `OA` is an `OA(k,n,t)`. - :meth:`wilson_construction` | Returns a `OA(k,rm+u)` from a truncated `OA(k+s,r)` by Wilson's construction. - :meth:`TD_product` | Returns the product of two transversal designs. - :meth:`OA_find_disjoint_blocks` | Returns `x` disjoint blocks contained in a given `OA(k,n)`. - :meth:`OA_relabel` | Returns a relabelled version of the OA. - :meth:`OA_from_quasi_difference_matrix` | Returns an Orthogonal Array from a Quasi-Difference matrix - :meth:`OA_from_Vmt` | Returns an Orthogonal Array from a `V(m,t)` - :meth:`OA_from_PBD` | Returns an `OA(k,n)` from a PBD - :meth:`OA_from_wider_OA` | Returns the first `k` columns of `OA`. + :meth:`wilson_construction` | Return a `OA(k,rm+u)` from a truncated `OA(k+s,r)` by Wilson's construction. + :meth:`TD_product` | Return the product of two transversal designs. + :meth:`OA_find_disjoint_blocks` | Return `x` disjoint blocks contained in a given `OA(k,n)`. + :meth:`OA_relabel` | Return a relabelled version of the OA. + :meth:`OA_from_quasi_difference_matrix` | Return an Orthogonal Array from a Quasi-Difference matrix + :meth:`OA_from_Vmt` | Return an Orthogonal Array from a `V(m,t)` + :meth:`OA_from_PBD` | Return an `OA(k,n)` from a PBD + :meth:`OA_from_wider_OA` | Return the first `k` columns of `OA`. .. TODO:: @@ -90,7 +90,7 @@ def transversal_design(k,n,check=True,existence=False): guys), you may want to disable it whenever you want speed. Set to ``True`` by default. - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -386,7 +386,7 @@ def is_transversal_design(B,k,n, verbose=False): def wilson_construction(OA,k,r,m,n_trunc,u,check=True): r""" - Returns a `OA(k,rm+u)` from a truncated `OA(k+s,r)` by Wilson's construction. + Return a `OA(k,rm+u)` from a truncated `OA(k+s,r)` by Wilson's construction. Let `OA` be a truncated `OA(k+s,r)` with `s` truncated columns of sizes `u_1,...,u_s`, whose blocks have sizes in `\{k+b_1,...,k+b_t\}`. If there @@ -482,7 +482,7 @@ def wilson_construction(OA,k,r,m,n_trunc,u,check=True): def TD_product(k,TD1,n1,TD2,n2, check=True): r""" - Returns the product of two transversal designs. + Return the product of two transversal designs. From a transversal design `TD_1` of parameters `k,n_1` and a transversal design `TD_2` of parameters `k,n_2`, this function returns a transversal @@ -675,7 +675,7 @@ def orthogonal_array(k,n,t=2,check=True,existence=False): guys), you may want to disable it whenever you want speed. Set to ``True`` by default. - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -921,7 +921,7 @@ def orthogonal_array(k,n,t=2,check=True,existence=False): def incomplete_orthogonal_array(k,n,holes_sizes,existence=False): r""" - Returns an `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)`. + Return an `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)`. An `OA(k,n)-\sum_{1\leq i\leq x} OA(k,s_i)` is an orthogonal array from which have been removed disjoint `OA(k,s_1),...,OA(k,s_x)`. So it can @@ -946,7 +946,7 @@ def incomplete_orthogonal_array(k,n,holes_sizes,existence=False): Right now the feature is only available when all holes have size 1, i.e. `s_i=1`. - - ``existence`` (boolean) -- instead of building the design, returns: + - ``existence`` (boolean) -- instead of building the design, return: - ``True`` -- meaning that Sage knows how to build the design @@ -1077,7 +1077,7 @@ def incomplete_orthogonal_array(k,n,holes_sizes,existence=False): def OA_find_disjoint_blocks(OA,k,n,x): r""" - Returns `x` disjoint blocks contained in a given `OA(k,n)`. + Return `x` disjoint blocks contained in a given `OA(k,n)`. `x` blocks of an `OA` are said to be disjoint if they all have different values for a every given index, i.e. if they correspond to @@ -1134,7 +1134,7 @@ def OA_find_disjoint_blocks(OA,k,n,x): def OA_relabel(OA,k,n,blocks=tuple(),matrix=None): r""" - Returns a relabelled version of the OA. + Return a relabelled version of the OA. INPUT: @@ -1212,7 +1212,7 @@ def OA_relabel(OA,k,n,blocks=tuple(),matrix=None): def OA_from_quasi_difference_matrix(M,G,add_col=True): r""" - Returns an Orthogonal Array from a Quasi-Difference matrix + Return an Orthogonal Array from a Quasi-Difference matrix **Difference Matrices** @@ -1316,7 +1316,7 @@ def OA_from_quasi_difference_matrix(M,G,add_col=True): def OA_from_Vmt(m,t,V): r""" - Returns an Orthogonal Array from a `V(m,t)` + Return an Orthogonal Array from a `V(m,t)` **Definition** @@ -1384,7 +1384,7 @@ def OA_from_Vmt(m,t,V): def OA_from_PBD(k,n,PBD, check=True): r""" - Returns an `OA(k,n)` from a PBD + Return an `OA(k,n)` from a PBD **Construction** @@ -1462,7 +1462,7 @@ def OA_from_PBD(k,n,PBD, check=True): def OA_from_wider_OA(OA,k): r""" - Returns the first `k` columns of `OA`. + Return the first `k` columns of `OA`. If `OA` has `k` columns, this function returns `OA` immediately. diff --git a/src/sage/combinat/designs/orthogonal_arrays_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_recursive.py index 62e2d03104e..34f6ef0ee16 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_recursive.py @@ -45,7 +45,7 @@ def find_recursive_construction(k,n): OUTPUT: - Returns a pair ``f,args`` such that ``f(*args)`` returns the requested `OA` + Return a pair ``f,args`` such that ``f(*args)`` returns the requested `OA` if possible, and ``False`` otherwise. EXAMPLES:: @@ -306,7 +306,7 @@ def find_construction_3_3(k,n): def construction_3_3(k,n,m,i): r""" - Returns an `OA(k,nm+i)`. + Return an `OA(k,nm+i)`. This is Wilson's construction with `i` truncated columns of size 1 and such that a block `B_0` of the incomplete OA intersects all truncated columns. As @@ -391,7 +391,7 @@ def find_construction_3_4(k,n): def construction_3_4(k,n,m,r,s): r""" - Returns a `OA(k,nm+rs)`. + Return a `OA(k,nm+rs)`. This is Wilson's construction applied to a truncated `OA(k+r+1,n)` with `r` columns of size `1` and one column of size `s`. @@ -503,7 +503,7 @@ def find_construction_3_5(k,n): def construction_3_5(k,n,m,r,s,t): r""" - Returns an `OA(k,nm+r+s+t)`. + Return an `OA(k,nm+r+s+t)`. This is exactly Wilson's construction with three truncated groups except we make sure that all blocks have size `>k`, so we don't @@ -619,7 +619,7 @@ def find_construction_3_6(k,n): def construction_3_6(k,n,m,i): r""" - Returns a `OA(k,nm+i)` + Return a `OA(k,nm+i)` This is Wilson's construction with `r` columns of order `1`, in which each block intersects at most two truncated columns. Such a design exists when @@ -656,7 +656,7 @@ def construction_3_6(k,n,m,i): def OA_and_oval(q): r""" - Returns a `OA(q+1,q)` whose blocks contains `\leq 2` zeroes in the last `q` + Return a `OA(q+1,q)` whose blocks contains `\leq 2` zeroes in the last `q` columns. This `OA` is build from a projective plane of order `q`, in which there @@ -750,7 +750,7 @@ def OA_and_oval(q): def construction_q_x(k,q,x,check=True): r""" - Returns an `OA(k,(q-1)*(q-x)+x+2)` using the `q-x` construction. + Return an `OA(k,(q-1)*(q-x)+x+2)` using the `q-x` construction. Let `v=(q-1)*(q-x)+x+2`. If there exists a projective plane of order `q` (e.g. when `q` is a prime power) and `0 Date: Wed, 6 Aug 2014 13:02:46 +0200 Subject: [PATCH 6/6] trac #16766: form -> from --- src/sage/combinat/designs/steiner_quadruple_systems.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/designs/steiner_quadruple_systems.py b/src/sage/combinat/designs/steiner_quadruple_systems.py index 608af6ea143..910c80ad1c0 100644 --- a/src/sage/combinat/designs/steiner_quadruple_systems.py +++ b/src/sage/combinat/designs/steiner_quadruple_systems.py @@ -823,7 +823,7 @@ def _SQS14(): r""" Return a Steiner Quadruple System on 14 points. - Obtained form the La Jolla Covering Repository. + Obtained from the La Jolla Covering Repository. EXAMPLE:: @@ -855,7 +855,7 @@ def _SQS38(): r""" Return a Steiner Quadruple System on 14 points. - Obtained form the La Jolla Covering Repository. + Obtained from the La Jolla Covering Repository. EXAMPLE::