#11274: Cholesky matrix decomposition breaks over the rationals
------------------------------+---------------------------------------------
Reporter: rbeezer | Owner: jason, was
Type: defect | Status: new
Priority: minor | Milestone: sage-4.7.1
Component: linear algebra | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------------+---------------------------------------------
The matrix E is clearly symmetric, and by looking at its eigenvalues and
the determinants of principal submatrices it is clearly positive definite.
{{{
sage: E = matrix(QQ, [[2, 1], [1, 1]])
sage: E.is_symmetric()
True
sage: E.eigenvalues()
[0.3819660112501051?, 2.618033988749895?]
sage: E.det()
1
sage: E.cholesky_decomposition()
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
<snip>
ValueError: The input matrix was not symmetric and positive definite
}}}
At best the error message is misleading.
The try/except block needs to be more careful. It should be checking if
square roots are contained in the base ring, or it should first convert to
an algebraically closed field, or something like that.
In this example, the error is raised because the square root of a rational
is not again a rational, when I think the test should be if the argument
to the square root is negative.
Perhaps for {{{QQ}}}, the base ring should be promoted to the Real
Algebraic Field, {{{AA}}}.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11274>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.