Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sage/interfaces/singular.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def eval(self, x, allow_semicolon=True, strip=True, **kwds):
sage: o = s.hilb()
...// dimension (affine) = 0
// degree (affine) = 8
// ** right side is not a datum, assignment ignored
// ** right side is not a datum, assignment...ignored
...

rather than ignored
Expand Down Expand Up @@ -1763,7 +1763,7 @@ def sage_poly(self, R=None, kcache=None):
-4.00000000000000*z^3 - 27.0000000000000
sage: Rx.<x> = RR[]
sage: Rx("x + 7.5")._singular_().sage_poly()
x + 7.50000
x + 7.50000...
sage: Rx("x + 7.5")._singular_().sage_poly(Rx)
x + 7.50000000000000

Expand Down
29 changes: 1 addition & 28 deletions src/sage/libs/singular/function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1262,31 +1262,6 @@ cdef class SingularFunction(SageObject):
sage: with open(out) as f:
....: 'is no standard basis' in f.read()
False


TESTS:

We show that the interface recovers gracefully from errors::

sage: P.<e,d,c,b,a> = PolynomialRing(QQ,5,order='lex')
sage: I = sage.rings.ideal.Cyclic(P)

sage: triangL = sage.libs.singular.function_factory.ff.triang__lib.triangL
sage: _ = triangL(I)
Traceback (most recent call last):
...
RuntimeError: error in Singular function call 'triangL':
The input is no groebner basis.
leaving triang.lib::triangL (0)

Flush any stray output -- see :issue:`28622`::

sage: sys.stdout.flush()
...

sage: G= Ideal(I.groebner_basis())
sage: triangL(G,attributes={G:{'isSB':1}})
[[e + d + c + b + a, ...]]
"""
global dummy_ring

Expand Down Expand Up @@ -1351,9 +1326,7 @@ EXAMPLES::
sage: I = Ideal(Ideal(f1,f2).groebner_basis()[::-1])
sage: triangL(I, attributes={I:{'isSB':1}})
[[x2^4 + 4*x2^3 - 6*x2^2 - 20*x2 + 5, 8*x1 - x2^3 + x2^2 + 13*x2 - 5],
[x2, x1^2],
[x2, x1^2],
[x2, x1^2]]
[x2, x1^2]...

""" % (self._name)
from sage.interfaces.singular import get_docstring
Expand Down
4 changes: 1 addition & 3 deletions src/sage/rings/polynomial/multi_polynomial_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,7 @@ def triangular_decomposition(self, algorithm=None, singular=None):
sage: f2 = 1/2*((x1^2 + 2*x1 + 1)*x2^2 + 2*(x1^2 + x1)*x2 - 4*x1^2)
sage: I = Ideal(f1,f2)
sage: I.triangular_decomposition()
[Ideal (x2, x1^2) of Multivariate Polynomial Ring in x1, x2 over Rational Field,
Ideal (x2, x1^2) of Multivariate Polynomial Ring in x1, x2 over Rational Field,
Ideal (x2, x1^2) of Multivariate Polynomial Ring in x1, x2 over Rational Field,
[Ideal (x2, x1^2) of Multivariate Polynomial Ring in x1, x2 over Rational Field...
Ideal (x2^4 + 4*x2^3 - 6*x2^2 - 20*x2 + 5, 8*x1 - x2^3 + x2^2 + 13*x2 - 5)
of Multivariate Polynomial Ring in x1, x2 over Rational Field]

Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/polynomial_ring_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def PolynomialRing(base_ring, *args, **kwds):
// block 2 : ordering C
sage: print(singular(R))
polynomial ring, over a field, global ordering
// coefficients: Float() considered as a field
// coefficients: Float(...) considered as a field
// number of vars : 1
// block 1 : ordering dp
// : names x
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/polynomial_singular_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _singular_(self, singular=None):
sage: R.<x,y> = PolynomialRing(RealField(100)) # needs sage.rings.real_mpfr
sage: singular(R) # needs sage.libs.singular sage.rings.real_mpfr
polynomial ring, over a field, global ordering
// coefficients: Float()...
// coefficients: Float(...
// number of vars : 2
// block 1 : ordering dp
// : names x y
Expand Down
13 changes: 10 additions & 3 deletions src/sage/sandpiles/sandpile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2533,14 +2533,21 @@ def _set_resolution(self):
"""
# get the resolution in singular form
res = self.ideal()._singular_().mres(0)
len_res = len(res)
sing = res.parent()
# remove trailing zero in the resolution
found_zero = False
if sing.size(res[len_res]) == 0:
len_res -= 1
found_zero = True
# compute the betti numbers
# self._betti = [1] + [len(res[i])
# for i in range(1,len(res)-2)]
self._betti = [1] + [len(x) for x in res]
if found_zero:
self._betti = self._betti[:-1]
# convert the resolution to a list of Sage poly matrices
result = []
zero = self._ring.gens()[0] * 0
for i in range(1, len(res) + 1):
for i in range(1, len_res + 1):
syz_mat = []
new = [res[i][j] for j in range(1, int(res[i].size()) + 1)]
for j in range(self._betti[i]):
Expand Down
12 changes: 3 additions & 9 deletions src/sage/schemes/generic/algebraic_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,15 +1134,9 @@ def irreducible_components(self):

sage: PP.<x,y,z,w,v> = ProjectiveSpace(4, QQ)
sage: V = PP.subscheme((x^2 - y^2 - z^2) * (w^5 - 2*v^2*z^3) * w * (v^3 - x^2*z))
sage: V.irreducible_components() # needs sage.libs.singular
[Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
w,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
x^2 - y^2 - z^2,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
x^2*z - v^3,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
w^5 - 2*z^3*v^2]
sage: Vc=V.irreducible_components() # needs sage.libs.singular
sage: len(Vc)==4 and all(PP.subscheme(t) in Vc for t in [w, -w^5 + 2*z^3*v^2, -x^2*z + v^3, -x^2 + y^2 + z^2]) # needs sage.libs.singular
True

We verify that the irrelevant ideal is not accidentally returned
(see :issue:`6920`)::
Expand Down
Loading