Ok, this bit me again in a different way, so I've started tracking it
down...  Starting with what I did before:

> ----------------------------------------------------------------------
> | Sage Version 4.4, Release Date: 2010-04-24                         |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> Loading Sage library. Current Mercurial branch is: combinat
> sage: D = CombinatorialFreeModule(QQ, Partitions(), prefix='d');
> sage: d = D.basis();
> sage: s = SymmetricFunctions(QQ).schur()
> sage: def func(p):
> .....:     if len(p)==0: return 1
> .....:     else: return p[0]
> sage: D_to_Schur = D.module_morphism(diagonal=func, codomain=s)
> sage: Schur_to_D = ~D_to_Schur
> sage: D_to_Schur(Schur_to_D(2*s([2,1])))
> -12*s[2, 1]

But now the following *does* work:
sage: D_to_Schur(Schur_to_D(QQ(2)*s([2,1])))
2*s[2, 1]

Also, if we redefine func as follows, it works:

sage: def func(p):
.....:     if len(p)==0: return QQ(1)
.....:     else: return QQ(p[0])

I suspect, but haven't fully convinced myself, that this is related to
the following:

sage: s([2,1])._lmul_(2)  # Silently returns None
sage: s([2,1])._lmul_(QQ(2))
2*s[2, 1]

But this may be the intended behavior of _lmul_, in which case the real
problem lies elsewhere. (The code for _lmul_ is in
sage.combinat.free_module._acted_upon_ for whoever wants to check.)

Incidentally, if we just multiply by 2 and check the coefficient, it's OK:
sage: (2*s([2,1])).coefficients()[0].parent()
Rational Field

But for whatever reason this seems not to be happening in the first
example.  I'll try some more to figure out the best way to fix this, but
any help is welcome!

Cheers,
Jason

-- 
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-de...@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.

Reply via email to