From c1e8ea7ab646e08088ca76c177490ee6050e4939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Tue, 11 Feb 2025 12:56:54 -0500 Subject: [PATCH 1/3] adapt to DualSectors --- Project.toml | 2 +- test/test_gradedunitrangesext.jl | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index e88d226..14409bd 100644 --- a/Project.toml +++ b/Project.toml @@ -38,7 +38,7 @@ DiagonalArrays = "0.2.2" Dictionaries = "0.4.3" FillArrays = "1.13.0" GPUArraysCore = "0.1.0, 0.2" -GradedUnitRanges = "0.1.0" +GradedUnitRanges = "0.2.0" LabelledNumbers = "0.1.0" LinearAlgebra = "1.10" MacroTools = "0.5.13" diff --git a/test/test_gradedunitrangesext.jl b/test/test_gradedunitrangesext.jl index c81b320..bc35e1f 100644 --- a/test/test_gradedunitrangesext.jl +++ b/test/test_gradedunitrangesext.jl @@ -5,14 +5,7 @@ using BlockArrays: using BlockSparseArrays: BlockSparseArray, BlockSparseMatrix, BlockSparseVector, blockstoredlength using GradedUnitRanges: - GradedUnitRanges, - GradedOneTo, - GradedUnitRange, - GradedUnitRangeDual, - blocklabels, - dual, - gradedrange, - isdual + GradedUnitRanges, GradedOneTo, GradedUnitRange, blocklabels, dual, gradedrange, isdual using LabelledNumbers: label using SparseArraysBase: storedlength using SymmetrySectors: U1 @@ -208,8 +201,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) @test blockstoredlength(b) == 2 @test Array(b) == 2 * Array(a) for i in 1:2 - @test axes(b, i) isa GradedUnitRangeDual - @test axes(a[:, :], i) isa GradedUnitRangeDual + @test isdual(axes(b, i)) + @test isdual(axes(a[:, :], i)) end I = [Block(1)[1:1]] @test a[I, :] isa AbstractBlockArray @@ -233,8 +226,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) @test blockstoredlength(b) == 2 @test Array(b) == 2 * Array(a) for i in 1:2 - @test axes(b, i) isa GradedUnitRangeDual - @test axes(a[:, :], i) isa GradedUnitRangeDual + @test isdual(axes(b, i)) + @test isdual(axes(a[:, :], i)) end I = [Block(1)[1:1]] From d2b63f5f4ca10998dff996b77c18db9dc3d860cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Mon, 10 Feb 2025 11:42:54 -0500 Subject: [PATCH 2/3] adapt to GradedUnitRanges --- test/test_gradedunitrangesext.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_gradedunitrangesext.jl b/test/test_gradedunitrangesext.jl index bc35e1f..482d4b4 100644 --- a/test/test_gradedunitrangesext.jl +++ b/test/test_gradedunitrangesext.jl @@ -325,7 +325,7 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) @test iszero(b[Block(2, 1)]) @test iszero(b[Block(1, 2)]) @test b[Block(2, 2)] == a2 - @test all(GradedUnitRanges.space_isequal.(axes(b), (r, dual(r)))) + @test all(GradedUnitRanges.labelled_isequal.(axes(b), (r, dual(r)))) # Regression test for Vector, which caused # an ambiguity error with Base. @@ -339,7 +339,7 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64}) @test blockstoredlength(b) == 1 @test b[Block(1)] == a1 @test iszero(b[Block(2)]) - @test all(GradedUnitRanges.space_isequal.(axes(b), (r,))) + @test all(GradedUnitRanges.labelled_isequal.(axes(b), (r,))) end end end From 0bbcc8ef8f0c994f21776eac0f11c19f77b20d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Gauth=C3=A9?= Date: Tue, 11 Feb 2025 14:05:54 -0500 Subject: [PATCH 3/3] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a413b9a..0181fac 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BlockSparseArrays" uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4" authors = ["ITensor developers and contributors"] -version = "0.2.17" +version = "0.2.18" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"