Ticket #12188 (new defect)
Bug in is_smooth for curves over CC
| Reported by: | johanbosman | Owned by: | AlexGhitza |
|---|---|---|---|
| Priority: | critical | Milestone: | sage-5.10 |
| Component: | algebraic geometry | Keywords: | singular |
| Cc: | burcin, malb, vbraun, SimonKing, nbruin | Work issues: | |
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
sage: P.<X,Y,Z> = CC[] sage: C = Curve(X) sage: C.is_smooth() singular_ring_delete(ring*) called with NULL pointer. ... Exception KeyError: (The ring pointer 0x0,) in 'sage.libs.singular.ring.singular_ring_delete' ignored True
Change History
comment:2 Changed 17 months ago by burcin
- Cc malb, vbraun added
I'm not sure if this is actually supposed to work in Sage right now. Multivariate polynomial rings over CC use a generic implementation. The error message should just say "First parameter's ring must be multivariate polynomial ring via libsingular." This is not entirely clear, but at least it is a less scary message than "singular_ring_delete(ring*) called with NULL pointer."
Here is a shorter segment to reproduce the problem:
sage: P.<X,Y,Z> = CC[]
sage: I = P*X
sage: GroebnerStrategy(I)
File "/home/burcin/sage/sage-4.7.2/local/bin/sage-ipython", line 52, in <module>
ipy_sage.mainloop(sys_exit=1, banner='')
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/Shell.py", line 76, in mainloop
self.IP.mainloop(banner)
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib.py", line 1762, in mainloop
self.interact(banner)
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib.py", line 2001, in interact
more = self.push(line)
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib.py", line 2305, in push
more = self.runsource('\n'.join(self.buffer), self.filename)
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib.py", line 2231, in runsource
if self.runcode(code) == 0:
File "/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib.py", line 2260, in runcode
exec code_obj in self.user_global_ns, self.user_ns
File "<ipython console>", line 1, in <module>
Exception KeyError: (The ring pointer 0x0,) in ignored
singular_ring_delete(ring*) called with NULL pointer.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/burcin/sage/sage-4.7.2/<ipython console> in <module>()
/home/burcin/sage/sage-4.7.2/local/lib/python2.6/site-packages/sage/libs/singular/groebner_strategy.so in sage.libs.singular.groebner_strategy.GroebnerStrategy.__cinit__ (sage/libs/singular/groebner_strategy.cpp:2169)()
TypeError: First parameter's ring must be multivariate polynomial ring via libsingular.
This is the message I get after adding an "except +" after the declaration of singular_ring_delete().
It seems that GroebnerStrategy.__cinit__() (why __cinit__ and not __init__?) already has a doctest for this case. I don't see why the error message is not caught by the doctesting framework. Are these cython errors printed to stderr now?
In any case, GroebnerStrategy.__cinit__() raises an error on line 99 of sage/libs/singular/groebner_strategy.pyx. I thought the __dealloc__() method is not called if there is an error during __init__(). Any ideas what is going wrong here?
I suggest to open a new ticket to use libsingular from multivariate polynomial rings over CC and RR. This ticket can be about eliminating the scary singular_ring_delete error message.
comment:3 Changed 9 months ago by jdemeyer
- Priority changed from major to critical
- Milestone changed from sage-5.3 to sage-5.4
comment:5 Changed 8 months ago by nbruin
A quick test reveals that:
P.<X,Y,Z> = CC[] C = Curve(X) self = C d = self.codimension() minors = self.Jacobian_matrix().minors(d) I = self.defining_ideal() minors = tuple([ I.reduce(m) for m in minors ])
(Who ever thought that "Jacobian" was a good name for the singular subscheme? I think most algebraic geometers expect something else when they ask for the Jacobian of a curve).
and a little look indeed shows that this code tries to use "singular"'s reduce (the ideal gets reconstructed several times), and I think it does so successfully (does singular now allow rings with float coefficients?), so it looks indeed like a mismatch in ring deletions. It may be a good test case, because the ring really gets constructed internally, via a _singular_ method.
