How to get the value of Hadamard matrix given its column and row index?

331 Views Asked by At

Please refer to https://en.wikipedia.org/wiki/Hadamard_matrix for the Sylvester's construction of Hadamard matrix.

Given a Hadamard matrix $H\in R^{n\times n}$, then how to get the value of $H_{ij}$ via a math function like $f(i,j)$?

1

There are 1 best solutions below

1
On

I think that it looks as follows: Let $n=2^k$ and write the indices (from $0$ to $2^{k}-1$) in binary form: $i=i_0+2i_1+ ... 2^{k-1} i_{k-1}$ and $j=j_0+2j_1+ ... 2^{k-1} j_{k-1}$. Then $$ f(i,j)=\left( -1 \right)^{i_0j_0 + ... + i_{k-1}j_{k-1}} $$