We have some extra requirements that you don’t need to install to use TeNPy, but that you might find usefull to work with. TeNPy does not import the following libraries (at least not globally), but some functions might expect arguments behaving like objects from these libraries.
If you created a [conda] environment with
conda env create -f environment.yml, all the extra requirements below
should already be installed :)
pip install -r requirements.txt does not install all of them.)
Intel’s Math Kernel Library (MKL)¶
If you want to run larger simulations, we recommend the use of Intel’s MKL. It ships with a Lapack library, and uses optimization for Intel CPUs. Moreover, it uses parallelization of the LAPACK/BLAS routines, which makes execution much faster. As of now, the library itself supports no other way of parallelization.
If you don’t have a python version which is built against MKL,
we recommend using [conda] or directly intelpython.
Conda has the advantage that it allows to use different environments for different projects.
Both are available for Linux, Mac and Windows; note that you don’t even need administrator rights to install it on linux.
Simply follow the (straight-forward) instructions of the web page for the installation.
After a successfull installation, if you run
python interactively, the first output line should
state the python version and contain
Intel Corporation, respectively.
If you have a working conda package manager, you can install the numpy build against MKL with:
conda install mkl mkl-devel numpy scipy
mkl-devel package is required for linking against MKL, i.e. for compiling the Cython code.
As outlined in Installation with conda from conda-forge, on Linux/Mac you also need to pin blas to use MKL with the following line, if you use the `conda-forge` channel:
conda install "libblas=*=*mkl"
MKL uses different threads to parallelize various BLAS and LAPACK routines.
If you run the code on a cluster, make sure that you specify the number of used cores/threads correctly.
By default, MKL uses all the available CPUs, which might be in stark contrast than what you required from the
cluster. The easiest way to set the used threads is using the environment variable MKL_NUM_THREADS (or OMP_NUM_THREADS).
For a dynamic change of the used threads, you might want to look at
HDF5 file format support¶
We support exporting data to files in the [HDF5] format through the python interface of the h5py <https://docs.h5py.org/en/stable/> package, see Saving to disk: input/output for more information. However, that requires the installation of the HDF5 library and h5py.
YAML parameter files¶
tenpy.tools.params.Config class supports reading and writing YAML files, which requires the package
pip install pyyaml.