Let be a matrix satisfying
The Inverse Fast Walsh-Hadamard Transform is an algorithm that finds a vector such that for a vector
in time and space.
Algorithm
Lemma
Proof
If each in , if ,
By induction, it follows that
Lemma
is a vector such that .
Proof
- Apply the Fast Walsh-Hadamard Transform to find .
- Apply the lemma to find .
This algorithm solves the problem in time and space.
void ifwht(int n, std::vector<int> &a) {
fwht(n, a);
for (int i = 0; i < 1 << n; i++) {
a[i] >>= n;
}
}