On Dec 28, 2007 3:48 PM, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> William Stein wrote:
>
> > However, it's very interesting to note that you can do exactly the
> > same calculation _vastly_ more quickly using the specialized
> > "multivariate polynomial ring over the rational numbers" functionality
> > in Sage (which partly comes from Singular, by the way):
> >
> > sage: R.<a,b,c,d,e,f,g> = QQ[]
> > sage: V=[a,b,c,d,e,f,g]
> > sage: M=matrix(R,7,7,[[z^i for i in range(7)] for z in V])
> > sage: time w=det(M)
> > Time: CPU 0.02 s, Wall: 0.02 s
> > sage: str(w)[:50]
> > '-a^6*b^5*c^4*d^3*e^2*f + a^5*b^6*c^4*d^3*e^2*f + a'
> >
>
>
> sage: time p = M.permanent()
> CPU times: user 4.56 s, sys: 0.40 s, total: 4.96 s
> Wall time: 5.01
>
> sage: str(p)[:46]
>   'a^6*b^5*c^4*d^3*e^2*f + a^5*b^6*c^4*d^3*e^2*f '
>
> Notice the difference :)
>
> When I change QQ in ZZ it goes *boom*! Memory usage to 99% and more.

Sage has very optimized multivariate polynomial arithmetic over QQ.
It has very very slow arithmetic over ZZ.    This is temporary, and
has been temporary
for about 6 months now, which is why I think we should just do some hack to
make polys over ZZ actually use polys over QQ as their underlying
implementation,
at least until libsingular supports ZZ.

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-forum
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to