Need help with tenpy?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

181 Stars 68 Forks GNU General Public License v3.0 1.9K Commits 27 Opened issues


Tensor Network Python (TeNPy)

Services available


Need anything else?

Contributors list

TeNPy: Tensor Network Python

.. image:: :alt: GitHub last commit :target: .. image:: :alt: Documentation :target: .. image:: :alt: Build :target: .. image:: :alt: GitHub issues :target: .. image:: :alt: conda :target: .. image:: :alt: PyPi :target:

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?

If you have the

package manager, you can install the latest released version of TeNPy with::
conda install --channel=conda-forge physics-tenpy

Further details and alternative methods can be found the file

_. 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

_ with additional explanations and

The documentation is based on Python's docstrings, and some additional

files located in the folder
of the repository. All documentation is formated as
, 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
, Python IDEs of your choice or jupyter notebooks, or just read the source. Moreover, the documentation gets converted into HTML using
, and is 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

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.

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 

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

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{}},

To keep us motivated, you can also include your work into the list of

papers using TeNPy 


This work was funded by the U.S. Department of Energy, Office of Science, Office of Basic Energy Sciences, Materials Sciences and Engineering Division under Contract No. DE-AC02-05- CH11231 through the Scientific Discovery through Advanced Computing (SciDAC) program (KC23DAC Topological and Correlated Matter via Tensor Networks and Quantum Monte Carlo).


The code is licensed under GPL-v3.0 given in the file

of the repository, in the online documentation readable at

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.