From 9bd2f35a97bba32a73cbc2665c7ba0817f85f3b9 Mon Sep 17 00:00:00 2001 From: Matthew Fishman Date: Fri, 2 Oct 2026 19:44:40 -0400 Subject: [PATCH 1/2] Follow the TensorAlgebra scaleadd! rename Tracks the rename of the four-argument `add!` in https://github.com/ITensor/TensorAlgebra.jl/pull/239. Co-Authored-By: Claude Opus 5 (1M context) --- Project.toml | 8 ++++++-- docs/Project.toml | 2 +- src/gradedarray.jl | 2 +- src/vectorinterface.jl | 4 ++-- test/Project.toml | 2 +- test/test_uniquesectorarray.jl | 8 ++++---- test/test_vectorinterface.jl | 2 +- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Project.toml b/Project.toml index 846a5e31..e315ae1b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GradedArrays" uuid = "bc96ca6e-b7c8-4bb6-888e-c93f838762c2" -version = "0.17.0" +version = "0.17.1" authors = ["ITensor developers and contributors"] [workspace] @@ -26,6 +26,10 @@ VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8" [weakdeps] SUNRepresentations = "1a50b95c-7aac-476d-a9ce-2bfc675fc617" +[sources.TensorAlgebra] +rev = "mf/scaleadd" +url = "https://github.com/ITensor/TensorAlgebra.jl" + [extensions] GradedArraysSUNRepresentationsExt = "SUNRepresentations" @@ -42,7 +46,7 @@ Random = "1.10" SUNRepresentations = "0.4" ScopedValues = "1" StridedViews = "0.5" -TensorAlgebra = "0.22" +TensorAlgebra = "0.23" TensorKit = "0.17" TensorKitSectors = "0.3.8" VectorInterface = "0.6" diff --git a/docs/Project.toml b/docs/Project.toml index bcbffae8..7aa57518 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -14,5 +14,5 @@ Documenter = "1" GradedArrays = "0.17" ITensorFormatter = "0.2.27" Literate = "2" -TensorAlgebra = "0.22" +TensorAlgebra = "0.23" TensorKitSectors = "0.3.8" diff --git a/src/gradedarray.jl b/src/gradedarray.jl index b6fa926b..d88c4145 100644 --- a/src/gradedarray.jl +++ b/src/gradedarray.jl @@ -887,7 +887,7 @@ function TensorAlgebra.unmatricizeadd!( ndims_codomain(a_dest) == length(invperm_codomain) && (invperm_codomain..., invperm_domain...) == ntuple(identity, Val(N)) && axis_codomain(m) == axis_codomain(md) && axis_domain(m) == axis_domain(md) - TensorAlgebra.add!(md.buffer, m.buffer, α, β) + TensorAlgebra.scaleadd!(md.buffer, m.buffer, α, β) return a_dest end # Wrap `m` in `a_dest`'s axes reordered into the matricized leg order: `bipartition_axes` takes diff --git a/src/vectorinterface.jl b/src/vectorinterface.jl index f1012058..fb9fd65c 100644 --- a/src/vectorinterface.jl +++ b/src/vectorinterface.jl @@ -24,7 +24,7 @@ for AT in (:GradedArray, :AbstractFusedGradedArray, :AbstractSectorArray) end VI.scale!(a::$AT, α::Number) = TensorAlgebra.scale!(a, α) function VI.scale!(b::$AT, a::$AT, α::Number) - return TensorAlgebra.add!(b, a, α, false) + return TensorAlgebra.scaleadd!(b, a, α, false) end # The `!!` methods fall back to out-of-place allocation when the destination can't hold the # result. @@ -50,7 +50,7 @@ for AT in (:GradedArray, :AbstractFusedGradedArray, :AbstractSectorArray) return VI.add!(VI.scale!(similar(a, T), a, β), b, α, true) end function VI.add!(a::$AT, b::$AT, α::Number, β::Number) - return TensorAlgebra.add!(a, b, α, β) + return TensorAlgebra.scaleadd!(a, b, α, β) end function VI.add!!(a::$AT, b::$AT, α::Number, β::Number) T = Base.promote_op( diff --git a/test/Project.toml b/test/Project.toml index eb1fbc6e..88271c08 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -34,7 +34,7 @@ SUNRepresentations = "0.4" SafeTestsets = "0.1" StableRNGs = "1" Suppressor = "0.2.8" -TensorAlgebra = "0.22" +TensorAlgebra = "0.23" TensorKit = "0.17" TensorKitSectors = "0.3.8" Test = "1.10" diff --git a/test/test_uniquesectorarray.jl b/test/test_uniquesectorarray.jl index a29c8f59..fd6ccf4e 100644 --- a/test/test_uniquesectorarray.jl +++ b/test/test_uniquesectorarray.jl @@ -204,22 +204,22 @@ using Test: @test, @test_throws, @testset @test data(c) ≈ a_data * b_data end - @testset "TensorAlgebra.add! (UniqueSectorArray to UniqueSectorArray)" begin + @testset "TensorAlgebra.scaleadd! (UniqueSectorArray to UniqueSectorArray)" begin using TensorAlgebra: TensorAlgebra data1 = [1.0 2.0; 3.0 4.0] data2 = [10.0 20.0; 30.0 40.0] sa1 = UniqueSectorArray(data1, (U1(0), U1(1))) sa2 = UniqueSectorArray(data2, (U1(0), U1(1))) - TensorAlgebra.add!(sa1, sa2, 2.0, 1.0) + TensorAlgebra.scaleadd!(sa1, sa2, 2.0, 1.0) @test data(sa1) ≈ [21.0 42.0; 63.0 84.0] end - @testset "TensorAlgebra.add! (UniqueSectorArray to plain Array)" begin + @testset "TensorAlgebra.scaleadd! (UniqueSectorArray to plain Array)" begin using TensorAlgebra: TensorAlgebra dest = zeros(2, 2) data = [1.0 2.0; 3.0 4.0] sa = UniqueSectorArray(data, (U1(0), U1(1))) - TensorAlgebra.add!(dest, sa, 3.0, 0.0) + TensorAlgebra.scaleadd!(dest, sa, 3.0, 0.0) @test dest ≈ [3.0 6.0; 9.0 12.0] end diff --git a/test/test_vectorinterface.jl b/test/test_vectorinterface.jl index 92a0e2b6..8d5d5338 100644 --- a/test/test_vectorinterface.jl +++ b/test/test_vectorinterface.jl @@ -175,7 +175,7 @@ end @test a ≈ 2 .* a0 a = copy(a0) - TensorAlgebra.add!(a, a, 2, 3) + TensorAlgebra.scaleadd!(a, a, 2, 3) @test a ≈ 5 .* a0 end From 2997db64f9ebbf35dc367bc7cb67d3cbcfd36e1c Mon Sep 17 00:00:00 2001 From: Matthew Fishman Date: Fri, 2 Oct 2026 21:10:51 -0400 Subject: [PATCH 2/2] Remove the TensorAlgebra branch pin now that 0.23 is registered Co-Authored-By: Claude Opus 5 (1M context) --- Project.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Project.toml b/Project.toml index e315ae1b..dceaa0e5 100644 --- a/Project.toml +++ b/Project.toml @@ -26,10 +26,6 @@ VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8" [weakdeps] SUNRepresentations = "1a50b95c-7aac-476d-a9ce-2bfc675fc617" -[sources.TensorAlgebra] -rev = "mf/scaleadd" -url = "https://github.com/ITensor/TensorAlgebra.jl" - [extensions] GradedArraysSUNRepresentationsExt = "SUNRepresentations"