Weighting matrices appear in the statistical design of experiments (Weighting Matrices and Statistical Design of Experiments.
A weighting matrix is a generalization of Hadamard matrices, e.g.,
HadamardMatrix[8]
HadamardMatrix[8].Inverse[HadamardMatrix[8]]
HadamardMatrix[5]
but can have zeroes as entries in addition to -1 and +1--and they exist for square matrices that are not 4*(positive integer).
Beyond a random search which is trivial and not a great method, does anyone know how to compute a Weighing matrix of size (general positive integer)?
With[{size = 4}, Select[Tuples[Tuples[{-1, 0, 1}, size], size], Block[{diagQ = Transpose[#] . #, diagonals}, diagonals = Diagonal[diagQ]; DiagonalMatrixQ[diagQ] && AllTrue[diagonals, # == First[diagonals] &] ] &] ]
$\endgroup$