#5554: [with patch, needs work] implement cholesky_decomposition for matrices
other than RDF
----------------------------+-----------------------------------------------
Reporter: ncalexan | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.4.2
Component: linear algebra | Keywords: cholesky decomposition RDF real
----------------------------+-----------------------------------------------
Comment(by rbeezer):
Nicely done, great documentation, passes all tests. Suggestions for
improvements, in order of perceived importance.
1. Inputting a matrix over ZZ or QQ fails with the {{{ValueError}}}
message about not being symmetric or positive definite, which is not an
accurate error message in this case. Should there be an attempt to coerce
the matrix to RDF or CDF? Inputting (trivial) symbolic matrices proceeds
successfully (eg. [[x,y],[y,x]]). Perhaps a coercion attempt above will
cause a failure in this case, and this might be the right result? Another
interesting input is {{{matrix(2, [2, 2+i,2-i,4])}}} which is considered
to be defined over SR, yet is handled properly by the routines here, or
can be convrted to CDF for an accurate numerical result.
2. I think it would be safer to force the user to me more aware of the
positive definite requirement. I'd prefer to see a keyword argument like
"positive_definite=False" added. In other words, the default operation is
to perform a check for positive-definiteness, but when the user knows the
matrices at hand are positive-definite, the keyword can be invoked to
bypass the check. I think there are other examples like this in Sage (but
I can't locate a good one at the moment).
3. A couple of places in the documentation could benefit from including
the greater generality of matrices over the complex numbers, which this
enhancement now allows. Specifically:
(a) docstring in matrix2.pyx could make it clear that {{{L^t}}} is the
adjoint when the matrix has complex entries (rather than looking like just
the transpose).
(b) two error messages state that the matrix is "not symmetric." Could
they say instead "not symmetric (or not Hermitian)"?
4. Computing eigenvalues for matrices over a {{{RealField()}}} gives the
warning message
{{{UserWarning: Using generic algorithm for an inexact ring, which will
probably give incorrect results due to numerical precision issues.}}}
Would something similar be a good idea here for the generic algorithm?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5554#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---