On Mon, 28 Apr 2014, Nils Bruin wrote:
Nor is computing the characteristic polynomial. Note that `eigenvalues` returns its
answer in the "field
of algebraic numbers". Equality testing is notoriously difficult there, and
since the characteristic
polynomials of your matrices are not square-free, you will run into some nasty
comparisons. The fact that
the code finishes for n=121 is pretty good!
sage: n=122
sage: l=range(1,n+1); M=matrix([[floor(n/lcm(i,j)) for i in l] for j in l])
sage: f=M.characteristic_polynomial()
sage: x=flatten([[a.roots(QQbar,multiplicities=False)]*d for a,d in factor(f)])
works pretty quickly.
In reality, there's probably never a compelling reason to work with the
eigenvalues of a matrix as
explicit algebraic numbers
Thanks!
http://www.sagemath.org/doc/reference/number_fields/sage/rings/qqbar.html
says "we try hard to avoid computing a number field and working in the
number field; instead, we use floating-point interval arithmetic whenever
possible (basically whenever we need to prove non-equalities), and resort
to symbolic computation only as needed (basically to prove equalities)."
Is this so that I can get eigenvalue with arbitrary precision? (And how to
do it?) And compared to that, for example ...roots(ComplexField(1000)...)
will do computations with 1000 bit precision, so that I can not be sure
about how many bits are correct on final answer?
--
Jori Mäntysalo
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.