Opened 2 years ago

Closed 2 years ago

#25300 closed defect (fixed)

singular of ZZ[x] does not work

Reported by: chapoton Owned by:
Priority: major Milestone: sage-8.3
Component: interfaces Keywords:
Cc: mmezzarobba Merged in:
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 87b884e (Commits) Commit: 87b884eaf81577b106f204d9b8832714b8ed86e4
Dependencies: Stopgaps:

Description

Trying (in sage 8.2)

sage: singular(ZZ['x'])
TypeError                                 Traceback (most recent call last)
<ipython-input-52-39cf8be5601b> in <module>()
----> 1 singular(ZZ['x'])

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in __call__(self, x, type)
    787             return self(x.sage())
    788         elif not isinstance(x, ExpectElement) and hasattr(x, '_singular_'):
--> 789             return x._singular_(self)
    790 
    791         # some convenient conversions

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/structure/sage_object.pyx in sage.structure.sage_object.SageObject._singular_ (build/cythonized/sage/structure/sage_object.c:11770)()
    954             import sage.interfaces.singular
    955             G = sage.interfaces.singular.singular
--> 956         return self._interface_(G)
    957 
    958     def _singular_init_(self, have_ring=False):

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/structure/sage_object.pyx in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:6634)()
    728             except Exception:
    729                 raise NotImplementedError("coercion of object %s to %s not implemented:\n%s\n%s" % (repr(self), I))
--> 730         X = I(s)
    731         if c:
    732             try:

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in __call__(self, x, type)
    793             x = str(x)[1:-1]
    794 
--> 795         return SingularElement(self, type, x, False)
    796 
    797     def _coerce_map_from_(self, S):

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in __init__(self, parent, type, value, is_name)
   1284             except SingularError as x:
   1285                 self._session_number = -1
-> 1286                 raise_(TypeError, x, sys.exc_info()[2])
   1287             except BaseException:
   1288                 self._session_number = -1

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in __init__(self, parent, type, value, is_name)
   1279         if not is_name:
   1280             try:
-> 1281                 self._name = parent._create( value, type)
   1282             # Convert SingularError to TypeError for
   1283             # coercion to work properly.

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in _create(self, value, type)
    754         """
    755         name = self._next_var_name()
--> 756         self.set(type, name, value)
    757         return name
    758 

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in set(self, type, name, value)
    697         cmd += '%s %s=%s;'%(type, name, value)
    698         self.__to_clear = []
--> 699         self.eval(cmd)
    700 
    701     def get(self, var):

/home/chapoton/sage/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc in eval(self, x, allow_semicolon, strip, **kwds)
    655 
    656         if s.find("error") != -1 or s.find("Segment fault") != -1:
--> 657             raise SingularError('Singular error:\n%s'%s)
    658 
    659         if get_verbose() > 0:

TypeError: Singular error:
   ? `Univariate` is undefined
   ? error occurred in or before STDIN line 44: `def sage18=Univariate Polynomial Ring in x over Integer Ring;`

This seems to come from

sage: L=QQ['x']
sage: L._singular_init_()
polynomial ring, over a field, global ordering
// coefficients: QQ
// number of vars : 1
//        block   1 : ordering lp
//                  : names    x
//        block   2 : ordering C
sage: L=ZZ['x']
sage: L._singular_init_()
'Univariate Polynomial Ring in x over Integer Ring'

Change History (5)

comment:1 Changed 2 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/25300
  • Commit set to 87b884eaf81577b106f204d9b8832714b8ed86e4

New commits:

87b884efixing singular interface for ZZ['x']

comment:2 Changed 2 years ago by chapoton

  • Status changed from new to needs_review

comment:3 Changed 2 years ago by chapoton

  • Cc mmezzarobba added

green bot

comment:4 Changed 2 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

It makes sense to test this for more general cases (in particular, for ZZ as per the ticket description). LGTM.

comment:5 Changed 2 years ago by vbraun

  • Branch changed from u/chapoton/25300 to 87b884eaf81577b106f204d9b8832714b8ed86e4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.