Skip to content

Commit fe5fca1

Browse files
committed
add test
1 parent 06f8c73 commit fe5fca1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/tensors/diagonal.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ diagspacelist = (
119119
if BraidingStyle(I) isa SymmetricBraiding
120120
@timedtestset "Permutations" begin
121121
t = DiagonalTensorMap(randn(ComplexF64, reduceddim(V)), V)
122+
# preserving diagonal
122123
t1 = @constinferred permute(t, $(((2,), (1,))))
123-
if BraidingStyle(sectortype(V)) isa Bosonic
124-
@test t1 transpose(t)
125-
end
124+
@test t1 isa DiagonalTensorMap
126125
@test convert(TensorMap, t1) == permute(convert(TensorMap, t), (((2,), (1,))))
126+
t1′ = @constinferred transpose(t)
127+
@test t1′ isa DiagonalTensorMap
128+
@test t1 t1′
129+
130+
# not preserving diagonal
127131
t2 = @constinferred permute(t, $(((1, 2), ())))
128132
@test convert(TensorMap, t2) == permute(convert(TensorMap, t), (((1, 2), ())))
129133
t3 = @constinferred permute(t, $(((2, 1), ())))

0 commit comments

Comments
 (0)