On 11/03/2010 09:32 PM, Jason Grout wrote:
> On 11/3/10 3:30 PM, David Joyner wrote:
>> Sage seems to be reporting eigenvalues incorrectly. Can this bug been
>> reported before?
> 
> It's well known that serious numerical issues come up when doing
> eigenvalues of CC or RR matrices.  That's why the warning is printed
> that you see below.
> 
> Try using CDF, which ends up using numpy:
> 
> sage: M = matrix(CDF,[ [ 1476226, 1476226, 1476224, 1476225, 1476224 ],
>     [ 1476226, 1476224, 1476225, 1476224, 1476226 ],
>     [ 1476224, 1476225, 1476224, 1476226, 1476226 ],
>     [ 1476225, 1476224, 1476226, 1476226, 1476224 ],
>     [ 1476224, 1476226, 1476226, 1476224, 1476225 ] ])
> sage: M.eigenvalues()
> [7381125.0, 2.23606797746 - 4.42419210147e-31*I, 2.23606797737 +
> 4.42417798985e-31*I, -2.23606797751 + 1.92201810023e-11*I,
> -2.23606797751 - 1.92199318576e-11*I]
> 
> Sometime, we'll hopefully have an ALGLIB interface that will fix this
> for CC.
> 
> Maybe we should add a note to the warning printed out below to try using
> CDF instead of CC, and RDF instead of RR.

Does the reciprocal of the matrix's condition number (ratio of the
largest to smallest singular value)

sage: from numpy.linalg import cond   # see [1]
sage: cond(M.numpy())
3300939.4507573219
sage: 1 / 3300939.4507573219
3.029440602948878e-7

(or a similar measure) give us any information about the precision
needed to get accurate eigenvalues?

[1]
http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.cond.html

-- 
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
URL: http://www.sagemath.org

Reply via email to