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
1 change: 1 addition & 0 deletions docs/src/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ When releasing a new version, move the "Unreleased" changes to a new version sec
### Performance

- `twist!` and `twist` on a `TensorMap`, a `DiagonalTensorMap` or their adjoints use a cached tree transformer and the index manipulation kernel instead of a loop over all fusion trees, which removes the per-subblock bookkeeping and turns a twist of a GPU tensor, diagonal or not, into a single kernel launch ([#595](https://github.com/QuantumKitHub/TensorKit.jl/issues/595))
- `foreachblock` with several tensors is type stable, which removes the dynamic dispatch on every call to it and to the factorizations that go through it

## [0.17.3](https://github.com/QuantumKitHub/TensorKit.jl/compare/v0.17.2...v0.17.3) - 2026-10-30

Expand Down
2 changes: 1 addition & 1 deletion src/factorizations/matrixalgebrakit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for (f!, bf!) in ((:svd_compact!, :batched_svd_compact!), (:svd_full!, :batched_
@timeit_debug GLOBAL_TIMER $(string(f!)) begin
U, S, Vᴴ = F
driver = get(alg.kwargs, :driver, MAK.DefaultDriver())
cs = collect(union(blocksectors.((t, U, S, Vᴴ))...))
cs = collect(union(map(blocksectors, (t, U, S, Vᴴ))...))
if !isempty(cs) && MAK.supports_ragged_batch(MAK.$f!, alg, driver, storagetype(t))
As = [block(t, c) for c in cs]
Fs = ([block(U, c) for c in cs], [block(S, c) for c in cs], [block(Vᴴ, c) for c in cs])
Expand Down
8 changes: 4 additions & 4 deletions src/fusiontrees/duality_manipulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ function foldright(src::FusionTreeBlock)
multi_Fmove(f₁)
end
for (f₁′, coeff₁) in zip(f₁′s, coeffs₁)
b = f₁′.coupled
c = f₁.coupled
local b = f₁′.coupled
local c = f₁.coupled
A = get!(cache₃, (b, c)) do
Asymbol(a, b, c)
end
Expand Down Expand Up @@ -353,8 +353,8 @@ function foldleft(src::FusionTreeBlock)
multi_Fmove(f₂)
end
for (f₂′, coeff₂) in zip(f₂′s, coeffs₂)
b = f₂′.coupled
c = f₂.coupled
local b = f₂′.coupled
local c = f₂.coupled
A = get!(cache₃, (b, c)) do
Asymbol(a, b, c)
end
Expand Down
6 changes: 3 additions & 3 deletions src/tensors/blockiterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ for c in union(blocksectors.(ts)...)
end
```
"""
function foreachblock(f, t, ts...; scheduler = nothing)
function foreachblock(f, t, ts::Vararg{Any, N}; scheduler = nothing) where {N}
tensors = (t, ts...)
allsectors = union(blocksectors.(tensors)...)
allsectors = union(map(blocksectors, tensors)...)
foreach(allsectors) do c
return f(c, block.(tensors, Ref(c)))
return f(c, map(x -> block(x, c), tensors))
end
return nothing
end
Expand Down
Loading