IndexSet

ITensors.IndexSetMethod
IndexSet{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).

source
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).

source
IndexSet(inds)
IndexSet(inds::Index...)

Construct an IndexSet from a collection of indices (any collection that is convertable to a Tuple).

source
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).

source
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})).

source

Priming and tagging

Documentation for IndexSet priming and tagging methods can be found in the ITensor Priming and tagging section.

Base.mapMethod
map(f, is::IndexSet)

Apply the function to the elements of the IndexSet, returning a new IndexSet.

source

Set operations

Documentation for IndexSet set operations can be found in the ITensor IndexSet set operations section.

Subsets

ITensors.getfirstMethod
getfirst(f::Function, is::IndexSet)

Get the first Index matching the pattern function, return nothing if not found.

source
ITensors.getfirstMethod
getfirst(is::IndexSet)

Return the first Index in the IndexSet. If the IndexSet is empty, return nothing.

source
Base.filterMethod
filter(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.

source