[PYTHON] A memorandum of speed of arbitrary degree diagonalization

Purpose

Using mpmath (python) and Mathematica, which execute diagonalization by arbitrary precision calculation, the time required for diagonalization was measured, so I will leave it as a memorandum.

Evaluation method

The evaluated matrix is a one-dimensional Hamiltonian $ H = p^2/2 + q^4/2 $ Hermite matrix composed of the bases of the harmonic oscillator. Matrix elements are composed with 100-digit precision. The diagonalization routine

use.

result

Mathematica is about 10 times faster.

diag time.png

Task

In multidimensional, it takes 40 days for mathematica because it evaluates a matrix of about $ 10 ^ 4 \ times10 ^ 4 $. I would like to use mpack, which is a multiple extension of lapack.

Postscript

I installed mpack and touched it for a few hours. Since the speed was evaluated, I will record it as an additional note.

The diagonalized matrix is a symmetric execution column $ a_ {i, i} = i $, $ a_ {i + 1, j} = i $, $ a_ {i, j + 1} = i $ Otherwise, use a real symmetric matrix with 0 elements.

Compare mathematica and mpack Rsyev routines. As a result, mpack seems to be about 10 times faster than mathematica. diag-time-2.png

In the case of Hermitian, we have not evaluated it yet, but if it is about 10 times faster than Mathematica, the diagonalization of $ 10 ^ 4 \ times 10 ^ 4 $ will be completed in 4 days. This is very promising.

But first, you have to be able to use mpack.

Recommended Posts

A memorandum of speed of arbitrary degree diagonalization
A memorandum of kernel compilation
A small memorandum of openpyxl
A memorandum of using eigen3
[Python] A memorandum of beautiful soup4
A memorandum of files under conf.d
A memorandum of closure survey contents
A memorandum of using Python's input function
A memorandum of understanding about django's QueryDict
A memorandum of python string deletion process
A memorandum of trouble when formatting data
A memorandum of JSON Schema notation for dictionaries that take arbitrary keys
Memorandum of sed
A memorandum of calling Python from Common Lisp
A memorandum of studying and implementing deep learning
A memorandum of extraction by python bs4 request
[Linux command] A memorandum of frequently used commands
A memorandum about the warning of the pylint output result
Memorandum of fastText (editing)
memorandum of vi command
A memorandum about matplotlib
A memorandum about Nan.
elasticsearch_dsl Memorandum of Understanding
A memorandum of stumbling on my personal HEROKU & Python (Flask)
Image crawling summary performed at the speed of a second
Build a speed of light web API server with Falcon
[Introduction to AWS] A memorandum of building a web server on AWS