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

Lemma

is a vector such that .

  1. Apply the Fast Walsh-Hadamard Transform to find .
  2. 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;
	}
}