Skip to content

Commit 22abbb4

Browse files
committed
fix suggested details
1 parent 0364051 commit 22abbb4

File tree

3 files changed

+65
-41
lines changed

3 files changed

+65
-41
lines changed

src/sage/combinat/designs/database.py

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,22 +2080,23 @@ def QDM_19_6_1_1_1():
20802080
"""
20812081
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as AdditiveCyclic
20822082
M = [[None, 7, 13, 1, 16, 9, 2],
2083-
[ 0, 1, 15, 7, 17, 6, 14],
2084-
[ 0, 11, 10, 11, 5, 4, 3],
2085-
[ 7,None, 13, 16, 1, 2, 9],
2086-
[ 1, 0, 15, 17, 7, 14, 6],
2087-
[ 11, 0, 10, 5, 11, 3, 4]]
2083+
[ 0, 1, 15, 7, 17, 6, 14],
2084+
[ 0, 11, 10, 11, 5, 4, 3],
2085+
[ 7,None, 13, 16, 1, 2, 9],
2086+
[ 1, 0, 15, 17, 7, 14, 6],
2087+
[ 11, 0, 10, 5, 11, 3, 4]]
20882088

20892089
Mb = []
20902090

20912091
for R in zip(*M):
2092-
a,b,c,d,e,f = R
2093-
Mb.append([a,b,c,d,e,f])
2094-
Mb.append([b,c,a,f,d,e])
2095-
Mb.append([c,a,b,e,f,d])
2092+
a, b, c, d, e, f = R
2093+
Mb.append([a, b, c, d, e, f])
2094+
Mb.append([b, c, a, f, d, e])
2095+
Mb.append([c, a, b, e, f, d])
20962096

20972097
return AdditiveCyclic(19), Mb
20982098

2099+
20992100
def QDM_21_5_1_1_1():
21002101
r"""
21012102
Return a `(21,5;1,1;1)`-quasi-difference matrix.
@@ -4321,18 +4322,22 @@ def BIBD_111_6_1():
43214322
"""
43224323
from sage.sets.recursively_enumerated_set import RecursivelyEnumeratedSet
43234324
from .incidence_structures import IncidenceStructure
4324-
bibd = [(( 0,0), ( 1,0), ( 3,0), ( 7,0), (17,0), ( 0,1)),
4325-
(( 0,0), ( 5,0), (19,1), (28,1), (10,2), (30,2)),
4326-
(( 5,0), (33,0), (13,1), (34,1), (19,2), ( 7,2)),
4327-
(( 9,0), (27,0), (16,1), (11,1), (12,2), (36,2)),
4328-
((10,0), (23,0), (26,1), ( 8,1), ( 1,2), ( 6,2)),
4329-
((13,0), (24,0), (19,1), (18,1), ( 5,2), (32,2)),
4330-
((26,0), (34,0), ( 1,1), ( 7,1), (10,2), (33,2))]
4331-
gens = lambda B: [frozenset(((x*10) % 37,(y+1) % 3) for x,y in B),
4332-
frozenset(((x+1) % 37, y) for x,y in B)]
4333-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4325+
bibd = [(( 0, 0), ( 1, 0), ( 3, 0), ( 7, 0), (17, 0), ( 0, 1)),
4326+
(( 0, 0), ( 5, 0), (19, 1), (28, 1), (10, 2), (30, 2)),
4327+
(( 5, 0), (33, 0), (13, 1), (34, 1), (19, 2), ( 7, 2)),
4328+
(( 9, 0), (27, 0), (16, 1), (11, 1), (12, 2), (36, 2)),
4329+
((10, 0), (23, 0), (26, 1), ( 8, 1), ( 1, 2), ( 6, 2)),
4330+
((13, 0), (24, 0), (19, 1), (18, 1), ( 5, 2), (32, 2)),
4331+
((26, 0), (34, 0), ( 1, 1), ( 7, 1), (10, 2), (33, 2))]
4332+
gens = lambda B: [frozenset(((x * 10) % 37, (y + 1) % 3)
4333+
for x, y in B),
4334+
frozenset(((x + 1) % 37, y)
4335+
for x, y in B)]
4336+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4337+
successors=gens)
43344338
return IncidenceStructure(bibd)._blocks
43354339

4340+
43364341
def BIBD_126_6_1():
43374342
r"""
43384343
Return a (126,6,1)-BIBD.
@@ -4382,9 +4387,12 @@ def BIBD_136_6_1():
43824387
((0,0), (11,0), (17,0), ( 4,2), ( 5,2), (28,2)),
43834388
((0,0), ( 1,0), ( 0,1), (16,1), ( 0,2), (31,2)),
43844389
( inf ,( 0,0), ( 9,0), (18,0), (27,0), (36,0))]
4385-
gens = lambda B: [frozenset(((x*16) % 45,(y+1) % 3) if (x,y) != inf else inf for x,y in B),
4386-
frozenset(((x+1) % 45,y) if (x,y) != inf else inf for x,y in B)]
4387-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4390+
gens = lambda B: [frozenset(((x * 16) % 45,(y + 1) % 3)
4391+
if (x, y) != inf else inf for x, y in B),
4392+
frozenset(((x + 1) % 45,y)
4393+
if (x, y) != inf else inf for x, y in B)]
4394+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4395+
successors=gens)
43884396
return IncidenceStructure(bibd)._blocks
43894397

43904398

@@ -4414,11 +4422,15 @@ def BIBD_141_6_1():
44144422
( inf ,( 0,0), ( 7,0), (14,0), (21,0), (28,0)),
44154423
( inf ,( 0,a), ( 7,a), (14,a), (21,a), (28,a))]
44164424

