sage: F = GF(17)
sage: R.<x, y> = PolynomialRing(F)
sage: MS = MatrixSpace(F, 5, 4)
sage: cm = sage.structure.element.get_coercion_model()
sage: cm.explain(R,MS)
Action discovered.
Left scalar multiplication by Multivariate Polynomial Ring in x, y over Finite Field of size 17 on Full MatrixSpace of 5 by 4 dense matrices over Finite Field of size 17
Result lives in Full MatrixSpace of 5 by 4 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
Full MatrixSpace of 5 by 4 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
but it does not work anymore if we specify the 'lex' ordering for monomials of R:
sage: R.<x, y> = PolynomialRing(F, order='lex')
sage: cm.explain(R,MS)
Will try _r_action and _l_action
Unknown result parent.
However it works if we specify the 'degrevlex' ordering for monomials of R:
sage: R.<x, y> = PolynomialRing(F, order='degrevlex')
sage: cm.explain(R,MS)
Action discovered.
Left scalar multiplication by Multivariate Polynomial Ring in x, y over Finite Field of size 17 on Full MatrixSpace of 5 by 4 dense matrices over Finite Field of size 17
Result lives in Full MatrixSpace of 5 by 4 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
Full MatrixSpace of 5 by 4 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
And it works with the 'lex' ordering for monomials of R if the matrix space is "square" (through a different path however):
sage: MS = MatrixSpace(F, 5, 5)
sage: R.<x, y> = PolynomialRing(F, order='lex')
sage: cm.explain(R,MS)
Coercion on left operand via
Call morphism:
From: Multivariate Polynomial Ring in x, y over Finite Field of size 17
To: Full MatrixSpace of 5 by 5 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
Coercion on right operand via
Call morphism:
From: Full MatrixSpace of 5 by 5 dense matrices over Finite Field of size 17
To: Full MatrixSpace of 5 by 5 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
Arithmetic performed after coercions.
Result lives in Full MatrixSpace of 5 by 5 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
Full MatrixSpace of 5 by 5 dense matrices over Multivariate Polynomial Ring in x, y over Finite Field of size 17
As reported on this ask question:
but it does not work anymore if we specify the
'lex'
ordering for monomials ofR
:However it works if we specify the
'degrevlex'
ordering for monomials ofR
:And it works with the
'lex'
ordering for monomials ofR
if the matrix space is "square" (through a different path however):Depends on #23719
Component: coercion
Issue created by migration from https://trac.sagemath.org/ticket/19669