Clean up size checks for matrix multiplication - #33
Closed
vincentmacri wants to merge 196 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-42065: Add restriction in random_cone parameters in examples <!-- ^ 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". --> Fix timeout problem for some bad random seeds ``` sage: V = K.lattice().vector_space() ## line 3446 ## sage: L = [V(l) for l in K.lines()] ## line 3447 ## sage: all( L[i].inner_product(L[j]).is_zero() ....: for i in range(len(L)) ....: for j in range(len(L)) ....: if i != j ) ## line 3448 ## True sage: K = random_cone(strictly_convex=False, ....: min_ambient_dim=8, ....: min_rays=4) ## line 3454 ## ------------------------------------------------------------------------ /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/cysignals/signals.cpython-312-x86_64-linux- gnu.so(+0x8697)[0x7fbde3366697] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/cysignals/signals.cpython-312-x86_64-linux- gnu.so(+0x8757)[0x7fbde3366757] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/cysignals/signals.cpython-312-x86_64-linux- gnu.so(+0x8af6)[0x7fbde3366af6] /lib/x86_64-linux-gnu/libc.so.6(+0x45330)[0x7fbde4445330] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/sage/ext/memory.cpython-312-x86_64-linux- gnu.so(+0x5360)[0x7fbde25ec360] /usr/share/miniconda/envs/sage- dev/lib/libgmp.so.10(__gmpz_init2+0x33)[0x7fbde1580b23] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/ppl/../. ./../libppl.so.14(_ZN23Parma_Polyhedra_Library10Polyhedron10conversionIN S_16Generator_SystemENS_17Constraint_SystemEEEmRT_mRT0_RNS_10Bit_MatrixE m+0x18cd)[0x7fbd7576c18d] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/ppl/../. ./../libppl.so.14(_ZNK23Parma_Polyhedra_Library10Polyhedron18update_cons traintsEv+0x501)[0x7fbd75774d71] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/ppl/../. ./../libppl.so.14(_ZNK23Parma_Polyhedra_Library10Polyhedron8minimizeEv+0 x76)[0x7fbd75775c86] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site-packages/ppl/../. ./../libppl.so.14(_ZNK23Parma_Polyhedra_Library10Polyhedron20minimized_g eneratorsEv+0x11)[0x7fbd7577e6c1] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/ppl/polyhedron.cpython-312-x86_64-linux- gnu.so(+0x29481)[0x7fbd75522481] python3(PyObject_Vectorcall+0x2e)[0x55b54924350e] python3(_PyEval_EvalFrameDefault+0xa45)[0x55b54922e315] python3(PyVectorcall_Call+0xd3)[0x55b5491e3ffd] /usr/share/miniconda/envs/sage-dev/lib/python3.12/site- packages/sage/misc/lazy_import.cpython-312-x86_64-linux- gnu.so(+0x19f18)[0x7fbde139cf18] python3(_PyObject_MakeTpCall+0x2bc)[0x55b549223fac] python3(_PyEval_EvalFrameDefault+0xa45)[0x55b54922e315] python3(PyEval_EvalCode+0x9f)[0x55b5492e675f] python3(+0x2d51ba)[0x55b5493051ba] python3(_PyEval_EvalFrameDefault+0x387d)[0x55b54923114d] python3(_PyObject_FastCallDictTstate+0x273)[0x55b549226cc3] python3(_PyObject_Call_Prepend+0x67)[0x55b54925dbc7] python3(+0x2feda9)[0x55b54932eda9] python3(_PyObject_MakeTpCall+0x2bc)[0x55b549223fac] python3(_PyEval_EvalFrameDefault+0xa45)[0x55b54922e315] python3(_PyObject_FastCallDictTstate+0x1ce)[0x55b549226c1e] python3(+0x22d7aa)[0x55b54925d7aa] python3(_PyObject_MakeTpCall+0x264)[0x55b549223f54] python3(_PyEval_EvalFrameDefault+0xa45)[0x55b54922e315] python3(PyEval_EvalCode+0x9f)[0x55b5492e675f] python3(+0x2f24ea)[0x55b5493224ea] python3(+0x2ed015)[0x55b54931d015] python3(+0x2ea020)[0x55b54931a020] python3(_PyRun_SimpleFileObject+0x1c6)[0x55b549319ce6] python3(_PyRun_AnyFileObject+0x44)[0x55b549319a14] python3(Py_RunMain+0x39e)[0x55b5493165ae] python3(Py_BytesMain+0x37)[0x55b5492ce677] /lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca)[0x7fbde442a1ca] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x7fbde442a28b] python3(+0x29e4e7)[0x55b5492ce4e7] ------------------------------------------------------------------------ Attaching gdb to process id 30135. Cannot find gdb installed GDB is not installed. Install gdb for enhanced tracebacks. ------------------------------------------------------------------------ ``` you can verify this use ``` src/bin/sage -t --warn-long 5.0 --random- seed=165473321169090073016534533946561390697 src/sage/geometry/cone.py # Timed out ``` Fix sagemath#42140 ### 📝 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#42065 Reported by: Chenxin Zhong Reviewer(s): Michael Orlitzky
sagemathgh-42070: src/sage/stats: remove remaining "needs sage.foo" tags These are unmaintained, and don't do anything in the upstream SageMath library. URL: sagemath#42070 Reported by: Michael Orlitzky Reviewer(s):
sagemathgh-42086: Improve determinant calculation reliable method <!-- ^ 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". --> deprecate the linbox det algorithm, then some minor variables type fix for warnings Fix a flaky random error ``` src/bin/sage -t --warn-long 5.0 --random- seed=79637430941298043968778220652708662528 src/sage/matrix/matrix_integer_dense.pyx ********************************************************************** Error: Failed example:: Got: False A.determinant(algorithm='linbox',proof=False) == d Expected: True Got: False ********************************************************************** 1 item had failures: 1 of 25 in sage.matrix.matrix_integer_dense.Matrix_integer_dense.determinant [681 tests, 1 failure, 11.84s wall] ``` ### 📝 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: ... --> sagemath#40974 sagemath#37068 URL: sagemath#42086 Reported by: Chenxin Zhong Reviewer(s): Chenxin Zhong, Michael Orlitzky
sagemathgh-42120: generate endomorphism rings of "special" supersingular elliptic curves Follow-up to sagemath#36665 and sagemath#38483: Here we saturate the order $$\langle 1,\mathrm i,\mathrm j,\mathrm{ij}\rangle$$ at each prime dividing the conductor until the order is maximal, thus computing the full endomorphism ring of the generated curve. This algorithm is far from optimal: A better implementation is forthcoming, but I figured it makes sense to get the interface deployed and make things work at all before focusing on a smarter, more optimized version. Depends on: sagemath#42085, sagemath#42087 (for performance in doctests) URL: sagemath#42120 Reported by: Lorenz Panny Reviewer(s): Chenxin Zhong
sagemathgh-42128: Add graph constructors for graphs defined by systems of equations This PR adds constructors for bipartite graphs defined by triangular systems of polynomial equations over finite commutative rings. This follows the sage-devel proposal suggested earlier here: https://groups.google.com/g/sage-devel/c/J4NpaJOt9Ac More precisely, the PR introduces a new module `sage.graphs.generators.luw_graphs` for graphs whose point and line parts are defined by coordinate tuples over a given ring, with adjacency determined by equations of the form \[ p_i + l_i = f_i(p_1, l_1, \ldots, p_{i-1}, l_{i-1}). \] The acronym LUW stands for Lazebnik-Ustimenko-Woldar who originally popularized this class of graphs. The implementation has two layers: - `LUWGraphDescriptor`, which stores a validated algebraic description of the graph without constructing the full graph. - Graph-returning constructors exposed through `graphs`, namely `graphs.LUWGraph`, `graphs.WengerGraph`, `graphs.Dkq`, and `graphs.Akq`. The last three are explciit constructions from the literature of some well-known classes of graphs. This graph class contains some of the best-known constructions for a variety of extremal problems in graph theory. The descriptor object is intended to make experimentation with large graphs defined by systems of equations more practical. It supports inspecting the defining equations, computing order and size, constructing the full graph when desired, computing neighbors and local balls without first constructing the whole graph, and computing the adjacency matrix directly. The PR also includes descriptor-returning constructors: - `define_luw_graph` - `define_WengerGraph` - `define_Dkq` - `define_Akq` Local checks run: - `./sage -python -m py_compile src/sage/graphs/generators/luw_graphs.py src/sage/graphs/graph_generators.py` - `./sage -t src/sage/graphs/generators/luw_graphs.py` - `./sage -t src/sage/graphs/graph_generators.py` - `./sage -tox -e pycodestyle -- src/sage/graphs/generators/luw_graphs.py` - `./sage -tox -e rst -- src/sage/graphs/generators/luw_graphs.py src/doc/en/reference/graphs/index.rst` - `./sage -tox -e codespell -- src/sage/graphs/generators/luw_graphs.py src/sage/graphs/graph_generators.py src/doc/en/reference/graphs/index.rst` I also rebuilt the `reference/graphs` PDF locally. The broader graphs manual still emits unrelated pre-existing citation/cross-reference warnings, but the PDF build completed successfully. ### 📝 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 NA URL: sagemath#42128 Reported by: Vladislav Taranchuk Reviewer(s): David Coudert
sagemathgh-42132: make change_var an alias of change_variable_name <!-- ^ 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#42132 Reported by: Martin Rubey Reviewer(s):
sagemathgh-42139: Add python3 to Docker runtime dependencies <!-- ^ 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". --> Docker image can not run ``` root@LAPTOP-A6042VHQ:~# sudo docker run -it sagemath/sagemath:latest /usr/bin/env: ‘python3’: No such file or directory ``` Fix sagemath#42138 Fix sagemath#40867 ### 📝 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#42139 Reported by: Chenxin Zhong Reviewer(s): Sebastian Oehms
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.
📝 Checklist
⌛ Dependencies