Flint nmod matrices - #35
Closed
vincentmacri wants to merge 202 commits into
Closed
Conversation
Integrate the HiGHS MILP/LP solver backend and wiring (meson + conda metadata), and bump the bundled HiGHS package to 1.12.0.
…d corresponding error handling in the backend.
…st, dancing_links, connectivity, domination, and graph modules.
… the precision issue
- Update HiGHS from 1.12.0 to 1.13.0 with new checksums - Add spkg-configure.m4 for system package detection with compile test to verify headers are usable (handles broken distro packages) - Add distros/*.txt files for various package managers: arch, conda, debian, fedora, freebsd, gentoo, homebrew, macports, nix, opensuse, repology, void - Fix meson.build: use pkg-config includedir directly (already ends with /highs) - Fix highs_c_api.pxd: use 'interfaces/highs_c_api.h' to match include path
…e floating-point imprecision
…sibility in HiGHS
sagemathgh-42145: Set ruff format quote-style to preserve We have not adopted a strict rule throughout the project on using `'` versus `"` for quotes. This PR changes our ruff configuration to leave quotes alone, so that developers can use `ruff format` without creating large diffs that mostly just change `'` to `"`. If we ever decide to enforce either single or double quotes, we can just change this config option then. Hopefully this makes it easier to use `ruff format` more often when developing Sage without cluttering diffs. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42145 Reported by: Vincent Macri Reviewer(s): Antoine Leudière
sagemathgh-42149: Fix unused local lint errors <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42149 Reported by: Chenxin Zhong Reviewer(s): Martin Rubey
sagemathgh-42150: Use bootstrap -s to avoid downloading configure-hash package In the release workflow, `make configure` only regenerates `configure`; it does not create the matching `upstream/configure-<commit>.tar.gz` tarball. For unreleased commits, `make dist` later expects that tarball to exist. If it does not exist locally, Sage falls back to downloading it. Since unreleased commit tarballs have not been uploaded to the Sage mirrors or GitHub release assets, the download fails. Using `./bootstrap -s` solves this because it both regenerates `configure` and saves the matching configure tarball locally under `upstream/`. <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42150 Reported by: Chenxin Zhong Reviewer(s): Kwankyu Lee
sagemathgh-42151: faster enumeration of immutable trees We use the new method for building immutable graphs directly from list of edges introduced in sagemath#41988 to speed up the enumeration of immutable trees Before ```py sage: %timeit [len(list(graphs.trees(i, immutable=False))) for i in range(15)] 21.5 ms ± 84.2 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: %timeit [len(list(graphs.trees(i, immutable=True))) for i in range(15)] 125 ms ± 138 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) ``` After ```py sage: %timeit [len(list(graphs.trees(i, immutable=False))) for i in range(15)] 21.7 ms ± 258 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: %timeit [len(list(graphs.trees(i, immutable=True))) for i in range(15)] 66.3 ms ± 551 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42151 Reported by: David Coudert Reviewer(s): Frédéric Chapoton
sagemathgh-42152: minor fixes for pep8 in various files about missing or spurious empty lines, etc ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#42152 Reported by: Frédéric Chapoton Reviewer(s): David Coudert, Frédéric Chapoton, Martin Rubey
sagemathgh-42153: remove and deprecate the auld class CommutativeRing as another little step towards getting rid of the auld way of doing things, before categories ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#42153 Reported by: Frédéric Chapoton Reviewer(s):
sagemathgh-42155: add parameter immutable to distance regular graph generators (part 5) Following discussions in sagemath#39177, we add the option to return immutable graphs to some generators in `src/sage/graphs/generators/distance_regular.pyx`. - `graph_with_classical_parameters`, `pseudo_partition_graph`, `near_polygon_graph` We also add parameter `immutable` to methods `project_left` and `project_right` of `BipartiteGraph` and to method `folded_graph` of `Graph`. After that, it remains only method `distance_regular_graph` in `src/sage/graphs/generators/distance_regular.pyx`. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42155 Reported by: David Coudert Reviewer(s): Martin Rubey
sagemathgh-42160: fix wrong change in findstat interface fix wrong change done in sagemath#42123 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#42160 Reported by: Frédéric Chapoton Reviewer(s): Chenxin Zhong, Martin Rubey
sagemathgh-42161: Remove the rpy2 monkey patch <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> After upstream fix the issue, we can remove the monkey patch I added before ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42161 Reported by: Chenxin Zhong Reviewer(s): Michael Orlitzky
sagemathgh-42162: Fix matrix PID echelon doctest warnings ## What changed Removed stale `# needs sage.rings.number_field` markers from the shared `_echelon_form_PID` doctest setup and the dependent 2x2 example in `src/sage/matrix/matrix2.pyx`. ## Why The doctest setup defined `OL` and `a` only on examples marked optional, while later unmarked examples reused those variables. The doctest runner correctly warned that those variables were conditionally defined. Making the setup and dependent example regular doctests keeps the block internally consistent without adding more `# needs` tags or changing doctest behavior. ## Validation - `source /home/zhongcx/miniforge3/etc/profile.d/conda.sh && conda activate sage && ./sage -t src/sage/matrix/matrix2.pyx` - Result: 3228 tests passed, with the previous warnings gone. URL: sagemath#42162 Reported by: Chenxin Zhong Reviewer(s): Michael Orlitzky
sagemathgh-42163: Bound random cone After sagemath#42065 fix a hang on `matrix2.pyx` test ``` ./sage -t --warn-long 5.0 --random- seed=5577856474804946308033095330486221191 src/sage/matrix/matrix2.pyx ``` <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42163 Reported by: Chenxin Zhong Reviewer(s): Michael Orlitzky
sagemathgh-42167: Add support for reversion of power series in positive characteristic This PR improves the `reverse` method for power series/Laurent series to work in base rings of positive characteristic. The three methods relevant to this PR are all called `reverse` located in - `power_series_poly.pyx` - `laurent_series_ring_element.pyx` - `power_series_pari.pyx` The first two methods share implementation, while the third has a separate implementation. All three fail to reverse power series when the power series coefficients are **not** in $`\mathbb{F}_p`$ for some prime $`p`$. That is, a power series like $`f(x) = x + 2x^{2} + x^{3} +O(x^{4})`$ with coefficients coming from $`\mathbb{F}_3`$ can be reversed but something like $`g(x) = (1+a)x + 2x^{2} + O(x^{3})`$ with coefficients coming from $`\mathbb{F}_{3^2}`$ cannot be reversed. The default implementation in `power_series_poly.pyx` uses PARI for reversing and if it fails, attempts to lift to a characteristic zero field and tries to use Lagrange Inversion. However, `pari.serreverse` fails for non-prime finite fields and no `lift` method exists for non- prime finite field elements in SAGE. This results in a failure to reverse such series. Since there is no canonical way to lift such finite field elements, we instead implement Lagrange Inversion using a formula that avoids division-by-zero errors in positive characteristic. The formula used is formula 2.1.2 from I. M. Gessel's paper [Lagrange Inversion](https://arxiv.org/abs/1609.05988) and we use F. Johansson's Algorithm 1 found in [A fast algorithm for reversion of power series](https://arxiv.org/abs/1108.4772) for reversion. This algorithm is a good choice for a default implementation and is already part of libraries like FLINT. For the PARI version in `power_series_pari.pyx`, the same issue with `pari.serreverse` results in failure. Fixing this requires lifting to p-adics in PARI, which we don't address in this PR. A warning block has been added to reflect this issue. Additional changes following the suggestions in sagemath#40576 : 1. Rename `reverse` to `revert`. This is because `reverse` suggests a reversal of the list of coefficients instead of reversion of series. Such methods already exist elsewhere in SAGE, for example the `reverse` method for polynomials reverses coefficients. 2. The method `reverse` is deprecated. 3. Add `compositional_inverse` as an alias to `revert`. This change also harmonizes names with the method for reversion for `LazyPowerSeries` which is called `revert` with an alias `compositional_inverse`. 4. Improved documentation and added references. 5. Updated `laurent_series_ring_element.pyi` to reflect changes to the `pyx` file. Relevant issue : [https://github.com/sagemath/sage/issues/40576](url) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42167 Reported by: Eros M Reviewer(s): Martin Rubey
sagemathgh-42168: Fix doctest when `cypari2 leaked` is fixed <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> In sagemath/cypari2#206 there is a fix for the `cypari2 leaked ... on the PARI stack` warnings, that will eventually be part of a new release of cypari2. This PR fixes a couple of doctests in sagemath that fail with that fix. The doctests should then pass with or without the warning. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42168 Reported by: Gonzalo Tornaría Reviewer(s): Chenxin Zhong
sagemathgh-42178: remove code deprecated in sagemath#37170 URL: sagemath#42178 Reported by: Lorenz Panny Reviewer(s): Chenxin Zhong
sagemathgh-42181: implement proper hash for gap integers and rationals Make libgap hash to coincide with sage on integers and rationals. A step towards sagemath#30498 URL: sagemath#42181 Reported by: Vincent Delecroix Reviewer(s): Martin Rubey
sagemathgh-42184: fix mistake in documentation I made a serious and very embarassing mistake in the documentation, please review quickly! URL: sagemath#42184 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-42188: fixing a bunch of "optional -internet" doctests mostly by adding ... at the appropriate places. Cf sagemath#25536 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: sagemath#42188 Reported by: Frédéric Chapoton Reviewer(s): Martin Rubey
sagemathgh-42191: adding egf_to_ogf and converse and hadamard_product to lazy series as this is useful to have. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: sagemath#42191 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Martin Rubey
sagemathgh-42193: update to 2.12.0, convert to pip spkg resolve deprecation warnings, switch to pip package ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#42193 Reported by: Dima Pasechnik Reviewer(s): Martin Rubey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.