#11274: Cholesky matrix decomposition breaks over the rationals
----------------------------------+-----------------------------------------
       Reporter:  rbeezer         |         Owner:  jason, was
           Type:  defect          |        Status:  new       
       Priority:  minor           |     Milestone:  sage-5.1  
      Component:  linear algebra  |    Resolution:            
       Keywords:  sd40.5          |   Work issues:            
Report Upstream:  N/A             |     Reviewers:            
        Authors:  Rob Beezer      |     Merged in:            
   Dependencies:  #12966, #13018  |      Stopgaps:            
----------------------------------+-----------------------------------------
Changes (by {'newvalue': u'Rob Beezer', 'oldvalue': ''}):

 * cc: ddrake, novoselt (added)
  * keywords:  => sd40.5
  * dependencies:  => #12966, #13018
  * author:  => Rob Beezer


Old description:

> 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}}}.

New description:

 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}}}.

 '''Depends''':  #12966, #13018

--

Comment:

 *  Caching indefinite factorization seems to be ready to go.
 *  Exact Cholesky decomposition is working - tested on simple examples,
 but needs documentation.
 *  Cholesky overall needs a brutal refactoring, the existing situation is
 a '''total mess.'''

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11274#comment:1>
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.

Reply via email to