Clone via github.
(Preferred method—see our git quickstart guide.)
Or download latest
version v1.0.5 (changelog)

ITensor—Intelligent Tensor—is a C++ library for implementing tensor product wavefunction calculations. It is efficient and flexible enough to be used for research-grade simulations.
Features include:

ITensors are as easy to multiply as scalars: matching indices automatically contract, making it simple to transcribe tensor network diagrams into correct, efficient code.

For example, the diagram below (resembling the overlap of two matrix product states) can be converted to code as

Installing ITensor:

  1. Clone the latest version:
    git clone itensor
    Or download zip file if you do not have git.
    (Cloning with git allows you to track changes to ITensor and is the preferred method; for more see our git quickstart guide.)
  2. Read the installation instructions.
  3. Learn more from the documentation.

Code Samples

Perform a DMRG Calculation

SpinOne sites(100); //define Hilbert space of 100 spin-lattice sites
MPO H = Heisenberg(sites); //pre-defined Hamiltonian; easy to write your own
MPS psi(sites);

Sweeps sweeps(5); //perform 5 sweeps of DMRG
sweeps.maxm() = 50, 50, 100, 100, 200; //max number of states kept each sweep

dmrg(psi,H,sweeps); //run the DMRG algorithm
Real energy = psiHphi(psi,H,psi); //can analyze wavefunction afterwards 

Multiply Two ITensors

Index a("a",2), b("b",2), c("c",2);
ITensor Z(a,b), X(c,b);
commaInit(Z,a,b) = 1, 0,
commaInit(X,b,c) = 0, 1, 
                   1, 0;

//the * operator finds and
//contracts common index 'b'
//regardless of index order:

ITensor R = Z * X;

Print( R(a(1),c(2)) ); //Prints: R(a(1),c(2)) = 1
Print( R(a(2),c(1)) ); //Prints: R(a(1),c(2)) = -1

ITensor Collaboration

E. Miles Stoudenmire
Perimeter Institute
Miles has been ITensor's primary developer since 2010.
Steven R. White
UC Irvine
Steve developed the original ITensor concept and implementation and remains actively involved.