On Dec 14, 2007 2:31 PM, mb <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> The following code produces error
>
> var('a b c d e f g')
> V=[a,b,c,d,e,f,g]
> M=matrix(SR,7,7,[[z^i for i in range(7)] for z in V])
> print det(M)
>
> Is that because output is too large? If 7 is replaced by 6 everything
> is fine.

Hi.  As you know, this now works fine in Sage-2.9.1, since Mike Hanson
and Robert Bradshaw wrote a special symbolic matrix class:

sage: var('a b c d e f g')
sage: V=[a,b,c,d,e,f,g]
sage: M=matrix(SR,7,7,[[z^i for i in range(7)] for z in V])
sage: time w=det(M)
Time: CPU 6.57 s, Wall: 9.87 s

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'

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