Quadruple Precision Eigenvalues, Eigenvectors and Matrix Logarithms

…衆ロ難τιáo~ 提交于 2019-12-04 21:33:13

问题


I am attempting to diagonalize matrices in quadruple precision, and to take their logarithms. Is there a language in which I can accomplish this using built-in functions?

Note, the languages/packages in the tags are insufficient, suffering from the following deficiencies:

Matlab: Does not support quad precision.

Python/NumPy/SciPy: Matrices with dtype float128 yield eigenvectors in float64.

Sage: Interface through GP/PARI yields cryptic error messages.

Has anyone performed diagonalization and matrix logarithms to quad precision, and if so, how?


回答1:


@Matlab: Does not support quad precision.

Multiprecision Computing Toolbox for MATLAB provides routines for linear algebra computations in arbitrary precision.

It covers many other fields - basic math, numerical methods (integration, ode, optimization), special functions and basic data analysis.

Besides it allows running existing Matlab's programs in arbitrary precision with only minimal (or without any) modifications to source code.

Update (March 27, 2013): Now toolbox also includes fast quadruple precision mode, which is nearly 100 times faster compared to alternatives. See Fast Quadruple Precision Computations in MATLAB for comparisons and details.


Critics on suggested alternatives:

Symbolic Math Toolbox (MATLAB) from Mathworks targeted to symbolic computations. As such it lacks many essential features needed for arbitrary precision numerical computing.

For example, it is not even possible to compare two vpa() numbers since they are of "symbolic" type (by design). This only limitation rules out 99% of algorithms from numerical analysis.

Other basic linear algebra functions missing in Symbolic Math Toolbox are: norm, cond, max, min, sort, lu, qr, chol, schur.

Free Multiple Precision Toolbox (MATLAB).

Besides being extremely slow (it performs number-to-string conversion of operands on every arithmetic operation: +, -, ...) and lacking essential functionality (eig, det, cond, \, ...), it gives wrong results in functions it has.

E.g. incorrect results delivered by svd function made my research senseless at some point and error was painful to find.

mpmath (Python)

Mainly targeted to special functions computing (hypergeometric family in particular). And has no support for more or less advanced numerical algorithms. Has very little support for matrices. Although seems to have matrix logarithm you are looking for in the latest version.


Actually all these drawbacks pushed me to develop my own extension for MATLAB to enable it with arbitrary precision computing (referred at the beginning - Multiprecision Computing Toolbox for MATLAB). I just need it for my work.

It is under active development (but already fixes all listed problems with other alternatives) - I would appreciate any feedback.




回答2:


Regarding diagonalization, maybe this can help you (he also needed more accurate eigenvalues than what doubles where giving him and ended up using quadruple precision).

He is using fortran. Changing to quads involved defining an integer to be 16 instead of 8 and recompiling LAPACK with gfortran using "-fdefault-real-8" to promote doubles to quads. ¿Maybe you can build LAPACK like this and then use it from NumPy? I don't know.

Of course, since this precision is actually simulated, the program got 10 times slower.

Sorry for not being more specific: I've not tried anything like this but I remembered the blog post and it may be enough for you to at least get started.




回答3:


Would Symbolic Math Toolbox or the freely available Multiple Precision Toolbox, both for MATLAB, meet your needs? The Multiple Precision Toolbox doesn't seem to have an equivalent of eig, but it does have svd.



来源:https://stackoverflow.com/questions/9491907/quadruple-precision-eigenvalues-eigenvectors-and-matrix-logarithms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!