Skip to content

Commit 59f103b

Browse files
committed
Add T-matrices of order 67 in Cooper Wallis construction
1 parent 41a56fc commit 59f103b

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

src/doc/en/reference/references/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5225,6 +5225,11 @@ REFERENCES:
52255225
.. [Sam2012] \P. Samanta: *Antipodal Graphs*
52265226
:doi:`10.13140/RG.2.2.28238.46409`
52275227
5228+
.. [Saw1985] \K. Sawade.
5229+
*A Hadamard matrix of order 268*,
5230+
Graphs and Combinatorics 1(1) (1985): 185-187.
5231+
:doi:`10.1007/BF02582942`
5232+
52285233
.. [Sch1961] Craige Schensted. *Longest increasing and decreasing
52295234
subsequences*, Canadian Journal of Mathematics, Vol 13
52305235
(1961), pp. 179--191.

src/sage/combinat/matrices/hadamard_matrix.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,13 @@ def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False):
792792
r"""
793793
Construct hadamard matrices using the Cooper-Wallis construction for some small values of `n`.
794794
795-
This functions uses the data from :func:`sage.combinat.T_sequences.T_sequences_smallcases`
796-
and :func:`williamson_type_quadruples_smallcases`
797-
to construct an hadamard matrix of order `n` using the Cooper-Wallis construction
798-
detailed at :func:`hadamard_matrix_cooper_wallis_construction`.
795+
This function calls the function :func:`hadamard_matrix_cooper_wallis_construction`
796+
with the appropriate arguments.
797+
It constructs the matrices `X_1`, `X_2`, `X_3`, `X_4` using either
798+
T-matrices or the T-sequences from :func:`sage.combinat.T_sequences.T_sequences_smallcases`.
799+
The matrices `A`, `B`, `C`, `D` are taken from :func:`williamson_type_quadruples_smallcases`.
800+
801+
Data for T-matrices of order 67 is taken from [Saw1985]_.
799802
800803
INPUT:
801804
@@ -846,14 +849,28 @@ def hadamard_matrix_cooper_wallis_smallcases(n, check=True, existence=False):
846849
"""
847850
assert n%4 == 0 and n > 0
848851

852+
db = {
853+
67: (
854+
[1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
855+
[0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],
856+
[0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, 0, 0, 1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0],
857+
[0, 0, -1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, 1, 0, 0, 0]
858+
)
859+
}
860+
849861
for T_seq_len in divisors(n//4):
850862
will_size = n//(4* T_seq_len)
851-
if T_sequences_smallcases(T_seq_len, existence=True) and williamson_type_quadruples_smallcases(will_size, existence=True):
863+
if (T_seq_len in db or T_sequences_smallcases(T_seq_len, existence=True)) and williamson_type_quadruples_smallcases(will_size, existence=True):
852864
if existence:
853865
return True
854866

855-
e1, e2, e3, e4 = T_sequences_smallcases(T_seq_len, check=False)
856-
will_matrices = williamson_type_quadruples_smallcases(will_size)
867+
e1, e2, e3, e4 = None, None, None, None
868+
if T_seq_len in db:
869+
e1, e2, e3, e4 = db[T_seq_len]
870+
else:
871+
e1, e2, e3, e4 = T_sequences_smallcases(T_seq_len, check=False)
872+
873+
will_matrices = williamson_type_quadruples_smallcases(will_size)
857874
A, B, C, D = map(matrix.circulant, will_matrices)
858875
M = hadamard_matrix_cooper_wallis_construction(e1, e2, e3, e4, A, B, C, D, check=False)
859876

0 commit comments

Comments
 (0)