Hi Frédéric, Sorry for not answering sooner. I was giving a talk at Strasbourg at Kurush and Frederic F. conference). So I was busy preparing my talk (among other things).
> I have tried to implement a morphism of operads (from the PreLie > operad to the Dendriform operad) but I have some problem with > codomains. Could somebody help ? > > with my patch "free_operads_fc.patch" applied : > > sage: PL=PreLieOperad(QQ) > sage: DO=DendriformOperad(QQ) > sage: PLT=PL.basis().keys() > sage: t0=PL(PLT([],'a')) > sage: PL.operad_morphism(PL,t0) > sage: PL.operad_morphism(DO,t0) > > the last two lines both returns an error related to codomain. I had a look at your problem. One of the problem came from lazy_attribute in operads_with_basis: you cannot use lazy_attribute with a something which takes parameters. The role of lazy_attribute is (among other things) to save the typing of () such as in PL.one(). One could have used PL.one but this was ruled out for interface consistency reason. Back to your problem, you can't spare a () because you have the codomain. So you probably want to write things the following way: sage: PL2PL = PL.operad_morphism(PL) # define the morphism sage: PL2PL(t0) # apply it B[a[]] sage: PL2DO = PL.operad_morphism(DO) sage: PL2DO(t0) B[a[None, None]] sage: PL2DO(t0 < t0) -B[a[None, a[None, None]]] + B[a[a[None, None], None]] Does this makes sens to you ? I uploaded a patch named operad_morphism_fix-fh.patch which makes the previous examples work. Please fold it in yours (after making sure that you don't have any uncommited modifications: sage -hg pull -u sage -hg qgoto free_operads_fc.patch sage -hg qfold operad_morphism_fix-fh.patch And then as usual cd ../../../.hg/patches sage -hg commit -m "Folded operad_morphism_fix-fh.patch" sage -hg push I hope this fixes your problems. Just a remark: I checked that the code returned a result not that this is indeed the correct result. Please quadruple check. Cheers, Florent -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.