Hi Jason,

Thank you! Actually, following a suggestion from Nicolas, I have now
also written the following (minimally tested) function assuming the
base field is over QQ and assuming the function is symmetric (which
is not tested):

def from_polynomial(f):
    exp = [list(x) for x in f.exponents()]
    s = lambda x : sum(i for i in x)
    exp = [Partition(x) for x in exp if x in Partitions(s(x),min_part=0)]
    m=SFAMonomial(QQ)
    return sum(m(la) for la in exp)

Best,

Anne


Jason Bandlow wrote:
Oops, small typo.  Let me try again:

def toSF(f):
    """ Input is a symmetric polynomial in a polynomial ring in finitely
    many variables.  Output is a symmetric function in the monomial
    basis of the ring of symmetric functions over the same base ring.
    """
    X = f.parent().gens()
    n = f.parent().ngens()
    SF = SymmetricFunctions(f.base_ring())
    m = SF.monomial()
    out = m(0)
    while f != 0:
        lt = f.lt()
        c = lt.monomial_coefficient(lt)
        p = Partition(lt.exponents()[0])
        f += -c*m(p).expand(n,X)
        out += c*m(p)
    return out

-Jason

Jason Bandlow wrote:
Hi Anne,

Nicolas M. Thiery wrote:
On Sat, Feb 13, 2010 at 09:53:27AM -0800, Anne Schilling wrote:
I would like to write a symmetric polynomial (not function)
in terms of one of the usual bases (like Schur polynomials).
That's a quite basic feature, that we ought to have (that was fromPoly
in MuPAD-Combinat). But I fear we don't. At least I could not find it
browsing through the sources.
I don't know of the existence of such a function.   I've written a very
quick-and-dirty (and very minimally tested) function below.  If someone
opens a ticket, I will try to get a proper version of this into sage at
some point.

Cheers,
Jason

def toSF(f):
    """ Input is a symmetric polynomial in a polynomial ring in finitely
    many variables.  Output is a symmetric function in the monomial
    basis of the ring of symmetric functions over the same base ring.
    """
    X = f.parent().gens()
    n = f.parent().ngens()
    SF = SymmetricFunctions(f.base_ring())
    m = SF.monomial()
    out = m(0)
    while f != 0:
        lt = f.lt()
        c = lt.monomial_coefficient(lt)
        p = Partition(lt.exponents()[0])
        f += -m(p).expand(n,X)
        out += c*m(p)
    return out




--
Anne Schilling              E-mail: a...@math.ucdavis.edu
Professor                   Web:    http://www.math.ucdavis.edu/~anne
Department of Mathematics   Office: MSB 3222
University of California    Phone:  (530) 554 2326
One Shields Ave             Fax:    (530) 752 6635
Davis, CA 95616

--
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