diff --git a/src/TensorNetwork.jl b/src/TensorNetwork.jl index 9dac01997..8b8676674 100644 --- a/src/TensorNetwork.jl +++ b/src/TensorNetwork.jl @@ -438,7 +438,7 @@ function Base.replace!(tn::AbstractTensorNetwork, pair::Pair{<:Tensor,<:Tensor}) tn = TensorNetwork(tn) old_tensor, new_tensor = pair - old_tensor == new_tensor && return tn + old_tensor === new_tensor && return tn issetequal(inds(new_tensor), inds(old_tensor)) || throw(ArgumentError("replacing tensor indices don't match"))