Quadruple Precision Eigenvalues, Eigenvectors and Matrix Logarithms

2024/10/11 18:20:19

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?

Answer

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

https://en.xdnf.cn/q/69746.html

Related Q&A

How to use pyinstaller with pipenv / pyenv

I am trying to ship an executable from my python script which lives inside a virtual environment using pipenv which again relies on pyenv for python versioning. For that, I want to us pyinstaller. Wha…

Sending DHCP Discover using python scapy

I am new to python and learning some network programming, I wish to send an DHCP Packet through my tap interface to my DHCP server and expecting some response from it. I tried with several packet build…

cnf argument for tkinter widgets

So, Im digging through the code here and in every class (almost) I see an argument cnf={} to the constructor, but unless Ive missed it, it is not explicitly stated what cnf is / expected to contain. Ca…

python exceptions.UnicodeDecodeError: ascii codec cant decode byte 0xa7 in

I am using scrapy with python and I have this code in a python item piplinedef process_item(self, item, spider):import pdb; pdb.set_trace()ID = str(uuid.uuid5(uuid.NAMESPACE_DNS, item[link]))I got this…

Trace Bug which happends only sometimes in CI

I have a strange bug in python code which only happens sometimes in CI.We cant reproduce it.Where is the test code:response=self.admin_client.post(url, post) self.assertEqual(200, response.status_code,…

Limit neural network output to subset of trained classes

Is it possible to pass a vector to a trained neural network so it only chooses from a subset of the classes it was trained to recognize. For example, I have a network trained to recognize numbers and l…

Unable to fully remove border of PyQt QGraphicsView

I have tried calling self.setStyleSheet("background: transparent; border: transparent;") on a QGraphicsView, but it still leaves a 1 pixel border on the top edge. I have also tried replacing …

SqlAlchemy non persistent column

I am trying to define a model using sqlalchemy such that one of the columns i only need in memory for processing, i do not have a corresponding database column for that. I need it such that when i save…

Creating command line alias with python

I want to create command line aliases in one of my python scripts. Ive tried os.system(), subprocess.call() (with and without shell=True), and subprocess.Popen() but I had no luck with any of these me…

Remove unwanted lines in captcha text - opencv - python

I trying to get text from captcha image using opencv. Problem is text are masked with noise and it is complex to process with those horizontal line/noise.Original imageMy processed image :not sure how …