Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
f4 and mgb opts for M2 gb computations
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Oct 6, 2019
1 parent 533fd5d commit 0d90888
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/sage/rings/polynomial/multi_polynomial_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ def _macaulay2_(self, macaulay2=None):
self.__macaulay2[macaulay2] = z
return z

def _groebner_basis_macaulay2(self):
def _groebner_basis_macaulay2(self, strategy=None):
r"""
Return the Groebner basis for this ideal, computed using
Macaulay2.
Expand Down Expand Up @@ -3019,7 +3019,15 @@ def _groebner_basis_macaulay2(self):
from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence

I = self._macaulay2_()
G = str(I.gb().generators().external_string()).replace('\n','')
if strategy is None:
m2G = I.gb().generators()
elif strategy == 'f4':
m2G = I.groebnerBasis('Strategy=>F4')
elif strategy == 'mgb':
m2G = I.groebnerBasis('Strategy=>MGB')
else:
raise ValueError("Wrong M2 option")
G = str(m2G.external_string()).replace('\n','')
i = G.rfind('{{')
j = G.rfind('}}')
G = G[i+2:j].split(',')
Expand Down

0 comments on commit 0d90888

Please sign in to comment.