This construction works for $n=m$ both powers of 2. Take an enumeration of the truth tables of the linear functions $$\{[\langle a,x\rangle: x \in GF(2)^k],a \in GF(2)^k\}.$$ This will have the weight property except for the fact that the first row and column will be all zeroes, for example, for $k=3,$ we get
Call this matrix $A,$ and let $J$ be the all one matrix with the same dimensions. The blockmatrix $$ \left( \begin{array}{c|c} A+J & A \\ A & A+J \end{array} \right) $$ hasalmost has the desired property with size $n=m=2^{k+1}.$ In this case we get
I have taken an $8\times 8$ seed matrix but one can take smaller ones or larger ones as needed.
Note: Apply any two permutations to The problem is the rows and columns respectively, i.ematch. To remove this, considerI have rotated the matrix with $(i,j)$ entry $C(\sigma(i),\pi(j)),$ to get anotherrows of the matrix withto the same propertiesright by one. Do any distinct permutations giveNote that the sameoriginal rows of matrix? I don't think so but don't have a proof. Actually permutations fixing halves in certain patterns would. It's late$A$ were the linear multivariate boolean functions, and shifting them by one yields nonlinear functions, so I won't go any further rightthey are now distinct from the columns. The final outcome is below:
I used the magma calculator online available here. The code is below (without the cyclic rotation):
V:=VectorSpace(GF(2),3); L:=[v: v in V];
A:=Matrix([[InnerProduct(L[i+1],L[j]): j in [1..8]]: i in [0..7]]);A;
J:=Matrix([[1: i in [1..8]]: j in [1..8]]); C:=BlockMatrix(2,2,[A+J,A,A,A+J]); C;
function GetRowW(A,j,n) return Weight(VectorSpace(GF(2),n)![A[j,k]: k in [1..n]]); end function;
function GetColW(A,j,n) return Weight(VectorSpace(GF(2),n)![A[k,j]: k in [1..n]]); end function;
"row weights",{* GetRowW(C,j,16): j in [1..16] *};
"number of rows"; #{ [C[j,k]: k in [1..16]]: j in [1..16] };
"column weights",{* GetColW(C,j,16): j in [1..16] *};
"number of cols"; #{ [C[j,k]: j in [1..16]]: k in [1..16] };