Skip to content

Commit

Permalink
remove obsolete iszero checks (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos authored Dec 17, 2024
1 parent 0428ee4 commit 72a980b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/operators/mpohamiltonian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,12 @@ function Base.:+(H₁::MPOH, H₂::MPOH) where {MPOH<:MPOHamiltonian}
A₁ = H₁.A[i]
A₁_inds = CartesianIndices((2:(size(H₁[i], 1) - 1), 1:1, 1:1,
2:(size(H₁[i], 4) - 1)))
iszero(A₁) || copyto!(W, A₁_inds, A₁, CartesianIndices(A₁))
copyto!(W, A₁_inds, A₁, CartesianIndices(A₁))

A₂ = H₂.A[i]
A₂_inds = CartesianIndices((size(H₁[i], 1):(size(W, 1) - 1), 1:1, 1:1,
size(H₁[i], 4):(size(W, 4) - 1)))
iszero(A₂) || copyto!(W, A₂_inds, A₂, CartesianIndices(A₂))
copyto!(W, A₂_inds, A₂, CartesianIndices(A₂))
end

if H₁ isa InfiniteMPOHamiltonian || i != 1
Expand Down

0 comments on commit 72a980b

Please sign in to comment.