On Friday 05 September 2008, phil wrote: > I have a matrix that is composed of multivariant polynomial > entries. I want to compute its determinant. The problem is that it > is very slow or runs out of memory. For example, > R.<x,y> = QQ[] > C = random_matrix(R,10,10) > Cdet = C.determinant() # this line takes a long time > > If you have more variables, it will run out of memory instead (on a 32 > bit installation). > > Is there a more efficient way to do this? Would using symbolic > expressions then coercing back to the polynomial ring be better?
One thing that really puzzles me is that Magma doesn't seem to scale well w.r.t. to this particular benchmark. sage: R.<x,y> = QQ[] sage: C = random_matrix(R,10,10) sage: %time d = C.determinant() # going to be in 3.1.2 CPU times: user 0.34 s, sys: 0.00 s, total: 0.34 s Wall time: 0.34 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 0.59999999999999998 sage: C = random_matrix(R,14,14) sage: %time d = C.determinant() CPU times: user 2.58 s, sys: 0.00 s, total: 2.58 s Wall time: 2.60 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 27.84 # note that Magma also eats lots and lots of memory sage: C = random_matrix(R,15,15) sage: %time d = C.determinant() CPU times: user 4.49 s, sys: 0.00 s, total: 4.49 s Wall time: 4.55 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 68.590000000000003 sage: C = random_matrix(R,16,16) sage: %time d = C.determinant() CPU times: user 6.98 s, sys: 0.00 s, total: 6.98 s Wall time: 7.00 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 168.41 sage: magma(d) == d2 True sage: R.<x,y> = GF(32003)[] sage: C = random_matrix(R,16,16) sage: %time d = C.determinant() CPU times: user 0.78 s, sys: 0.00 s, total: 0.78 s Wall time: 0.92 s sage: CM = magma(C) sage: t = magma.cputime(); d2 = CM.Determinant(); magma.cputime(t) 64.920000000000002 sage: magma(d) == d2 True So I wonder if Singular's implementations are just really good or if Magma is just particularly bad for this particular benchmark. I have no feeling how fast these things should be. Thoughts? Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
