research/lab/py/walsh-fill
0 directories and 2 files in research/lab/py/walsh-fill.
walsh-fill
- Computes the Walsh coefficients
hat f(S) = 2^-dim sum_(c in F) (-1)^(|S cap c|)of every base-2 design atdim 1..4by one Hadamard product, and their level sumsW_j = sum_(|S| = j) hat f(S), kept as the integers2^dim W_j. - Corner
iis the binary digits ofi, most significant first, asmrlyrs::math::bang::factory::code_to_cornersreads a code. section_expansioncounts filled cells on literal grids, every nonempty code atdim 1..3and 2000 seeded codes atdim 4, sides1..9, plus a literal corner histogram against all 65536 codes atdim 4, and checks2^dim fill(N) = sum_j 2^dim W_j N^(dim-j)at oddNandw N^dimat evenN.section_profilechecks2^dim W_j = sum_w a_w K_j(w),K_jthe Krawtchouk polynomial, on every code atdim 1..4, andK^2 = 2^dim I.section_mirrorchecksfill_F(-N) = (-1)^dim fill_F'(N)on every code atdim 1..4, testsfill_F(-N) = +- void_F(N)against the profile criteriona_j + a_(dim-j) = C(dim, j), the count formula and the self-dual designs.section_rootsmaps every rootr != 1/2ofP_F(n)tomu = 1/(2r - 1)and evaluatesR(mu) = sum_j W_j mu^jthere, on the 77 profiles atdim 1..3, and checksR > 0on a grid of(-1, 1).section_driftchecksdim/2 - mean = W_1/(2 W_0)on every nonempty code atdim 1..4, and2^dim W_1 = U, the bichromatic edge count, exactly on the down-sets.section_stabilitychecks2^dim sum_(c in F) fill_(F+c)(N) = sum_j 2^(2 dim) W^j N^(dim-j),W^jthe squared-coefficient weight, andsum_c fill_(F+c)(N) = w N^dimover all flips, by literal counts at odd sides1..9, every code atdim 1..3.section_entropyprints-log2of the fill ratio at sides2, 3, 9, ..., 729fordim 1 code 1,dim 1 code 2,dim 2 code 7,dim 3 code 23.section_thresholdchecks2^dim W_0 = S(dim, t)and2^dim W_1 = (t+1) C(dim, t+1)for the rule "at mosttodd" atdim 1..8by a Hadamard transform of each rule, prints the majority ratios, and groupsS(dim, t)/2^dimover0 <= t < dim <= 2048by exact value.section_flatfinds the codes withW_j = 0for0 < j < dimatdim 1..4, checks them against the level-parity criterion, and intersects them with the 896 bent codes atdim 4.
RUN
uv run python research/lab/py/walsh-fill/walsh.py
- From the repo root; one core, about 4 seconds: expansion 0.1s, mirror 0.6s, drift 0.6s, threshold 2.1s, the rest under 0.2s each. A verb name runs one section.
WITNESSES
method.mdThe coin, Theorem: 339045 expansion checks at odd sides and 271236 even-side checks, 0 mismatches;Wofdim 2 code 7,dim 2 code 11,dim 3 code 23,dim 3 code 232.method.mdThe coin,N -> -Nswaps fill and void exactly at a balanced profile: swapping designs 2, 4, 40, 2800 atdim 1..4, equal to the profile criterion and the count formula, self-dual 2, 4, 16, 256 inside;dim 3 code 27, corners000, 001, 011, 100, the least non-self-dual swap,dim 2 code 3swaps,dim 3 code 1does not.method.mdThe coin, The roots are zeros of the biased mean: 77 profiles, worst residual2.7e-15.method.mdThe coin, The drift is half the slope of the log biased mean at the fair coin: drift identity on 65808 codes;2^dim W_1 = Uon the nonempty down-sets, 2, 5, 19, 167 atdim 1..4, and on no other code.method.mdThe coin, Noise stability is the fill summed over the flips by filled corners: 2730 literal checks; the four polynomials of thedim 3 code 23flip orbit.method.mdThe coin, A level costslog2(2^dim/w)bits at infinite side: side-3 costs0.584962501,1.584962501,0.169925001,0.432959407atdim 1 code 1,dim 1 code 2,dim 2 code 7,dim 3 code 23, andNtimes the gap at side 729 against(W_1/W_0)/ln 2.method.mdThe coin, Threshold rules and Shared limit ratios: majority1/2, 3/4, 1/2, 11/16, 1/2, 21/32, 1/2, 163/256atdim 1..8;5/16and11/16atdim 4; beyond1/2, held by the 1024 odd majorities, 26 shared values todim 2048, each held by exactly two rules.method.mdThe coin, Lower-order-free designs: 4, 8, 4, 140 atdim 1..4, none of the 896 bent codes atdim 4.