/tenpy_benchmarks

Benchmarks of TeNPy

Primary LanguageJupyter NotebookGNU General Public License v3.0GPL-3.0

Benchmarks for TeNPy

This repo contains a few benchmarks for TeNPy with a comparison to ITensor.

Setup

  • Download this git repo, including submodules (i.e. call git submodule init and git submodule update if needed)

  • Setup a python environment you want to use, e.g. via one of the following:

    • conda create ./env_conda python pip numpy scipy mkl libblas=*=*mkl
      cd TeNpy
      pip install -e .
    • python -m venv env_pip
      . env_pip/bin/activate
      pip install physics-tenpy h5py

    If needed, adjust the environment: section in the submit scripts to load the environment.

Running the benchmarks

The setup is based on the cluster_jobs.py file for easy submission to the cluster, and can be submitted like this:

./> # edit submit files as necessary
./> mkdir run
./> cd run
run/> ../cluster_jobs.py submit ../submit_1D_DMRG.yml

Comparing with ITensor

The DMRG sweep is setup for a comparison to ITensor in the itensors/ subfolder. We provide the resulting log files with the timings in the repo. To re-run this part, follow these steps:

  • Install Julia.
  • Run julia interactively, enter the package manager by pressing "]" and install the necessary packages:
    julia> ]
    pkg> add ITensors
    pkg> add ITensorMPS
    pkg> add MKL
    
  • To manually run the julia script, go to the itensor directory and run julia run_itensor_comparison.jl
  • The stdout contains timings per sweep and is the output file we use for plotting.
  • To submit this as a job to the cluster, you can use cluster_jobs.py submit submit_itensor_benchmark.yml.

Plotting and analyzing results

See the jupyter notebooks in the plots/ folder.