Ask Your Question

Cannot mulyiply polynomial by matrix when ordering is explicitly specified

asked 2015-12-04 16:43:59 +0200

d125q gravatar image

updated 2023-01-09 23:59:38 +0200

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 17:33:34 +0200

tmonteil gravatar image

updated 2015-12-04 17:46:56 +0200

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 11:36:31 +0200 )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 16:43:59 +0200

Seen: 332 times

Last updated: Dec 04 '15