4417-
gens = lambda B: [frozenset(((x*16) % 35,(y+1) % 3 if y != a else a) if (x,y) != inf else inf for x,y in B),
4418-
frozenset(((x+1) % 35, y ) if (x,y) != inf else inf for x,y in B)]
4419-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4425+
gens = lambda B: [frozenset(((x * 16) % 35, (y + 1) % 3 if y != a else a)
4426+
if (x, y) != inf else inf for x, y in B),
4427+
frozenset(((x + 1) % 35, y )
4428+
if (x, y) != inf else inf for x, y in B)]
4429+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4430+
successors=gens)
44204431
return IncidenceStructure(bibd)._blocks
44214432

4433+
44224434
def BIBD_171_6_1():
44234435
r"""
44244436
Return a (171,6,1)-BIBD.
@@ -4442,11 +4454,15 @@ def BIBD_171_6_1():
44424454
(( 0,0), (12,0), ( 0,1), (27,1), ( 0,2), (18,2)),
44434455
((37,0), (42,0), (31,1), ( 9,1), (46,2), ( 6,2))]
44444456

4445-
gens = lambda B: [frozenset(((x*7) % 57,(y+1) % 3) for x,y in B),
4446-
frozenset(((x+1) % 57, y) for x,y in B)]
4447-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4457+
gens = lambda B: [frozenset(((x * 7) % 57, (y + 1) % 3)
4458+
for x, y in B),
4459+
frozenset(((x + 1) % 57, y)
4460+
for x, y in B)]
4461+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4462+
successors=gens)
44484463
return IncidenceStructure(bibd)._blocks
44494464

4465+
44504466
def HigmanSimsDesign():
44514467
r"""
44524468
Return the Higman-Sims designs, which is a `(176, 50, 14)`-BIBD.
@@ -4535,11 +4551,15 @@ def BIBD_196_6_1():
45354551
((0,0), ( 1,0), ( 0,1), (30,1), ( 0,2), (18,2)),
45364552
((8,0), (19,0), (44,1), (31,1), (46,2), (48,2))]
45374553

4538-
gens = lambda B: [frozenset(((x*30) % 49,(y+1) % 3 if y != a else a) for x,y in B),
4539-
frozenset(((x+1) % 49, y) for x,y in B)]
4540-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4554+
gens = lambda B: [frozenset(((x * 30) % 49, (y + 1) % 3 if y != a else a)
4555+
for x, y in B),
4556+
frozenset(((x + 1) % 49, y)
4557+
for x, y in B)]
4558+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4559+
successors=gens)
45414560
return IncidenceStructure(bibd)._blocks
45424561

4562+
45434563
def BIBD_201_6_1():
45444564
r"""
45454565
Return a (201,6,1)-BIBD.
@@ -4564,11 +4584,15 @@ def BIBD_201_6_1():
45644584
((3,1), (20,1), (44,1), (36,2), (39,2), (59,2)),
45654585
((0,0), ( 0,1), (30,1), (38,1), (66,1), ( 0,2))]
45664586

4567-
gens = lambda B: [frozenset(((x*29) % 67,y) for x,y in B),
4568-
frozenset(((x+1) % 67,y) for x,y in B)]
4569-
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd], successors=gens)
4587+
gens = lambda B: [frozenset(((x * 29) % 67, y)
4588+
for x, y in B),
4589+
frozenset(((x + 1) % 67, y)
4590+
for x, y in B)]
4591+
bibd = RecursivelyEnumeratedSet([frozenset(e) for e in bibd],
4592+
successors=gens)
45704593
return IncidenceStructure(bibd)._blocks
45714594

4595+
45724596
def BIBD_79_13_2():
45734597
r"""
45744598
Return a symmetric `(79,13,2)`-BIBD.

src/sage/combinat/designs/orthogonal_arrays.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,8 @@ def incomplete_orthogonal_array(k,n,holes,resolvable=False, existence=False):
13721372
# (i.e. OA(k,n1)-x.OA(k,1) and OA(k,n2) ==> OA(k,n1.n2)-x.OA(k,n2) )
13731373
elif (min_hole > 1 and
13741374
max_hole == min_hole and
1375-
n % min_hole == 0 and # h divides n
1376-
orthogonal_array(k,min_hole,existence=True) and # OA(k,h)
1375+
n % min_hole == 0 and # h divides n
1376+
orthogonal_array(k,min_hole,existence=True) and # OA(k,h)
13771377
incomplete_orthogonal_array(k,n//min_hole,[1]*number_of_holes,existence=True)): # OA(k,n/h)-x.OA(k,1)
13781378
if existence:
13791379
return True

src/sage/combinat/designs/orthogonal_arrays_build_recursive.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,13 +1606,13 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False,explain_construct
16061606
OA.extend([N-xx-1 for xx in B] for B in orthogonal_array(k,x))
16071607

16081608
# iv)
1609-
elif (x == q**2+1 and
1610-
orthogonal_array( k , x ,existence=True) and # d0
1611-
orthogonal_array(k+e4, t+1 ,existence=True) and # d2-e4
1612-
orthogonal_array(k + 1,t+q+1,existence=True)): # d4-1
1609+
elif (x == q**2 + 1 and
1610+
orthogonal_array(k, x, existence=True) and # d0
1611+
orthogonal_array(k + e4, t + 1, existence=True) and # d2 - e4
1612+
orthogonal_array(k + 1, t + q + 1, existence=True)): # d4 - 1
16131613

16141614
if verbose:
1615-
print("Case iv) with k={},q={},t={},x={},e4={}".format(k,q,t,x,e4))
1615+
print(f"Case iv) with k={k},q={q},t={t},x={x},e4={e4}")
16161616

16171617
# Sets of size t:
16181618
#

0 commit comments

Comments
 (0)