Learn to Use ITensor

main / classes / indexset Julia | C++

IndexSet (and IQIndexSet)

Container for storing indices.

The following documentation refers to IndexSet, but also applies to IQIndexSet, which is implemented using the same template class. For IQIndexSet, just replace all usage of the Index type with the type IQIndex.

IndexSet and IQIndexSet are defined in "itensor/indexset.h". Also see "itensor/indexset_impl.h". An IndexSet is a subclass of Range which is defined in "itensor/tensor/range.h".


//Make some indices
auto b1 = Index("bond 1",5);
auto b3 = Index("bond 3",8);
auto s2 = Index("Site 2",2,Site); 
auto s3 = Index("Site 3",2,Site);

auto inds = IndexSet(b1,b3,s2,s3);

//Print all the indices
for(auto& i : inds) println(i);

//Or just print the whole set at once
println("inds = ",inds);

Print(rank(inds)); //prints 4


Accessor Methods

Other Class Methods and Features

Prime Level Functions

Other IndexSet Functions

This page current as of version 2.0.7

Back to Classes
Back to Main