The Hadamard Determinant Problem asks what is the maximum value of the determinant of an \(n \times n\) matrix that has entries consisting of only \(\pm 1\). The optimal determinant is known up to \(n = 22\). This problem asks you to come up with a \(23 \times 23\) matrix such that the determinant is as large as possible.
Please submit a CSV file that contains \(23 \times 23 = 529\) values that are either \(\pm 1\). Each group of \(23\) numbers corresponds to a row of the \(23 \times 23\) matrix, call it \(M\). The best score corresponds to maximizing \(\frac{\det(M)}{10^9}\)
The following is a Python implementation of the score function to help you get started.
import numpy as np
from sympy import Matrix
def score(mat: [int]):
if len(mat) != 23 * 23:
return None
for num in mat:
if num != 1 and num != -1:
return None
np_mat = np.reshape(mat, (23, 23))
sym_mat = Matrix(np_mat)
return sym_mat.det() // (10 ** 9)