Skip to content

Commit

Permalink
Gröbner bases over ℚ via msolve
Browse files Browse the repository at this point in the history
  • Loading branch information
mezzarobba committed Aug 19, 2023
1 parent c8d8e13 commit 93b4384
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/sage/rings/polynomial/msolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _run_msolve(ideal, options):

return msolve_out.stdout

def groebner_basis_degrevlex(ideal):
def groebner_basis_degrevlex(ideal, proof=True):
r"""
Compute a degrevlex Gröbner basis using msolve
Expand Down Expand Up @@ -97,13 +97,13 @@ def groebner_basis_degrevlex(ideal):
sage: I.groebner_basis(algorithm='msolve') # optional - msolve
Traceback (most recent call last):
...
NotImplementedError: unsupported base field: Rational Field
ValueError: msolve relies on heuristics; please use proof=False
sage: I.groebner_basis(algorithm='msolve', proof=False) # optional - msolve
[x*y - 1, x^2 + y^2 - 4*x - 2*y + 4, y^3 - 2*y^2 + x + 4*y - 4]
"""

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

drlpolring = ideal.ring().change_ring(order='degrevlex')
msolve_out = _run_msolve(ideal, ["-g", "2"])
Expand Down
3 changes: 1 addition & 2 deletions src/sage/rings/polynomial/multi_polynomial_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4269,8 +4269,7 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal
Macaulay2's ``GroebnerBasis`` command with the strategy "MGB" (if available)
``'msolve'``
`optional package msolve <../spkg/msolve.html>`_ (degrevlex order,
prime fields)
`optional package msolve <../spkg/msolve.html>`_ (degrevlex order)
``'magma:GroebnerBasis'``
Magma's ``Groebnerbasis`` command (if available)
Expand Down

0 comments on commit 93b4384

Please sign in to comment.