Skip to content

Commit

Permalink
Fix select on empty inds
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Aug 30, 2023
1 parent b347f71 commit 34ed452
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TensorNetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ end
Return tensors whose indices match with the list of indices `i`.
"""
select(tn::TensorNetwork, i::AbstractVecOrTuple{Symbol}) = mapreduce(Base.Fix1(select, tn), , i)
select(tn::TensorNetwork, i::AbstractVecOrTuple{Symbol}) = filter(Base.Fix1(, i) inds, tensors(tn))
select(tn::TensorNetwork, i::Symbol) = map(x -> tn.tensors[x], unique(tn.indices[i]))

"""
Expand Down

0 comments on commit 34ed452

Please sign in to comment.