#19669: Broken coercion between MatrixSpace and polynomial Ring when this latter
has an ordering set to 'lex'.
------------------------+-----------------------------
Reporter: tmonteil | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.10
Component: coercion | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
------------------------+-----------------------------
As reported on [http://ask.sagemath.org/question/31323/cannot-mulyiply-
polynomial-by-matrix-when-ordering-is-explicitly-specified/?answer=31324
#post-id-31324 this ask question]:
{{{
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
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/19669>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.