Quick search for eigenvectors on HPC using Qutip and slepc4py

I am doing some numerical calculations of quantum computing, and I want to find the eigenvectors of a large Hermitian matrix (~ 2 ^ 14 rows / columns)

I work on a machine with 24/48 XEON threads. The code was originally written using the Qutip library. I found out that the included function eigenstates()uses only one thread on my machine, so I'm trying to find a faster way to do this.

I tried to use the functions scipy.linalg eig()and eigh(), as well scipy.sparse.linalg eig(), and eigh(), but they both look slower than function, built-in Qutip.

I saw some suggestion that I might get some speedup from using slepc4py, however the package documentation seems very inadequate. I cannot learn how to convert a complex numpy array to a SLEPC matrix.

A = PETSc.Mat().create()
A[:,:] = B[:,:]
# where B is a scipy array of complex type
TypeError: Cannot cast array data from dtype('complex128') to dtype('float64') according to the rule 'safe'
+4
source share
2 answers

QuTiP eigensolver SciPy eigensolver. , BLAS, SciPy, , . eigensolver , BLAS (, Intel MKL). matvec, , , . , . , . , , - .

+1

, , qutip mkl . python :

import ctypes
mkl_rt = ctypes.CDLL('libmkl_rt.so')
mkl_get_max_threads = mkl_rt.mkl_get_max_threads
mkl_rt.mkl_set_num_threads(ctypes.byref(ctypes.c_int(48)))

Intel mkl .

( question)

0

Source: https://habr.com/ru/post/1668657/


All Articles