Learn to Use ITensor

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


MPS is matrix product state of ITensors. IQMPS nearly identical but uses IQTensors. In the documentation below, MPS refers to both MPS and IQMPS unless explicitly specified. The type ITensor should be replaced with IQTensor for the case of an IQMPS.

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 psi.position(n) on an MPS psi makes site n the orthogonality center (OC). Calling psi.position(m) moves the OC in an intelligent way using the fewest steps possible. If an arbitrary tensor of the MPS is modified, and psi.position(n) is again called, the MPS class knows how to restore the OC in the fewest number of steps.

MPS tensors follow the convention that indices connecting neighboring tensors have the IndexType Link. Physical indices have the IndexType Site.

MPS objects can be constructed from either a SiteSet or an InitState.


int N = 100;
auto sites = SpinHalf(N);

auto psi = MPS(sites); //create random product MPS

// Shift MPS gauge such that site 1 is
// the orthogonality center
//Shift orthogonality center to site k

// Read-only access of tensor at site j
auto A = psi.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
psi.Aref(j) *= -1;

// Initialize an IQMPS 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 qpsi = IQMPS(state);



Retrieving Basic Information about MPS

Modifying MPS Tensors

Modifying and Re-gauging MPS

MPS Prime Level Methods

Operations on MPS

Functions for Analyzing MPS

Functions for Modifying MPS

Developer / Advanced Methods

This page current as of version 2.0.7

Back to Classes
Back to Main