From 03264b51f3d8fd02fb34d4f0ddd2217f11bb210b Mon Sep 17 00:00:00 2001 From: lkdvos Date: Tue, 19 Sep 2023 22:51:26 +0200 Subject: [PATCH] Formatter --- src/tensors/braidingtensor.jl | 2 +- src/tensors/linalg.jl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tensors/braidingtensor.jl b/src/tensors/braidingtensor.jl index 352c6cb8..121ba7e2 100644 --- a/src/tensors/braidingtensor.jl +++ b/src/tensors/braidingtensor.jl @@ -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)")) diff --git a/src/tensors/linalg.jl b/src/tensors/linalg.jl index c5ef2224..757363f8 100644 --- a/src/tensors/linalg.jl +++ b/src/tensors/linalg.jl @@ -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, α) @@ -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)))