As the first part of a demonstration on eigensystems, I was surprised to 
see that computing QQbar polynomial roots was way slower that computing the 
roots of the same polynomial expressed as a symbolic expression, or solveing 
it :

# Relative timings of QQbar.roots and solve
from time import time as stime
BR = QQbar
Dim = 3
set_random_seed(0)
pM = MatrixSpace(BR, Dim).random_element()
sM = matrix([[SR(u.radical_expression()) for u in v] for v in pM])
sl = var("sl")
slI = sl*diagonal_matrix([1]*Dim)
sCM = sM - slI
sCP = sCM.det()
t0 = stime()
SS = solve(sCP, sl)
t1 = stime()
SR = sCP.roots()
t2 = stime()
R1.<pl> = BR[]
plI = pl*diagonal_matrix([1]*Dim)
pCM = pM - plI
pCP = pCM.det()
t3 = stime()
SP = pCP.roots()
t4 = stime()
print("solve : %7.2f, roots(symbolic) : %7.2f, roots(QQbar) : %7.2f"%\
      (t1 -t0, t2 - t1, t4 - t3))

gives :

solve :    2.36, roots(symbolic) :    2.04, roots(QQbar) :  600.07

a quick check on Cocalc <https://cocalc.com> showed the same behavior in 
9.1 ; so if it is a problem, it is not a recent one…

Is this the expected behavior ?
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/68574487-81e1-42e1-8ff7-6f754427792en%40googlegroups.com.

Reply via email to