@@ -119,23 +119,26 @@ diagspacelist = (
119119 if BraidingStyle (I) isa SymmetricBraiding
120120 @timedtestset " Permutations" begin
121121 t = DiagonalTensorMap (randn (ComplexF64, reduceddim (V)), V)
122+ t_tm = convert (TensorMap, t)
123+
122124 # preserving diagonal
123125 t1 = @constinferred permute (t, $ (((2 ,), (1 ,))))
124126 @test t1 isa DiagonalTensorMap
125- @test convert (TensorMap, t1) == permute (convert (TensorMap, t) , (((2 ,), (1 ,))))
127+ @test convert (TensorMap, t1) == permute (t_tm , (((2 ,), (1 ,))))
126128 t1′ = @constinferred transpose (t)
127129 @test t1′ isa DiagonalTensorMap
128- @test t1 ≈ t1′
130+ @test convert (TensorMap, t1′) == transpose (t_tm)
131+ BraidingStyle (I) isa Bosonic && @test t1 ≈ t1′
129132
130133 # not preserving diagonal
131134 t2 = @constinferred permute (t, $ (((1 , 2 ), ())))
132- @test convert (TensorMap, t2) == permute (convert (TensorMap, t) , (((1 , 2 ), ())))
135+ @test convert (TensorMap, t2) == permute (t_tm , (((1 , 2 ), ())))
133136 t3 = @constinferred permute (t, $ (((2 , 1 ), ())))
134- @test convert (TensorMap, t3) == permute (convert (TensorMap, t) , (((2 , 1 ), ())))
137+ @test convert (TensorMap, t3) == permute (t_tm , (((2 , 1 ), ())))
135138 t4 = @constinferred permute (t, $ (((), (1 , 2 ))))
136- @test convert (TensorMap, t4) == permute (convert (TensorMap, t) , (((), (1 , 2 ))))
139+ @test convert (TensorMap, t4) == permute (t_tm , (((), (1 , 2 ))))
137140 t5 = @constinferred permute (t, $ (((), (2 , 1 ))))
138- @test convert (TensorMap, t5) == permute (convert (TensorMap, t) , (((), (2 , 1 ))))
141+ @test convert (TensorMap, t5) == permute (t_tm , (((), (2 , 1 ))))
139142 end
140143 end
141144 @timedtestset " Trace, Multiplication and inverse" begin
0 commit comments