Cannot mulyiply polynomial by matrix when ordering is explicitly specified
Consider the following code:
sage: F = GF(17)
sage: R.<x, y> = PolynomialRing(F)
sage: MS = MatrixSpace(F, 5, 4)
sage: x, y = R.gens()
sage: MS.random_element() * x # Good.
sage: MS.random_element() * y # Good.
# So far, so good. Now watch.
sage: R.<x, y> = PolynomialRing(F, order='lex')
sage: x, y = R.gens()
sage: MS.random_element() * x
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-12-928a7b216caf> in <module>()
----> 1 MS.random_element() * x
sage/structure/element.pyx in sage.structure.element.Matrix.__mul__ (/build/sagemath/src/sage-6.9/src/build/cythonized/sage/structure/element.c:23250)()
sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/build/sagemath/src/sage-6.9/src/build/cythonized/sage/structure/coerce.c:9739)()
TypeError: unsupported operand parent(s) for '*': 'Full MatrixSpace of 5 by 4 dense matrices over Finite Field of size 17' and 'Multivariate Polynomial Ring in x, y over Finite Field of size 17'
Does anybody know if this is intentional? In my opinion it shouldn't happen because lex ordering is already the implicit default. The bug does not seem to occur with degrevlex ordering, which is also weird. The bug also does not occur with square matrices, which is even weirder.
SageMath Version 6.9, Release Date: 2015-10-10