Skip to content

Commit 9223689

Browse files
lkdvosclaude
andauthored
Replace TensorKit cache machinery with MemoizationKit.jl (#568)
* Replace TensorKit cache machinery with MemoizationKit.jl Track MemoizationKit.jl main through Pkg sources and delegate cache storage, container selection, and module-wide inspection and clearing to MemoizationKit. Preserve the registry for the existing GPU transformer cache and use MemoizationKit.LRU for its container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use MemoizationKit keys and remove duplicated cache helpers Use MemoizationKit.Hashed and cachekey to share sector structures across degeneracy dimensions without changing the function signature. Pass fusion-tree arguments directly to MemoizationKit, retaining the braiding result annotation needed for anyonic inference. Remove the upstream-covered Hashed tests, add TensorKit integration checks, and document native cache configuration and optional extensions. * Integrate MemoizationKit timers with TensorKit profiling Enable and disable MemoizationKit instrumentation with TensorKit timers, using the shared timer and existing profiling categories. Verify lookup and computation sections are recorded and that disabling timers stops recording. * Measure TensorKit cached values by buffer sizes * Switch to registered MemoizationKit.jl Cached.jl was registered as MemoizationKit.jl under QuantumKitHub; depend on the registered release and drop the `[sources]` entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review: descriptive cache names and transpose inference - Rename `fsbraid`/`fstranspose` to `fusiontreebraid`/`fusiontreetranspose`, as these are now user-facing through the MemoizationKit APIs and dashboard. - Restore the return type annotation on `fusiontreetranspose`, without which the `FusionTreePair` path infers `Any` and the cache stores untyped values. - Update the Enzyme inactivity rule for the new three-argument `fusiontreebraid`. - Refer to the MemoizationKit documentation for further features. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop the extra cache registry now that extension caches are owned by TensorKit The GPU transformers are cached through `@cached` methods of `treebraider` and `treetransposer`, which share TensorKit's caches. These are inspected, emptied and timed through MemoizationKit, so the separate `GLOBAL_CACHES` registry is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use renamed fusiontreetranspose in Enzyme rules, unicode subscripts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cache device transformers in separate functions `treebraider` and `treetransposer` forward device storage types to `device_treebraider` and `device_treetransposer`, whose methods are added by the GPU extension. These have their own MemoizationKit cache, so their size can be configured separately from the host transformers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Require MemoizationKit v0.1.1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Ignore JET's uncorrelated union split in the tree transformer bodies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Require MemoizationKit v0.1.2 and drop the tree transformer JET ignores Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cache the diagonal device transformers with the other device transformers The diagonal transformers of the GPU extension become methods of `device_treebraider` and `device_treetransposer`, so their cache is owned by TensorKit and handled by `empty_globalcaches!` and `global_cache_info`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clear TensorKit's caches before each test Workers run many test files in turn, and the caches filled by one would otherwise stay alive for the rest of the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Cache the device tracers and twisters in TensorKit-owned functions `treetracer` and `treetwister` on device storage forward to `device_treetracer` and `device_treetwister`, whose caches belong to TensorKit, are sized independently of the host ones and are cleared by `empty_globalcaches!`. The diagonal twister shares that cache, and `TraceTransformer`s are measured like the generic tree transformers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review: trim tests and changelog, show the cache dashboard Drop the unused `LRU` import, the internal device-cache changelog entry, the CUDA test of the separate device caches and the timer section assertions, and add a preview of the MemoizationKit cache dashboard to the manual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clear the caches after each space in the DiagonalTensorMap tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 35ed557 commit 9223689

20 files changed

Lines changed: 316 additions & 387 deletions

‎Project.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ projects = ["test", "docs"]
99
[deps]
1010
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
1111
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
12-
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
1312
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1413
MatrixAlgebraKit = "6c742aac-3347-4629-af66-fc926824e5e4"
14+
MemoizationKit = "1b238080-9255-4fe9-b224-89eb24efe93b"
1515
OhMyThreads = "67456a42-1dca-4109-a031-0a68de7e3ad5"
1616
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1717
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
@@ -55,9 +55,9 @@ Enzyme = "0.13.216"
5555
EnzymeTestUtils = "0.2.8"
5656
FiniteDifferences = "0.12"
5757
GPUArrays = "11.4.1"
58-
LRUCache = "1.6"
5958
LinearAlgebra = "1"
6059
MatrixAlgebraKit = "0.6.14"
60+
MemoizationKit = "0.1.2"
6161
Mooncake = "0.5.27"
6262
OhMyThreads = "0.8.0"
6363
PrecompileTools = "1"

‎docs/src/Changelog.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ When releasing a new version, move the "Unreleased" changes to a new version sec
2929
### Changed
3030

3131
- `planartrace!` precomputes and caches a `TraceTransformer` with the subblock positions and recoupling coefficients, and executes it with a kernel shared by all sectortypes, analogous to the index manipulations; `planar_trace` is now also defined for `FusionTreeBlock`s, and GPU tensors use a dedicated kernel (internal)
32+
- Caching is provided by [MemoizationKit.jl](https://github.com/QuantumKitHub/MemoizationKit.jl), which can inspect, resize and configure TensorKit's caches, also by memory size; this replaces the internal `@cached` machinery and the LRUCache.jl dependency
3233

3334
### Deprecated
3435

‎docs/src/man/fusiontrees.md‎

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,49 @@ This is simply given by
260260

261261
The `braid` and `permute` routines for double fusion trees will be the main access point for corresponding manipulations on tensors.
262262
As a consequence, results from these routines are memoized via a `@cached` mechanism.
263-
The caching strategy is controlled by `CacheStyle`: for `FusionStyle(I) isa UniqueFusion` no caching is used (`NoCache()`), since the result is a single cheap scalar coefficient; for `MultipleFusion` or `GenericFusion` sectors, a global LRU cache (`GlobalLRUCache()`) is used, as computing the transformation matrix can be expensive and results are reused frequently.
263+
The caching strategy is controlled by `MemoizationKit.CacheStyle`: for `FusionStyle(I) isa UniqueFusion` no caching is used (`NoCache()`), since the result is a single cheap scalar coefficient; for `MultipleFusion` or `GenericFusion` sectors, `GlobalCache()` uses MemoizationKit.jl's configured container (ClockCache by default), as computing the transformation matrix can be expensive and results are reused frequently.
264+
265+
TensorKit also uses MemoizationKit.jl for sector structures, degeneracy structures and fusion tree transformers.
266+
Sector structures share cache entries across spaces with the same sectors, even if their degeneracy dimensions differ, through `MemoizationKit.cachekey`.
267+
The MemoizationKit APIs can inspect, resize and configure these caches:
268+
269+
```julia
270+
using TensorKit, MemoizationKit
271+
MemoizationKit.cache_info(TensorKit)
272+
MemoizationKit.set_cache_size!(TensorKit.treebraider, 50_000)
273+
MemoizationKit.set_cache_size!(TensorKit.treebraider, 2^30; by = MemoizationKit.cachesize) # 1 GiB of cached values
274+
MemoizationKit.set_cache_preferences!(TensorKit; maxsize = 50_000, measure = "bytes")
275+
MemoizationKit.set_cache_preferences!(; container = "LRU")
276+
```
277+
278+
Preferences are saved in `LocalPreferences.toml` and apply after restarting Julia; a runtime size change applies immediately.
279+
`MemoizationKit.uncached(f, args...)` computes a result without consulting or filling the cache.
280+
TensorKit supplies efficient `MemoizationKit.cachesize` methods for its structure, fusion-tree and transformer results.
281+
These estimate bytes from the fixed-size fields and live array buffers; matrix coefficients and inline sector values are not traversed individually.
282+
Reference-containing scalar or sector arrays fall back to `Base.summarysize`.
283+
Buffers shared between cache entries count toward each entry, while identical source and destination structure buffers within a transformer count once.
284+
The budget excludes cache keys, container and allocation overhead, and spare array capacity; it is a cached-value estimate rather than a limit on total process memory.
285+
Further features, such as the live cache dashboard, disk caching and the full configuration options, are described in the [MemoizationKit.jl documentation](https://quantumkithub.github.io/MemoizationKit.jl/stable/).
286+
287+
For example, `using Tachikoma; MemoizationKit.cache_dashboard()` shows the hit rates and sizes of TensorKit's caches live, here after a few index manipulations on tensors with different symmetries:
288+
289+
```text
290+
[RAM] │ Disk
291+
5 caches · 184 entries · recent hit rate 77.5%
292+
Name ▲ Hit rate Size Kind Activity
293+
▌TensorKit.degeneracystructure █████97%████▋ ▏░░░░░░░12/10k░░░░░░░░ Clock ▇███▇███
294+
TensorKit.fusiontreebraid ░░░░░0%░░░░░░ ▍░░░░░░147/10k░░░░░░░░ Clock
295+
TensorKit.sectorstructure █████96%████▌ ▏░░░░░░░12/10k░░░░░░░░ Clock ████████
296+
TensorKit.treebraider █████81%██▌░░ ▏░░░░░░░9/10k░░░░░░░░░ Clock ███ ███
297+
TensorKit.treetwister █████80%██▍░░ ▏░░░░░░░4/10k░░░░░░░░░ Clock ████████
298+
299+
╭─ TensorKit.degeneracystructure ────────────────────────────────────────────────────────────────╮
300+
│Clock · 12 of 10000 entries · 278 hits · 12 misses │
301+
│hit rate: recent 97.5% · lifetime 95.9% · 23.0 hits/s │
302+
│███▅▇▇▇▅▇▇▇ │
303+
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
304+
⇥ tab ↑↓ select ⏎ resize e empty s sort r reverse / filter g refresh q quit
305+
```
264306

265307
This caching implies that potential inefficiencies in the fusion tree manipulations (which we nonetheless try to avoid) will not seriously affect performance of tensor manipulations.
266308

‎docs/src/man/profiling.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# [Profiling and timers](@id s_profiling)
22

33
TensorKit's index manipulations, tensor contractions and factorizations are instrumented with [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl) sections that are compiled away by default, so they incur no runtime cost.
4+
Enabling TensorKit's timers also enables MemoizationKit.jl's cache lookup and computation timers, recorded in the same timer tree and categories.
45
They can be enabled to obtain a detailed breakdown of where time is spent inside these operations, in particular the split between the different kinds of work involved in manipulating symmetric tensors:
56

67
| category | contents |

‎ext/TensorKitEnzymeExt/utility.jl‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pullback_dC!(ΔC, β::Number) = scale!(ΔC, conj(β))
2626
@inline EnzymeRules.inactive_type(::Type{<:TensorKit.GenericTreeTransformer}) = true
2727
@inline EnzymeRules.inactive_type(::Type{<:TensorKit.UniqueTreeTransformer}) = true
2828
@inline EnzymeRules.inactive_type(::Type{<:TensorKit.VectorSpace}) = true
29-
@inline EnzymeRules.inactive_type(::Type{<:TensorKit.LRU}) = true
29+
@inline EnzymeRules.inactive_type(::Type{<:TensorKit.MemoizationKit.AbstractCache}) = true
3030

3131
function EnzymeRules.augmented_primal(
3232
config::EnzymeRules.RevConfigWidth{1},
@@ -142,16 +142,18 @@ end
142142
@inline EnzymeRules.inactive(::typeof(TensorKit.fusiontrees), ::Any) = nothing
143143
@inline EnzymeRules.inactive(::typeof(TensorKit.fusiontrees), ::Any, ::Any) = nothing
144144
@inline EnzymeRules.inactive(::typeof(TensorKit.fusiontrees), ::Any, ::Any, ::Any) = nothing
145-
@inline EnzymeRules.inactive(::typeof(TensorKit.fsbraid), ::Any) = nothing
146-
@inline EnzymeRules.inactive(::typeof(TensorKit.fsbraid), ::Any, ::Any) = nothing
145+
@inline EnzymeRules.inactive(::typeof(TensorKit.fusiontreebraid), ::Any, ::Any, ::Any) = nothing
147146
@inline EnzymeRules.inactive(::typeof(TensorKit.artin_braid), ::Any, ::Any) = nothing
148-
@inline EnzymeRules.inactive(::typeof(TensorKit.fstranspose), ::Any) = nothing
149-
@inline EnzymeRules.inactive(::typeof(TensorKit.fstranspose), ::Any, ::Any) = nothing
147+
@inline EnzymeRules.inactive(::typeof(TensorKit.fusiontreetranspose), ::Any, ::Any) = nothing
150148
@inline EnzymeRules.inactive(::typeof(TensorKit.product_transform), ::Any...) = nothing
151149
@inline EnzymeRules.inactive(::typeof(TensorKit.treetransposer), ::Any...) = nothing
152150
@inline EnzymeRules.inactive(::typeof(TensorKit.treebraider), ::Any...) = nothing
153151
@inline EnzymeRules.inactive(::typeof(TensorKit.treetracer), ::Any...) = nothing
154152
@inline EnzymeRules.inactive(::typeof(TensorKit.treetwister), ::Any...) = nothing
153+
@inline EnzymeRules.inactive(::typeof(TensorKit.device_treetransposer), ::Any...) = nothing
154+
@inline EnzymeRules.inactive(::typeof(TensorKit.device_treebraider), ::Any...) = nothing
155+
@inline EnzymeRules.inactive(::typeof(TensorKit.device_treetracer), ::Any...) = nothing
156+
@inline EnzymeRules.inactive(::typeof(TensorKit.device_treetwister), ::Any...) = nothing
155157
@inline EnzymeRules.inactive(::typeof(TensorKit.insertleftunit), ::HomSpace, ::Any) = nothing
156158
@inline EnzymeRules.inactive(::typeof(TensorKit.insertrightunit), ::HomSpace, ::Any) = nothing
157159
@inline EnzymeRules.inactive(::typeof(TensorKit.removeunit), ::HomSpace, ::Any) = nothing

‎ext/TensorKitGPUArraysExt.jl‎

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -371,65 +371,52 @@ function DeviceTraceTransformer(transformer::TraceTransformer{T, N₁, N₂}, p,
371371
)
372372
end
373373

374+
TensorKit.treebraider(
375+
A::Type{<:AnyGPUVector}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
376+
conjsrc::Bool, levels::IndexTuple
377+
) = TensorKit.device_treebraider(A, Vdst, Vsrc, p, conjsrc, levels)
378+
TensorKit.treetransposer(
379+
A::Type{<:AnyGPUVector}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple, conjsrc::Bool
380+
) = TensorKit.device_treetransposer(A, Vdst, Vsrc, p, conjsrc)
381+
TensorKit.treetracer(
382+
A::Type{<:AnyGPUVector}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple, q::Index2Tuple
383+
) = TensorKit.device_treetracer(A, Vdst, Vsrc, p, q)
384+
TensorKit.treetwister(
385+
A::Type{<:AnyGPUVector}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
386+
conjsrc::Bool, twistmask::NTuple{N, Bool}, inv::Bool
387+
) where {N} = TensorKit.device_treetwister(A, Vdst, Vsrc, p, conjsrc, twistmask, inv)
388+
374389
# Cache the device transformer directly, constructing the cached host version only on a miss.
375-
@cached function TensorKit.treebraider(
390+
@cached function TensorKit.device_treebraider(
376391
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
377392
conjsrc::Bool, levels::IndexTuple
378393
) where {TA <: AnyGPUVector}
379394
host = TensorKit.treebraider(Vector{scalartype(A)}, Vdst, Vsrc, p, conjsrc, levels)
380395
return device_transformer(A, host, linearize(p))
381396
end
382397

383-
@cached function TensorKit.treetransposer(
398+
@cached function TensorKit.device_treetransposer(
384399
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple, conjsrc::Bool
385400
) where {TA <: AnyGPUVector}
386401
host = TensorKit.treetransposer(Vector{scalartype(A)}, Vdst, Vsrc, p, conjsrc)
387402
return device_transformer(A, host, linearize(p))
388403
end
389404

390-
@cached function TensorKit.treetracer(
405+
@cached function TensorKit.device_treetracer(
391406
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple, q::Index2Tuple
392407
) where {TA <: AnyGPUVector}
393408
host = TensorKit.treetracer(Vector{scalartype(A)}, Vdst, Vsrc, p, q)
394409
return device_transformer(A, host, p, q)
395410
end
396411

397-
@cached function TensorKit.treetwister(
412+
@cached function TensorKit.device_treetwister(
398413
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
399414
conjsrc::Bool, twistmask::NTuple{N, Bool}, inv::Bool
400415
) where {TA <: AnyGPUVector, N}
401416
host = TensorKit.treetwister(Vector{scalartype(A)}, Vdst, Vsrc, p, conjsrc, twistmask, inv)
402417
return device_transformer(A, host, linearize(p))
403418
end
404419

405-
const DEFAULT_DEVICECACHE_SIZE = 1000
406-
407-
function __init__()
408-
# extensions can't modify GLOBAL_CACHES during precompilation, so register explicitly
409-
append!(
410-
TensorKit.GLOBAL_CACHES, (
411-
Symbol("TensorKitGPUArraysExt.GLOBAL_TREEBRAIDER_CACHE") => GLOBAL_TREEBRAIDER_CACHE,
412-
Symbol("TensorKitGPUArraysExt.GLOBAL_TREETRANSPOSER_CACHE") => GLOBAL_TREETRANSPOSER_CACHE,
413-
Symbol("TensorKitGPUArraysExt.GLOBAL_DIAGONAL_TREEBRAIDER_CACHE") => GLOBAL_DIAGONAL_TREEBRAIDER_CACHE,
414-
Symbol("TensorKitGPUArraysExt.GLOBAL_DIAGONAL_TREETRANSPOSER_CACHE") => GLOBAL_DIAGONAL_TREETRANSPOSER_CACHE,
415-
Symbol("TensorKitGPUArraysExt.GLOBAL_DIAGONAL_TREETWISTER_CACHE") => GLOBAL_DIAGONAL_TREETWISTER_CACHE,
416-
Symbol("TensorKitGPUArraysExt.GLOBAL_TREETRACER_CACHE") => GLOBAL_TREETRACER_CACHE,
417-
Symbol("TensorKitGPUArraysExt.GLOBAL_TREETWISTER_CACHE") => GLOBAL_TREETWISTER_CACHE,
418-
)
419-
)
420-
421-
# device-caches should probably have smaller sizes:
422-
resize!(GLOBAL_TREEBRAIDER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
423-
resize!(GLOBAL_TREETRANSPOSER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
424-
resize!(GLOBAL_DIAGONAL_TREEBRAIDER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
425-
resize!(GLOBAL_DIAGONAL_TREETRANSPOSER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
426-
resize!(GLOBAL_DIAGONAL_TREETWISTER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
427-
resize!(GLOBAL_TREETRACER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
428-
resize!(GLOBAL_TREETWISTER_CACHE; maxsize = DEFAULT_DEVICECACHE_SIZE)
429-
430-
return nothing
431-
end
432-
433420
# Allocations must outlive any GPUArrays allocation-cache scope around the operation.
434421
device_transformer(A, transformer::UniqueTreeTransformer, p) =
435422
device_transformer(A, DeviceUniqueTreeTransformer(transformer, p))
@@ -690,23 +677,24 @@ function diagonal_device_transformer(A, transformer, dstdiagonal::Bool)
690677
return device_transformer(A, DeviceUniqueTreeTransformer(blocks, work_offsets, nwork))
691678
end
692679

693-
@cached function diagonal_treebraider(
680+
# Transformers for diagonal sources share the cache of the other device transformers.
681+
@cached function TensorKit.device_treebraider(
694682
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
695683
conjsrc::Bool, levels::IndexTuple, dstdiagonal::Bool
696684
) where {TA <: AnyGPUVector}
697685
host = TensorKit.treebraider(Vector{scalartype(A)}, Vdst, Vsrc, p, conjsrc, levels)
698686
return diagonal_device_transformer(A, host, dstdiagonal)
699687
end
700688

701-
@cached function diagonal_treetransposer(
689+
@cached function TensorKit.device_treetransposer(
702690
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
703691
conjsrc::Bool, dstdiagonal::Bool
704692
) where {TA <: AnyGPUVector}
705693
host = TensorKit.treetransposer(Vector{scalartype(A)}, Vdst, Vsrc, p, conjsrc)
706694
return diagonal_device_transformer(A, host, dstdiagonal)
707695
end
708696

709-
@cached function diagonal_treetwister(
697+
@cached function TensorKit.device_treetwister(
710698
A::Type{TA}, Vdst::TensorMapSpace, Vsrc::TensorMapSpace, p::Index2Tuple,
711699
conjsrc::Bool, twistmask::NTuple{N, Bool}, inv::Bool, dstdiagonal::Bool
712700
) where {TA <: AnyGPUVector, N}
@@ -731,7 +719,7 @@ Base.@propagate_inbounds function TensorKit._braid!(
731719
)
732720
Vdst, Vsrc = space(tdst), space(tsrc)
733721
@boundscheck TensorKit.spacecheck_transform(permute, Vdst, Vsrc, p, conjsrc)
734-
transformer = diagonal_treebraider(
722+
transformer = TensorKit.device_treebraider(
735723
storagetype(tdst), Vdst, Vsrc, p, conjsrc, levels, tdst isa DiagonalTensorMap
736724
)
737725
return _add_diagonal!(tdst, tsrc, conjsrc, transformer, α, β)
@@ -743,7 +731,7 @@ Base.@propagate_inbounds function TensorKit._transpose!(
743731
)
744732
Vdst, Vsrc = space(tdst), space(tsrc)
745733
@boundscheck TensorKit.spacecheck_transform(permute, Vdst, Vsrc, p, conjsrc)
746-
transformer = diagonal_treetransposer(
734+
transformer = TensorKit.device_treetransposer(
747735
storagetype(tdst), Vdst, Vsrc, p, conjsrc, tdst isa DiagonalTensorMap
748736
)
749737
return _add_diagonal!(tdst, tsrc, conjsrc, transformer, α, β)
@@ -755,7 +743,7 @@ Base.@propagate_inbounds function TensorKit._twist!(
755743
)
756744
Vdst, Vsrc = space(tdst), space(tsrc)
757745
@boundscheck TensorKit.spacecheck_transform(permute, Vdst, Vsrc, p, conjsrc)
758-
transformer = diagonal_treetwister(
746+
transformer = TensorKit.device_treetwister(
759747
storagetype(tdst), Vdst, Vsrc, p, conjsrc, twistmask, inv, tdst isa DiagonalTensorMap
760748
)
761749
return _add_diagonal!(tdst, tsrc, conjsrc, transformer, α, β)

‎src/TensorKit.jl‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ const TO = TensorOperations
119119
using MatrixAlgebraKit
120120

121121
using Dictionaries: Dictionaries, Dictionary, Indices, gettoken, gettokenvalue
122-
using LRUCache
123122
using OhMyThreads
124123
using ScopedValues
125124
using TimerOutputs: TimerOutputs, TimerOutput, @timeit_debug

0 commit comments

Comments
 (0)