Learn to Use ITensor

main / classes / indexval


An IndexVal conceptually represents an Index fixed to a specific value.

IndexVal holds both an Index called "index" and an integer "val" representing a particular value the Index can take. The value is 1-indexed and must be in the range [1,m] where m is the size of the Index.

IndexVal is defined in "itensor/index.h".


auto s1 = Index("Site 1",4,Site);
auto iva = IndexVal(s1,3),
auto ivb = IndexVal(s1,1);
Print(iva.val); //prints: iva.val = 3
Print(ivb.val); //prints: ivb.val = 1

//Can make an IndexVal by "plugging" an
//integer into an Index
auto ivc = s1(4);
Print(ivc.val); //prints: ivc.val = 4
Print(ivc.index); //prints: ("Site 1",4,Site)

Public Data Members

Class Methods

Other Operations With IndexVals

This page current as of version 2.0.6

Back to Classes
Back to Main