Skip to content

Commit ce7457f

Browse files
author
Release Manager
committed
gh-36103: upgrade msolve to 0.5.0, update interface - upgrade msolve to 0.5.0 - add support for Gröbner bases over ℚ to the msolve interface Fixes #36055. URL: #36103 Reported by: Marc Mezzarobba Reviewer(s): Matthias Köppe
2 parents a3e6bb2 + 4aa8a9e commit ce7457f

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

build/pkgs/msolve/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tarball=msolve-VERSION.tar.gz
2-
sha1=db99898afd03c2491d7d2190b89cea9ff0c41313
3-
md5=4ff5909d27f164aad9f7bdff633c037d
4-
cksum=507678049
2+
sha1=bfd1d4f2e5dc0eb321592b3add6665a9d3eadf8c
3+
md5=33a16c21ea8dea9e796d40f1dfd52fa9
4+
cksum=117017965
55
upstream_url=https://github.com/algebraic-solving/msolve/releases/download/vVERSION/msolve-VERSION.tar.gz

build/pkgs/msolve/package-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.9
1+
0.5.0

src/sage/rings/polynomial/msolve.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _run_msolve(ideal, options):
6464

6565
return msolve_out.stdout
6666

67-
def groebner_basis_degrevlex(ideal):
67+
def groebner_basis_degrevlex(ideal, proof=True):
6868
r"""
6969
Compute a degrevlex Gröbner basis using msolve
7070
@@ -85,25 +85,27 @@ def groebner_basis_degrevlex(ideal):
8585
[c^4 + 38*c^3 - 6*c^2 - 6*c, 30*c^3 + 32*c^2 + b - 14*c,
8686
a + 2*b + 2*c - 1]
8787
88-
TESTS::
89-
90-
sage: R.<foo, bar> = PolynomialRing(GF(536870909), 2)
91-
sage: I = Ideal([ foo^2 - 1, bar^2 - 1 ])
92-
sage: I.groebner_basis(algorithm='msolve') # optional - msolve
93-
[bar^2 - 1, foo^2 - 1]
88+
Gröbner bases over the rationals require `proof=False`::
9489
9590
sage: R.<x, y> = PolynomialRing(QQ, 2)
9691
sage: I = Ideal([ x*y - 1, (x-2)^2 + (y-1)^2 - 1])
9792
sage: I.groebner_basis(algorithm='msolve') # optional - msolve
9893
Traceback (most recent call last):
9994
...
100-
NotImplementedError: unsupported base field: Rational Field
95+
ValueError: msolve relies on heuristics; please use proof=False
96+
sage: I.groebner_basis(algorithm='msolve', proof=False) # optional - msolve
97+
[x*y - 1, x^2 + y^2 - 4*x - 2*y + 4, y^3 - 2*y^2 + x + 4*y - 4]
98+
99+
TESTS::
100+
101+
sage: R.<foo, bar> = PolynomialRing(GF(536870909), 2)
102+
sage: I = Ideal([ foo^2 - 1, bar^2 - 1 ])
103+
sage: I.groebner_basis(algorithm='msolve') # optional - msolve
104+
[bar^2 - 1, foo^2 - 1]
101105
"""
102106

103-
base = ideal.base_ring()
104-
if not (isinstance(base, FiniteField) and base.is_prime_field() and
105-
base.characteristic() < 2**31):
106-
raise NotImplementedError(f"unsupported base field: {base}")
107+
if ideal.base_ring() is QQ and sage.structure.proof.proof.get_flag(proof, "polynomial"):
108+
raise ValueError("msolve relies on heuristics; please use proof=False")
107109

108110
drlpolring = ideal.ring().change_ring(order='degrevlex')
109111
msolve_out = _run_msolve(ideal, ["-g", "2"])

src/sage/rings/polynomial/multi_polynomial_ideal.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,8 +4272,7 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal
42724272
Macaulay2's ``GroebnerBasis`` command with the strategy "MGB" (if available)
42734273
42744274
``'msolve'``
4275-
`optional package msolve <../spkg/msolve.html>`_ (degrevlex order,
4276-
prime fields)
4275+
`optional package msolve <../spkg/msolve.html>`_ (degrevlex order)
42774276
42784277
``'magma:GroebnerBasis'``
42794278
Magma's ``Groebnerbasis`` command (if available)

0 commit comments

Comments
 (0)