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.

Why?

Jaap


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