IndexSet
ITensors.IndexSet
— MethodIndexSet{N, IndexT}(inds)
IndexSet{N, IndexT}(inds::Index...)
Construct an IndexSet of order N and element type IndexT from a collection of indices (any collection that is convertable to a Tuple).
IndexSet{N}(inds)
IndexSet{N}(inds::Index...)
Construct an IndexSet of order N
from a collection of indices (any collection that is convertable to a Tuple).
IndexSet(inds)
IndexSet(inds::Index...)
Construct an IndexSet from a collection of indices (any collection that is convertable to a Tuple).
IndexSet(inds::Vector{<:Index})
Convert a Vector of indices to an IndexSet.
Warning: this is not type stable, since a Vector is dynamically sized and an IndexSet is statically sized. Consider using the constructor IndexSet{N}(inds::Vector)
.
IndexSet{N}(inds::Vector{<:Index})
Convert a Vector of indices to an IndexSet of size N.
Type stable conversion of a Vector of indices to an IndexSet (in contrast to IndexSet(::Vector{<:Index})
).
Priming and tagging
Documentation for IndexSet priming and tagging methods can be found in the ITensor Priming and tagging section.
Base.map
— Methodmap(f, is::IndexSet)
Apply the function to the elements of the IndexSet, returning a new IndexSet.
Set operations
Documentation for IndexSet set operations can be found in the ITensor IndexSet set operations section.
Subsets
ITensors.getfirst
— Methodgetfirst(f::Function, is::IndexSet)
Get the first Index matching the pattern function, return nothing
if not found.
ITensors.getfirst
— Methodgetfirst(is::IndexSet)
Return the first Index in the IndexSet. If the IndexSet is empty, return nothing
.
Base.filter
— Methodfilter(f::Function, inds::IndexSet)
filter(f::Function, ::Order{N}, inds::IndexSet)
Filter the IndexSet by the given function (output a new IndexSet with indices i
for which f(i)
returns true).
Note that this function is not type stable, since the number of output indices is not known at compile time.
To make it type stable, specify the desired order by passing an instance of the type Order
.