On 19 January 2015 at 23:03, mmarco <mma...@unizar.es> wrote:
> It is much faster to work with absolute fields instead of towers of
> extensions:
>
> sage: K.<sqrt3>=QuadraticField(3)
> sage: F.<sqrt5>=K.extension(x^2-5)
> sage: R.<a1,a2,a3,a4,a5> = F[]
> sage: %time _=(a1+a2+a3+sqrt5*a4+sqrt3*a5)^25
> CPU times: user 27.4 s, sys: 12 ms, total: 27.4 s
> Wall time: 27.5 s
> sage: FF.<a>=F.absolute_field()
> sage: fsqrt3=FF(F(sqrt3))
> sage: fsqrt5=FF(sqrt5)
> sage: RR.<a1,a2,a3,a4,a5> = FF[]
> sage: %time _=(a1+a2+a3+fsqrt5*a4+fsqrt3*a5)^25
> CPU times: user 1.26 s, sys: 3 ms, total: 1.27 s
> Wall time: 1.27 s
>
>
> I guess that pari internally follows the second approach.

No I don't think so.  In gp:

? Mod(x,x^2-3) + Mod(y,y^2-5)
%2 = Mod(x + Mod(y, y^2 - 5), x^2 - 3)

This can be read as a polynomial in x subject to the side condition
that x^2=3, where one of the coefficients is y subject to y^2=5.

Before I tried the above I did this:

? Mod(x,x^2-3) + Mod(x,x^2-5)
%1 = 0

which is a warning to anyone trying to interface between Sage and Pari/GP!

John

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

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

Reply via email to