Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Jun 11, 2024
1 parent 4267178 commit e57e6f5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion test/tensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,18 @@ for V in spacelist
@test UdU one(UdU)
VVd = V * V'
@test VVd one(VVd)
@test U * S * V permute(t, ((3, 4, 2), (1, 5)))
t2 = permute(t, ((3, 4, 2), (1, 5)))
@test U * S * V t2

s = LinearAlgebra.svdvals(t2)
s′ = LinearAlgebra.diag(S)
if s isa TensorKit.SectorDict
for (c, b) in s
@test b s′[c]
end
else
@test s s′
end
end
end
@testset "empty tensor" begin
Expand Down Expand Up @@ -458,6 +469,16 @@ for V in spacelist
t2 = permute(t, ((1, 3), (2, 4)))
@test t2 * V V * D

d = LinearAlgebra.eigvals(t2; sortby=nothing)
d′ = LinearAlgebra.diag(D)
if d isa TensorKit.SectorDict
for (c, b) in d
@test b d′[c]
end
else
@test d d′
end

# Somehow moving these test before the previous one gives rise to errors
# with T=Float32 on x86 platforms. Is this an OpenBLAS issue?
VdV = V' * V
Expand Down

0 comments on commit e57e6f5

Please sign in to comment.