From 0991e1d8667fb2919cb35604dc51f6e1fa7c779d Mon Sep 17 00:00:00 2001 From: lkdvos Date: Sun, 1 Nov 2026 13:26:30 -0500 Subject: [PATCH] Pass spaces to spacecheck_transform TensorKit v0.17.3 removed the method of `spacecheck_transform` that takes tensors, so permuting, transposing or braiding a block tensor threw a MethodError. The method that takes spaces exists in v0.17.2 as well. Co-Authored-By: Claude Opus 5.5 --- src/tensors/indexmanipulations.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tensors/indexmanipulations.jl b/src/tensors/indexmanipulations.jl index 9a0fce9..1d06091 100644 --- a/src/tensors/indexmanipulations.jl +++ b/src/tensors/indexmanipulations.jl @@ -8,7 +8,7 @@ for f in (:permute, :transpose) tdst::BlockTensorMap, tsrc::BlockTensorMap, p::Index2Tuple, α::Number, β::Number, backend::AbstractBackend, allocator ) - @boundscheck TK.spacecheck_transform(TK.$f, tdst, tsrc, p) + @boundscheck TK.spacecheck_transform(TK.$f, space(tdst), space(tsrc), p) dstdata = parent(tdst) srcdata = permutedims(StridedView(parent(tsrc)), (p[1]..., p[2]...)) @@ -22,7 +22,7 @@ for f in (:permute, :transpose) tdst::AbstractBlockTensorMap, tsrc::BlockTensorOrAdjoint, p::Index2Tuple, α::Number, β::Number, backend::AbstractBackend, allocator ) - @boundscheck TK.spacecheck_transform(TK.$f, tdst, tsrc, p) + @boundscheck TK.spacecheck_transform(TK.$f, space(tdst), space(tsrc), p) p_lin = (p[1]..., p[2]...) _scale_untouched!(tdst, tsrc, β, p_lin) @inbounds for (I, v) in nonzero_pairs(tsrc) @@ -53,7 +53,7 @@ end tdst::BlockTensorMap, tsrc::BlockTensorMap, p::Index2Tuple, levels::IndexTuple, α::Number, β::Number, backend::AbstractBackend, allocator ) - @boundscheck TK.spacecheck_transform(braid, tdst, tsrc, p, levels) + @boundscheck TK.spacecheck_transform(braid, space(tdst), space(tsrc), p, levels) dstdata = parent(tdst) srcdata = permutedims(StridedView(parent(tsrc)), (p[1]..., p[2]...)) @@ -70,7 +70,7 @@ end p::Index2Tuple, levels::IndexTuple, α::Number, β::Number, backend::AbstractBackend, allocator ) - @boundscheck TK.spacecheck_transform(braid, tdst, tsrc, p, levels) + @boundscheck TK.spacecheck_transform(braid, space(tdst), space(tsrc), p, levels) p_lin = (p[1]..., p[2]...) _scale_untouched!(tdst, tsrc, β, p_lin) @inbounds for (I, v) in nonzero_pairs(tsrc)