Examples
Toy codes
These “toy codes” are meant to give you a flavor of the different algorithms,
while keeping the codes as readable and simple as possible.
They can be found in a separate [TeNPyToycodes] repository https://github.com/tenpy/tenpy_notebooks in the folder tenpy_toycodes/
.
The only requirements to run them are Python 3, Numpy, and Scipy, (and jupyter for running the notebooks).
For reference, we include them here as examples.
It has the following tutorial notebooks.
- Tensor basics
- MPS and model basics
- DMRG runs
- Exercises similar to
exercise_toycodes.ipynb
using TeNPy - Exercises based on the toy codes
- Solutions to Tensor basics
- Solutions to MPS and model basics
- Solutions to DMRG runs
- Solutions for the
exercise_tenpy.ipynb
notebook - Solutions for the
exercise_toycodes.ipynb
notebook - Example functions inside toycodes
Python scripts
These example scripts illustrate the very basic interface for calling TeNPy.
They are included in the [TeNPySource] repository in the folder examples/
,
we include them here in the documentation for reference.
You need to install TeNPy to call them (see Installation instructions), but you can copy them anywhere before execution.
(Some scripts include other files from the same folder, though; copy those as well.)
A bit more elaborate examples from the subfolders in examples/*
are included in this list:
YAML config examples
We also have abunch of example config files that can be used for standard simulations, see Simulations.
Jupyter Notebooks
This is a collection of [jupyter] notebooks from the [TeNPyNotebooks] repository. You need to install TeNPy to execute them (see Installation instructions), but you can copy them anywhere before execution. Note that some of them might take a while to run, as they contain more extensive examples.
- A first TEBD Example
- A first finite DMRG Example
- Interactive calls of Simulations
- Lattices: visualization and further examples
- Toric Code
- Why you need the Mixer in DMRG
- Time evolution with time-dependent Hamiltonian
- Excitations with DMRG and segment boundary conditions
- Sampling of Purification MPS
- Multi-Species Models
- Overview predefined lattices