> What happened is that the resultant computation was shipped off to pari 
> and when it came back, it was "converted" back into SR. However, sage 
> doesn't actually know an intelligent way of coercing pari objects into SR, 
> so it just gets wrapped into SR as an "arithmetic constant": a python 
> object that has arithmetic operations defined for it. As a result, "sqrt" 
> on it is just the pari "sqrt", which apparently makes a series expansion. 
> In order to make the object useful, you really need to ensure the object is 
> properly created:
>
> sage: -r
> -g1^2 + (2*g3 - g2^2)*g1 - g3^2
> sage: sqrt(-g1^2 + (2*g3 - g2^2)*g1 - g3^2)
> sqrt(-(g2^2 - 2*g3)*g1 - g1^2 - g3^2)
>
>
Thank you for the explanation, this explain a lot of thing; I did the same 
thing to paste the result of the resultant and I didn't understand why the 
answer was different.

My problem is that I have a big expression in terms of some 
sqrt(-G.resultant(H)) where G,H = G1,G2,G3 and I want to simplify the 
expression by use of the equality sqrt(-G.resultant(H))^2 = -G.resultant(H).
What I did, which is ugly (but works in my case), is that I take other 
variables e_i which are aimed to be sqrt(-G.resultant(H)) and I use the 
substitution routine. The trouble is that if I say that e^2 = 
sqrt(-G.resultant(H)) the substitution doesn't know that e^3 = 
e*sqrt(-G.resultant(H)) and the same for higher power. In my expression the 
only powers of e are e^2, e^3, e^4 so I say explicitly what the result 
should be and it works.
I do something like that for the substitution, where eq is my equation in 
terms of e_i and g_j :
eq = 
eq.subs_expr({e1^2:-G2.resultant(G3),e2^2:-G1.resultant(G3),e3^2:-G1.resultant(G2)})
eq = 
eq.subs_expr({e1^3:e1*(-G2.resultant(G3)),e2^3:e2*(-G1.resultant(G3)),e3^3:e3*(-G1.resultant(G2))})
eq = 
eq.subs_expr({e1^4:(-G2.resultant(G3))^2,e2^4:(-G1.resultant(G3))^2,e3^4:(-G1.resultant(G2))^2})


If you know something better, it would be great.

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