Le samedi 24 mai 2014 16:29:38 UTC+2, Tom Harris a écrit :

> Now I have some code to generate the polynomial which I am interested in, 
> I store it as p:
>
> p = (output of some functions)
>
> ( p is ((x1^3 - 2*x1*x2 + x3)*c1^2 - (x1*x2 - x3)*c1 + x3)*c2^2 + x1^3 + 
> c1^2*x3 - (x1*x2 - x3)*c1 - ((x1*x2 - x3)*c1^2 - (x1^3 - x1*x2 + x3)*c1 + 
> x1*x2 - x3)*c2 - 2*x1*x2 + x3) 
>
> Now the curious thing: p is (naively at least) symmetric in c1 and c2, but 
> calling ElemSym(p) returns an error:
>
> ValueError: x0 + 2*x1 + x2 is not a symmetric polynomial
>
> but if I copy the polynomial itself and call
>
> ElemSym(((x1^3 - 2*x1*x2 + x3)*c1^2 - (x1*x2 - x3)*c1 + x3)*c2^2 + x1^3 + 
> c1^2*x3 - (x1*x2 - x3)*c1 - ((x1*x2 - x3)*c1^2 - (x1^3 - x1*x2 + x3)*c1 + 
> x1*x2 - x3)*c2 - 2*x1*x2 + x3)),
>
> then it works and I get
>
> (x1^3-2*x1*x2+x3)*e[] + (-x1*x2+x3)*e[1] + x3*e[1, 1] + 
> (x1^3-x1*x2-x3)*e[2] + (-x1*x2+x3)*e[2, 1] + (x1^3-2*x1*x2+x3)*e[2, 2] + 
> (3*x1*x2-3*x3)*e[3] + (-2*x1^3+4*x1*x2-2*x3)*e[3, 1] + 
> (2*x1^3-4*x1*x2+2*x3)*e[4]
>
> as expected.
>
> Can somebody help me understand what is going on here?
>

Maybe the output of your function does not live in C?
Instead of ElemSym(p), you could try:

    ElemSym(C(p))

or

    p = C(p)
    ElemSym(p)

 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to