#12969: Coercion failures in symmetric functions
-----------------------------+----------------------------------------------
Reporter: aschilling | Owner: sage-combinat
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: combinatorics | Keywords: symmetric functions, coercion
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
The following code triggers a coercion failure in the symmetric function
code
{{{
sage: H = MacdonaldPolynomialsH(QQ)
sage: P = MacdonaldPolynomialsP(QQ)
sage: m = SFAMonomial(P.base_ring())
sage: Ht = MacdonaldPolynomialsHt(QQ)
sage: m(P.one())
m[]
sage: Ht(P.one())
}}}
The coercion path does exist, however!
This can also be checked with the new syntax using the patches in the
sage-combinat queue as follows:
{{{
sage: R = QQ['q,t'].fraction_field()
sage: Sym = sage.combinat.sf.sf.SymmetricFunctions(R)
sage: H = Sym.macdonald().H();
sage: P = Sym.macdonald().P();
sage: m = Sym.monomial();
sage: Ht = Sym.macdonald().Ht();
sage: m(P.one())
sage: Ht(P.one())
}}}
The bug is in the coercion system. Sage does
not find a path from P to Ht, whereas there definitely is one:
{{{
def coercion_graph(self, G = None):
if G is None:
G = DiGraph()
if self not in G.vertices():
G.add_vertex(self)
for h in self._introspect_coerce()['_coerce_from_list']:
coercion_graph(h.domain(), G)
G.add_edge(h.domain(), self)
return G
R = QQ['q,t'].fraction_field()
R.rename("R")
Sym = sage.combinat.sf.sf.SymmetricFunctions(R); Sym.rename("Sym")
p = Sym.p(); p.rename("p")
s = Sym.schur(); s.rename("s")
e = Sym.elementary(); e.rename("e")
m = Sym.monomial(); m.rename("m")
h = Sym.complete(); h.rename("h")
H = Sym.macdonald().H(); H.rename("H")
P = Sym.macdonald().P(); P.rename("P")
J = Sym.macdonald().J(); J.rename("J")
S = Sym.macdonald().S(); S.rename("S")
Ht = Sym.macdonald().Ht(); Ht.rename("Ht")
m.coerce_map_from(P);
print Ht.coerce_map_from(P)
G = coercion_graph(Ht)
G.show()
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12969>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.