Skip to content

Commit b42cb13

Browse files
committed
adapt compat
1 parent 97b3520 commit b42cb13

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ DiagonalArrays = "0.3"
3838
Dictionaries = "0.4.3"
3939
FillArrays = "1.13.0"
4040
GPUArraysCore = "0.1.0, 0.2"
41-
GradedUnitRanges = "0.1.0"
41+
GradedUnitRanges = "0.2"
4242
LabelledNumbers = "0.1.0"
4343
LinearAlgebra = "1.10"
4444
MacroTools = "0.5.13"
4545
MapBroadcast = "0.1.5"
4646
SparseArraysBase = "0.5"
4747
SplitApplyCombine = "1.2.3"
48-
TensorAlgebra = "0.1.0, 0.2"
48+
TensorAlgebra = "0.2.4"
4949
Test = "1.10"
5050
TypeParameterAccessors = "0.2.0, 0.3"
5151
julia = "1.10"

ext/BlockSparseArraysTensorAlgebraExt/BlockSparseArraysTensorAlgebraExt.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
module BlockSparseArraysTensorAlgebraExt
22
using BlockArrays: AbstractBlockedUnitRange
3-
using GradedUnitRanges: tensor_product
43
using TensorAlgebra: TensorAlgebra, FusionStyle, BlockReshapeFusion
54

6-
function TensorAlgebra.:(a1::AbstractBlockedUnitRange, a2::AbstractBlockedUnitRange)
7-
return tensor_product(a1, a2)
8-
end
9-
105
using BlockArrays: AbstractBlockedUnitRange
116
using BlockSparseArrays: AbstractBlockSparseArray, blockreshape
127
using TensorAlgebra: TensorAlgebra, FusionStyle, BlockReshapeFusion
@@ -46,13 +41,11 @@ using DerivableInterfaces: @interface
4641
using GradedUnitRanges:
4742
GradedUnitRanges,
4843
AbstractGradedUnitRange,
49-
OneToOne,
5044
blockmergesortperm,
5145
blocksortperm,
5246
dual,
5347
invblockperm,
54-
nondual,
55-
tensor_product
48+
nondual
5649
using LinearAlgebra: Adjoint, Transpose
5750
using TensorAlgebra:
5851
TensorAlgebra, FusionStyle, BlockReshapeFusion, SectorFusion, fusedims, splitdims

test/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BlockArrays = "1"
2929
BlockSparseArrays = "0.3"
3030
DiagonalArrays = "0.3"
3131
GPUArraysCore = "0.2"
32-
GradedUnitRanges = "0.1"
32+
GradedUnitRanges = "0.2"
3333
JLArrays = "0.2"
3434
LabelledNumbers = "0.1"
3535
LinearAlgebra = "1"
@@ -38,8 +38,8 @@ Random = "1"
3838
SafeTestsets = "0.1"
3939
SparseArraysBase = "0.5"
4040
Suppressor = "0.2"
41-
SymmetrySectors = "0.1"
42-
TensorAlgebra = "0.2"
41+
SymmetrySectors = "0.1.7"
42+
TensorAlgebra = "0.2.4"
4343
Test = "1"
4444
TestExtras = "0.3"
4545
TypeParameterAccessors = "0.3"

test/test_gradedunitrangesext.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@eval module $(gensym())
21
using Test: @test, @testset
32
using BlockArrays:
43
AbstractBlockArray, Block, BlockedOneTo, blockedrange, blocklengths, blocksize
@@ -19,6 +18,7 @@ using SymmetrySectors: U1
1918
using TensorAlgebra: fusedims, splitdims
2019
using LinearAlgebra: adjoint
2120
using Random: randn!
21+
2222
function randn_blockdiagonal(elt::Type, axes::Tuple)
2323
a = BlockSparseArray{elt}(undef, axes)
2424
blockdiaglength = minimum(blocksize(a))
@@ -390,4 +390,15 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
390390
@test all(GradedUnitRanges.space_isequal.(axes(b), (r, dual(r))))
391391
end
392392
end
393+
394+
@testset "dag" begin
395+
elt = ComplexF64
396+
r = gradedrange([U1(0) => 2, U1(1) => 3])
397+
a = BlockSparseArray{elt}(undef, r, dual(r))
398+
a[Block(1, 1)] = randn(elt, 2, 2)
399+
a[Block(2, 2)] = randn(elt, 3, 3)
400+
@test isdual.(axes(a)) == (false, true)
401+
ad = dag(a)
402+
@test Array(ad) == conj(Array(a))
403+
@test isdual.(axes(ad)) == (true, false)
393404
end

0 commit comments

Comments
 (0)