-
-
Notifications
You must be signed in to change notification settings - Fork 673
Closed
Description
sage: R = LazyPowerSeriesRing(QQ)
sage: x = R.gen()
sage: x
x
sage: M = Matrix(R, [[x, x], [1, x]])
sage: M.det()
Uninitialized lazy power series
Sounds good so far. Now let's do this all again, in the same session:
sage: R = LazyPowerSeriesRing(QQ)
sage: x = R.gen()
sage: x
x
sage: M = Matrix(R, [[x, x], [1, x]])
sage: M.det()
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-10-90e0c7c30c91> in <module>()
----> 1 M.det()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.det (sage/matrix/matrix2.c:10774)()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.determinant (sage/matrix/matrix2.c:8701)()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__mul__ (sage/structure/element.c:14531)()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7330)()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion (sage/structure/coerce.c:8800)()
/home/darij/sage-5.12.beta5/local/lib/python2.7/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps._coercion_error (sage/structure/coerce.c:14607)()
RuntimeError: There is a bug in the coercion code in Sage.
Both x (=1) and y (=x) are supposed to have identical parents but they don't.
In fact, x has parent 'Lazy Power Series Ring over Rational Field'
whereas y has parent 'Lazy Power Series Ring over Rational Field'
Original elements 1 (parent Lazy Power Series Ring over Rational Field) and x (parent Lazy Power Series Ring over Rational Field) and maps
<type 'NoneType'> None
<type 'sage.categories.morphism.CallMorphism'> Call morphism:
From: Lazy Power Series Ring over Rational Field
To: Lazy Power Series Ring over Rational Field
This error does not persist if I set M to be Matrix(R, [[x, x], [x, x]])
instead, so the coercion of 1 from integers to lazy power series seems to trigger the issue.
CC: @simon-king-jena @mantepse
Component: coercion
Keywords: LazyPowerSeries
Issue created by migration from https://trac.sagemath.org/ticket/15248