Faster Walsh-Hadamard and Discrete Fourier Transforms From Matrix Non-Rigidity

Josh Alman, Kevin Rao

Abstract

We give algorithms with lower arithmetic operation counts for both the Walsh-Hadamard Transform (WHT) and the Discrete Fourier Transform (DFT) on inputs of power-of-2 size $N$. For the WHT, our new algorithm has an operation count of $\frac{23}{24}N \log N + O(N)$, providing the first improvement on the $N \log N$ folklore algorithm. For the DFT, our new FFT algorithm uses $\frac{15}{4}N \log N + O(N)$ real arithmetic operations. Our leading constant $\frac{15}{4} = 3.75$ improves on the leading constant of 5 from Cooley-Tukey (1965), 4 from split-radix (1968), $\frac{34}{9} \approx 3.777$ from Van Buskirk (2004), and 3.76875 from Sergeev (2017). Our new WHT algorithm exploits matrix non-rigidity, decomposing the WHT matrix into low-rank and sparse components. Our new DFT algorithm uses a novel reduction, replacing parts of previous FFTs with calls to our improved WHT algorithm.

Introduction

The Discrete Fourier Transform (DFT) and the Walsh-Hadamard Transform (WHT) are fundamental tools in signal processing, data compression, and quantum computing. While their $O(N \log N)$ complexity has been known since the 1960s, the leading constant of this complexity remains a critical target for optimization in high-performance computing. For the WHT, the standard "folklore" algorithm has a leading constant of 1.0, a barrier that has stood for decades. For the DFT, the leading constant has seen incremental improvements from 5.0 down to approximately 3.768. This work breaks these long-standing theoretical barriers by leveraging the concept of matrix non-rigidity.

Methodology

The core innovation lies in the application of Matrix Rigidity theory. A matrix is rigid if its rank cannot be significantly reduced by changing a small number of entries. Conversely, a non-rigid matrix can be decomposed into a sum of a low-rank matrix and a sparse matrix.

WHT via Non-Rigidity

The authors exploit the non-rigidity of the $8 \times 8$ Hadamard matrix ($H_8$). By decomposing $H_8$ and carefully reusing intermediate sums across the low-rank and sparse components, they reduce the operation count for this base case from 24 to 23. Due to the recursive nature of the WHT, this single-operation saving in the base case propagates through every layer of the $N \log N$ computation tree.

The "Uprooting" Trick and DFT Optimization

To improve the DFT, the authors developed a novel reduction strategy. They observed that the arithmetic structure of additions and subtractions in a Modified Split-Radix FFT is identical to that of a WHT. By "uprooting" these specific operations and replacing them with their new, faster WHT algorithm, the speedup is inherited by the FFT.

Algorithm 2: Split-Radix FFT (Rewritten) showing the complex arithmetic structure targeted for optimization.

Furthermore, the algorithm utilizes bit-shift optimizations by pushing multiplications by 2 into the recursive base cases, taking advantage of fast hardware-level bit shifts instead of general floating-point multiplications.

Key Results

The primary contribution of this work is the establishment of new theoretical upper bounds for arithmetic complexity for both transforms.

  • Walsh-Hadamard Transform: The leading constant is reduced from 1.0 to approximately 0.958 ($\frac{23}{24}$).
  • Discrete Fourier Transform: The new "WHUFFT" (Walsh-Hadamard Uprooted FFT) achieves a leading constant of 3.75 ($\frac{15}{4}$), setting a new world record.
Comparison of leading constants for various DFT algorithms, highlighting the improvement achieved in this work.

Conclusion and Future Work

This research demonstrates that matrix non-rigidity is a powerful tool for algorithmic design, not just a theoretical curiosity. While the current results are limited to power-of-two input sizes, they open new avenues for optimization. Future work may involve direct exploitation of DFT non-rigidity or investigating how these theoretical operation count reductions translate to wall-clock time on modern hardware, where memory access patterns and cache locality are equally critical to performance.

Summary updated

Abstract

We give algorithms with lower arithmetic operation counts for both the Walsh-Hadamard Transform (WHT) and the Discrete Fourier Transform (DFT) on inputs of power-of-2 size $N$. For the WHT, our new algorithm has an operation count of $\frac{23}{24}N \log N + O(N)$. To our knowledge, this gives the first improvement on the $N \log N$ operation count of the simple, folklore Fast Walsh-Hadamard Transform algorithm. For the DFT, our new FFT algorithm uses $\frac{15}{4}N \log N + O(N)$ real arithmetic operations. Our leading constant $\frac{15}{4} = 3.75$ improves on the leading constant of $5$ from the Cooley-Tukey algorithm from 1965, leading constant $4$ from the split-radix algorithm of Yavne from 1968, leading constant $\frac{34}{9}=3.777\ldots$ from a modification of the split-radix algorithm by Van Buskirk from 2004, and leading constant $3.76875$ from a theoretically optimized version of Van Buskirk's algorithm by Sergeev from 2017. Our new WHT algorithm takes advantage of a recent line of work on the non-rigidity of the WHT: we decompose the WHT matrix as the sum of a low-rank matrix and a sparse matrix, and then analyze the structures of these matrices to achieve a lower operation count. Our new DFT algorithm comes from a novel reduction, showing that parts of the previous best FFT algorithms can be replaced by calls to an algorithm for the WHT. Replacing the folklore WHT algorithm with our new improved algorithm leads to our improved FFT.
BibTeX
@inproceedings{alman2023faster,
  author = {Josh Alman and Kevin Rao},
  title = {{Faster Walsh-Hadamard and Discrete Fourier Transforms From Matrix Non-Rigidity}},
  booktitle = {STOC},
  year = {2023},
  doi = {10.1145/3564246.3585188},
}
Figure