Skip to content

Commit

Permalink
Fix more in-place operations
Browse files Browse the repository at this point in the history
  • Loading branch information
leburgel committed Jan 8, 2025
1 parent 52d8d28 commit 9f38380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/environments/ctmrg_environments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,14 @@ function LinearAlgebra.mul!(edst::CTMRGEnv, esrc::CTMRGEnv, α::Number)
end

function LinearAlgebra.rmul!(e::CTMRGEnv, α::Number)
rmul!(e.corners, α)
rmul!(e.edges, α)
rmul!.(e.corners, α)
rmul!.(e.edges, α)

Check warning on line 560 in src/environments/ctmrg_environments.jl

View check run for this annotation

Codecov / codecov/patch

src/environments/ctmrg_environments.jl#L559-L560

Added lines #L559 - L560 were not covered by tests
return e
end

function LinearAlgebra.axpy!::Number, e₁::CTMRGEnv, e₂::CTMRGEnv)
e₂.corners .+= α * e₁.corners
e₂.edges .+= α * e₁.edges
axpy!.(α, e₁.corners, e₂.corners)
axpy!.(α, e₁.edges, e₂.edges)

Check warning on line 566 in src/environments/ctmrg_environments.jl

View check run for this annotation

Codecov / codecov/patch

src/environments/ctmrg_environments.jl#L565-L566

Added lines #L565 - L566 were not covered by tests
return e₂
end

Expand Down
4 changes: 2 additions & 2 deletions src/states/infinitepeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ end

# Used in _scale during OptimKit.optimize
function LinearAlgebra.rmul!::InfinitePEPS, α::Number)
rmul!.A, α)
rmul!..A, α)
return ψ
end

# Used in _add during OptimKit.optimize
function LinearAlgebra.axpy!::Number, ψ₁::InfinitePEPS, ψ₂::InfinitePEPS)
ψ₂.A .+= α * ψ₁.A
axpy!.(α, ψ₁.A, ψ₂.A)
return ψ₂
end

Expand Down

0 comments on commit 9f38380

Please sign in to comment.