Skip to content

Commit

Permalink
Formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Sep 19, 2023
1 parent 2f9c7f1 commit 03264b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tensors/braidingtensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function planarcontract!(C::AbstractTensorMap{S,N₁,N₂},
codB, domB = codomainind(B), domainind(B)
oindA, cindA, oindB, cindB = reorder_indices(codA, domA, codB, domB, oindA, cindA,
oindB, cindB, p1, p2)

if space(B, cindB[1]) != space(A, cindA[1])' ||
space(B, cindB[2]) != space(A, cindA[2])'
throw(SpaceMismatch("$(space(C)) ≠ permute($(space(A))[$oindA, $cindA] * $(space(B))[$cindB, $oindB], ($p1, $p2)"))
Expand Down
6 changes: 4 additions & 2 deletions src/tensors/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Base.copy(t::AbstractTensorMap) = Base.copy!(similar(t), t)
Base.:-(t::AbstractTensorMap) = VectorInterface.scale(t, -one(scalartype(t)))

Base.:+(t1::AbstractTensorMap, t2::AbstractTensorMap) = VectorInterface.add(t1, t2)
Base.:-(t1::AbstractTensorMap, t2::AbstractTensorMap) = VectorInterface.add(t1, t2, -one(scalartype(t1)))
function Base.:-(t1::AbstractTensorMap, t2::AbstractTensorMap)
return VectorInterface.add(t1, t2, -one(scalartype(t1)))
end

Base.:*(t::AbstractTensorMap, α::Number) = VectorInterface.scale(t, α)
Base.:*::Number, t::AbstractTensorMap) = VectorInterface.scale(t, α)
Expand Down Expand Up @@ -169,7 +171,7 @@ function LinearAlgebra.adjoint!(tdst::AbstractTensorMap,
tsrc::AbstractTensorMap)
spacetype(tdst) === spacetype(tsrc) && InnerProductStyle(tdst) === EuclideanProduct() ||
throw(ArgumentError("adjoint! requires Euclidean inner product spacetype"))
space(tdst) == adjoint(space(tsrc)) ||
space(tdst) == adjoint(space(tsrc)) ||
throw(SpaceMismatch("$(space(tdst)) ≠ adjoint($(space(tsrc)))"))
for c in blocksectors(tdst)
adjoint!(StridedView(block(tdst, c)), StridedView(block(tsrc, c)))
Expand Down

0 comments on commit 03264b5

Please sign in to comment.