From 8eb2285bf4c5d8b11dd3c32b15fd9c52e90112c0 Mon Sep 17 00:00:00 2001 From: Matteo Cati Date: Wed, 7 Dec 2022 11:21:41 +0100 Subject: [PATCH] Add spence construction to general construction function --- src/sage/combinat/matrices/hadamard_matrix.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/matrices/hadamard_matrix.py b/src/sage/combinat/matrices/hadamard_matrix.py index a5888bf823a..79f06d3a4a4 100644 --- a/src/sage/combinat/matrices/hadamard_matrix.py +++ b/src/sage/combinat/matrices/hadamard_matrix.py @@ -1284,8 +1284,7 @@ def is_hadamard_matrix(M, normalized=False, skew=False, verbose=False): @matrix_method def hadamard_matrix(n,existence=False, check=True): r""" - Tries to construct a Hadamard matrix using a combination of Paley - and Sylvester constructions. + Tries to construct a Hadamard matrix using the available methods. INPUT: @@ -1417,6 +1416,10 @@ def hadamard_matrix(n,existence=False, check=True): if existence: return True M = turyn_type_hadamard_matrix_smallcases(n, check=False) + elif hadamard_matrix_spence_construction(n ,existence=True): + if existence: + return True + M = hadamard_matrix_spence_construction(n, check=False) elif skew_hadamard_matrix(n, existence=True) is True: if existence: return True