Skip to content

Commit ea2645e

Browse files
committed
Fix QR/LQ spaces and map_fields_recursive
1 parent 194acc8 commit ea2645e

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎ext/TensorKitEnzymeTestUtilsExt.jl‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ function EnzymeTestUtils.rand_tangent(rng, t::DiagonalTensorMap)
5757
return DiagonalTensorMap(EnzymeTestUtils.rand_tangent(rng, t.data), space(t, 1))
5858
end
5959

60+
function EnzymeTestUtils.map_fields_recursive(f::typeof(Base.copyto!), y::TensorKit.SortedVectorDict{K, V}, x::TensorKit.SortedVectorDict{K, V}) where {K, V}
61+
copyto!(y.keys, x.keys)
62+
copyto!(y.values, x.values)
63+
return y
64+
end
65+
6066
end

‎test/enzyme-factorizations/lq.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function remove_lq_null_gauge_dependence!(ΔNᴴ, Q)
2929
return ΔNᴴ
3030
end
3131

32-
@timedtestset "Enzyme - Factorizations (LQ): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes, A in (randn(T, V[1] ⊗ V[2] ← V[1] ⊗ V[2]), randn(T, V[1] ⊗ V[2] ← V[1]))
32+
@timedtestset "Enzyme - Factorizations (LQ): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes, A in (randn(T, V[1] ⊗ V[2] ← V[1] ⊗ V[2]), randn(T, V[1] ⊗ V[2] ← (V[3] ⊗ V[4] ⊗ V[5])'))
3333
atol = default_tol(T)
3434
rtol = default_tol(T)
3535
EnzymeTestUtils.test_reverse(lq_compact, Duplicated, (A, Duplicated); atol, rtol)

‎test/enzyme-factorizations/qr.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function remove_qrgauge_dependence!(ΔQ, t, Q)
2121
return ΔQ
2222
end
2323

24-
@timedtestset "Enzyme - Factorizations (QR): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes, A in (randn(T, V[1] ⊗ V[2] ← V[1] ⊗ V[2]), randn(T, V[1] ⊗ V[2] ← V[1]))
24+
@timedtestset "Enzyme - Factorizations (QR): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes, A in (randn(T, V[1] ⊗ V[2] ← V[1] ⊗ V[2]), randn(T, V[1] ⊗ V[2] ⊗ V[3] ← (V[4] ⊗ V[5])'))
2525
atol = default_tol(T)
2626
rtol = default_tol(T)
2727

0 commit comments

Comments
 (0)