From 3d85b07823975f8f9abf10cdec5bed745e7f689d Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Mon, 23 Nov 2026 17:35:30 +0100 Subject: [PATCH 1/2] Mark more things inactive for Enzyme --- ext/TensorKitEnzymeExt/utility.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/TensorKitEnzymeExt/utility.jl b/ext/TensorKitEnzymeExt/utility.jl index 4eac157db..261db24bd 100644 --- a/ext/TensorKitEnzymeExt/utility.jl +++ b/ext/TensorKitEnzymeExt/utility.jl @@ -27,6 +27,7 @@ pullback_dC!(ΔC, β::Number) = scale!(ΔC, conj(β)) @inline EnzymeRules.inactive_type(::Type{<:TensorKit.UniqueTreeTransformer}) = true @inline EnzymeRules.inactive_type(::Type{<:TensorKit.VectorSpace}) = true @inline EnzymeRules.inactive_type(::Type{<:TensorKit.MemoizationKit.AbstractCache}) = true +@inline EnzymeRules.inactive_type(::Type{<:MemoizationKit.AbstractCache}) = true function EnzymeRules.augmented_primal( config::EnzymeRules.RevConfigWidth{1}, @@ -138,6 +139,7 @@ function EnzymeRules.forward( end end +@inline EnzymeRules.inactive(::typeof(TensorKit.recouplingmatrix), ::Any...) = nothing @inline EnzymeRules.inactive(::typeof(TensorKit.planar_trace), ::TensorKit.FusionTreePair, ::TensorKit.Index2Tuple, ::TensorKit.Index2Tuple) = nothing @inline EnzymeRules.inactive(::typeof(TensorKit.fusiontrees), ::Any) = nothing @inline EnzymeRules.inactive(::typeof(TensorKit.fusiontrees), ::Any, ::Any) = nothing From 09ef1edf0d78767675a2d39cafe0c888890a962a Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Mon, 23 Nov 2026 18:13:27 +0100 Subject: [PATCH 2/2] Remove duplicate --- ext/TensorKitEnzymeExt/utility.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/TensorKitEnzymeExt/utility.jl b/ext/TensorKitEnzymeExt/utility.jl index 261db24bd..7ae302c13 100644 --- a/ext/TensorKitEnzymeExt/utility.jl +++ b/ext/TensorKitEnzymeExt/utility.jl @@ -27,7 +27,6 @@ pullback_dC!(ΔC, β::Number) = scale!(ΔC, conj(β)) @inline EnzymeRules.inactive_type(::Type{<:TensorKit.UniqueTreeTransformer}) = true @inline EnzymeRules.inactive_type(::Type{<:TensorKit.VectorSpace}) = true @inline EnzymeRules.inactive_type(::Type{<:TensorKit.MemoizationKit.AbstractCache}) = true -@inline EnzymeRules.inactive_type(::Type{<:MemoizationKit.AbstractCache}) = true function EnzymeRules.augmented_primal( config::EnzymeRules.RevConfigWidth{1},