IQIndexVal
IQIndexVal conceptually represents an IQIndex fixed to a specific value.
An IQIndexVal holds both an IQIndex .index and
an integer .val representing a particular value the IQIndex can take.
The value is 1-indexed and must be in the range [1,m] where m is the size
of the IQIndex.
IQIndexVals correspond to a specific block of their associated IQIndex.
Consider an IQIndexVal iv associated with an IQIndex I having
two blocks, both of size 8. If iv.val <= 8
it corresponds to the first block of I. If iv.val > 8
it corresponds to the second block of I.
IQIndexVal is defined in the header "itensor/iqindex.h".
Synopsis
auto I = IQIndex("I",Index("I+1",8),QN(+1),
Index("I-1",8),QN(-1));
auto iv = IQIndexVal(I,9);
Print(iv.index == I); //prints: true
Print(iv.val == 9); //prints: true
Print(iv.qn()); //prints: QN(-1)
Public Data Members
IQIndex indexlong val
Class Methods
IQIndexVal(IQIndex I, long val)Constructor taking an IQIndex
Iand valueval.
After constructing an IQIndexValiv, the data members
iv.index == Iandiv.val == val..qn() -> QNReturn the quantum number of the block corresponding to this IQIndexVal.
.indexqn() -> IndexQNReturn an IndexQN whose Index and QN are those of the block corresponding to this IQIndexVal.
explicit operator IndexVal()Explicit cast IQIndexVal to IndexVal. The resulting IndexVal has the property:
.indexis the result of casting the IQIndexVal's IQIndex to just an Index.valis unchanged
Conceptually this cast views the associated IQIndex as just an Index, ignoring its block structure.
.blockIndexVal() -> IndexValReturn an IndexVal with the following properties:
.indexis the block index corresponding to the block of the IQIndexVal.valis the relative offset within the block of the IQIndexVal
For example, if an IQIndexVal has value 11, then if the IQIndex is such that the first block has size 3; second block has size 6; and third block 3 has size 8; then the IQIndexVal falls inside (corresponds to) the third block, and has relative offset 2 (=11-6-3).
.dag()Reverse the Arrow direction of the
.indexfield of this IQIndexVal..prime(IndexType type, int inc = 1)Increment the primelevel of
.indexif its IndexType matchestypeby 1, or by an optional amountinc..noprime(IndexType type = All)Set the primelevel of
.indexto zero (optionally only if its IndexType matchestype)..mapprime(int plevold, int plevnew, IndexType type = All)If the primelevel of
.indexisplevold, change it toplevnew(optionally only if its IndexType matchestype).
Other IQIndexVal Features
IQIndexVals are default constructible.
IQIndexVals compare equal if both their
.indexand.valmembers are equal.IQIndexVals can be compared to an IQIndex, in which case only the
.indexfield is used.
IQIndexVal Functions
dag(IQIndexVal iv) -> IQIndexValReturn a copy of the IQIndexVal with the Arrow direction of its
.indexreversed.prime(IQIndexVal iv, IndexType type, int inc = 1) -> IQIndexValReturn a copy of the IQIndexVal
iv, incrementing the primelevel of its.indexfield if its IndexType matchestypeby 1, or by an optional amountinc.noprime(IQIndexVal iv, IndexType type = All) -> IQIndexValReturn a copy of the IQIndexVal
iv, setting the primelevel of its.indexfield to zero (optionally only if its IndexType matchestype).mapprime(IQIndexVal iv, int plevold, int plevnew, IndexType type = All) -> IQIndexValReturn a copy of the IQIndexVal
ivsuch that if the primelevel of its.indexfield isplevold, it is changed toplevnew(optionally only if its IndexType matchestype).
This page current as of version 2.0.6