diff --git a/Project.toml b/Project.toml index b34ba28..537dc3d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ITensorBase" uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7" -version = "0.9.0" +version = "0.9.1" authors = ["ITensor developers and contributors"] [workspace] @@ -52,7 +52,7 @@ Mooncake = "0.4.202, 0.5" OrderedCollections = "1.6" Random = "1.10" SimpleTraits = "0.9.4" -TensorAlgebra = "0.12.4, 0.13" +TensorAlgebra = "0.13.4" TensorOperations = "5.3.1" TermInterface = "2" TupleTools = "1.6" diff --git a/src/index.jl b/src/index.jl index d65e591..a709c64 100644 --- a/src/index.jl +++ b/src/index.jl @@ -1,5 +1,6 @@ using Accessors: @set using Random: AbstractRNG, RandomDevice +using TensorAlgebra: TensorAlgebra as TA using UUIDs: UUID, uuid4 tagpairstring(pair::Pair) = string(first(pair)) * "=>" * string(last(pair)) @@ -39,6 +40,11 @@ function uniquename(rng::AbstractRNG, ::Type{<:IndexName}) return IndexName(rng) end +# Derive contractions on integer labels: an `IndexName` carries an id and a tag dictionary and is +# far costlier to compare than an integer, and deriving a contraction makes several comparison +# passes over the labels. See `TensorAlgebra.label_type`. +TA.label_type(::Type{<:IndexName}) = Int + to_symbol_pair(p::Pair) = Symbol(first(p)) => Symbol(last(p)) # Like `Dict`, accept one or more bare `Pair`s as tags. A `Pair` iterates over