Ask Your Question

Cannot mulyiply polynomial by matrix when ordering is explicitly specified

asked 2015-12-04 09:43:59 -0500

d125q gravatar image

updated 2015-12-04 10:47:33 -0500

tmonteil gravatar image

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
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-12-04 10:33:34 -0500

tmonteil gravatar image

updated 2015-12-04 10:46:56 -0500

This definitely looks like a bug, thanks for reporting ! I created trac ticket 19669 for that.

edit flag offensive delete link more


Thank you!

d125q gravatar imaged125q ( 2015-12-25 04:36:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-04 09:43:59 -0500

Seen: 122 times

Last updated: Dec 04 '15