Skip to content
Tensor Network Python (TeNPy)
Python Shell
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc updated badges on top of the readme Nov 8, 2019
examples added overview to documentation Nov 6, 2019
tenpy fix MPS.get_rho_segment() to return rho with proper labels Oct 30, 2019
tests add option to use "order='folded'" for a Chain with periodic boundary… Oct 15, 2019
toycodes format docstrings with docformatter (version 1.3) for the first time. Oct 2, 2019
.gitignore Merge branch 'master' of into engine_rebuild Aug 9, 2019
.style.yapf autoformat with yapf; simplified .style.yapf to be based on PEP8 Apr 18, 2018
.travis.yml added .travis.yml and requirements.txt Apr 25, 2019
AUTHORS.txt updated author list May 10, 2019
CHANGELOG.rst add option to use "order='folded'" for a Chain with periodic boundary… Oct 15, 2019
LICENSE added AUTHORS.txt, (GPL) LICENSE and copyright notices in each file Feb 18, 2018 updated changelog Aug 15, 2019
README.rst updated badges on top of the readme Nov 8, 2019 minor fixes on documentation Oct 2, 2019 add separate cleanup file Mar 4, 2019
environment.yml updated INSTALL.rst Apr 26, 2019
requirements-doc.txt specify requirements separately Apr 25, 2019
requirements-extra.txt format docstrings with docformatter (version 1.3) for the first time. Oct 2, 2019
requirements-min.txt specify requirements separately Apr 25, 2019
requirements-plot.txt specify requirements separately Apr 25, 2019
requirements-test.txt specify requirements separately Apr 25, 2019
requirements.txt specify requirements separately Apr 25, 2019
setup.cfg added MANIFEST to define files included into sdist package Apr 26, 2019 format docstrings with docformatter (version 1.3) for the first time. Oct 2, 2019


Tensor Network Python (TeNPy)

GitHub last commit Build GitHub issues PyPi

TeNPy (short for 'Tensor Network Python') is a Python library for the simulation of strongly correlated quantum systems with tensor networks.

The philosophy of this library is to get a new balance of a good readability and usability for new-comers, and at the same time powerful algorithms and fast development of new algorithms for experts. For good readability, we include an extensive documentation next to the code, both in Python doc strings and separately as user guides, as well as simple example codes and even toy codes, which just demonstrate various algorithms (like TEBD and DMRG) in ~100 lines per file.

How do I get set up?

Follow the instructions in the file doc/INSTALL.rst, online here. The latest version of the source code can be obtained from

How to read the documentation

The documentation is available online at The documentation is roughly split in two parts: on one hand the full "reference" containing the documentation of all functions, classes, methods, etc., and on the other hand the "user guide" containing some introductions and additional explanations.

The documentation is based on Python's docstrings, and some additional *.rst files located in the folder doc/ of the repository. All documentation is formated as reStructuredText, which means it is quite readable in the source plain text, but can also be converted to other formats. If you like it simple, you can just use intective python help(), Python IDEs of your choice or jupyter notebooks, or just read the source. Moreover, the documentation is nightly converted into HTML using Sphinx, and made available online at The big advantages of the (online) HTML documentation are a lot of cross-links between different functions, and even a search function. If you prefer yet another format, you can try to build the documentation yourself, as described in :doc:`doc/contributing.rst <contributing>`.

Help - I looked at the documentation, but I don't understand how ...?

We have set up a community forum at, where you can post questions and hopefully find answers. Once you got some experience with TeNPy, you might also be able to contribute to the community and answer some questions yourself ;-) We also use this forum for official annoucements, for example when we release a new version.

Citing TeNPy

When you use TeNPy for a work published in an academic journal, you can cite this paper to acknowledge the work put into the development of TeNPy. (The license of TeNPy does not force you, however.) For example, you could add the sentence "Calculations were performed using the TeNPy Library (version X.X.X)\cite{tenpy}." in the acknowledgements or in the main text.

The corresponding BibTex Entry would be the following (the \url{...} requires \usepackage{hyperref} in the LaTeX preamble.):

    title={{Efficient numerical simulations with Tensor Networks: Tensor Network  Python (TeNPy)}},
    author={Johannes Hauschild and Frank Pollmann},
    journal={SciPost Phys. Lect. Notes},
    note={Code available from \url{}},

I found a bug

You might want to check the github issues, if someone else already reported the same problem. To report a new bug, just open a new issue on github. If you already know how to fix it, you can just create a pull request :) If you are not sure whether your problem is a bug or a feature, you can also ask for help in the TeNPy forum.


The code is licensed under GPL-v3.0 given in the file LICENSE of the repository, in the online documentation readable at

You can’t perform that action at this time.