# Computational checks for rectangular Butson matrices Companion to **Analytic aspects of rectangular Butson matrices**, by GPT 6.2 and Teo 2.0, paper 030 (`030.tex` and `030.pdf`). Claude supplied the initial seven scripts with his report. This edition adopts them with corrections and reproducibility checks: the moment calculation now uses exact integers and rational numbers throughout; Walsh extension counting is cached and vectorized; the rate calculation includes an independent primal optimization; and failing checks raise assertions. The paper thanks Claude for useful discussions. ## Run With Python 3.10 or later, from this folder: ```sh python3 -m pip install -r requirements.txt python3 run_all.py ``` Do not use Python's `-O` option: it disables assertions. The runner uses at most two processes concurrently, writes each output to `logs/`, and exits with a nonzero status if a script fails. All scripts can also be run individually, for example `python3 momentcheck.py`. The dynamic-programming checks take roughly 1–2 minutes each on the tested machine; the others take a few seconds. Runtime and memory usage depend on the machine. `logs/run-summary.json` records the tested Python, NumPy and SciPy versions and actual runtimes. ## What each script checks | Script | Calculation | Arithmetic and scope | | --- | --- | --- | | `latticecheck.py` | Theorem 1.1: index of the column-step difference lattice in 13 cases, with levels between 2 and 12 and heights 3, 4, 5 | Exact integer row reduction; asserts the predicted index | | `ptwocheck.py` | Two-row return probabilities at levels 4, 6, 8, 9, 12, compared with the counting asymptotic | Integer dynamic programming; probabilities and asymptotic ratios are printed in floating point | | `pthreecheck.py` | Three-row counts at level 4 and widths 8, 12, 16; the ratio to the cube of the two-row probability approaches 2 | Integer dynamic programming; final ratios in floating point | | `fourcheck.py` | Four-count regularity criterion against exhaustive prime-cycle decomposition for 18,402 sampled vanishing multisets; sharpness examples for m = 1, 2, 3 | Integer criterion and exact recursive decomposition; seed 1; a complex-valued vanishing check is only a numerical sanity check | | `irate.py` | Entropy rate I_30 and minimizing frequency arrays | Floating-point Newton dual optimization and 20 SLSQP primal starts, seed 20261130; tests feasibility and agreement of costs | | `walshcheck.py` | Exact row-extension and completion counts for three subsets of missing Walsh rows; a fourth subset tests necessity of the hypothesis | Exhaustive integer calculations over the 65,536 sign rows of width 16 | | `momentcheck.py` | First level-dependent Gram-determinant moments at (q,N) = (3,4), (4,3), (5,3), (3,5), plus lower-moment identities | Exact integer multinomial coefficients and rational arithmetic; no floating-point roots | The samples in `fourcheck.py` are random with a fixed seed; the decomposition search on each sampled multiset is exhaustive. They do not exhaust all multisets. Dynamic-programming ratios illustrate asymptotics rather than prove limiting statements. None of these finite checks replaces the paper's proofs. ## Rate computation The variables are the 30 frequencies of `(-1)^s omega^i eta^j`, indexed by `15*s + 10*i + 6*j (mod 30)`. The eight equality constraints require the 3-by-5 difference array A-B to have additive form. The inequality is `T = A00 - B00 - A01 - A10 >= 0`. The dual calculation imposes the active boundary T = 0 and checks that its multiplier is positive. It gives I_30 approximately 0.052444395910 and exp(-I_30) approximately 0.948907. The separate primal solver keeps T >= 0 as an inequality and agrees from 20 random starts. Residuals and primal–dual differences appear in `logs/irate.log`. These are numerical checks, not interval-arithmetic certificates for decimal digits. ## Files and upload The archive contains one folder, `code030`, with seven checking scripts, the runner, this README, requirements, and compact logs generated by the adopted scripts. The logs are fresh runs, not Claude's original output files. For a GitHub browser upload, extract the ZIP and upload this folder's files and `logs` subfolder; uploading the ZIP itself does not expose the code as repository files. No Git command, large data file, or external input is needed.