Skip to content

Commit

Permalink
Fix error throw in replace! (#201)
Browse files Browse the repository at this point in the history
* Fix error throw for replace!

* remove previous push line
  • Loading branch information
jofrevalles authored Sep 12, 2024
1 parent 4636f70 commit db23164
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 @@ -225,8 +225,8 @@ function Base.replace!(tn::AbstractTensorNetwork, pair::Pair{<:Tensor,<:Tensor})
old_tensor, new_tensor = pair
issetequal(inds(new_tensor), inds(old_tensor)) || throw(ArgumentError("replacing tensor indices don't match"))

delete!(tn, old_tensor)
push!(tn, new_tensor)
delete!(tn, old_tensor)

return tn
end
Expand Down

0 comments on commit db23164

Please sign in to comment.