Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/spaces/homspace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ according to the permutation `p₁` and `p₂` respectively.
function permute(W::HomSpace, (p₁, p₂)::Index2Tuple)
p = (p₁..., p₂...)
TupleTools.isperm(p) && length(p) == numind(W) ||
throw(ArgumentError("$((p₁, p₂)) is not a valid permutation for $(W)"))
throw(ArgumentError(lazy"$((p₁, p₂)) is not a valid permutation for $(W)"))
return select(W, (p₁, p₂))
end

Expand All @@ -226,7 +226,7 @@ end
function braid(W::HomSpace, (p₁, p₂)::Index2Tuple, levels::IndexTuple)
p = (p₁..., p₂...)
TupleTools.isperm(p) && length(p) == numind(W) == length(levels) ||
throw(ArgumentError("$((p₁, p₂)), $levels is not a valid braiding for $(W)"))
throw(ArgumentError(lazy"$((p₁, p₂)), $levels is not a valid braiding for $(W)"))
return select(W, (p₁, p₂))
end

Expand Down Expand Up @@ -265,7 +265,7 @@ Obtain the HomSpace that is obtained from composing the morphisms in `W` and `V`
to be possible, the domain of `W` must match the codomain of `V`.
"""
function compose(W::HomSpace{S}, V::HomSpace{S}) where {S}
domain(W) == codomain(V) || throw(SpaceMismatch("$(domain(W)) ≠ $(codomain(V))"))
domain(W) == codomain(V) || throw(SpaceMismatch(lazy"$(domain(W)) ≠ $(codomain(V))"))
return HomSpace(codomain(W), domain(V))
end

Expand Down
8 changes: 4 additions & 4 deletions src/tensors/treetransformers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function AbelianTreeTransformer(transform, p, Vdst, Vsrc)

Δt = Base.time() - t₀

@debug("Treetransformer for $Vsrc to $Vdst via $p", nblocks = L, Δt)
@debug(lazy"Treetransformer for $Vsrc to $Vdst via $p", nblocks = L, Δt)

return transformer
end
Expand Down Expand Up @@ -81,7 +81,7 @@ function GenericTreeTransformer(transform, p, Vdst, Vsrc)
data[local_counter] = U, (sz_dst, newstructs_dst), (sz_src, newstructs_src)

@debug(
"Created recoupling block for uncoupled: $(fs_src.uncoupled)",
lazy"Created recoupling block for uncoupled: $(fs_src.uncoupled)",
sz = size(U), sparsity = count(!iszero, U) / length(U)
)
end
Expand All @@ -96,7 +96,7 @@ function GenericTreeTransformer(transform, p, Vdst, Vsrc)
data[i] = U, (sz_dst, newstructs_dst), (sz_src, newstructs_src)

@debug(
"Created recoupling block for uncoupled: $(fs_src.uncoupled)",
lazy"Created recoupling block for uncoupled: $(fs_src.uncoupled)",
sz = size(U), sparsity = count(!iszero, U) / length(U)
)
end
Expand All @@ -109,7 +109,7 @@ function GenericTreeTransformer(transform, p, Vdst, Vsrc)
Δt = Base.time() - t₀

@debug(
"TreeTransformer for $Vsrc to $Vdst via $p",
lazy"TreeTransformer for $Vsrc to $Vdst via $p",
nblocks = length(transformer.data),
sz_median = size(transformer.data[cld(end, 2)][1], 1),
sz_max = size(transformer.data[1][1], 1),
Expand Down
14 changes: 7 additions & 7 deletions src/tensors/vectorinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ function VectorInterface.scale!!(t::AbstractTensorMap, α::Number)
return T <: scalartype(t) ? scale!(t, α) : scale(t, α)
end
function VectorInterface.scale!(ty::AbstractTensorMap, tx::AbstractTensorMap, α::Number)
space(ty) == space(tx) || throw(SpaceMismatch("$(space(ty)) ≠ $(space(tx))"))
space(ty) == space(tx) || throw(SpaceMismatch(lazy"$(space(ty)) ≠ $(space(tx))"))
for ((cy, by), (cx, bx)) in zip(blocks(ty), blocks(tx))
scale!(by, bx, α)
end
return ty
end
function VectorInterface.scale!(ty::TensorMap, tx::TensorMap, α::Number)
space(ty) == space(tx) || throw(SpaceMismatch("$(space(ty)) ≠ $(space(tx))"))
space(ty) == space(tx) || throw(SpaceMismatch(lazy"$(space(ty)) ≠ $(space(tx))"))
scale!(ty.data, tx.data, α)
return ty
end
Expand All @@ -66,7 +66,7 @@ end
# TODO: remove VectorInterface from calls to `add!` when `TensorKit.add!` is renamed
function VectorInterface.add(ty::AbstractTensorMap, tx::AbstractTensorMap, α::Number, β::Number)
S = check_spacetype(ty, tx)
space(ty) == space(tx) || throw(SpaceMismatch("$(space(ty)) ≠ $(space(tx))"))
space(ty) == space(tx) || throw(SpaceMismatch(lazy"$(space(ty)) ≠ $(space(tx))"))

# result type defaults to TensorMap if the types don't match to avoid assymmetric
# implementation via zerovector(ty, T) vs zerovector(tx, T)
Expand All @@ -84,7 +84,7 @@ end
function VectorInterface.add!(
ty::AbstractTensorMap, tx::AbstractTensorMap, α::Number, β::Number
)
space(ty) == space(tx) || throw(SpaceMismatch("$(space(ty)) ≠ $(space(tx))"))
space(ty) == space(tx) || throw(SpaceMismatch(lazy"$(space(ty)) ≠ $(space(tx))"))
for ((cy, by), (cx, bx)) in zip(blocks(ty), blocks(tx))
add!(by, bx, α, β)
end
Expand All @@ -93,7 +93,7 @@ end
function VectorInterface.add!(
ty::TensorMap, tx::TensorMap, α::Number, β::Number
)
space(ty) == space(tx) || throw(SpaceMismatch("$(space(ty)) ≠ $(space(tx))"))
space(ty) == space(tx) || throw(SpaceMismatch(lazy"$(space(ty)) ≠ $(space(tx))"))
add!(ty.data, tx.data, α, β)
return ty
end
Expand All @@ -112,7 +112,7 @@ end
# inner
#-------
function VectorInterface.inner(tx::AbstractTensorMap, ty::AbstractTensorMap)
space(tx) == space(ty) || throw(SpaceMismatch("$(space(tx)) ≠ $(space(ty))"))
space(tx) == space(ty) || throw(SpaceMismatch(lazy"$(space(tx)) ≠ $(space(ty))"))
InnerProductStyle(tx) === EuclideanInnerProduct() || throw_invalid_innerproduct(:inner)
T = VectorInterface.promote_inner(tx, ty)
s = zero(T)
Expand All @@ -122,7 +122,7 @@ function VectorInterface.inner(tx::AbstractTensorMap, ty::AbstractTensorMap)
return s
end
function VectorInterface.inner(tx::TensorMap, ty::TensorMap)
space(tx) == space(ty) || throw(SpaceMismatch("$(space(tx)) ≠ $(space(ty))"))
space(tx) == space(ty) || throw(SpaceMismatch(lazy"$(space(tx)) ≠ $(space(ty))"))
InnerProductStyle(tx) === EuclideanInnerProduct() || throw_invalid_innerproduct(:inner)
if FusionStyle(sectortype(tx)) isa UniqueFusion # all quantum dimensions are one
return inner(tx.data, ty.data)
Expand Down
Loading