Skip to content

Commit

Permalink
Trac #27013: py3: some care for Hadamard matrices
Browse files Browse the repository at this point in the history
URL: https://trac.sagemath.org/27013
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Jan 23, 2019
2 parents 6521233 + b806b2e commit c128368
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/sage/combinat/matrices/hadamard_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def GS_skew_hadamard_smallcases(n, existence=False, check=True):
williamson_goethals_seidel_skew_hadamard_matrix as WGS

def pmtoZ(s):
return [1 if x == '+' else -1 for x in s]
return [1 if x == '+' else -1 for x in s]

if existence:
return n in [36, 52, 92]
Expand Down Expand Up @@ -1209,6 +1209,7 @@ def symmetric_conference_matrix(n, check=True):
assert (C==C.T and C**2==(n-1)*I(n))
return C


def szekeres_difference_set_pair(m, check=True):
r"""
Construct Szekeres `(2m+1,m,1)`-cyclic difference family
Expand Down Expand Up @@ -1248,16 +1249,18 @@ def szekeres_difference_set_pair(m, check=True):
t = F.multiplicative_generator()**2
G = F.cyclotomic_cosets(t, cosets=[F.one()])[0]
sG = set(G)
A = filter(lambda a: a-F.one() in sG, G)
B = filter(lambda b: b+F.one() in sG, G)
A = [a for a in G if a - F.one() in sG]
B = [b for b in G if b + F.one() in sG]
if check:
from itertools import product, chain
assert(len(list(A)) == len(list(B)) == m)
if m>1:
assert(sG==set([xy[0]/xy[1] for xy in chain(product(A,A), product(B,B))]))
assert(all(F.one()/b+F.one() in sG for b in B))
assert(not any(F.one()/a-F.one() in sG for a in A))
return G,A,B
assert(len(A) == len(B) == m)
if m > 1:
assert(sG == set([xy[0] / xy[1]
for xy in chain(product(A, A), product(B, B))]))
assert(all(F.one() / b + F.one() in sG for b in B))
assert(not any(F.one() / a - F.one() in sG for a in A))
return G, A, B


def typeI_matrix_difference_set(G,A):
r"""
Expand Down

0 comments on commit c128368

Please sign in to comment.