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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GradedArrays"
uuid = "bc96ca6e-b7c8-4bb6-888e-c93f838762c2"
version = "0.17.0"
version = "0.17.1"
authors = ["ITensor developers <support@itensor.org> and contributors"]

[workspace]
Expand Down Expand Up @@ -42,7 +42,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"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion src/gradedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/vectorinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions test/test_uniquesectorarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/test_vectorinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading