Learn to Use ITensor

main / classes / mps C++v3 | C++v2 | Julia


The MPS class is a matrix product state of ITensors.

The main benefit of using the MPS class is that it can provide strong guarantees about the orthogonality properties of the matrix product state it represents. Calling A.position(n) on an MPS A makes site n the orthogonality center (OC). Calling A.position(m) moves the OC in an intelligent way using the fewest steps possible. If an arbitrary tensor of the MPS is modified, and A.position(n) is again called, the MPS class knows how to restore the OC in the fewest number of steps.

ITensor library functions assume an Index structure that each MPS tensor has one site index (an index unique to that tensor) as well as one or two link indices, each of which is shared by one of the neighboring MPS tensors. They also generally assume open boundary conditions, such that the end MPS tensors have only one link and one site index. However, these constraints are not enforced when constructing an MPS or modifying the tensors of an MPS.

Some ITensor library functions accepting MPS objects assume the convention that indices connecting neighboring tensors have the tag "Link" and physical indices carry the "Site" tag, for example the dmrg function (but these requirements may be lifted in the future).

MPS objects can be constructed by specifying the number of tensors, from a SiteSet, or from an InitState.


int N = 10;
auto sites = SpinHalf(N,{"ConserveQNs=",false});

auto A = randomMPS(sites); //create random product MPS

// Shift MPS gauge such that site 1 is
// the orthogonality center
//Shift orthogonality center to site j
auto j = 5;

// Read-only access of tensor at site j
auto Aj = A(j);

// Replace tensor at site j with
// a modified tensor.

// Directly modify tensor at site j; "ref"
// signified that a reference to A_j tensor is returned
A.ref(j) *= -1;

// Initialize an MPS to a specific product state
auto state = InitState(sites);
for(int i = 1; i <= N; ++i)
    if(i%2 == 0) state.set(i,"Up");
    else         state.set(i,"Dn");
auto B = MPS(state);

Constructors and Constructor Functions

Retrieving Basic Information about MPS

Index Methods

Modifying MPS Tensors

Modifying and Re-gauging MPS

MPS Tag and Prime Methods

MPS have the same tag and prime methods that are defined for ITensors and IndexSets. See the Tag and Prime Methods section of the IndexSet documentation for a complete list of methods.

When applied to an MPS, the method is applied to every MPS tensor.

Operations on MPS

Functions for Analyzing MPS

Functions for Modifying MPS

Developer / Advanced Methods

This page current as of version 3.0.0

Back to Classes
Back to Main