Exact Permutation Moments for Walsh Interaction-Order Energies: A Projector Specialization of Quadratic-Form Randomization Theory
Abstract
WHAT THIS PACKAGE DOES This reproducibility package accompanies the methods manuscript "Exact Permutation Moments for Walsh Interaction-Order Energies: A Projector Specialization of Quadratic-Form Randomization Theory" (J600, Roshankumar Chandaliya, QDL project). It provides the complete open-source implementation, exhaustive verification, computational benchmarks, and environment metadata needed to independently reproduce every numerical claim in the manuscript. WHY IT MATTERS Exact permutation moments of quadratic forms are classical, but their specialization to Walsh interaction-order projectors on the Boolean cube has not, to our knowledge, been packaged as a ready-to-use computational toolkit. That gap matters in practice: practitioners who want null distributions for Walsh-degree energies typically rely on large Monte Carlo permutation runs, which are slow and noisy. This package shows, with public code and reproducible benchmarks, that the same first- and second-order null moments can be computed analytically in microseconds — a speedup of roughly four to five orders of magnitude over Monte Carlo, with agreement to machine precision. WHAT THE MANUSCRIPT ESTABLISHES (BRIEFLY) For a centered finite population assigned to the N = 2^n vertices of the Boolean cube, the degree-k interaction-order energy is: E_k = sum_{|A|=k} g_hat_pi(A)^2 By specializing established quadratic-form randomization theory to orthogonal Walsh projectors, the manuscript derives compact exact formulas for the permutation mean, variance, and cross-level covariance. The formulas are verified exhaustively at N = 4 (24 permutations) and N = 8 (40,320 permutations), and benchmarked up to n = 18. WHAT IS INSIDE THE PACKAGE - Reference implementation of the exact null-moment formulas (exact_null_moments).- Two independent energy evaluators: dense Fast Walsh-Hadamard Transform (FWHT) and sparse Hamming/Krawtchouk aggregation, cross-checked against each other.- Monte Carlo benchmark using 100,000 uniform value permutations, for direct runtime comparison.- Exhaustive permutation verification at N = 4 (all 24 permutations) and N = 8 (all 40,320 permutations).- Edge-case verification: exact B = 0 case (g = [1, 1, 1, -3]), and a proof-by-grid-check that no valid centered N = 4 field admits B < 0.- Timing distributions as CSV files, reporting median, interquartile range, minimum, and maximum for each tested size.- Environment metadata: Python 3.13.5, NumPy 2.3.5, Intel Xeon Platinum 8573C, 5-vCPU container, kernel 6.18.44.- Publication-ready LaTeX benchmark table matching Table 3 of the manuscript.- SHA256 integrity manifest covering all scripts, CSVs, and the LaTeX table.- README with step-by-step reproduction instructions and a fixed random seed (20260917). HEADLINE COMPUTATIONAL RESULT On the recorded environment, the exact formula is approximately 10^4 to 10^5 times faster than a 100,000-permutation Monte Carlo estimate of the same first- and second-order moments, with numerical agreement to machine precision. Dense and sparse evaluators agree to a maximum relative error below 2.5 x 10^-16 across n = 4 through 18. Absolute timings are hardware-specific; all scripts and seeds are fixed so the benchmarks can be rerun on other machines. INTENDED AUDIENCE Statisticians, applied probabilists, and computational scientists working with permutation inference, Boolean Fourier analysis, high-order contingency tables, or log-linear interaction decompositions. Researchers who need fast, exact null moments for Walsh-degree energies can use this package directly; readers who want the underlying theorem should consult the companion manuscript. SCOPE AND HONEST BOUNDARIES This package is a computational and reproducibility artifact. It does not introduce new physical claims, does not imply causality or retrocausality, and does not establish any microscopic Hamiltonian. The theorem is a static finite-sample exchangeability result; it is not a temporal, interventional, or physical law. Timing results are machine- and implementation-specific and are reported as benchmarks, not as universal performance claims. The full permutation distribution and tail probabilities are outside the scope of first- and second-moment formulas and remain an open problem for this statistic. CITATION If you use this package, please cite both the companion manuscript and this record. Companion manuscript J600: DOI 10.5281/zenodo.22808605. LICENSE Source code — MIT. Data and benchmark outputs — CC BY 4.0. See the LICENSE file in the package for the full text.