Repository navigation
Add a Hadamard matrix of order 2060 - #42876
Conversation
Use the orbit seed and Williamson quadruple from schneiderlo/hadamard-2060 with the existing Cooper-Wallis construction. Expose the order through matrix.hadamard and test existence, construction name, and orthogonality. Co-authored-by: Codex <codex@openai.com>
Show the matrix.hadamard(2060) entry point in examples, test the direct constructor separately, and name the author of the construction. Co-authored-by: Codex <codex@openai.com>
Restore the description of the Cooper-Wallis construction and credit Loïc Schneider specifically for finding the input sequences and Williamson quadruple. Co-authored-by: Codex <codex@openai.com>
Decode Loïc Schneider’s length-103 sequence seed in the existing small-cases constructor and reuse its order-5 Williamson quadruple. The generic Hadamard constructor now discovers order 2060 through the normal Cooper-Wallis path. Co-authored-by: Codex <codex@openai.com>
|
@schneiderlo - your construction is being added to Sage here. |
|
Documentation preview for this PR (built with commit ca5c3dc; changes) is ready! 🎉 |
|
(Sorry @vbraun) Even though the construction is now published and there are not too many ways to do the same thing, we should get confirmation from @schneiderlo before taking his code? |
|
@orlitzky it's all done with blessings by @schneiderlo, we have been in email contact, and planning to write a joint note on this. It was an AI-assisted discovery, which I then was able to unroll into a small addition to our source code. |
|
The construction itself takes a very long time and adds two new "slow doctest" warnings to the CI. To avoid this I would recommend something like what I did in https://github.com/sagemath/sage/blob/develop/src/sage/graphs/generators/distance_regular.pyx#L540 I made some slight modifications to the files, and the construction takes 20 minutes on my machine: If I instead pickle a list of list of python ints and xz them, then decompressing, unpickling, and constructing a matrix from them takes only 16s: (The compressed data file is only 106K, not 15M.) Obviously we do still want to test the construction, but this can be done in pytest with a "longlong" marker so that it is only run by the CI, as in https://github.com/sagemath/sage/blob/develop/src/sage/graphs/generators/generators_test.py |
Ok, thanks, I just didn't see a license in the repo and was worried. |
|
Yes we had an email exchange, if needed I can add a license to my repo if needed (would MIT be ok? Or something else?) . |
MIT, or a 3-clause BSD, or anything GPL-compatible will be fine. |
|
@orlitzky - I just asked Codex 🤖 to help your troubles, so now you should review the update... |
|
Thanks, it looks good to me if the CI passes (all jobs are currently queued). I can pickle the rows to speed up the method itself later on. |
|
As soon as I walked away, one more minor thing came to mind: the new I don't remember why, but someone once decided that the pytest files should be installed. AFAIK all of the others are. |
done. |
|
I have updated the repo schneiderlo/hadamard-2060 and it is now MIT |
|
I think two days is long enough to wait for the CI to finish, setting back to positive. |
sagemathgh-42876: Add a Hadamard matrix of order 2060 ## Summary Add the Hadamard matrix of order 2060 using the orbit seed and Williamson quadruple from [schneiderlo/hadamard- 2060](https://github.com/schneiderlo/hadamard-2060). The existing Cooper–Wallis constructor expands these data; the explicit matrix is not stored in Sage. `matrix.hadamard(2060)` now constructs a normalized matrix, and the existence and construction-name queries recognize the order. The doctests keep quick existence and construction-name checks. Full construction and normalized orthogonality checks for both the general and Cooper–Wallis entry points live in a parameterized pytest test marked `longlong`, following the existing graph-generator test convention. This removes the two expensive order-2060 constructions from doctest runs. ## Verification - Both `longlong` pytest cases pass locally (about 34 seconds combined on macOS arm64). - All 10 Cooper–Wallis small-cases doctests pass; both order-2060 general-constructor query doctests pass. One unchanged order-668 doctest could not complete because this environment lacks the optional graph database. - Ruff and `git diff --check` pass. - Local runtime checks use the existing compiled Sage libraries, with the updated module loaded from this worktree; the editable environment could not rebuild automatically. Fixes sagemath#42875. URL: sagemath#42876 Reported by: Dima Pasechnik Reviewer(s): Michael Orlitzky
Summary
Add the Hadamard matrix of order 2060 using the orbit seed and Williamson quadruple from schneiderlo/hadamard-2060. The existing Cooper–Wallis constructor expands these data; the explicit matrix is not stored in Sage.
matrix.hadamard(2060)now constructs a normalized matrix, and the existence and construction-name queries recognize the order.The doctests keep quick existence and construction-name checks. Full construction and normalized orthogonality checks for both the general and Cooper–Wallis entry points live in a parameterized pytest test marked
longlong, following the existing graph-generator test convention. This removes the two expensive order-2060 constructions from doctest runs.Verification
longlongpytest cases pass locally (about 34 seconds combined on macOS arm64).git diff --checkpass.Fixes #42875.