#15303: Coercion discovery fails to be transitive
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.0
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/SimonKing/ticket/15303 | 528a03535447d67f04dc16d0a22cc38def54f9f1
Dependencies: #14711, #15329, | Stopgaps:
#15331 |
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Replying to [comment:121 darij]:
> What is broken in qsym.py? I'm asking because I'm editing the file
currently.
Here is the diff that I did to fix the failure:
{{{
#!diff
diff --git a/src/sage/combinat/ncsf_qsym/qsym.py
b/src/sage/combinat/ncsf_qsym/qsym.py
index 583ca87..f127c19 100644
--- a/src/sage/combinat/ncsf_qsym/qsym.py
+++ b/src/sage/combinat/ncsf_qsym/qsym.py
@@ -2232,23 +2232,25 @@ class
QuasiSymmetricFunctions(UniqueRepresentation, Parent):
def __init_extra__(self):
"""
Set up caches for the transition maps to and from the
monomial
- basis, and register them as coercions.
+ basis, and register them as coercions. By :trac:`15303`, we
need
+ to copy coerce maps before exposing them outside of the
coercion
+ system.
TESTS::
sage: HWL =
QuasiSymmetricFunctions(QQ).HazewinkelLambda()
sage: M = QuasiSymmetricFunctions(QQ).Monomial()
- sage: HWL.coerce_map_from(M)
+ sage: M2HWL = copy(HWL.coerce_map_from(M)); M2HWL
Generic morphism:
From: Quasisymmetric functions over the Rational Field
in the Monomial basis
To: Quasisymmetric functions over the Rational Field
in the HazewinkelLambda basis
- sage: M.coerce_map_from(HWL)
+ sage: HWL2M = copy(M.coerce_map_from(HWL)); HWL2M
Generic morphism:
From: Quasisymmetric functions over the Rational Field
in the HazewinkelLambda basis
To: Quasisymmetric functions over the Rational Field
in the Monomial basis
- sage: M.coerce_map_from(HWL)(HWL[2])
+ sage: HWL2M(HWL[2])
M[1, 1]
- sage: HWL.coerce_map_from(M)(M[2])
+ sage: M2HWL(M[2])
HWL[1, 1] - 2*HWL[2]
"""
M = self.realization_of().M()
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15303#comment:123>
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/groups/opt_out.