Basics

The following few sections should help you on your way to setting up and running simulations.

TensorKit

MPSKit works on "TensorMap" objects defined in TensorKit.jl. These abstract objects can represent not only plain arrays but also symmetric tensors. A TensorMap is a linear map from its domain to its codomain.

Initializing a TensorMap can be done using

TensorMap(initializer,eltype,codomain,domain);
TensorMap(inputdat,codomain,domain);

As an example, the following creates a random map from ℂ^10 to ℂ^10 (which is equivalent to a random matrix)

TensorMap(rand,ComplexF64,ℂ^10,ℂ^10);
dat = rand(ComplexF64,10,10); TensorMap(dat,ℂ^10,ℂ^10);

Similarly, the following creates a symmetric tensor

TensorMap(rand,ComplexF64,ℂ[U₁](0=>1)*ℂ[U₁](1//2=>3),ℂ[U₁](1//2=>1,-1//2=>2))

TensorKit defines a number of operations on TensorMap objects

a = TensorMap(rand,ComplexF64,ℂ^10,ℂ^10);
3*a; a+a; a*a; a*adjoint(a); a-a; dot(a,a); norm(a);

but the primary workhorse is the @tensor macro

a = TensorMap(rand,ComplexF64,ℂ^10,ℂ^10);
b = TensorMap(rand,ComplexF64,ℂ^10,ℂ^10);
@tensor c[-1;-2]:=a[-1,1]*b[1,-2];

creates a new TensorMap c equal to a*b.

For more information, check out the tensorkit documentation!

Overview

Within MPSKit we defined a set of states, a number of operators and some algorithms which combine the two in a nontrivial way.

As a simple example we can define a FiniteMPS

state = FiniteMPS(rand,ComplexF64,10,ℂ^2,ℂ^10);

A hamiltonian operator

opp = nonsym_ising_ham();

And use this to find the groundstate

(groundstate,_) = find_groundstate(state,opp,DMRG());

Tips & tricks

  • There is an examples folder
  • Julia inference is taxed a lot; so use (jupyter notebooks / Revise ) instead of re-running a script everytime