Clone via github.
(this is the preferred method—see our git quickstart guide.)
Or download latest
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.
- A complete DMRG code
- Efficient matrix product state class
- Quantum number conserving tensors
- Complex numbers (handled lazily: no efficiency loss if real)
- Easy install: only dependencies are BLAS/Lapack and C++11
- ITensor 1.1 (May 2015)
- Article: Should you use Periodic Boundary Conditions in DMRG?
- ITensor at 2014 Sherbrooke Summer School
ITensors are nearly as easy to multiply as scalars: all tensors indices are stamped with a unique internal id number; matching indices automatically contract when two ITensors are multiplied, making it simple to transcribe tensor network diagrams into correct, efficient code.
For example, the diagram below (resembling the partial overlap of two matrix product states) can be converted to code as
- Clone the latest version:
Or download zip file if you do not have git.
git clone https://github.com/ITensor/ITensor itensor
(Cloning with git allows you to track changes to ITensor and is the preferred method; for more see our git quickstart guide.)
- Read the installation instructions.
- Learn more from the documentation.
Perform a DMRG Calculation
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, 0,-1; 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