A matrix product representation library for Python

JOSS PyPI Travis Documentation Status Coverage Status Maintainability

mpnum is a flexible, user-friendly, and expandable toolbox for the matrix product state/tensor train tensor format. mpnum provides:

To install the latest stable version run

pip install mpnum

If you want to install mpnum from source, please run (on Unix)

git clone
cd mpnum
pip install .

In order to run the tests and build the documentation, you have to install the development dependencies via

pip install -r requirements.txt

For more information, see:

Required packages:

Supported Python versions:


How to contribute

Contributions of any kind are very welcome. Please use the issue tracker for bug reports. If you want to contribute code, please see the section on how to contribute in the documentation.



Distributed under the terms of the BSD 3-Clause License (see LICENSE).


If you use mpnum for yor paper, please cite:

Suess, Daniel and Milan Holzäpfel (2017). mpnum: A matrix product representation library for Python. Journal of Open Source Software, 2(20), 465,

mpnum has been used and cited in the following publications: