In Sage 5.4 determinant for dense matrix is very slow. For the following Hankel 
determinant calculation, Sage 4.6.1 is 100000 time more fast than Sage 5.4 (!!):

Sage 5.4, Sparse = False, Time=117.49

Sage 4.6.1, Sparse=False, Time=0.0011

# --------------------
import time

def test(K, SP):
  n=100
  f=taylor(prod((1-x**i) for i in range(1,n)),x,0,n)
  A=[f.coefficient(x,i) for i in range(n)]
  cf= [[A[i+j] for i in range(K)] for j in range(K)]
  m= matrix(ZZ, cf, sparse=SP)
  #
  t0=time.time()
  print "  K =", K, ", result =", m.det()
  t_det= time.time()-t0
  print " ",version()
  print "  sparse= ", SP
  print "  time  = ", t_det
  
KK=30
test(KK, True)
print
test(KK, False)


# --------------------

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to