diff --git a/Project.toml b/Project.toml index c7504a4..c7cecd0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OMEinsumContractionOrders" uuid = "6f22d1fd-8eed-4bb7-9776-e7d684900715" authors = ["Jin-Guo Liu", "Pan Zhang"] -version = "0.8.1" +version = "0.8.2" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/json.jl b/src/json.jl index f32d7b9..8014887 100644 --- a/src/json.jl +++ b/src/json.jl @@ -31,7 +31,7 @@ function _fromdict(dict) end ne = fromdict(LT, dict["tree"]) if haskey(dict, "slices") - return SlicedEinsum(_convert.(LT, dict["slices"]), ne) + return SlicedEinsum(LT[_convert(LT, l) for l in dict["slices"]], ne) else return ne end @@ -68,4 +68,4 @@ function einsfromdict(::Type{LT}, dict::Dict) where LT end _convert(::Type{LT}, x) where LT = convert(LT, x) -_convert(::Type{Char}, x::String) where LT = (@assert length(x)==1; x[1]) +_convert(::Type{Char}, x::String) = (@assert length(x)==1; x[1]) diff --git a/src/treesa.jl b/src/treesa.jl index c63f27e..fb31557 100644 --- a/src/treesa.jl +++ b/src/treesa.jl @@ -454,7 +454,7 @@ function ExprTree(code::NestedEinsum) _exprtree(code, _label_dict(code)) end function _exprtree(code::NestedEinsum, labels) - @assert length(code.args) == 2 + @assert length(code.args) == 2 "einsum contraction not in the binary form, got number of arguments: $(length(code.args))" ExprTree(map(enumerate(code.args)) do (i,arg) if isleaf(arg) # leaf nodes ExprTree(ExprInfo(getindex.(Ref(labels), getixsv(code.eins)[i]), arg.tensorindex))