Skip to main content

# NUMKL

[![version](https://img.shields.io/pypi/v/numkl.svg)](https://pypi.org/project/numkl/) [![conda](https://anaconda.org/refraction-ray/numkl/badges/version.svg)](https://anaconda.org/refraction-ray/numkl)

This package works as the python wrapper to directly call some MKL routines while keep the same interface with numpy.

## Install

Use pip install numkl

Or conda install -c refraction-ray numkl

You should make sure Intel MKL library and Intel compilers are installed and configured for relevant enviroment variables. Especially, environment variable MKLROOT is necessary for pip installation. And proper LD_LIBRARY_PATH is necessary in runtime.

Currently, you also need cython preinstalled in your python enviroment for pip installation.

Note this package is in its very early age, no guarantee on successful installation and usage. And this package only supports linux.

## Example

`python import numpy as np from numkl import eig a = np.array([[0.,1.0],[1.0,0.]]) e,v = eig.eighx(a) `

## Why

This package is not reinventing wheels like numpy, instead, it provide features that current numpy doesn’t provide.

For the symmetric or Hermitian matrix eigenproblem, numpy has already provided the interface numpy.linalg.eigh and numpy.linalg.eigvalsh. By correctly configuring and linking, these two functions also can directly calling MKL routines. So why bother?

There are at least two aspects why numpy eigenproblem interface is not good enough:

  1. The 32 bit int overflow and unable to calculate eigenproblem for large matrix. See [this issue](https://github.com/numpy/numpy/issues/13956). Note currently this issue cannot be solve by simply hacking the compiling parameters, instead one need to change the source code of numpy.

  2. The memory waste due to keeping the input matrix. See [this issue](https://github.com/numpy/numpy/issues/14024). Actually, it costs two times of the space in numpy for getting all eigenvalues than directly using lapack routine.

In a word, this package is designed for “push-to-the-limit” style computations, where you can compute the eigenproblem for matrix dimension larger than 32766. And the interface is seamlessly integrated with numpy.

Release files for numkl 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numkl 0.0.4
File Size Uploaded
numkl-0.0.4.tar.gz 133.5 kB Details

Release files / numkl-0.0.4.tar.gz

Download URL numkl-0.0.4.tar.gz
Size 133.5 kB
Tags Source
SHA-256 checksum
How to use checksums
994dd8b0e299b65bda6354427aeaa7608128d41913d6077c5c5bd7c29597ffa7
BLAKE2b-256 checksum
How to use checksums
ab75252643dd281522feef0ff0b692c3e669ce2f1318ded78091c6dc440a4bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page