On Fri, Dec 09, 2011 at 10:19:22AM +0100, Jeroen Demeyer wrote:
> I am asking for:
> 
> sage: e = SymmetricFunctions(QQ).e()
> sage: R.<e1,e2,e3> = PolynomialRing(QQ)
> sage: e[3,1,1].express_as_polynomial([1,e1,e2,e3])
> e1^2*e3

Ah, you want the result expressed as a plain polynomial. Then it's
just a one-liner change of representation:

    sage: e = SymmetricFunctions(QQ).e()
    sage: x = e.an_element()
    sage: x
    1/2*e[] + 3*e[1, 1, 1] + 2*e[2, 1, 1]
    sage: sum( c*prod( Re[i-1] if i<=3 else R.zero for i in part ) for (part,c) 
in x )
    3*e1^3 + 2*e1^2*e2 + 1/2

However I agree this one-liner deserves to be wrapped for the user,
especially since this one-liner won't handle properly corner cases (in
particular x=0). So ...

Free commutative algebras represented using a multiplicative basis
(like this one) should have:

 - An "algebra_morphism" method
 - A morphism and its inverse, built using algebra_morphism,
   implementing the isomorphism with some plain Sage polynomial ring

   Any good suggestion of name? the obvious to_polynomial is ambiguous
   since we don't know if we want a polynomial in the x's or in the
   e's.
 - Functionalities like factor and such, implemented through the
   those isomorphisms

Note: in MuPAD, had the algebra_morphism functionality, and we could
also write expr(x) which returned x as an expression in (the analogue
of) SR, and then we could just do poly(expr(x)). We also. That's
probably why we had not come up with an appropriate interface for this
functionality.

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to