Opened 5 years ago

Last modified 9 months ago

#25250 new defect

Ideal operations unsupported over quotient rings

Reported by: Brent Baccala Owned by:
Priority: minor Milestone: sage-8.2
Component: algebra Keywords: Singular, quotient ring, ideal
Cc: Samuel Lelièvre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Some basic ideal operations are unsupported over quotient rings.

R.<x,y,z> = QQ[]
SE = R.quotient(y^2*z - x*(x-z)*(x+3*z))
(x,y,z) = SE.gens()

I = ideal(x,z)

J = ideal(SE(1))

Now, both quotient and saturation:


fail with almost the same error message:

TypeError: Cannot call Singular function 'quotient' with ring parameter of type '<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category'>'

Yet, we can perform the calculation by calling Singular directly:

def newquotient(i,j):
   iname = i._singular_().name()
   jname = j._singular_().name()
   return singular.ideal('quotient({0}, {1})'.format(iname, jname)).sage()


Something similar would probably work for saturation.

The problem, as I see it, is two fold. First, in libs/singular/function.pyx's __call__ method, only rings of type MPolynomialRing_libsingular or NCPolynomialRing_plural are supported, although quotient rings can definitely be converted to Singular:

sage: SE._singular_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 3
//        block   1 : ordering dp
//                  : names    x y z
//        block   2 : ordering C
// quotient ring from ideal
_[1]=-x^3-2*x^2*z+y^2*z+3*x*z^2 we should have something in __call__ that can handle a quotient ring, and maybe any ring that can be converted to a Singular representation.

Second, the ideal and sat functions in Singular don't seem to depend on the base ring being set, so the whole ring conversion problem is somewhat of a needless distraction. (Notice how simple the newquotient routine is.) Perhaps Singular functions should accept an additional option to bypass setting the base ring.

Change History (3)

comment:1 Changed 5 years ago by Samuel Lelièvre

Authors: slelievre

comment:2 Changed 5 years ago by Samuel Lelièvre

Authors: slelievre
Cc: Samuel Lelièvre added

comment:3 Changed 9 months ago by Songtao Mao

Actually, I do not know why it does not work for saturation.

Dx=S.ideal(a*b*c, b^2*c^2*d-a^2*b*c, a^2*c^2*d-b*2*a*c, a^2*b^2*d-a*b*c^2)

def newsat(i,j):
   iname = i._singular_().name()
   jname = j._singular_().name()
   return singular.ideal('sat({0}, {1})'.format(iname, jname)).sage()


And some error occurs

TypeError: Singular error:
   ? `ideal`(sage289) = `list` is not supported
   ? expected `ideal` = `ideal`
   ? expected `ideal` = `module`
   ? expected `ideal` = `matrix`
   ? error occurred in or before STDIN line 676: `ideal sage289=sage288;`
   ? expected ideal-expression. type 'help ideal;'

I do not know why. Hope someone can help.

Note: See TracTickets for help on using tickets.