Skip to content

Commit

Permalink
Clean up blocktensor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Nov 10, 2024
1 parent 923c207 commit a8ba065
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions test/abstracttensor/blocktensor.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test
using TestExtras
using TensorKit
using BlockTensorKit
using Random
Expand Down Expand Up @@ -83,46 +84,6 @@ end
end
end

# @testset "Tensor Dict conversion" begin
# W = V1 ⊗ V2 ⊗ V3 ← V4 ⊗ V5
# for T in (Int, Float32, ComplexF64)
# t = TensorMap(rand, T, W)
# d = convert(Dict, t)
# @test t == convert(TensorMap, d)
# end
# end

@testset "BlockTensor Tensor conversion" begin
W = V1 V2 V3 V4 V5
for T in scalartypes
if T <: Integer
t = TensorMap(sz -> rand(-20:20, sz), W)
else
t = TensorMap(randn, T, W)
end

t′ = @constinferred convert(TensorMap, t)
@test norm(t′) norm(t)
@test dim(t′) == dim(t)
@test t BlockTensorMap(t′, W)
end
end

# if hasfusiontensor(I)
# @timedtestset "Tensor Array conversion" begin
# W = V1 ⊗ V2 ⊗ V3 ← V4 ⊗ V5
# for T in (Int, Float32, ComplexF64)
# if T == Int
# t = TensorMap(sz -> rand(-20:20, sz), W)
# else
# t = TensorMap(randn, T, W)
# end
# a = @constinferred convert(Array, t)
# @test t ≈ @constinferred TensorMap(a, W)
# end
# end
# end

@testset "Basic linear algebra" begin
W = V1 V2 V3 V4 V5
for T in (Float32, ComplexF64)
Expand Down

0 comments on commit a8ba065

Please sign in to comment.