Opened 6 years ago

Last modified 6 years ago

#18224 new defect

Univariate g-algebras are broken

Reported by: darij Owned by:
Priority: major Milestone: sage-6.7
Component: algebra Keywords: singular, plural, g-algebra, gröbner
Cc: tscrim Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by darij)

This works:

sage: F.<x,y> = FreeAlgebra(QQ)
sage: F.g_algebra({})
Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: {}

This does not:

sage: F.<x> = FreeAlgebra(QQ)
sage: F.g_algebra({})
// ** commutative ring with 1 variable
Exception KeyError: (The ring pointer -0x4f6e5368,) in 'sage.libs.singular.ring.singular_ring_delete' ignored
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-54-9d158958de5f> in <module>()
----> 1 F.g_algebra({})

/home/skraeling/sage/local/lib/python2.7/site-packages/sage/algebras/free_algebra.pyc in g_algebra(self, relations, names, order, check)
    875         from sage.rings.polynomial.plural import g_Algebra
    876         return g_Algebra(base_ring, cmat, dmat, names = names or self.variable_names(),
--> 877                          order=order, check=check)
    878 
    879     def poincare_birkhoff_witt_basis(self):

/home/skraeling/sage/src/sage/structure/factory.pyx in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:1291)()
    364         key, kwds = self.create_key_and_extra_args(*args, **kwds)
    365         version = self.get_version(sage_version)
--> 366         return self.get_object(version, key, kwds)
    367 
    368     cpdef get_object(self, version, key, extra_args):

/home/skraeling/sage/src/sage/structure/factory.pyx in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:1665)()
    408         except KeyError:
    409             pass
--> 410         obj = self.create_object(version, key, **extra_args)
    411         self._cache[version, cache_key] = obj
    412         try:

/home/skraeling/sage/src/sage/rings/polynomial/plural.pyx in sage.rings.polynomial.plural.G_AlgFactory.create_object (build/cythonized/sage/rings/polynomial/plural.cpp:4621)()
    171         base_ring,names,c,d,order,category = key
    172         check = extra_args.get('check')
--> 173         return NCPolynomialRing_plural(base_ring, names, c,d, order, category, check)
    174     def create_key_and_extra_args(self, base_ring, c,d, names=None, order=None,
    175                                  category=None,check=None):

/home/skraeling/sage/src/sage/rings/polynomial/plural.pyx in sage.rings.polynomial.plural.NCPolynomialRing_plural.__init__ (build/cythonized/sage/rings/polynomial/plural.cpp:5841)()
    347         if check:
    348             from sage.libs.singular.function_factory import ff
--> 349             test = ff.nctools__lib.ndcond(ring = self)
    350             if (len(test) != 1) or (test[0] != 0):
    351                 raise ValueError("NDC check failed!")

/home/skraeling/sage/src/sage/libs/singular/function.pyx in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:13927)()
   1296                 isinstance(ring, NCPolynomialRing_plural)):
   1297             raise TypeError("Cannot call Singular function '%s' with ring parameter of type '%s'"%(self._name,type(ring)))
-> 1298         return call_function(self, args, ring, interruptible, attributes)
   1299 
   1300     def _sage_doc_(self):

/home/skraeling/sage/src/sage/libs/singular/function.pyx in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:15723)()
   1488             (self._name, "\n ".join(error_messages)))
   1489 
-> 1490     res = argument_list.to_python(_res)
   1491 
   1492     if self.call_handler.free_res():

/home/skraeling/sage/src/sage/libs/singular/function.pyx in sage.libs.singular.function.Converter.to_python (build/cythonized/sage/libs/singular/function.cpp:11738)()
    944         cdef Resolution res_resolution
    945         if rtyp == IDEAL_CMD:
--> 946             return singular_ideal_to_sage_sequence(<ideal*>to_convert.data, self._singular_ring, self._sage_ring)
    947 
    948         elif rtyp == POLY_CMD:

/home/skraeling/sage/src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx in sage.rings.polynomial.multi_polynomial_ideal_libsingular.singular_ideal_to_sage_sequence (build/cythonized/sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpp:3032)()
    102     else:
    103         for j from 0 <= j < IDELEMS(i):
--> 104             p = new_MP(parent, p_Copy(i.m[j], r))
    105             l.append( p )
    106 

TypeError: Cannot convert sage.rings.polynomial.plural.NCPolynomialRing_plural to sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular

Thanks Travis for isolating this bug.

Change History (1)

comment:1 Changed 6 years ago by darij

  • Description modified (diff)
  • Summary changed from Univariant g-algebras are broken to Univariate g-algebras are broken
Note: See TracTickets for help on using tickets.