diff --git a/src/sage/combinat/designs/orthogonal_arrays_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_recursive.py index e30cb85e8df..43b7deb72a9 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_recursive.py @@ -1735,72 +1735,54 @@ def find_brouwer_separable_design(k,n): return False -def _reorder_matrix(matrix,N): +def _reorder_matrix(matrix): r""" + Return a matrix which is obtained from ``matrix`` by permutation of each row + in which each column contain every symbol exactly once. - Reorders the elements of each row such that the elements appear once per - column. + The input must be a `N \times k` matrix with entries in `\{0,\ldots,N-1\}` + such that: + - the symbols on each row are distinct (and hence can be identified with + subsets of `\{0,\ldots,N-1\}`), + - each symbol appear exactly `k` times. - This is equivalent to an edge coloring of a bipartite graph. This function - is used by :func:`brouwer_separable_design`. + The problem is equivalent to an edge coloring of a bipartite graph. This + function is used by :func:`brouwer_separable_design`. - INPUT: - - - ``matrix`` -- a `k\times N`` matrix of integers in which every `0\leq it`. The blocks of size `t` can be partitionned into `q^2-q+t-1` - parallel classes according to their associated subplane `B_i` with `i>t`. + `t(q^2+q+1)` points (to which `x` new points are then added). The blocks of + this subdesign belong to two categories: - * The blocks of size `q+t` + * The blocks of size `t`: they come from the lines which intersect a + `B_i` on `q+1` points for some `i>t`. The blocks of size `t` can be partitionned + into `q^2-q+t-1` parallel classes according to their associated subplane `B_i` + with `i>t`. - Those blocks form a separable design, as every point is incident with - `q+t` of them. + * The blocks of size `q+t`: those blocks form a symmetric design, as every + point is incident with `q+t` of them. **Constructions** @@ -1848,7 +1827,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): * *Sets of size* `q+t`) - A `(q+t)\times N` matrix is built whose `N` rows are the sets of size + A `N \times (q+t)` array is built whose rows are the sets of size `q+t` such that every value appears once per column. For each block of a `OA(k-1,q+t)-(q+t).OA(k-1,t)`, the product with the rows of the matrix yields a parallel class of a resolvable `OA(k-1,N)`. @@ -1862,7 +1841,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): * *Sets of size* `q+t`) - A `(q+t)\times (N-x)` matrix `M` is built whose `N-x` rows are the + A `(N-x) \times (q+t)` array `M` is built whose `N-x` rows are the sets of size `q+t` such that every value appears once per column. For each of the new `x=q+t` points `p_1,\dots,p_{q+t}` we build a matrix `M_i` obtained from `M` by adding a column equal to `(p_i,p_i,p_i\dots @@ -1998,7 +1977,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): m = q**2-q+1 for i in range(m): for B in BIBD: - assert sum([(xx%m)==i for xx in B]) in [1,q+1], sum([(xx%m)==i for xx in B]) + assert sum((xx%m)==i for xx in B) in [1,q+1], sum((xx%m)==i for xx in B) # We are only interested by the points of the first t Baer subplanes (each # has size q**2+q+1). Note that each block of the projective plane: @@ -2022,7 +2001,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): for B in BIBD: # Find the Baer subplane which B intersects on more than 1 point - B_mod = sorted([xx%m for xx in B]) + B_mod = sorted(xx%m for xx in B) while B_mod.pop(0) != B_mod[0]: pass plane = B_mod[0] @@ -2099,7 +2078,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): # (This is equivalent to an edge coloring of the (bipartite) incidence # graph of points and sets) - matrix = _reorder_matrix(blocks_of_size_q_plus_t,N) + matrix = _reorder_matrix(blocks_of_size_q_plus_t) # 3) We now create blocks of an OA(k-1,N) as the product of # a) A set of size q+t (i.e. a row of the matrix) @@ -2165,7 +2144,7 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False): OA_tq1_classes = [[B[1:] for B in OA_tq1[i*(t+q+1):(i+1)*(t+q+1)]] for i in range(t+q)] # - matrix = _reorder_matrix(blocks_of_size_q_plus_t,N-x) + matrix = _reorder_matrix(blocks_of_size_q_plus_t) for i,classs in enumerate(OA_tq1_classes): OA.extend([[R[xx] if xx - matrix = _reorder_matrix(blocks_of_size_q_plus_t,N-x) + matrix = _reorder_matrix(blocks_of_size_q_plus_t) for i,classs in enumerate(OA_tq1_classes): OA.extend([[R[xx] if xx - matrix = _reorder_matrix(blocks_of_size_q_plus_t,N-x) + matrix = _reorder_matrix(blocks_of_size_q_plus_t) for i,classs in enumerate(OA_tq1_classes): OA.extend([[R[xx] if xx